function redirecciona (url){
	document.location = url;	
}

function redireccionaNVentana (url,nombre){
	window.open(unescape(url),nombre);
}

function decodificaCadena(dato){
	return unescape(dato);	
}

/*Activa una capa semitransparente que ocupa toda la pantalla.*/
function capaSemitransparenteON(){
	if ( document.body.innerHTML.indexOf('<div id="capaSemiTrans"></div>') < 0 ) {
		document.body.innerHTML = document.body.innerHTML + '<div id="capaSemiTrans"></div>';
	}
	document.getElementById("capaSemiTrans").style.background = 'url("http://www.hermandadperdon.es/imagenes/capaSemiTrans.gif")';
	document.getElementById("capaSemiTrans").style.display = 'inline';
	if(document.body.scrollHeight != 0){
		document.getElementById("capaSemiTrans").style.height = document.body.scrollHeight + "px";
	} else {
		document.getElementById("capaSemiTrans").style.height = document.body.height + "px";
	}
	document.getElementById("capaSemiTrans").style.width = document.body.scrollWidth + "px";
}

function capaSemitransparenteON_enFrio(){
	document.write('<div id="capaSemiTrans"></div>');
	
	document.getElementById("capaSemiTrans").style.background = 'url("http://www.hermandadperdon.es/imagenes/capaSemiTrans.gif")';
	document.getElementById("capaSemiTrans").style.display = 'inline';
	if(document.body.scrollHeight != 0){
		document.getElementById("capaSemiTrans").style.height = document.body.scrollHeight + "px";
	} else {
		document.getElementById("capaSemiTrans").style.height = document.body.height + "px";
	}
	document.getElementById("capaSemiTrans").style.width = document.body.scrollWidth + "px";
}

/*Oculta una capa semitransparente que ocupa toda la pantalla.*/
function capaSemitransparenteOFF(){
	document.getElementById("capaSemiTrans").style.display = 'none';	
}

/*Activa una capa semitransparente que muestra una animaci�n*/
function animacionEsperaON(texto, top, right, bottom, left, boolCapaSemitransparente) {
	
	if (boolCapaSemitransparente) {
		capaSemitransparenteON();
	}
	
	if ( document.body.innerHTML.indexOf('<div id="espera">') < 0 ) {
		document.body.innerHTML = document.body.innerHTML + '<div id="espera"><img src="http://www.hermandadperdon.es/imagenes/loading.gif" border="0"/><br/>' + texto + '</div>';
	}
	
	document.getElementById('espera').style.display = 'inline';
	document.getElementById('espera').style.margin = top + " " + right + " " + bottom + " " + left;
	
}

function animacionEsperaON_enFrio(texto, top, right, bottom, left, boolCapaSemitransparente) {
	
	if (boolCapaSemitransparente) {
		capaSemitransparenteON_enFrio();
	}
	
	document.write('<div id="espera"><img src="http://www.hermandadperdon.es/imagenes/loading.gif" border="0"/><br/>' + texto + '</div>');
	
	document.getElementById('espera').style.display = 'inline';
	document.getElementById('espera').style.margin = top + " " + right + " " + bottom + " " + left;
	
}

/*Activa una capa semitransparente que muestra una animaci�n*/
function animacionEsperaOFF() {
	document.getElementById('espera').style.display="none";
	if(document.getElementById('capaSemiTrans')) {
		capaSemitransparenteOFF();
	}
}

/*Hacer parpadear el texto "Ultima Hora"*/
function titUltHora(){
	if(document.getElementById("titUltHora").innerHTML == ""){
		document.getElementById("titUltHora").innerHTML = "¡Última <br/> hora!";
	} else {
		document.getElementById("titUltHora").innerHTML = "";
	}
	
	if (document.getElementById("titUltHora").innerHTML == ""){
		setTimeout("titUltHora()",300);
	} else {
		setTimeout("titUltHora()",1500);
	}
}

/*Hacer que aparezca un texto letra a letra de forma animada.*/
function cueUltHora(datos){	
	
	var actual = document.getElementById("cueUltHora").innerHTML;
	var HTML = datos.substr(0,actual.length + 1);
	
	if(actual.length == datos.length){
		document.getElementById("cueUltHora").innerHTML = "";
	} else {
		document.getElementById("cueUltHora").innerHTML = HTML;
	}	
	
	if((actual.length + 1) == datos.length){
		setTimeout("cueUltHora('"+ datos +"')",10000);
	} else {
		setTimeout("cueUltHora('"+ datos +"')",100);
	}	
}