// JavaScript Document
/**
* variables globales de asignacion de navegador
*/  
var ie=(document.all) ? 1:0; var n4=(document.layers) ? 1:0; var n6=(document.getElementById) ? 1:0; 
var paso=0;
var valor;
var tiempo;
var Y;
var activo=false;
var capa="texto";
var tiempo;
/**
* funcion para inicializar valores generales en la interfaz
*/
function iniciaValores(height,top,width){
	Y=top;
	paso=0;
    if(ie){
		document.all[capa].style.top=Y;
		document.all[capa].style.height=height;
		document.all[capa].style.clip="rect(0px,"+width+"px,"+height+"px,0px)";
	}else if(n4){
		document.layers[capa].top=Y;
		document.layers[capa].height=height;}
	if(n6){
		document.getElementById(capa).style.top=Y;
		document.getElementById(capa).style.height=height;
		document.getElementById(capa).style.clip="rect(0px,"+width+"px,"+height+"px,0px)";}
}
/**
* funcion para scrolear la capa de textos
*/
function recorta(donde,width){
	if(ie){
		clearTimeout(tiempo);
		Y=parseInt(document.all[capa].style.top);
		H=parseInt(document.all[capa].style.height);
		if((Y>altura)&&(donde==0)){
			activo=true;
			valor=10;
			paso+=valor;
			document.all[capa].style.top = Y-valor;
			document.all[capa].style.height = H+valor;
			eval("document.all['"+capa+"'].style.clip='rect("+paso+","+width+","+(H+valor)+",0)'");
			tiempo=setTimeout("recorta(0,"+width+")",400);
		}else if((Y<=280) && (donde==1) && (activo==true)){
			valor=-10;
			paso+=valor;
			document.all[capa].style.top = Y-valor;
			document.all[capa].style.height = H+valor;
			eval("document.all['"+capa+"'].style.clip='rect("+paso+","+width+","+(H+valor)+",0)'");
			tiempo=setTimeout("recorta(1,"+width+")",400);}
	}else if(n4){
		Y=document.layers[capa].top;
		H=document.layers[capa].height;
		if((Y>altura)&&(donde==0)){
			activo=true;
			valor=10;
			paso+=valor;
			document.layers[capa].top = Y-valor;
			document.layers[capa].height = H+valor;
			document.layers[capa].clip.top=paso;
			document.layers[capa].clip.bottom=(H+valor);
            tiempo=setTimeout("recorta(0,"+width+")",400);
		}else if((Y<=70)&&(donde==1) && (activo==true)){
			valor=-10;
			paso+=valor;
			document.layers[capa].top = Y-valor;
			document.layers[capa].height = H+valor;
			document.layers[capa].clip.top=paso;
			document.layers[capa].clip.bottom=(H+valor);
			tiempo=setTimeout("recorta(1,"+width+")",400);}
	}else if(n6){
		Y=parseInt(document.getElementById(capa).style.top);
		H=parseInt(document.getElementById(capa).style.height);
		if((Y>altura)&&(donde==0)){
			activo=true;
            valor=10;
            paso+=valor;
            document.getElementById(capa).style.top = Y-valor;
            document.getElementById(capa).style.height = H+valor;
            eval("document.getElementById('"+capa+"').style.clip='rect("+paso+","+width+","+(H+valor)+",0)'");
            tiempo=setTimeout("recorta(0,"+width+")",400);
		}else if((Y<=280)&&(donde==1) && (activo==true)){
			valor=-10;
            paso+=valor;
            document.getElementById(capa).style.top = Y-valor;
            document.getElementById(capa).style.height = H+valor;
            eval("document.getElementById('"+capa+"').style.clip='rect("+paso+","+width+","+(H+valor)+",0)'");
            tiempo=setTimeout("recorta(1,"+width+")",400);}
   }
}