function redirigir($destino){	 
	//tiempo de redirección por si falla el movimiento
	setTimeout("this.location.href='"+$destino+"'", 2000); 
	compuerta();
	setTimeout('compuerta()', 1);
	document.getElementById("cargando").style.visibility = "visible";
}
function compuerta(){
	//para FireFox y para IE
	if (document.getElementById("Layer4").style.visibility != "hidden"){
		document.getElementById("Layer4").style.visibility = "hidden";
		document.getElementById("Layer7").style.visibility = "hidden";
		//mantengo el ancho de la celda que separa la compuerta de la izq de la pantalla
		document.getElementById("espacio").style.width = 90;
	}
	if (parseInt(document.getElementById("puerta").style.width) > 90){
		//reduzción primero de la ultima celda
		if ((parseInt(document.getElementById("lagro_p").style.width)-20) >= 0){
			document.getElementById("lagro_p").style.width = parseInt(document.getElementById("lagro_p").style.width) - 20;
		}else{
			document.getElementById("lagro_p").style.width = parseInt(document.getElementById("lagro_p").style.width) - parseInt(document.getElementById("lagro_p").style.width)
		}
		//reducción de capa
		document.getElementById("puerta").style.left = parseInt(document.getElementById("puerta").style.left) + 20;
		document.getElementById("puerta").style.width = parseInt(document.getElementById("puerta").style.width) - 20;
		setTimeout('compuerta()', 1);
	}else{
		document.getElementById("puerta").style.visibility = "hidden";
	}
	
}
function carga(){
	//para IE o sino FF
	if (document.all){
		document.getElementById("lagro_p").style.width = parseInt(document.body.offsetWidth) - 785;
		document.getElementById("Layer4").style.width = parseInt(document.body.offsetWidth) - 285;
		//ajusto la capa para que tenga un valor fijo y no porcentual
		document.getElementById("puerta").style.width = parseInt(document.body.offsetWidth) - 25;
	}else{
		document.getElementById("lagro_p").style.width = parseInt(window.innerWidth) - 760;
		document.getElementById("Layer4").style.width = parseInt(window.innerWidth) - 210;
		//ajusto la capa para que tenga un valor fijo y no porcentual
		document.getElementById("puerta").style.width = parseInt(window.innerWidth);
	}
}