// 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-company").hover(function(){          
		   if (hide01) clearTimeout(hide01);
			setTimeout(function() {$("#dropdown-company").show();});
			$("#nav-company").addClass("active");
        }, function() {
			hide01 = setTimeout(function() {$("#dropdown-company").hide();});
			$("#nav-company").removeClass("active");
        });
        $("#dropdown-company").hover(function(){
            if (hide01) clearTimeout(hide01);
            $("#nav-company").addClass("active");
        }, function() {
            hide01 = setTimeout(function () { $("#dropdown-company").hide(); });
            $("#nav-company").removeClass("active");
        });
		
		$('#clsCompany').click(function() {
		    hide01 = setTimeout(function () { $("#dropdown-company").hide(); });
		    $("#nav-company").removeClass("active");
		});
		
        var hide02 = false;
		$("#nav-products").hover(function(){          
		   if (hide02) clearTimeout(hide02);		   		   
			setTimeout(function() {$("#dropdown-products").show();});		   
			$(this).addClass("active");
        }, function() {
			hide02 = setTimeout(function() {$("#dropdown-products").hide();});
			$("#nav-products").removeClass("active");
        });
        $("#dropdown-products").hover(function(){
            if (hide02) clearTimeout(hide02);
            $("#nav-products").addClass("active");
        }, function() {
			hide02 = setTimeout(function() {$("#dropdown-products").hide();});
			$("#nav-products").removeClass("active");
        });
		
		$('#clsProducts').click(function() {
			hide02 = setTimeout(function() {$("#dropdown-products").hide();});
			$("#nav-products").removeClass("active");
		});

        var hide03 = false;
        $("#nav-resources").hover(function () {
            if (hide03) clearTimeout(hide03);
            setTimeout(function () { $("#dropdown-resources").show(); });
            $(this).addClass("active");
        }, function () {
            hide03 = setTimeout(function () { $("#dropdown-resources").hide(); });
            $("#nav-resources").removeClass("active");
        });
        $("#dropdown-resources").hover(function () {
            if (hide03) clearTimeout(hide03);
            $("#nav-resources").addClass("active");
        }, function () {
            hide03 = setTimeout(function () { $("#dropdown-resources").hide(); });
            $("#nav-resources").removeClass("active");
        });

        $('#clsResources').click(function () {
            hide03 = setTimeout(function () { $("#dropdown-resources").hide(); });
            $("#nav-resources").removeClass("active");
        });

        var hide04 = false;
        $("#nav-account").hover(function () {
            if (hide04) clearTimeout(hide04);
            setTimeout(function () { $("#dropdown-account").show(); });
            $(this).addClass("active");
        }, function () {
            hide04 = setTimeout(function () { $("#dropdown-account").hide(); });
            $("#nav-account").removeClass("active");
        });
        $("#dropdown-account").hover(function () {
            if (hide04) clearTimeout(hide04);
            $("#nav-account").addClass("active");
        }, function () {
            hide04 = setTimeout(function () { $("#dropdown-account").hide(); });
            $("#nav-account").removeClass("active");
        });

        $('#clsAccount').click(function () {
            hide04 = setTimeout(function () { $("#dropdown-account").hide(); });
            $("#nav-account").removeClass("active");
        });			                            	

		
});
