$(document).ready(function() {

  var exception= ["link1", "link2"];
  $('#refineSearch .launcher').each(function () {
    var the_parent =$(this).parent();
    if ($(this).hasClass("disabled")){return;}
     
    var timeout = null;
    var the_button= $(this);
    var the_item_id= $(this).attr('id');
    
    var the_current_menu =$(the_parent).next();
      
    var the_list=$(the_current_menu).find('.listwrap');
  
    $([the_button.get(0), the_current_menu.get(0)]).mouseover(function () {
      if (timeout){clearTimeout(timeout);}
      timeout = setTimeout(function(){$(the_list).slideDown('fast'); $(the_parent).addClass("launchActive"); if(jQuery.inArray(the_item_id, exception)>-1){hideselect(true);}},200);
     
    }).mouseout(function () {
      if (timeout){clearTimeout(timeout);}
      hide_func = (jQuery.inArray(the_item_id, exception)>-1) ? function(){hideselect(false);} : function(){;};
      
      timeout = setTimeout(function(){$(the_list).slideUp('fast',hide_func); $(the_parent).removeClass("launchActive");},650);
    });
  });

  $(".show_help").click(function(){
    var title_open="Cliquez pour afficher l'aide"
    var title_close="Cliquez pour masquer l'aide";
    var cur_title=$(this).attr('title');
    $(this).parent().parent().find(".hide").slideToggle();
    the_title= (cur_title==title_open) ? title_close:title_open;
    $(this).attr({title:the_title});
  });
});

function hideselect(istrue){
  if ($.browser.msie&$.browser.version<7){
    if (istrue){
      $('#pageNbrTop').hide();
      $('#fakePageNbrTop').width(parseInt($('#pageNbrTop').width())+3);
    }
    else {
      $('#pageNbrTop').show();
      $('#fakePageNbrTop').width(0);
    }
  }
}

