// JavaScript Document
var menu = Array();
menu[0] = Array('a.developer', 'ul#subDeveloper');
menu[1] = Array('a.project', 'ul#subProject');
menu[2] = Array('a.contactus', 'ul#subContactus');
menu[3] = Array('a.download', 'ul#subDownload');
menu[4] = Array('a.hotel', 'ul#subHotel');
var fuera = false;
var b;
function desplegar(boton) {		
		$(boton).fadeIn(350);	
}
function ocultar() {	
	if(fuera == true){
		$(b).fadeOut(350);	
	}	
}
$(document).ready(function() {	
	
	function botones() {
		$.each(menu, function(i, n) {
			$(n[0]).mouseover(function() {
				fuerta = false;
				desplegar(n[1]);				
			});						  
		});
		$.each(menu, function(i, n) {
			$(n[0]).mouseout(function() {				
				fuera = true;
				b = n[1];
				setTimeout("ocultar()", 100);				
			});						  
		});
	}
	function scaner() {
		$.each(menu, function(i, n) {
			$(n[1]).children("li").mouseout(function() {
				$(this).children("ul").fadeOut(350);
				fuera = true;
				b = n[1];
				setTimeout("ocultar()", 100); 
			});
			$(n[1]).children("li").mouseover(function() {
				fuera = false;				
			});
		});	
	}	
	botones();
	scaner();
	
	
			
});
