// Drupal comes to the rescue ...
$(document.documentElement).addClass('js');
// 'js enabled' cookie
// document.cookie = 'has_js=1; path=/';

var hoverTimeout = 250 /* ms */;
var hoverTimeoutId;
function kickoffTimeout( closure )
{
  if( hoverTimeoutId )
  {
    clearTimeout( hoverTimeoutId );
  }
  
  hoverTimeoutId = setTimeout( closure, hoverTimeout );
}

$(document).ready(function(){
  $('.hover_sense').hover(
    // in
    function(e){ 
      $(this).addClass('hover');
    },
    // out
    function(e){ 
      $(this).removeClass('hover');
    }
  );
  
  if ($.browser.msie && $.browser.version.substr(0,1)<7) {
    $('body.advanced_search .big_hover').hover(
      // in
      function(e){ $('select').hide(); },
      // out
      function(e){ $('select').show(); }
    );
  }
  
  $('.sort_form select').change(function(){
    $(this).parents('.sort_form')[0].submit();
  });
  
  $('#pc_link').fancybox({
    'frameWidth': 800,
    'frameHeight': 480
  });
});