// jDiv - a jQuery plugin // (c) Skyrocket Labs // http://www.skyrocketlabs.com // fred@skyrocketlabs.com
$(document).ready(function() {
        var hide = false;
        // Shows the DIV on hover with a fade in
		$("#menu1").hover(function(){          
		   if (hide) clearTimeout(hide);
            $("#hidden-div").fadeIn();
            // The main nav menu item is assigned the 'active' CSS class
			$(this).addClass("active");
        }, function() {
            // Fades out the DIV and removes the 'active' class from the main nav menu item
			hide = setTimeout(function() {$("#hidden-div").fadeOut("fast");});
			$("#menu1").removeClass("active");
        });
		// Ensures the DIV displays when your mouse moves away from the main nav menu item
        $("#hidden-div").hover(function(){
            if (hide) clearTimeout(hide);
            $("#menu1").addClass("active");
        }, function() {
            // If your mouse moves out of the displayed hidden DIV, the DIv fades out and removes the 'active' class
			hide = setTimeout(function() {$("#hidden-div").fadeOut("fast");});
			$("#hidden-div").stop().fadeIn();
			$("#menu1").removeClass("active");
        });
var hide = false;
        // Shows the DIV on hover with a fade in
		$("#menu2").hover(function(){          
		   if (hide) clearTimeout(hide);
            $("#hidden-div2").fadeIn();
            // The main nav menu item is assigned the 'active' CSS class
			$(this).addClass("active");
        }, function() {
            // Fades out the DIV and removes the 'active' class from the main nav menu item
			hide = setTimeout(function() {$("#hidden-div2").fadeOut("fast");});
			$("#menu2").removeClass("active");
        });
		// Ensures the DIV displays when your mouse moves away from the main nav menu item
        $("#hidden-div2").hover(function(){
            if (hide) clearTimeout(hide);
            $("#menu2").addClass("active");
        }, function() {
            // If your mouse moves out of the displayed hidden DIV, the DIv fades out and removes the 'active' class
			hide = setTimeout(function() {$("#hidden-div2").fadeOut("fast");});
			$("#hidden-div2").stop().fadeIn();
			$("#menu2").removeClass("active");
        });
var hide = false;
        // Shows the DIV on hover with a fade in
		$("#menu3").hover(function(){          
		   if (hide) clearTimeout(hide);
            $("#hidden-div3").fadeIn();
            // The main nav menu item is assigned the 'active' CSS class
			$(this).addClass("active");
        }, function() {
            // Fades out the DIV and removes the 'active' class from the main nav menu item
			hide = setTimeout(function() {$("#hidden-div3").fadeOut("fast");});
			$("#menu3").removeClass("active");
        });
		// Ensures the DIV displays when your mouse moves away from the main nav menu item
        $("#hidden-div3").hover(function(){
            if (hide) clearTimeout(hide);
            $("#menu3").addClass("active");
        }, function() {
            // If your mouse moves out of the displayed hidden DIV, the DIv fades out and removes the 'active' class
			hide = setTimeout(function() {$("#hidden-div3").fadeOut("fast");});
			$("#hidden-div3").stop().fadeIn();
			$("#menu3").removeClass("active");
        });
var hide = false;
        // Shows the DIV on hover with a fade in
		$("#menu4").hover(function(){          
		   if (hide) clearTimeout(hide);
            $("#hidden-div4").fadeIn();
            // The main nav menu item is assigned the 'active' CSS class
			$(this).addClass("active");
        }, function() {
            // Fades out the DIV and removes the 'active' class from the main nav menu item
			hide = setTimeout(function() {$("#hidden-div4").fadeOut("fast");});
			$("#menu4").removeClass("active");
        });
		// Ensures the DIV displays when your mouse moves away from the main nav menu item
        $("#hidden-div4").hover(function(){
            if (hide) clearTimeout(hide);
            $("#menu4").addClass("active");
        }, function() {
            // If your mouse moves out of the displayed hidden DIV, the DIv fades out and removes the 'active' class
			hide = setTimeout(function() {$("#hidden-div4").fadeOut("fast");});
			$("#hidden-div4").stop().fadeIn();
			$("#menu4").removeClass("active");
        });
});
/*tabs functionality */
	$(function () {
			var tabContainers = $('div.tabs > div');
			tabContainers.hide().filter(':first').show();
			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
});