// JavaScript Document
var menuArray = [
['monitor-3d.htm' , 'Monitor 3D'],
['cine-3d.htm' , 'Cine 3D'],
['proyeccion-dia.htm' , 'Proyección día'],
['pantallas-interactivas.htm' , 'Pantallas interactivas'],
['video-wall.htm' , 'Videowall'],
['kioskos-interactivos.htm' , 'Kioskos interactivos']
];


var menuTimeOut = 0;
var inMenu = false;
sfHover = function() {     
	d = document.getElementById("menuproductos");
	d.onmouseover=function() {             
		if (menuTimeOut != 0 ) {
			clearTimeout(menuTimeOut);
			menuTimeOut = 0;
		}
		if (!inMenu)
			this.className+=" sfhover";
		inMenu = true;
	}         
	d.onmouseout=function() {             
		inMenu = false;
		menuTimeOut = setTimeout("clearMenu()", 500);
	}   
	
	d = document.getElementById("menuproductosul");
	d.onmouseover=function() {             
		if (menuTimeOut != 0 ) {
			clearTimeout(menuTimeOut);
			menuTimeOut = 0;
		}
		inMenu = true;
	}         
	d.onmouseout=function() {             
		inMenu = false;
		menuTimeOut = setTimeout("clearMenu()", 500);
	}   

	for (i=0;i<=menuArray.length-1;i++) {
		var li = d.appendChild(document.createElement('li'));
		var a = li.appendChild(document.createElement('a'));
		a.innerHTML = menuArray[i][1];
		a.href = menuArray[i][0];
	}

} 

function clearMenu() {
	if (!inMenu) {
		d = document.getElementById("menuproductos");
		d.className=d.className.replace(new RegExp(" sfhover\\b"), "");
	}
	clearTimeout(menuTimeOut);
	menuTimeOut = 0;
}

window.onload = sfHover;
