// JavaScript Document

jQuery(document).ready(function() {
	
	jQuery("#productsubmenu").hide();
	jQuery("#categorysubmenu").hide();
	
	
	jQuery("#prodid").mouseenter(function(){
		jQuery('#categorysubmenu').hide();
    	clearTimeout(jQuery("#prodid").data('timeoutId'));
    	    //jQuery("#productsubmenu").fadeIn("slow");
        jQuery("#productsubmenu").show();
	}).mouseleave(function(){
		var timeoutId = setTimeout(function(){ jQuery("#productsubmenu").hide();}, 100);
		jQuery("#prodid").data('timeoutId', timeoutId); //set the timeoutId, allowing us to clear this trigger if the mouse comes back over
	});
	
	jQuery("#productsubmenu").mouseenter(function(){
    	clearTimeout(jQuery("#prodid").data('timeoutId'));
    	jQuery("#productsubmenu").show();
	}).mouseleave(function(){
		var timeoutId = setTimeout(function(){ jQuery("#productsubmenu").hide();}, 100);
		jQuery("#prodid").data('timeoutId', timeoutId); //set the timeoutId, allowing us to clear this trigger if the mouse comes back over
	});
	
	jQuery("#catid").mouseenter(function(){
		jQuery('#productsubmenu').hide();
    	clearTimeout(jQuery("#catid").data('timeoutId'));
    	jQuery("#categorysubmenu").show();
	}).mouseleave(function(){
		var timeoutId = setTimeout(function(){ jQuery("#categorysubmenu").hide();}, 100);
		jQuery("#catid").data('timeoutId', timeoutId); //set the timeoutId, allowing us to clear this trigger if the mouse comes back over
	});
	
	jQuery("#categorysubmenu").mouseenter(function(){
    	clearTimeout(jQuery("#catid").data('timeoutId'));
    	jQuery("#categorysubmenu").show();
	}).mouseleave(function(){
		var timeoutId = setTimeout(function(){ jQuery("#categorysubmenu").hide();}, 100);
		jQuery("#catid").data('timeoutId', timeoutId); //set the timeoutId, allowing us to clear this trigger if the mouse comes back over
	});
	
	
			
});



