// 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 hide = false;
        // Shows the DIV on hover with a fade in
		$("#menu1").hover(function(){          
		   if (hide) clearTimeout(hide);
            $("#fotosdiv").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() {$("#fotosdiv").fadeOut("fast");});
			$("#menu1").removeClass("active");
        });
		// Ensures the DIV displays when your mouse moves away from the main nav menu item
        $("#fotosdiv").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() {$("#fotosdiv").fadeOut("fast");});
			$("#fotosdiv").stop().fadeIn();
			$("#menu1").removeClass("active");
        });
	});

$(document).ready(function() {
        var hide = false;
        // Shows the DIV on hover with a fade in
		$("#menu2").hover(function(){          
		   if (hide) clearTimeout(hide);
            $("#sobrediv").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() {$("#sobrediv").fadeOut("fast");});
			$("#menu2").removeClass("active");
        });
		// Ensures the DIV displays when your mouse moves away from the main nav menu item
        $("#sobrediv").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() {$("#sobrediv").fadeOut("fast");});
			$("#sobrediv").stop().fadeIn();
			$("#menu2").removeClass("active");
        });
	});

$(document).ready(function() {
        var hide = false;
        // Shows the DIV on hover with a fade in
		$("#menu3").hover(function(){          
		   if (hide) clearTimeout(hide);
            $("#eventosdiv").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() {$("#eventosdiv").fadeOut("fast");});
			$("#menu3").removeClass("active");
        });
		// Ensures the DIV displays when your mouse moves away from the main nav menu item
        $("#eventosdiv").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() {$("#eventosdiv").fadeOut("fast");});
			$("#eventosdiv").stop().fadeIn();
			$("#menu3").removeClass("active");
        });
	});