// Funciones para marcar como activa una sección en el menu del web.

function MarcarSeccionEnMenu(Seccion,Total) {
	for (Contador=1; Contador<Total; Contador++) {
		IdPestanna="Opc"+Contador;
		document.getElementById(IdPestanna).className = "";
	}
	IdActiva=Seccion;
	document.getElementById(IdActiva).className = "activo";
}

// Funciones para mostrar y ocultar menus despelgables del web.

function monstrarSubMenu(Capa) {
	var nuevoClass ="SubMenu Mostrar";	
	document.getElementById("Menu"+Capa).className = nuevoClass;
	document.getElementById("Opc"+Capa).style.backgroundColor = "#EBEBEB";	
}
function ocultarSubMenu(Capa) {
	var nuevoClass = "SubMenu";
	document.getElementById("Menu"+Capa).className = nuevoClass;
	document.getElementById("Opc"+Capa).style.backgroundColor = "#ffffff";		
}

// Corrector de Bug PNG para Explorer. Opera y Mozilla funcionan correctamente sin este JS
function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.vspace) imgStyle = "margin-top:" + img.vspace + "; margin-bottom:" + img.vspace + "; "+ imgStyle		
		 if (img.hspace) imgStyle = "margin-left:" + img.hspace + "; margin-right:" + img.hspace + "; "+ imgStyle		 		 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
var ua = navigator.userAgent.toLowerCase();
function detect(text) {
   stringposition = ua.indexOf(text) + 1;
   data = text;
   return stringposition;
}
if (detect('opera')) {
	 
 } else if (detect('firefox')){
	 
} else if (detect('msie')){
	 window.attachEvent("onload", correctPNG);	
}	 

function openw(foto)
{
	window.open("/popup.php?imagen="+foto,"IWIN","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no")
}