/* ---- FUNCIONES COMPORTAMIENTO DE ESTILOS DE BUSCADOR DE CABECERA ---- */
/* ---- Abel Tena - 26 feb 2009 ---- */

function ActivarBuscador() {
	if (document.getElementById('q').value == "Texto a buscar...") {
		document.getElementById('q').value = "";
	}
	document.getElementById('q').style.color = "#000000";
}

function DesactivarBuscador() {
	if (document.getElementById('q').value == "") {
		document.getElementById('q').style.color = "#888888";
		document.getElementById('q').value = "Texto a buscar...";
	}
}

function CompruebaBusqueda() {
	if (document.getElementById('q').value == "Texto a buscar...") {
		document.getElementById('q').value ="";
	}	
}

//==========================================================================
// Utiles.
//==========================================================================

function ltrim(s) {
	return s.replace(/^\s+/, "");
}

function rtrim(s) {
	return s.replace(/\s+$/, "");
}

function trim(s) {
	return rtrim(ltrim(s));
}

var ua = navigator.userAgent.toLowerCase();
function detect(text) {
   stringposition = ua.indexOf(text) + 1;
   data = text;
   return stringposition;
}	

//==========================================================================
// Funciķn de apertura de ventanas flotantes.
//==========================================================================
function openw2(foto,ancho,alto,scrol){
	var centroy=((screen.availHeight - alto)/2);
	var centrox=((screen.availWidth - ancho)/2);
	window.open(foto,"IWIN","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars="+scrol+",resizable=yes,copyhistory=no,width="+ancho+",height="+alto+",left="+centrox+",top="+centroy)
}

function openw(foto,ancho,alto,scrol)
{
	var centroy=((screen.availHeight - alto)/2);
	var centrox=((screen.availWidth - ancho)/2);
	window.open(foto,"IWIN","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scrol+",resizable=no,copyhistory=no,width="+ancho+",height="+alto+",left="+centrox+",top="+centroy)
}

/*---------------------------------------------------------------------*/

/* ---- FUNCIONES FECHA EN CALENDARIO DE CABECERA ---- */
/* ---- Abel Tena - 26 feb 2009 ---- */

var fecha=new Date();
var diames=fecha.getDate();
var diasemana=fecha.getDay();
var mes=fecha.getMonth() +1 ;
var ano=fecha.getFullYear();
var textosemana = new Array (7); 
	  textosemana[0]="Domingo";
	  textosemana[1]="Lunes";
	  textosemana[2]="Martes";
	  textosemana[3]="Miércoles";
	  textosemana[4]="Jueves";
	  textosemana[5]="Viernes";
	  textosemana[6]="Sábado";
var textomes = new Array (12);
	  textomes[1]="Enero";
	  textomes[2]="Febrero";
	  textomes[3]="Marzo";
	  textomes[4]="Abril";
	  textomes[5]="Mayo";
	  textomes[6]="Junio";
	  textomes[7]="Julio";
	  textomes[7]="Agosto";
	  textomes[9]="Septiembre";
	  textomes[10]="Octubre";
	  textomes[11]="Noviembre";
	  textomes[12]="Diciembre";
	  
/*---------------------------------------------------------------------*/

/* ---- FUNCIONES MUESTRA Y OCULTA EL MENU DE EDICIONES ---- */
/* ---- Abel Tena - 26 feb 2009 ---- */

function mostrarSubmenuEdicion() {
		document.getElementById('SubMenuEdicion').style.display = 'block';
		document.getElementById('OpcEdicion').style.color = '#000000';
		document.getElementById('OpcEdicion').style.backgroundColor = '#e6ffec';
		//document.getElementById('OpcEdicion').style.backgroundImage = 'url(/img/fondo_OpcEdicion.gif)';
		document.getElementById('OpcEdicion').style.borderBottom = '1px solid #ffc335';
}

function ocultarSubmenuEdicion() {
		document.getElementById('SubMenuEdicion').style.display="none";
		document.getElementById('OpcEdicion').style.color = '#ffffff';
		document.getElementById('OpcEdicion').style.backgroundColor="#009718";
		//document.getElementById('OpcEdicion').style.backgroundImage = 'url(/img/fondo_OpcEdicion.gif)';
		document.getElementById('OpcEdicion').style.borderBottom = '1px solid #002daf';
}


/*---------------------------------------------------------------------*/

/* ---- FUNCIONES GALERIA EN COLUMNA DERECHA ---- */
/* ---- Abel Tena - 27 feb 2009 ---- */
	  
function CargarFotoEnCajaGaleria(Foto) {
	document.getElementById('FotoPrincipal_Cajagaleria').src= "/img/pruebas_al_instalar_borrar/"+Foto+".jpg";
}	  
	  
	  
	  
/*---------------------------------------------------------------------*/

/* MUESTRA LA CAJA DE COMPARTIR CON AGREGADORES */
/* ---- Abel Tena - 02 marzo 2009 ---- */

	function MostrarCompartir(idNoticia) {
		if (document.getElementById('CajaComparte').style.display!="block") {
			document.getElementById('Comparte').className="ShareActivo";
			document.getElementById('CajaComparte').style.display="block";
			if (document.getElementById('IframeCajaComparte').src=="") {
				document.getElementById('IframeCajaComparte').src="comparte.php?id="+idNoticia;
			}
		}else{
			document.getElementById('Comparte').className="ShareInactivo";
			document.getElementById('CajaComparte').style.display="none";
		}	
	}
	
/*---------------------------------------------------------------------*/

/* AUNMENTAR Y REDUCIR TEXTO DE LAS NOTICIAS */
/* ---- Abel Tena - 02 marzo 2009 ---- */



function ampliarTexto(bloque){
	if (document.getElementById(bloque).style.fontSize== '1.2em') {
		document.getElementById(bloque).style.fontSize= '1.4em';
	}else{
		if (document.getElementById(bloque).style.fontSize!= '1.4em') {
			document.getElementById(bloque).style.fontSize= '1.2em';
		}
	}
}

function reducirTexto(bloque){
	document.getElementById(bloque).style.fontSize= '1em';
}

/*---------------------------------------------------------------------*/

/* FUNCION QUE MUESTRA Y OCULTA LA CAJA DE AVISO DE COMENTARIOS */
/* ---- Abel Tena - 02 marzo 2009 ---- */

function MostrarCajaAviso(id,numElementos)
{
	for (i=0; i<numElementos; i++)
	{
		if ("CajaAviso"+i != id)
		{
			document.getElementById("CajaAviso"+i).style.display="none";
		}
	}
	
	if (document.getElementById(id).style.display=="block")
	{
		document.getElementById(id).style.display="none";
	}
	else
	{
		document.getElementById(id).style.display="block";	
	}
}


/*---------------------------------------------------------------------*/

/* FUNCION QUE FLOTA UN TEXTO JUNTO AL PUNTERO DEL RATON. */
/* ---- Abel Tena - 02 marzo 2009 ---- */

	function position(event){
	   var x = event.clientX+document.body.scrollLeft;
	   var y = event.clientY+document.body.scrollTop+document.documentElement.scrollTop;
	   document.getElementById('CajaFlotante').style.top= (y-61)+'px';
	   document.getElementById('CajaFlotante').style.left= (x+13)+'px';  
	}

	function MostrarInformacion(NoticiaCorrelativa,LineaTexto) {
		document.getElementById('CajaFlotante').style.display = 'block';
		document.getElementById('TextoCajaFlotante').innerHTML  = LineaTexto;
		document.getElementById('NoticiaCorrelativa').innerHTML  = NoticiaCorrelativa;
	}

	function OcultarInformacion() {
		document.getElementById('CajaFlotante').style.display = 'none';
		document.getElementById('TextoCajaFlotante').innerHTML  = '';		
		document.getElementById('NoticiaCorrelativa').innerHTML  = '';
	}	
/*---------------------------------------------------------------------*/



/*---------------------------------------------------------------------*/

/* FUNCION QUE MUESTRA UN CUBREPAGINAS. */
/* ---- Abel Tena - 03 marzo 2009 ---- */

function mostrarCubrepaginas(URLIframe){
	var anchoDePantalla = document.body.clientWidth;
	document.getElementById('Cubrepaginas').style.marginTop='0px';	
	document.getElementById('Cubrepaginas').style.display = 'block';
	if (detect('msie')){ 
		document.getElementById('CuerpoPrincipal').scroll = 'no';
		document.getElementById('Cubrepaginas').style.filter= 'alpha(opacity=93)';
	}else{	
		document.getElementById('CuerpoPrincipal').style.overflow = 'hidden';
		document.getElementById('Cubrepaginas').style.opacity = '0.93';
	}	
/*	document.getElementById('IframeComun').src=URLIframe;*/
	parent.top.location = '#cabecera';

    document.getElementById('IframeComun').src = URLIframe; 
	setTimeout ('Ejecutar("'+URLIframe+'")',300)
}

function Ejecutar(URLIframe) {
	document.getElementById('IframeHerramientas').style.display = 'block';
}

function ocultarCubrepaginas(){
	document.getElementById('IframeComun').src='/noticias/vacio.php';
	document.getElementById('Cubrepaginas').style.display = 'none';
	document.getElementById('IframeHerramientas').style.display = 'none';
	if (detect('msie')){ 
		document.getElementById('CuerpoPrincipal').scroll = 'yes';	
	}else{	
		document.getElementById('CuerpoPrincipal').style.overflow = 'auto';
	}
}

function monstrarCapa(Elemento) {

	if (document.getElementById(Elemento).style.display != 'block') {
		document.getElementById(Elemento).style.display = 'block';
	}else{
		document.getElementById(Elemento).style.display = 'none';
	}
}





/*---------------------------------------------------------------------*/

/* FUNCION QUE MUESTRA UN CUBREPAGINAS. */
/* ---- Abel Tena - 26 marzo 2009 ---- */

function mostrarFoto(NombreFoto,TextoFoto){
	if (detect('msie')){ 	
		var ScrollDePantalla =  window.document.documentElement.scrollTop;
		var TotalPantalla =  window.document.documentElement.scrollBottom;
	}else{
		var ScrollDePantalla =  window.pageYOffset;	
	}	
	document.getElementById('FotoPopUp').src=NombreFoto;
	document.getElementById('FotoPopUp').alt=TextoFoto;
	if (TextoFoto!="") {
		document.getElementById('TextoFotoPopUp').style.display = 'block';
	}
	document.getElementById('TextoFotoPopUp').innerHTML=TextoFoto;
	document.getElementById('Cubrepaginas').style.marginTop=(ScrollDePantalla)+"px";	
	document.getElementById('Cubrepaginas').style.display = 'block';
	
	if (detect('msie')){ 
		document.getElementById('CuerpoPrincipal').scroll = 'no';
		document.getElementById('Cubrepaginas').style.filter= "alpha(opacity=93)";
	}else{	
		document.getElementById('Cubrepaginas').style.opacity = '0.93';
		document.getElementById('CuerpoPrincipal').style.overflow = 'hidden';
	}	
	
	document.getElementById('PopUpFoto').style.display = 'block';	
	centradoEnPagina();
}

function ocultarCubrepaginasFoto(){
	document.getElementById('FotoPopUp').src="/img/Loader.gif";
	document.getElementById('FotoPopUp').alt="";
	document.getElementById('Cubrepaginas').style.display = 'none';
	document.getElementById('PopUpFoto').style.display = 'none';
	document.getElementById('TextoFotoPopUp').style.display = 'none';
	document.getElementById('EnlaceFoto').style.marginTop= "0px";
	
	if (detect('msie')){ 
		document.getElementById('CuerpoPrincipal').scroll = 'yes';	
	}else{	
		document.getElementById('CuerpoPrincipal').style.overflow = 'auto';
	}
	
}

function centradoEnPagina() {
	setTimeout("CalcularCentradodeFoto()",700);
}


function CalcularCentradodeFoto() {
	var altoImagen = document.getElementById('FotoPopUp').clientHeight;
	if (detect('msie')){ 	
		var altoDePantalla = document.body.clientHeight;
		var altoDePantalla = document.documentElement.clientHeight;
		var ScrollDePantalla =  window.document.documentElement.scrollTop;
	}else{
		var altoDePantalla =  window.innerHeight;	
		var ScrollDePantalla =  window.pageYOffset;	
	}

	if (altoDePantalla-altoImagen>0) {
		var margenImagen = ((altoDePantalla-altoImagen)/2);
	}else{
		var margenImagen = 0;
	}
	var espaciadoSuperior=parseInt(ScrollDePantalla)+parseInt(margenImagen)-20;
	document.getElementById('PopUpFoto').style.marginTop= ""+espaciadoSuperior+"px";
}


/*---------------------------------------------------------------------*/

/* FUNCION QUE MUESTRA Y OCULTA LAS PESTA&Ntilde;AS DE LO MAS. */
/* ---- Abel Tena - 04 marzo 2009 ---- */


function CambiarPestanaListados(A_Activar) {
	if (document.getElementById(A_Activar).className=="Activa") {
		parent.top.location = '/noticias/lomas.php';
	}
	else
	{
		var ElementosEnCajaPestanas = document.getElementById('Pestanas_CajaListados_derecha');
		var Pestanas = ElementosEnCajaPestanas.getElementsByTagName('a');
		
		var ElementosEnCajaListados = document.getElementById('Listados_CajaListados_derecha');
		var Listados = ElementosEnCajaListados.getElementsByTagName('div');	
		
		var NumeroDePestanas = Pestanas.length;
		var NumeroDeListados = Listados.length;
		
		/* Primero Activamos la pestana pulsada */
		
		for (contador=0; contador<NumeroDePestanas; contador++) {
			if (Pestanas[contador].id==A_Activar) {
				Pestanas[contador].className="Activa";
			}else{
				Pestanas[contador].className="";
			}
		}
		
		/* Segundo ocultamos todas los listado y mostramos el activo */	
		
		for (contador=0; contador<NumeroDeListados; contador++) {
			if (Listados[contador].id=='Caja_'+A_Activar) {
				Listados[contador].style.display="block";
			}else{
				Listados[contador].style.display="none";
			}
		}	
	}
}

/* MUESTRA DESCRIPCIONES DE LOS DESTACADOS DE PORTADA */



function MonstrarDescripDestacado(CapaDescripcion) {
		document.getElementById(CapaDescripcion).style.marginTop='0px';
		document.getElementById('Caja'+CapaDescripcion).style.marginTop='0px';	
}

function OcultarDescripDestacado(CapaDescripcion) {
		document.getElementById(CapaDescripcion).style.marginTop='65px';
		document.getElementById('Caja'+CapaDescripcion).style.marginTop='65px';	
}


/* MUESTRA DESCRIPCIONES DE LOS BLOGS DE PORTADA */



function MonstrarDescripBlog(CapaDescripcion) {
		document.getElementById(CapaDescripcion).style.marginTop='0px';
		document.getElementById('Caja'+CapaDescripcion).style.marginTop='0px';	
}

function OcultarDescripBlog(CapaDescripcion) {
		document.getElementById(CapaDescripcion).style.marginTop='70px';
		document.getElementById('Caja'+CapaDescripcion).style.marginTop='70px';	
}

/*SEGURIDAD Y UTILES*/
function validarEntero(valor){
	if(valor!=0){
		valor = parseInt(valor);
		if (isNaN(valor)) {
			return "";
		}
	}
	return valor;
}

function VerificarMail(strMail) {
//La siguiente funcion da error si se introduce algo.usuario@dominio.es
	var patMail = /^(.+)@(.+)$/;
	var patUser = /^[a-zņA-Z\d_-]+(\.[a-zņA-Z\d_-]+)*$/;
	var patDomainIP = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
	var patDomain = /^[a-zņA-Z\d_-]+(\.[a-zņA-Z\d_-]+)+$/;
	var matchArray = strMail.match(patMail);
	if(matchArray == null){return false;}
	var user = new String(matchArray[1]);
	var domain = new String(matchArray[2]); 
	if(user.match(patUser) == null){return false;}
	var IPArray = domain.match(patDomainIP);
	if(IPArray != null){ 
		 for (var i=1;i<=4;i++) {
		  if(IPArray[i]>255){return false;}
		 }
		 return true; 
	}
	var domainArray = domain.match(patDomain);
	if(domainArray == null) {return false;}
	if(domainArray[domainArray.length - 1].length < 3 || domainArray[ domainArray.length - 1].length > 5) { return false;}
	return true;
}

function charactermax(id, idreturn, idcontador, longtotal){
	var longit = document.getElementById(id).value.length;
	if(!longit) {longit = '0';}
	document.getElementById(idreturn).innerHTML = longit + '';

	if (longit>longtotal) {
		document.getElementById(idcontador).style.color= '#990000';
		document.getElementById(idcontador).style.fontWeight= 'bold';
		document.getElementById(id).style.borderColor= '#ff0033';
	}else{
		if (longit>longtotal && longit<longtotal) {
			document.getElementById(idcontador).style.color= '#ff6000';
			document.getElementById(id).style.borderColor= '#5ee086';
		}else{
			document.getElementById(idcontador).style.color= '#999999';
			document.getElementById(id).style.borderColor= '#5ee086';
		}
		document.getElementById(idcontador).style.fontWeight= 'normal';
	}
}



/* FUNCIONES QUE MUESTRA LINKS A RSS EN BLOGS */


			function MostrarRSS() {
				document.getElementById('CajaDeRSS').style.display = 'block';
				document.getElementById('IconoRSS').className = 'Activo';
			}
			function OcultarRSS() {
				document.getElementById('CajaDeRSS').style.display = 'none';
				document.getElementById('IconoRSS').className = '';
			}	
			
			
			
/* ONBLUR DESDE JAVASCRIPT DE TODOS LOS FORMULARIOS. */			

function MarcadoresDeFormularios() {

	var inputes=document.getElementsByTagName('input');
	
	var textareas=document.getElementsByTagName('textarea');
	
	var selectes=document.getElementsByTagName('select');
	
	
	
	var numElementosInput = inputes.length;
	
	var numElementosTextareas = textareas.length;
	
	var numElementosSelect = selectes.length;
	
	
	for (contador=0; contador<numElementosInput; contador++) {
		if (inputes[contador].type=='radio' || inputes[contador].type=='checkbox') {
			inputes[contador].style.backgroundImage= "none";
			inputes[contador].style.border="0px"
		}
		
		if (inputes[contador].className!='Boton' && inputes[contador].type!='radio' && inputes[contador].type!='checkbox') {
			inputes[contador].onfocus= function() { this.style.border= '1px solid #00a7ed';}
			inputes[contador].onblur= function() { this.style.border= '1px solid #c0c0c0';}
		}
	}
	for (contador=0; contador<numElementosTextareas; contador++) {
		textareas[contador].onfocus= function() { this.style.border= '1px solid #00a7ed';}
		textareas[contador].onblur= function() { this.style.border= '1px solid #c0c0c0';}
	}		
	for (contador=0; contador<numElementosSelect; contador++) {
		selectes[contador].onfocus= function() { this.style.border= '1px solid #00a7ed';}
		selectes[contador].onblur= function() { this.style.border= '1px solid #c0c0c0';}
	}			
}

/* FUNCION CARRUSELL FOTOS DE PORTADA  */

var FotoActiva	= 0;
var NivelAlpha 	= 100;
var VelocidadFundido = 30;
var TiempoFotoVisible = 10000;

function CarrusellFotos() {
	if (NumElementos>0) {
		setTimeout("CambiarFoto()",5000);
	}
}

function CambiarFoto() {
	if (FotoActiva < NumElementos) {
		FotoActiva = FotoActiva+1;
	}else{
		FotoActiva = 0;
	}
	setTimeout("FundidoOut()",1);
}


function FundidoOut() {
	NivelAlpha = NivelAlpha-10;
	if (NivelAlpha > 0) {
		if (detect('msie')){
			document.getElementById('Datos_CajaGaleria').style.filter = "alpha(opacity=" + NivelAlpha + ")";
		}else{
			document.getElementById('Datos_CajaGaleria').style.opacity  = NivelAlpha/100; 
		}
		setTimeout("FundidoOut()",VelocidadFundido);
	}else{
		document.getElementById('FotoPrincipal_Cajagaleria').src				= gal_SRCImagenGrande[FotoActiva];
		document.getElementById('Datos_CajaGaleria').style.opacity  			= '0';
		document.getElementById('Link_FotoPrincipal_Cajagaleria').href			= gal_LinksGalerias[FotoActiva];
		document.getElementById('Link_FotoPrincipal_Cajagaleria2').href			= gal_LinksGalerias[FotoActiva];
		document.getElementById('Link_FotoPrincipal_Cajagaleria2').innerHTML	= gal_Titular[FotoActiva];
		
		document.getElementById('CajaDescripcionGaleria').innerHTML				= gal_Descripcion[FotoActiva];
			
		document.getElementById('NumComentariosgaleria').href					= gal_LinksGalerias[FotoActiva]+'#Comentarios';
		
		if(gal_Comentarios[FotoActiva]!=''){
			document.getElementById('NumComentariosgaleria').innerHTML				= ' Comentarios (' + gal_Comentarios[FotoActiva] + ')';
		}else{
			document.getElementById('NumComentariosgaleria').innerHTML				= '';
		}
		document.getElementById('Link_FotoPrincipal_Cajagaleria3').href			= gal_LinksGalerias[FotoActiva];
		
		document.getElementById('CabecerSeccion').innerHTML						= gal_Seccion[FotoActiva];
		
		setTimeout("FundidoIn()",VelocidadFundido);		
	}
}

function FundidoIn() {
	NivelAlpha = NivelAlpha + 10;
	if (NivelAlpha <= 100) {
		if (detect('msie')){
			document.getElementById('Datos_CajaGaleria').style.filter = "alpha(opacity=" + NivelAlpha + ")";
		}else{
			document.getElementById('Datos_CajaGaleria').style.opacity  = NivelAlpha/100; 
		}		
		setTimeout("FundidoIn()",1);
	}else{
		//Desmarcamos todos
		for (cuenta=0; cuenta < NumElementos+1; cuenta++) {
			document.getElementById('FotoGaleriaPortada' + cuenta).style.borderColor='#7b7b7b';
			document.getElementById('Opcion_CajaGaleria' + cuenta).style.backgroundImage= 'none';
		}
		//Marcamos seleccionado
		document.getElementById('FotoGaleriaPortada' + FotoActiva).style.borderColor='#df0000';		
		document.getElementById('Opcion_CajaGaleria' + FotoActiva).style.backgroundImage='url(../img/fondo_galeria_activa.gif)';

		setTimeout("CambiarFoto()",TiempoFotoVisible);
	}
}




/* FUNCION QUE REDUCE ESPACIOS EN LOCALIZACION DE BANNERS VACIOS */
/* CON http://ads.grupozeta.es/RealMedia/ads/Creatives/default/empty.gif DENTRO */

function OcultaEspacioBannersVacios() {
	var Capas = document.getElementsByTagName("div");
	for (var i=0; i<Capas.length; i++) {
		if (detect('msie')){
			if (Capas[i].getAttribute("className")=="PublicidadTop1" || Capas[i].getAttribute("className")=="PublicidadTop2" || Capas[i].getAttribute("className")=="PublicidadBottom1" || Capas[i].getAttribute("className")=="PublicidadBottom2" || Capas[i].getAttribute("className")=="PublicidadBottom3" || Capas[i].getAttribute("className")=="PublicidadBottom4" || Capas[i].getAttribute("className")=="PublicidadColIzq1" || Capas[i].getAttribute("className")=="PublicidadColIzq2" || Capas[i].getAttribute("className")=="PublicidadColIzq3" || Capas[i].getAttribute("className")=="PublicidadColCentral1" || Capas[i].getAttribute("className")=="PublicidadColCentral2" || Capas[i].getAttribute("className")=="PublicidadFaldon1" || Capas[i].getAttribute("className")=="Faldon1") {
				var BannerImg = Capas[i].getElementsByTagName("img");
				if (BannerImg!=null && BannerImg.length>0) {
					for (var n=0; n<BannerImg.length; n++) {
						ContieneEspacioVacio=BannerImg[n].getAttribute("src");
						if(ContieneEspacioVacio =='http://www.vivirdigital.es/empty.gif'){
							Capas[i].style.display = "none";
						}
					}
				}else{
					if (trim(Capas[i].innerHTML)=='') {
						Capas[i].style.display = "none";
					}
				}
			}	 

			if (Capas[i].getAttribute("className")=="PublicidadTop1") {
				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://www.vivirdigital.es/empty.gif'){
							document.getElementById('publicidadCabecera').style.display = "none";
						}
					}
				}
			}

			if (Capas[i].getAttribute("className")=="PublicidadTop1") {
				if (Capas[i].innerHTML.indexOf('http://www.vivirdigital.es/empty.gif')!=-1){
					Capas[i].style.display = "none";
					document.getElementById('publicidadCabecera').style.display = "none";
				}
			}			

		}else{
			if (Capas[i].getAttribute("class")=="PublicidadTop1" || Capas[i].getAttribute("class")=="PublicidadTop2" || Capas[i].getAttribute("class")=="PublicidadBottom1" || Capas[i].getAttribute("class")=="PublicidadBottom2" || Capas[i].getAttribute("class")=="PublicidadBottom3" || Capas[i].getAttribute("class")=="PublicidadBottom4" || Capas[i].getAttribute("class")=="PublicidadColIzq1" || Capas[i].getAttribute("class")=="PublicidadColIzq2" || Capas[i].getAttribute("class")=="PublicidadColIzq3" || Capas[i].getAttribute("class")=="PublicidadColCentral1" || Capas[i].getAttribute("class")=="PublicidadColCentral2" || Capas[i].getAttribute("class")=="PublicidadFaldon1" || Capas[i].getAttribute("class")=="Faldon1") {
				var BannerImg = Capas[i].getElementsByTagName("img");

				if (BannerImg!=null && BannerImg.length>0) {
					for (var n=0; n<BannerImg.length; n++) {
						ContieneEspacioVacio=BannerImg[n].getAttribute("src");
						if(ContieneEspacioVacio =='http://www.vivirdigital.es/empty.gif'){
							Capas[i].style.display = "none";
						}
					}
				}else{
					if (trim(Capas[i].innerHTML)=='') {
						Capas[i].style.display = "none";
					}
				}
			}

			if (Capas[i].getAttribute("class")=="PublicidadTop1") {
				if (Capas[i].innerHTML.indexOf('<!--  -->')!=-1){
					Capas[i].style.display = "none";
					document.getElementById('publicidadCabecera').style.display = "none";
				}
			}
		}
	}
}


/* FUNCION QUE ELIMINA 'Texto' EN EL FORM BUSCADOR */
function CorregirFormulario(elemento,Variable) {
	if (document.getElementById(elemento).value==Variable) {
		document.getElementById(elemento).value="";
	}
}
