$(document).ready(function() {
  /* Setup a global hover */
  $('.hover').show().fadeTo(0,0);
  $('#nav li a').hover(
    function() {
      $('.hover',this).stop().fadeTo(300,1,"easeOutQuart");
    },
    function() {
      $('.hover',this).stop().fadeTo(300,0,"easeOutQuart");
    }
  );
  
  if($('#nextSearchField').val().length==0)
    $('#nextSearchField').val("Search").click(
      function() {
        if($(this).val()=="Search")
          $(this).val("");
      }
    ).blur(
      function() {
        if($(this).val()=="")
          $(this).val("Search");
      }
    );
  
  /* Hide via javascript (as opposed to CSS) */
  $(".hidden-js").hide();
  
  /* Supress typographic widows */
  $.jqwidont.init();
  $('p,h1,h2,h3,h4,h5,span').widont();
  
  /* Subnav hover */
  $('#subnav li a').hover(
    function() {$('img',this).stop().fadeTo(300,0,"easeOutQuart");},
    function() {$('img',this).stop().fadeTo(300,1,"easeOutQuart");}
  );
});

String.prototype.trim=function() {
	return this.replace(/^\s+|\s+$/g,"");
}