// $Id: navigation.js,v 1.4 2009-11-16 22:37:23 jon Exp $
$(document).ready(function() {

  showMe = function() {
    id = $(this).attr('id');
    if (!id) id = $(this).parent().attr('id');
    if (!id) return;
    if (hiding[id]) clearTimeout(hiding[id]);
    if ($("#"+id).is('.showing')) return; 

    $(".quick_bike_selector ul > li.showing").removeClass('showing');
    $(".quick_bike_selector li > div").css({'left' : '-999em'}).hide();

    $("#"+id).addClass('showing');

    $("div", $("#"+id)).css({'left' : '-2px'}).slideDown("fast");
  } 

  hideMe = function(id) {
    $('#'+id).removeClass('showing');
    $("div", '#'+id).css({'left' : '-999em'}).hide();
  }

  hideMeDelay = function () {
    id = $(this).attr('id');
    if (!id) id = $(this).parent().attr('id');
    if (!id) return;

    hiding[id] = window.setTimeout("hideMe('"+id+"')", hideDelay);
  }

  var hideDelay = 750; // number of millisecs before hiding occurs on mouseout
  var hiding = [];     // array to hold timeout indentifiers

  var hoverIntentConfig = {    
    sensitivity: 1,  // number = sensitivity threshold (must be 1 or higher)
    interval: 25,    // number = milliseconds for onMouseOver polling interval
    over: showMe,    // function = onMouseOver callback (REQUIRED)    
    out: hideMeDelay // function = onMouseOut callback (REQUIRED)    
  }

  $(".quick_bike_selector div").addClass("js_on");
  
  $(".quick_bike_selector ul > li").hoverIntent(hoverIntentConfig);

});