// jDiv - a jQuery plugin
// (c) Skyrocket Labs
// http://www.skyrocketlabs.com
// fred@skyrocketlabs.com
// Created: 10.24.2009
// Last updated: 02.06.2010

// DISPLAYS HIDDEN DIVS AS SUBMENUS ON HOVER

$(document).ready(function() {

        var hide01 = false;
		$("#nav-products").hover(function(){          
		   if (hide01) clearTimeout(hide01);
            $("#panel-products").fadeIn('300');
			$(this).addClass("active");
        }, function() {
			hide01 = setTimeout(function() {$("#panel-products").fadeOut('300');});
			$("#nav-products").removeClass("active");
        });
        $("#panel-products").hover(function(){
            if (hide01) clearTimeout(hide01);
            $("#nav-products").addClass("active");
        }, function() {
			hide01 = setTimeout(function() {$("#panel-products").fadeOut('300');});
			$("#panel-products").fadeIn('300');
			$("#nav-products").removeClass("active");
        });

        var hide02 = false;
		$("#nav-brands").hover(function(){          
		   if (hide02) clearTimeout(hide02);
            $("#panel-brands").fadeIn('300');
			$(this).addClass("active");
        }, function() {
			hide02 = setTimeout(function() {$("#panel-brands").fadeOut('300');});
			$("#nav-brands").removeClass("active");
        });
        $("#panel-brands").hover(function(){
            if (hide02) clearTimeout(hide02);
            $("#nav-brands").addClass("active");
        }, function() {
			hide02 = setTimeout(function() {$("#panel-brands").fadeOut('300');});
			$("#panel-brands").fadeIn('300');
			$("#nav-brands").removeClass("active");
        });
		
});
