// 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-events").hover(function(){          
		   if (hide01) clearTimeout(hide01);
            $("#dropdown-events").show();
			$(this).addClass("active");
        }, function() {
			hide01 = setTimeout(function() {$("#dropdown-events").hide();});
			$("#nav-events").removeClass("active");
        });
        $("#dropdown-events").hover(function(){
            if (hide01) clearTimeout(hide01);
            $("#nav-events").addClass("active");
        }, function() {
			hide01 = setTimeout(function() {$("#dropdown-events").hide();});
			$("#dropdown-events").stop().show();
			$("#nav-events").removeClass("active");
        });

        var hide02 = false;
		$("#nav-applying").hover(function(){          
		   if (hide02) clearTimeout(hide02);
            $("#dropdown-applying").show();
			$(this).addClass("active");
        }, function() {
			hide02 = setTimeout(function() {$("#dropdown-applying").hide();});
			$("#nav-applying").removeClass("active");
        });
        $("#dropdown-applying").hover(function(){
            if (hide02) clearTimeout(hide02);
            $("#nav-applying").addClass("active");
        }, function() {
			hide02 = setTimeout(function() {$("#dropdown-applying").hide();});
			$("#dropdown-applying").stop().show();
			$("#nav-applying").removeClass("active");
        });
		
        var hide03 = false;
		$("#nav-tuition").hover(function(){          
		   if (hide03) clearTimeout(hide03);
            $("#dropdown-tuition").show();
			$(this).addClass("active");
        }, function() {
			hide03 = setTimeout(function() {$("#dropdown-tuition").hide();});
			$("#nav-tuition").removeClass("active");
        });
        $("#dropdown-tuition").hover(function(){
            if (hide03) clearTimeout(hide03);
            $("#nav-tuition").addClass("active");
        }, function() {
			hide03 = setTimeout(function() {$("#dropdown-tuition").hide();});
			$("#dropdown-tuition").stop().show();
			$("#nav-tuition").removeClass("active");
        });
		
        var hide04 = false;
		$("#nav-academics").hover(function(){          
		   if (hide04) clearTimeout(hide04);
            $("#dropdown-academics").show();
			$(this).addClass("active");
        }, function() {
			hide04 = setTimeout(function() {$("#dropdown-academics").hide();});
			$("#nav-academics").removeClass("active");
        });
        $("#dropdown-academics").hover(function(){
            if (hide04) clearTimeout(hide04);
            $("#nav-academics").addClass("active");
        }, function() {
			hide04 = setTimeout(function() {$("#dropdown-academics").hide();});
			$("#dropdown-academics").stop().show();
			$("#nav-academics").removeClass("active");
        });
		
        var hide05 = false;
		$("#nav-admitted").hover(function(){          
		   if (hide05) clearTimeout(hide05);
            $("#dropdown-admitted").show();
			$(this).addClass("active");
        }, function() {
			hide05 = setTimeout(function() {$("#dropdown-admitted").hide();});
			$("#nav-admitted").removeClass("active");
        });
        $("#dropdown-admitted").hover(function(){
            if (hide05) clearTimeout(hide05);
            $("#nav-admitted").addClass("active");
        }, function() {
			hide05 = setTimeout(function() {$("#dropdown-admitted").hide();});
			$("#dropdown-admitted").stop().show();
			$("#nav-admitted").removeClass("active");
        });
		
        var hide06 = false;
		$("#nav-parents").hover(function(){          
		   if (hide06) clearTimeout(hide06);
            $("#dropdown-parents").show();
			$(this).addClass("active");
        }, function() {
			hide06 = setTimeout(function() {$("#dropdown-parents").hide();});
			$("#nav-parents").removeClass("active");
        });
        $("#dropdown-parents").hover(function(){
            if (hide06) clearTimeout(hide06);
            $("#nav-parents").addClass("active");
        }, function() {
			hide06 = setTimeout(function() {$("#dropdown-parents").hide();});
			$("#dropdown-parents").stop().show();
			$("#nav-parents").removeClass("active");
        });
		
		var hide07 = false;
		$("#nav-counselors").hover(function(){          
		   if (hide07) clearTimeout(hide07);
            $("#dropdown-counselors").show();
			$(this).addClass("active");
        }, function() {
			hide07 = setTimeout(function() {$("#dropdown-counselors").hide();});
			$("#nav-counselors").removeClass("active");
        });
        $("#dropdown-counselors").hover(function(){
            if (hide07) clearTimeout(hide07);
            $("#nav-counselors").addClass("active");
        }, function() {
			hide07 = setTimeout(function() {$("#dropdown-counselors").hide();});
			$("#dropdown-counselors").stop().show();
			$("#nav-counselors").removeClass("active");
        });
		
});
