
function getElementPosition(elem) { 
	var offsetTrail = elem; 
	var offsetLeft = 0; 
	var offsetTop = 0; 
	while (offsetTrail) { 
		offsetLeft += offsetTrail.offsetLeft;
		offsetTop += offsetTrail.offsetTop; 
		offsetTrail = offsetTrail.offsetParent; 
	} 
	
	if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined" && navigator.appName=="Microsoft Internet Explorer" ) { 
	offsetLeft += parseInt(document.body.leftMargin); 
	offsetTop += parseInt(document.body.topMargin); 
	
	}			
	return {left:offsetLeft, top:offsetTop}; 
}


function visible(idcapa) {	
	posicionX=getElementPosition(document.getElementById(idcapa)).left; 					
	document.getElementById(idcapa+'1').style.left=posicionX +"px";					
	document.getElementById(idcapa+'1').style.visibility= "visible";		 
}	


function oculta(idcapa) {
	document.getElementById(idcapa).style.visibility="hidden";
}


function activa_menu(){
	if (document.getElementById("menucapa1").style.display == "none"){						
		document.getElementById("menucapa1").style.display = "block";
		document.getElementById("menucapa2").style.display = "block";
		document.getElementById("linkmenucapa").style.display = "none";											
	}else{
		document.getElementById("menucapa1").style.display = "none";				
		document.getElementById("menucapa2").style.display = "none";
		document.getElementById("linkmenucapa").style.display = "block";								
	}

}
		
		
		