// JavaScript Document
var mnuMain='';
function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
function OcultarSub(vmnu){
	document.getElementById(vmnu).style.visibility="hidden";
	document.getElementById(vmnu).style.position="absolute";
}
function MostrarSub(vmnu){
	//alert(mnuMain+' '+vmnu);
	if(mnuMain==vmnu){
		if(document.getElementById(vmnu).style.visibility=="inherit"){
			document.getElementById(vmnu).style.visibility="hidden";		
			document.getElementById(vmnu).style.position="absolute";			
		}else{
			document.getElementById(vmnu).style.visibility="inherit";
			document.getElementById(vmnu).style.position="static";	
		}
	}
	else{
		
		if(mnuMain!=''&&vmnu!='subMnuACPAP')
				OcultarSub(mnuMain);	
		mnuMain=vmnu;
		if(document.getElementById(vmnu).style.visibility=="inherit"){
			document.getElementById(vmnu).style.visibility="hidden";		
			document.getElementById(vmnu).style.position="absolute";			
		}else{
			document.getElementById(vmnu).style.visibility="inherit";
			document.getElementById(vmnu).style.position="static";	
		}
	}
}

function openURL(url,opc){
	if(opc!="")
		document.location=url+'.php'+opc;
	else
		document.location=url+'.php';
}

function popUp(str,w,h)
{
		if(w<=0) w=450;
		if(h<=0) h=350;
	var son=window.open('popups/'+str,'FAN','scrollbars=yes,resizable=yes,width='+w+',height='+h+',status=no,location=no,toolbar=no, menubar=no,left='+(screen.availWidth-w)/2+', top='+(screen.availHeight-h)/2 );
		//son.document.location="popups/"+str;
	    son.resizeTo(w+5,h+15);
		son.focus();
}
function popupimagen(str,w,h)
{
	var son=window.open('','FAN','scrollbars=yes,resizable=yes,width='+w+',height='+h+',status=no,location=no,toolbar=no, menubar=no');
		son.document.open();
		son.document.write('<html><head><title>:: Fondo Ambiental Nacional ::</title></head>');
		son.document.write('<body bgcolor="#000000" leftmargin="0" topmargin="0"><div align="center"><img src="'+str+'"></div></body></html>');
		son.document.close(); 
		son.resizeTo(w+5,h+15);
		son.focus();
}
function popDownload(str,w,h)
{
	window.open(str,'FAN','scrollbars=no,resizable=no,width=100,height=100,status=no,location=no,toolbar=no, menubar=no,left='+(screen.availWidth-w)/2+', top='+(screen.availHeight-h)/2 );
		//son.document.location="popups/"+str;
}