    /**
    * 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 altura=-450;
  //  var Y;
  //  var activo=false; 
  //  var capa="texto";
   // var tiempo;
	
	var paso2=0;
    var valor2;
    var tiempo2;
    var altura2=-140;
	var X;
    var activo2=false; 
    var capa2="lectura";
    var tiempo2;

    
    /**
    * funcion para inicializar valores generales en la interfaz
    */
    function iniciaValores()
    {	 
     //   Y=270;
	//	Y2=270;
    //    paso=0; 
		
		X=395;
		X2=395;
		L=550;
        paso2=0;        
       
        
        if(ie)
        {      
          //  document.all[capa].style.top=Y;
           // document.all[capa].style.height=100;
          //  document.all[capa].style.clip="rect(0px,270px,100px,0px)";
		//	document.all[capa].style.visibility="visible";
            document.all[capa2].style.top=X;
			document.all[capa2].style.left=L;
            document.all[capa2].style.height=132;
            document.all[capa2].style.clip="rect(0px,270px,132px,0px)"; 
			document.all[capa2].style.visibility="visible";

        }
		
        else if(n4)
        {
            // document.layers[capa].top=Y;
            // document.layers[capa].height=100;
			// document.layers[capa].visibility="show";
             document.layers[capa2].top=X;
			 document.layers[capa2].left=L;
             document.layers[capa2].height=132;
			 document.layers[capa2].visibility="show";

         }
        if(n6)
        {            
           // document.getElementById(capa).style.top=Y;
           // document.getElementById(capa).style.height=100;
           // document.getElementById(capa).style.clip="rect(0px,270px,100px,0px)";
			//document.getElementById(capa).style.visibility="visible";
            document.getElementById(capa2).style.top=X;
			document.getElementById(capa2).style.left=L;
            document.getElementById(capa2).style.height=130;
            document.getElementById(capa2).style.clip="rect(0px,270px,132px,0px)";
			document.getElementById(capa2).style.visibility="visible";

        }
    }
   
    /**
    * funcion para scrolear la capa de textos
    */
    function recorta(donde)
    {
	
	
        if(ie)
        {
            clearTimeout(tiempo);
            Y=parseInt(document.all[capa].style.top);
            var H=parseInt(document.all[capa].style.height);
            if((Y>altura)&&(donde==0))
            {
                activo=true;
                valor=2;     
                paso+=valor;
                document.all[capa].style.top = Y-valor;
                document.all[capa].style.height = H+valor;
                eval("document.all['"+capa+"'].style.clip='rect("+paso+",300,"+(H+valor)+",0)'");
                tiempo=setTimeout("recorta(0)",50);
            }
            else if((Y<=Y2) && (donde==1) && (activo==true))
            {   
			      
                valor=-2;
                paso+=valor;
                document.all[capa].style.top = Y-valor;
                document.all[capa].style.height = H+valor;
                eval("document.all['"+capa+"'].style.clip='rect("+paso+",300,"+(H+valor)+",0)'");
                tiempo=setTimeout("recorta(1)",50);
            }
        }
        else if( n4)
        {
            Y=document.layers[capa].top;
            var H=document.layers[capa].height;
            if((Y>altura)&&(donde==0))
            {
                activo=true;
                valor=2;     
                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)",50);
            }
            else if((Y<=Y2)&&(donde==1) && (activo==true))
            {         
                valor=-2;
                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)",50);
            }
        }
        else if(n6)
        {
            Y=parseInt(document.getElementById(capa).style.top);
            var H=parseInt(document.getElementById(capa).style.height);
            if((Y>altura)&&(donde==0))
            {
                activo=true;
                valor=2;     
                paso+=valor;
                document.getElementById(capa).style.top = Y-valor;
                document.getElementById(capa).style.height = H+valor;
                eval("document.getElementById('"+capa+"').style.clip='rect("+paso+",300,"+(H+valor)+",0)'");
                tiempo=setTimeout("recorta(0)",50);
            }
            else if((Y<=Y2)&&(donde==1) && (activo==true))
            {         
                valor=-2;

                paso+=valor;
                document.getElementById(capa).style.top = Y-valor;
                document.getElementById(capa).style.height = H+valor;
                eval("document.getElementById('"+capa+"').style.clip='rect("+paso+",300,"+(H+valor)+",0)'");
                tiempo=setTimeout("recorta(1)",50);
            }
        }
    }
	
	    /**
    * funcion para scrolear la capa2 de textos
    */
    function recorta2(donde2)
    {
	
        if(ie)
        {
            clearTimeout(tiempo2);
            X=parseInt(document.all[capa2].style.top);
            var H2=parseInt(document.all[capa2].style.height);
            if((X>altura2)&&(donde2==0))
            {
                activo2=true;
                valor2=2;     
                paso2+=valor2;
                document.all[capa2].style.top = X-valor2;
                document.all[capa2].style.height = H2+valor2;
                eval("document.all['"+capa2+"'].style.clip='rect("+paso2+",300,"+(H2+valor2)+",0)'");
                tiempo2=setTimeout("recorta2(0)",50);
            }
            else if((X<=X2) && (donde2==1) && (activo2==true))
            {   
			
                valor2=-2;
                paso2+=valor2;
                document.all[capa2].style.top = X-valor2;
                document.all[capa2].style.height = H2+valor2;
                eval("document.all['"+capa2+"'].style.clip='rect("+paso2+",300,"+(H2+valor2)+",0)'");
                tiempo2=setTimeout("recorta2(1)",50);
            }
        }
        else if( n4)
        {
            X=document.layers[capa2].top;
            var H2=document.layers[capa2].height;
            if((X>altura2)&&(donde2==0))
            {
                activo2=true;
                valor2=2;     
                paso2+=valor2;
                document.layers[capa2].top = X-valor2;
                document.layers[capa2].height = H2+valor2;
                document.layers[capa2].clip.top=paso2;
                document.layers[capa2].clip.bottom=(H2+valor2);
                tiempo2=setTimeout("recorta2(0)",50);
            }
            else if((X<=X2)&&(donde2==1) && (activo2==true))
            {         
                valor2=-2;
                paso2+=valor2;
                document.layers[capa2].top = X-valor2;
                document.layers[capa2].height = H2+valor2;
                document.layers[capa2].clip.top=paso2;
                document.layers[capa2].clip.bottom=(H2+valor2);
                tiempo2=setTimeout("recorta2(1)",50);
            }
        }
        else if(n6)
        {
            X=parseInt(document.getElementById(capa2).style.top);
            var H2=parseInt(document.getElementById(capa2).style.height);
            if((X>altura2)&&(donde2==0))
            {
                activo2=true;
                valor2=2;     
                paso2+=valor2;
                document.getElementById(capa2).style.top = X-valor2;
                document.getElementById(capa2).style.height = H2+valor2;
                eval("document.getElementById('"+capa2+"').style.clip='rect("+paso2+",300,"+(H2+valor2)+",0)'");
                tiempo2=setTimeout("recorta2(0)",50);
            }
            else if((X<=X2)&&(donde2==1) && (activo2==true))
            {         
                valor2=-2;

                paso2+=valor2;
                document.getElementById(capa2).style.top = X-valor2;
                document.getElementById(capa2).style.height = H2+valor2;
                eval("document.getElementById('"+capa2+"').style.clip='rect("+paso2+",300,"+(H2+valor2)+",0)'");
                tiempo2=setTimeout("recorta2(1)",50);
            }
        }
    }
