
if (self != top) { top.location.href = self.location.href }

/* FUNCION QUE REDUCE ESPACIOS EN LOCALIZACION DE BANNERS VACIOS */
/* CON http://ads.grupozeta.es/RealMedia/ads/Creatives/default/empty.gif DENTRO */

function OcultaEspacioBannersVacios () {

	var ua = navigator.userAgent.toLowerCase();

	function detect(text) {

	   stringposition = ua.indexOf(text) + 1;

	   data = text;

	   return stringposition;

	}

	var Capas = document.getElementsByTagName("div");

	for (var i=0; i<Capas.length; i++) {

		if (detect('msie')){

			if (Capas[i].getAttribute("className")=="Publicidadx01" || Capas[i].getAttribute("className")=="PublicidadTop3" || Capas[i].getAttribute("className")=="PublicidadTop1" || Capas[i].getAttribute("className")=="PublicidadTop2" || Capas[i].getAttribute("className")=="PublicidadBottom1" || Capas[i].getAttribute("className")=="PublicidadPosition1" || Capas[i].getAttribute("className")=="PublicidadPosition4" || Capas[i].getAttribute("className")=="PublicidadTopLeft" || Capas[i].getAttribute("className")=="PublicidadLeft3" || Capas[i].getAttribute("className")=="PublicidadMiddle1" || Capas[i].getAttribute("className")=="PublicidadFrame2" || Capas[i].getAttribute("className")=="PublicidadBottom2") {

				var BannerImg = Capas[i].getElementsByTagName("img");

				if (BannerImg!=null) {

					for (var n=0; n<BannerImg.length; n++) {

						ContieneEspacioVacio=BannerImg[n].getAttribute("src");

						if(ContieneEspacioVacio =='http://ads.grupozeta.es/RealMedia/ads/Creatives/default/empty.gif'){

							Capas[i].style.display = "none";

						}

					}

				}

			}	 

			if (Capas[i].getAttribute("className")=="Megabanner") {

				var BannerImg = Capas[i].getElementsByTagName("img");

				if (BannerImg!=null) {

					for (var n=0; n<BannerImg.length; n++) {

						ContieneEspacioVacio=BannerImg[n].getAttribute("src");

						if(ContieneEspacioVacio =='http://ads.grupozeta.es/RealMedia/ads/Creatives/default/empty.gif'){

							document.getElementById('CajaPromocionCabecera').style.display = "none";

						}

					}

				}

			}

			if (Capas[i].getAttribute("className")=="Megabanner") {

				if (Capas[i].innerHTML.indexOf('<!--  -->')!=-1){

					Capas[i].style.display = "none";

					document.getElementById('CajaPromocionCabecera').style.display = "none";

				}

			}		

		}else{

			if (Capas[i].getAttribute("class")=="Publicidadx01" || Capas[i].getAttribute("class")=="PublicidadTop3" || Capas[i].getAttribute("class")=="PublicidadTop1" || Capas[i].getAttribute("class")=="PublicidadTop2" || Capas[i].getAttribute("class")=="PublicidadBottom1" || Capas[i].getAttribute("class")=="PublicidadPosition1" || Capas[i].getAttribute("class")=="PublicidadPosition4" || Capas[i].getAttribute("class")=="PublicidadTopLeft" || Capas[i].getAttribute("class")=="PublicidadLeft3" || Capas[i].getAttribute("class")=="PublicidadMiddle1" || Capas[i].getAttribute("class")=="PublicidadFrame2" || Capas[i].getAttribute("class")=="PublicidadBottom2") {

				var BannerImg = Capas[i].getElementsByTagName("img");

				if (BannerImg!=null) {

					for (var n=0; n<BannerImg.length; n++) {

						ContieneEspacioVacio=BannerImg[n].getAttribute("src");

						if(ContieneEspacioVacio =='http://ads.grupozeta.es/RealMedia/ads/Creatives/default/empty.gif'){

							Capas[i].style.display = "none";

						}

					}

				}

			}

			if (Capas[i].getAttribute("class")=="Megabanner") {

				if (Capas[i].innerHTML.indexOf('<!--  -->')!=-1){

					Capas[i].style.display = "none";

					document.getElementById('CajaPromocionCabecera').style.display = "none";

				}

			}

		}

	}

}


/* Caja flotante de datos */

	function position(event){
	   var x = event.clientX+document.body.scrollLeft;
	   var y = event.clientY+document.body.scrollTop+document.documentElement.scrollTop;
	   document.getElementById('CajaEnMapa').style.top= (y-40)+'px';
	   document.getElementById('CajaEnMapa').style.left= (x-210)+'px';  
	}
	function MostrarInformacion(IDPadre) {
		document.getElementById('CajaEnMapa').style.display = 'block';
		document.getElementById('TextoCajaEnMapa').innerHTML  = document.getElementById(IDPadre).alt;
	}
	function OcultarInformacion() {
		document.getElementById('CajaEnMapa').style.display = 'none';
	}	
	
	function openw(foto,ancho,alto)
	{ window.open(foto,"IWIN","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width="+ancho+",height="+alto)
	}

	function openw2(foto,ancho,alto,scrol)
	{ window.open(foto,"IWIN","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scrol+",resizable=no,copyhistory=no,width="+ancho+",height="+alto)
}

function MostrarTextoCompletoComarcas() {
	document.getElementById('Texto').style.display='none';
	document.getElementById('Texto2').style.display='block';
	document.getElementById('MostrarTexto').style.display='none';
	document.getElementById('OcultarTexto').style.display='block';		
}

function OcultarTextoCompletoComarcas() {
	document.getElementById('Texto2').style.display='none';
	document.getElementById('Texto').style.display='block';
	document.getElementById('MostrarTexto').style.display='block';
	document.getElementById('OcultarTexto').style.display='none';		
}


function validate_busqueda() {
  	validity = true; // asume valido
        var result1=document.busqueda.searchstring.value
        if (result1==0){
        alert("Tienes que buscar algo!!");validity = false;}
  	return validity
}

		
/*-------------------------------------------------------------------------------------*/
/*UTILES GENERALES													   				   */
/*-------------------------------------------------------------------------------------*/
function validarFloat(valor){
	if(valor!=0){
		valor = parseFloat(valor);
		if (isNaN(valor)) {
			return "";
		}
	}
	return valor;
}
function Redondear(x, places){
	return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}
function trim(cadena){
	for(i=0; i<cadena.length; ){
		if(cadena.charAt(i)==" "){
			cadena=cadena.substring(i+1, cadena.length);
		}else{
			break;
		}
	}
	for(i=cadena.length-1; i>=0; i=cadena.length-1){
		if(cadena.charAt(i)==" "){
			cadena=cadena.substring(0,i);
		}else{
			break;
		}
	}
	return cadena;
}		


function Ir2(canal) {
	parent.top.location = canal;
} 
