
  /* Modified by Alex Spooner, 2009-05-20 11:58:54 EST */
  
  // MENU 1/2
  var tmo = new Array();
  function hideMenu(id)
  {
    $("ul#" + id).slideUp("fast");
  }
  
  $(document).ready(function(){

    // FANCYBOX
    $("a.fancybox").fancybox({
      'overlayShow'     : false,
      'zoomSpeedIn'     : 600,
      'zoomSpeedOut'    : 500,
      'easingIn'        : 'easeOutBack',
      'easingOut'       : 'easeInBack'
    }); 

    // SEARCH
    iqdef = "Search";
    $("#iQ")
      .focus(function(){
        if ($(this).val()==iqdef) $(this).val('');
      }) 
      .blur(function(){
        if ($(this).val()=='') $(this).val(iqdef);
      }); 

    $("#iSearch")
      .focus(function(){
        if ($(this).val()==iqdef) $(this).val('');
      }) 
      .blur(function(){
        if ($(this).val()=='') $(this).val(iqdef);
      });
    
    // MENU 2/2
    $("#nav a").hover(
      function(){
        id = $(this).attr("rel");        
        if (tmo[id]) clearTimeout(tmo[id]);
        id2 = id.substring(0,6) + '0000';        
        if (tmo[id2]) clearTimeout(tmo[id2]);
        $("ul#" + id).slideDown("fast");
      },
      function(){
        id = $(this).attr("rel");
        tmo[id] = setTimeout("hideMenu('"+ id +"')",500);
        id2 = id.substring(0,6) + '0000';        
        if (id!=id2) tmo[id2] = setTimeout("hideMenu('"+ id2 +"')",500);
      }
    ); 

  });
