jQuery(document).ready(function() {
/*
  // Resize the h1 tags so that they can float properly.
  var img_width = jQuery('#primary .primary img').width();
  var primary_width = jQuery('#primary .primary').width();
  var embed_width = (primary_width - img_width) - 20;
  jQuery('#primary .primary h1').width(embed_width);
*/

  // Deletes value of search box
  jQuery('#sidebar form input.input').click(function() {
    if(jQuery(this).attr('value') == 'SEARCH OUR SITE') {
      jQuery(this).attr('value','');
    }
    return false;
  });

  jQuery('#primary .search form input.input').click(function() {
    if(jQuery(this).attr('value') == 'SEARCH AGAIN') {
      jQuery(this).attr('value','');
    }
    return false;
  });

  jQuery('#primary .search form input.input').click(function() {
    if(jQuery(this).attr('value') == 'ENTER KEYWORDS') {
      jQuery(this).attr('value','');
    }
    return false;
  });

  // Resizes the nav menu
  var current_width = jQuery('#nav li.current').width();
  jQuery('#nav li.current').width(current_width-14);

  // Deletes the value of the search for IE6
  jQuery('#sidebar input.submit').attr('value','');

/*
  // Finds the height of the sidebar module to correctly
  // add the shadow behind it.
  var height = jQuery('#sidebar .module').height();
  var width = jQuery('#sidebar .module').width();
  var padding_width = jQuery('#sidebar .module').css('padding-left');
  var has_number_crunch = jQuery('#sidebar .module').hasClass('entry_number_crunching');
  if(!has_number_crunch) {
    if(padding_width) {
      padding_width = padding_width.replace('px','') * 2;
      width = width + padding_width;
      var padding_height = jQuery('#sidebar .module').css('padding-top');
      padding_height = padding_height.replace('px','') * 2;
      height = height + padding_height;
      jQuery('#sidebar .module_bg').css({
        height: height,
        width: width
      });

      if(jQuery.browser.msie() && jQuery.browser.version.number() == '7.0') {
        jQuery('#sidebar .module_bg').css({
          top: 4
        });      
      }
    }
  }
*/

  // Open/close share section
  jQuery('.article_links li.share > a').click(
    function() {
      jQuery(this).next().toggle();
      jQuery(this).parent().toggleClass('current');
     // jQuery('.article_links').css('margin-bottom','70px');
      return false;
    }
  );

});
