// 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-research").hover(function () {          
		   if (hide01) clearTimeout(hide01);
		   $("#dropdown-research").show();
			$(this).addClass("active");
        }, function() {
            hide01 = setTimeout(function () { $("#dropdown-research").hide(); });
			$("#nav-research").removeClass("active");
        });
$("#dropdown-research").hover(function () {
            if (hide01) clearTimeout(hide01);
            $("#nav-research").addClass("active");
        }, function() {
            hide01 = setTimeout(function () { $("#dropdown-research").hide(); });
			$("#dropdown-research").stop().show();
			$("#nav-research").removeClass("active");
        });

        var hide02 = false;
        $("#nav-centers").hover(function () {          
		   if (hide02) clearTimeout(hide02);
		   $("#dropdown-centers").show();
			$(this).addClass("active");
        }, function() {
            hide02 = setTimeout(function () { $("#dropdown-centers").hide(); });
            $("#nav-centers").removeClass("active");
        });
        $("#dropdown-centers").hover(function () {
            if (hide02) clearTimeout(hide02);
            $("#nav-centers").addClass("active");
        }, function() {
            hide02 = setTimeout(function () { $("#dropdown-centers").hide(); });
			$("#dropdown-centers").stop().show();
			$("#nav-centers").removeClass("active");
        });
		
        var hide03 = false;
        $("#nav-products").hover(function () {          
		   if (hide03) clearTimeout(hide03);
		   $("#dropdown-products").show();
			$(this).addClass("active");
        }, function() {
            hide03 = setTimeout(function () { $("#dropdown-products").hide(); });
            $("#nav-products").removeClass("active");
        });
        $("#dropdown-products").hover(function () {
            if (hide03) clearTimeout(hide03);
            $("#nav-products").addClass("active");
        }, function() {
            hide03 = setTimeout(function () { $("#dropdown-products").hide(); });
			$("#dropdown-products").stop().show();
			$("#nav-products").removeClass("active");
        });
		
        var hide04 = false;
        $("#nav-company").hover(function () {          
		   if (hide04) clearTimeout(hide04);
		   $("#dropdown-company").show();
			$(this).addClass("active");
        }, function() {
            hide04 = setTimeout(function () { $("#dropdown-company").hide(); });
            $("#nav-company").removeClass("active");
        });
        $("#dropdown-company").hover(function () {
            if (hide04) clearTimeout(hide04);
            $("#nav-company").addClass("active");
        }, function() {
            hide04 = setTimeout(function () { $("#dropdown-company").hide(); });
			$("#dropdown-company").stop().show();
			$("#nav-company").removeClass("active");
        });
		
        var hide05 = false;
		$("#nav-news").hover(function(){          
		   if (hide05) clearTimeout(hide05);
		   $("#dropdown-news").show();
			$(this).addClass("active");
        }, function() {
            hide05 = setTimeout(function () { $("#dropdown-news").hide(); });
            $("#nav-news").removeClass("active");
        });
        $("#dropdown-news").hover(function () {
            if (hide05) clearTimeout(hide05);
            $("#nav-news").addClass("active");
        }, function() {
            hide05 = setTimeout(function () { $("#dropdown-news").hide(); });
			$("#dropdown-news").stop().show();
			$("#nav-news").removeClass("active");
        });
		
        var hide06 = false;
		$("#nav-contacts").hover(function(){          
		   if (hide06) clearTimeout(hide06);
            $("#dropdown-contacts").show();
			$(this).addClass("active");
        }, function() {
			hide06 = setTimeout(function() {$("#dropdown-contacts").hide();});
			$("#nav-contacts").removeClass("active");
        });
        $("#dropdown-contacts").hover(function(){
            if (hide06) clearTimeout(hide06);
            $("#nav-contacts").addClass("active");
        }, function() {
			hide06 = setTimeout(function() {$("#dropdown-contacts").hide();});
			$("#dropdown-contacts").stop().show();
			$("#nav-contacts").removeClass("active");
        });
		
});
