function GestionarMenuSuperior(oPMP){

 var iPMP = oPMP.id.split("-")[1];
 var oDD = document.getElementById("MenuSuperior").getElementsByTagName("dl")[0].getElementsByTagName("dd");

 oPMP.unselectable = "on";

 for(i=0;i<oDD.length;i++){
  iDD = oDD[i].id.split("-")[1];
  if(iDD==iPMP){
   oDD[i].style.display = "block";
  }else{
   oDD[i].style.display = "none";
  }
 }

}

function CambiarFondoMS(esto, iEstado){
	var oHijo = esto.firstChild;
	if(iEstado == 0){
		if (esto.className != "menuTerHome")
			{
			esto.style.backgroundColor = "#8396A4";
			oHijo.style.cssText = "color: #FFFFFF;";
			}
		
	} else {
		if (esto.className != "menuTerHome")
			{
			esto.style.backgroundColor = "#D2D9E3";
			oHijo.style.cssText = "color: #333333;";
			}
	}
}

function CambiarFondoMT(esto, iEstado){
	var oHijo = esto.firstChild;
	if (iEstado == 0)
		{
		esto.style.backgroundColor = "#8396A4";
		oHijo.style.color = "#FFFFFF";
		}
	else
		{
		esto.style.backgroundColor = "#D2D9E3";
		oHijo.style.color = "#333333";
		}
}

function CambiarFondo(esto,iEstado){
	var oHijo = esto.firstChild;
	if(iEstado == 0){
		esto.style.backgroundColor="#E7E3D7";
		esto.style.backgroundImage="url(img/comunes/fondos/menuLateral.gif)";
		esto.style.backgroundPositionX="left";
		esto.style.backgroundRepeat="repeat-y";
		oHijo.style.cssText = "color: #333333;";
	} else {
		esto.style.backgroundColor="#891536";
		esto.style.backgroundImage="url(img/comunes/fondos/menuLateralSeleccionado.gif)";
		esto.style.backgroundPositionX="left";
		esto.style.backgroundRepeat="repeat-y";
		oHijo.style.cssText = "color: #FFFFFF;";
	}

}

function VerImagen(iIdImagen){

 var windowImagen;
 windowImagen = window.open("popup/popupimagen.asp?idimagen="+iIdImagen,"Imagen","width=100,height=100,top=10,left=10,scrollbars=yes,resizable=yes");

}

function ActivarCursor(oImagen){

 oImagen.style.cursor = "pointer";

}

function resolucion(iResolucion){
	var xmlHttp
	if (iResolucion == 0) {
		if (window.ActiveXObject){
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
			xmlHttp.open("GET", "resolucion.asp?resolucion="+screen.width+"*"+screen.height, false);
			xmlHttp.send();
		} else {
			xmlHttp = new XMLHttpRequest();
			xmlHttp.open("GET", "resolucion.asp?resolucion="+screen.width+"*"+screen.height, false);
			xmlHttp.send(null);
		}
	}
}

function obtenerResolucionLinks(iResolucion) {
	if (iResolucion == 0){
		var i;
		var screenW = screen.width;
		var screenH = screen.height;
		var host = location.host;
		for (i=0;i<document.links.length;i++) {
			enlace = document.links[i].href;
			if ((enlace.indexOf("javascript") == -1)&&(enlace.indexOf(host) != -1)) {
				if ((enlace.indexOf("?") != -1)&&(enlace.indexOf("#") == -1)) {
					document.links[i].href=document.links[i].href+'&r='+screenW+'*'+screenH;
				}
			}
		}
	}
}

function inicio(iResolucion){
	resolucion(iResolucion);
	obtenerResolucionLinks(iResolucion);
}
