$(document).ready(function() {
  $(".archives_link").click( function () {
    $("#archives").fadeToggle(500);
    return false;
  });
  
  $(".loader").css("visibility","hidden");
  
  $("#comment_id").val('mo2051');
  
  $("#write_comment .subscribe_hints").hide();
  $("#write_comment #comment_submit").attr("disabled", "disabled"); 
  
  $("#comment_subscribe").change( function () {
    if ($("#comment_subscribe").is(":checked") ) {
      $("#write_comment .subscribe_hints").show();
    } else {
      $("#write_comment .subscribe_hints").hide();
    }
  });
  
  $("#comment_terms").change( function () {
    if ($("#comment_terms").is(":checked") ) {
      $("#write_comment #comment_submit").attr("disabled", ""); 
    } else {
      $("#write_comment #comment_submit").attr("disabled", "disabled"); 
    }
  });
  
  
  $("#write_comment").submit( function() {
    $(".loader").css("visibility","visible");
  });
  
});

jQuery.fn.fadeToggle = function(speed, easing, callback) { 
   return this.animate({opacity: 'toggle'}, speed, easing, callback); 
};