function Ir(canal) {
parent.top.location = canal;
	} 

// 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.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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function openwindow(pie,imagen){
	window.open('/popup.php?pie='+pie+'&imagen='+imagen,'Imagen','resizable=yes,menubar=no,toolbar=no,scrollbars=yes,width=468,height=300,top=50,left=50');
}

function iecompattest(){
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}		

function CambiarFotoPortada() {
	imagen= Math.floor(Math.random()*4);
	document.getElementById("FotoPortada").style.backgroundImage="url(http://www.solardeurbezo.c/img/fotos_portada/"+imagen+".jpg)";
}



function ActivarPestanna(IDPEstanna) {
	document.getElementById(IDPEstanna).className="EnlaceMenuActivo";
}

function DesactivarPestanna(IDPEstanna) {
	document.getElementById(IDPEstanna).className="EnlaceMenuInactivo";
}



function ComprobarFormBaja(form){
	if(document.getElementById('EMailB').value==''){
		alert('El campo EMail es obligatorio .');
		return false;
	}
	if(!validarEmailModificar(document.getElementById('EMailB').value)){
		return false;
	}
	if(document.getElementById('PasswordB').value==''){
		alert('El campo Clave es obligatorio.');
		return false;
	}
	return true;
}


function Ir(canal) {
parent.top.location = "/"+canal;
	}
	
	
function RedimensionaImagenes (IdCapaImagenes,IdCapaRecursos, Excepcion1) {
		// ABEL TENA.
		// Redimensiona las im&aacute;genes mayores de 425 
		// Si no hay ninguna > de 425 y no hay video redimensiona la columna de recursos
		// al tama&ntilde;o de la mayor de ellas.
			
		var mylist=document.getElementById(IdCapaImagenes)
		var listitems= mylist.getElementsByTagName('img')
		var mayor=0;
		for (i=0; i<listitems.length; i++) {
			if (listitems[i].width>'425') {
				listitems[i].width='425';
			}
			if (listitems[i].width>mayor) {
				mayor=listitems[i].width;
			}
		}
		if (mayor<200) {mayor=200}
		if ( !document.getElementById(Excepcion1) )
		{
			document.getElementById(IdCapaRecursos).style.width=(mayor+2)+"px";
		}	
}
