function iniciar_fondo()
{
	contador++

	setTimeout('poner_opacidad_capa(0)',700)	
}

function iniciar_fondo_estatico()
{
	document.getElementById('fondo').style.background = "url("+imagenes[contador]+") top left no-repeat"
	
	setTimeout('poner_opacidad_capa2(0)',700)	
}

function desplegar_cuerpo(){
	setTimeout('mover_capa(70)',700)
}

function desplegar_cuerpo_largo(){
	setTimeout('mover_capa_largo(200)',700)
}


function aparecer_fondo()
{
	contador++
	if(contador>=imagenes.length)
	{
		contador=0
	}

	setTimeout('poner_opacidad_capa(0)',5000)	
}


function poner_opacidad_capa(numero)
{
numero+=10
document.getElementById('fondo').style.filter = "alpha(opacity:"+numero+")";
document.getElementById('fondo').style.MozOpacity = numero/100;
document.getElementById('fondo').style.opacity = numero/100;

if(numero<100)
{
	setTimeout('poner_opacidad_capa('+numero+')',150)
}
else
{
document.getElementById('fondo2').style.backgroundImage = "url("+imagenes[contador]+")"
document.getElementById('fondo2').style.backgroundPosition = "top left";
document.getElementById('fondo2').style.backgroundRepeat = "no-repeat";
document.getElementById('fondo2').style.display = "block"
setTimeout('desaparecer_fondo()',150)
}

}

function poner_opacidad_capa2(numero)
{
numero+=10
document.getElementById('fondo').style.filter = "alpha(opacity:"+numero+")";
document.getElementById('fondo').style.MozOpacity = numero/100;
document.getElementById('fondo').style.opacity = numero/100;

if(numero<100)
{
	setTimeout('poner_opacidad_capa2('+numero+')',150)
}

}

function poner_opacidad_texto(numero)
{
numero+=10
document.getElementById('texto_cuerpo').style.filter = "alpha(opacity:"+numero+")";
document.getElementById('texto_cuerpo').style.MozOpacity = numero/100;
document.getElementById('texto_cuerpo').style.opacity = numero/100;

if(numero<100)
{
	setTimeout('poner_opacidad_texto('+numero+')',150)
}

}

function desaparecer_fondo()
{	
	contador++
	if(contador>=imagenes.length)
	{
		contador=0
	}
	
	setTimeout('quitar_opacidad_capa(100)',5000)
}

function quitar_opacidad_capa(numero)
{
numero-=10
document.getElementById('fondo').style.filter = "alpha(opacity:"+numero+")";
document.getElementById('fondo').style.MozOpacity = numero/100;
document.getElementById('fondo').style.opacity = numero/100;

if(numero>0)
{
	setTimeout('quitar_opacidad_capa('+numero+')',150)
}
else
{
document.getElementById('fondo').style.filter = "alpha(opacity:0)";
document.getElementById('fondo').style.MozOpacity = 0.0;
document.getElementById('fondo').style.opacity = 0.0;
document.getElementById('fondo').style.backgroundImage = "url("+imagenes[contador]+")";
document.getElementById('fondo').style.backgroundPosition = "top left";
document.getElementById('fondo').style.backgroundRepeat = "no-repeat";
setTimeout('aparecer_fondo()',150)
}

}

function quitar_opacidad_cuerpo(numero)
{
numero-=10
document.getElementById('cuerpo').style.filter = "alpha(opacity:"+numero+")";
document.getElementById('cuerpo').style.MozOpacity = numero/100;
document.getElementById('cuerpo').style.opacity = numero/100;

if(numero>60)
{
	setTimeout('quitar_opacidad_cuerpo('+numero+')',150)
}

}

function poner_opacidad_cuerpo(numero)
{
numero+=10
document.getElementById('cuerpo').style.filter = "alpha(opacity:"+numero+")";
document.getElementById('cuerpo').style.MozOpacity = numero/100;
document.getElementById('cuerpo').style.opacity = numero/100;

if(numero<100)
{
	setTimeout('poner_opacidad_cuerpo('+numero+')',150)
}

}


function mover_capa(numero)
{
numero+=5
document.getElementById('cuerpo').style.width = numero+"px";

if(numero<255)
{
	if(numero==75)
	{
		poner_opacidad_cuerpo(50)
	}
	
	if(numero==180)
	{
		poner_opacidad_texto(0)
		quitar_opacidad_cuerpo(100)
	}
	
	setTimeout('mover_capa('+numero+')',50)
}
}

function mover_capa_largo(numero)
{
numero+=5
document.getElementById('cuerpo').style.width = numero+"px";

if(numero<400)
{
	if(numero==205)
	{
		poner_opacidad_cuerpo(50)
	}
	
	if(numero==300)
	{
		poner_opacidad_texto(0)
		quitar_opacidad_cuerpo(100)
	}
	
	setTimeout('mover_capa_largo('+numero+')',50)
}
}