MENU = {
	aBotones : ['bFed','bCom','bFdd','bNot','bGal','bMet','bEsc'],
	bSel : null,
	load : function() {
		if ((document.getElementById('submenu'))&&(document.getElementById('submenu').style.display!='none')) return;
		for(i=0;(btn = document.getElementById(MENU.aBotones[i]));i++) {
			EXTRAS.addEvent(document.getElementById(MENU.aBotones[i]),'mouseover',MENU.mostrar,true);
			EXTRAS.addEvent(document.getElementById(MENU.aBotones[i]),'mouseout',MENU.ocultar,true);			
		}
		
	},
	existe : function(str) {
		for(i=0;(bId=MENU.aBotones[i]);i++)
				if (str==bId) return true;
		return false;
	},
	_muestra : function(v) {
		var obj = document.getElementById(MENU.bSel).getElementsByTagName("ul")[0];
		EXTRAS.addEvent(obj,'mouseover',MENU.mostrar,true);
		EXTRAS.addEvent(obj,'mouseout',MENU.ocultar,true);
		obj.style.display = "block";

	},
	_ocultar : function() {
		document.title = "";
		for(i=0;(bId=MENU.aBotones[i]);i++) {
			if (MENU.bSel==bId) continue;
			document.getElementById(bId).getElementsByTagName("ul")[0].style.display="none";
		}
	},
	mostrar : function(e) {
		if (typeof(MENU)=="undefined") return;
		var e = (e) ? e : window.event ;
		var target = (e.target) ? e.target : e.srcElement;
		while (target&&(!MENU.existe(target.id))) {
			target = target.parentNode;
		}
		MENU.bSel = target.id;
		MENU._ocultar();	
		MENU._muestra(0);
		return false;
	},
	ocultar : function(e) {
		if (typeof(MENU)=="undefined") return;
		var e = (e) ? e : window.event ;
		var target = (e.target) ? e.target : e.srcElement;
		MENU.bSel = null;
		setTimeout("MENU._ocultar();",400);
	}
}

PNG = {
	load : function() {
		for (i=0;(im=document.images[i]);i++) {
			if (im.attachEvent) {
				if (/\.png$/i.test(im.src)) {
					im.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+im.src+"', sizingMethod='scale')";
					im.style.width = im.width+"px";
					im.style.height = im.height+"px";
					im.src = "img/blank.gif";
				}
			}
			else return;
		}
	}
}

PRINT = {
	load : function() {
		EXTRAS.addEvent(document.getElementById("print"),'click',PRINT.print,false);
	},
	print : function() {
		window.print();
	}
}

if(document.getElementsByTagName) {
	EXTRAS.addEvent(window,'load',MENU.load,false);
	EXTRAS.addEvent(window,'load',PNG.load,false);
	EXTRAS.addEvent(window,'load',PRINT.load,false);
}


