var primer = false
var primera= true
var antigua
var estado = false 
var activada = new Array()
	     activada[0] = false
		 activada[1] = false
		 activada[2] = false
		 recorte=20
		
	
	function controlRoll(desdeDonde){
	 for (x=1;x<activada.length+1;x++){
	      if(this.nombreObj == activada[x]){
		    pase = false
			break
			}
			}
		if(x == activada.length+1) pase = true	
	    if(pase == true){
		   if(desdeDonde == 1){
		    for (i=1;i<activada.length+1;i++){
			  if(i == this.queNav){
			    if(activada[i] != false){
			   eval(activada[i]+".apagarEncender("+false+")")
			    }
			   eval(this.nombreObj+".apagarEncender("+true+")")
			   activada[i] = this.nombreObj
			   break
			    } 
			  }
			}
			if(desdeDonde == 2) eval(this.nombreObj+".apagarEncender("+true+")")
			if(desdeDonde == 3) eval(this.nombreObj+".apagarEncender("+false+")")
			 }
	}
	
	
	
			 //navegadores
			 ns4 = (document.layers)? true:false
ie4 = ((document.all)&&!(document.getElementById ))? true:false
ie5	= (document.getElementById)? true:false

 // movimiento
function objeto(id,idcapafondo,nom,desde,hasta,posicionInicio,cantidad,recorte,posLeft,ancho){
	     if(ns4){
		     this.css= document.layers[id]
			 this.css2= document.layers[idcapafondo]
			 this.css.top = posicionInicio
			 this.css2.top = posicionInicio
			 this.y = this.css.top
			 this.css.visibility='show'
			 
			 }
		if(ie4){
		     this.css = document.all[id].style
			 this.css2 = document.all[idcapafondo].style
			 this.css.top = posicionInicio
			 this.css2.top = posicionInicio
			 this.y = this.css.pixelTop
			 this.css.visibility='visible'	
			 }
		if(ie5){
		    this.css = document.getElementById(id).style
			this.css2 = document.getElementById(idcapafondo).style
			this.css.top = posicionInicio
			this.css2.top = posicionInicio
			//this.y = this.css.pixelTop
			this.y = parseInt(this.css.top)
			this.css.visibility = 'visible'
			}
			
		this.nombre = nom 
		this.desde = desde
		this.hasta = hasta
		this.cantidad = cantidad
		this.activa = false
		this.acbajo = false	 
		this.control = control	 
		this.arriba = arriba
		this.abajo = abajo
		this.controlWeb = controlWeb
		this.recorte=recorte
		this.css.left=posLeft
		this.css2.left=posLeft
		this.css.width=ancho
		this.css2.width=ancho
		}
    function abajo(){
	this.recorte=this.recorte+this.cantidad
	    if(this.y < this.hasta){
		this.y = this.y+this.cantidad
		/* this.css.top = this.y
		this.css2.top = this.y */
		this.acbajo = true
		eval("this.css.clip='rect(0,1000,"+this.recorte+",0)'")
		eval("this.css2.clip='rect(0,1000,"+this.recorte+",0)'")
		bajando =setTimeout(this.nombre+".abajo()",30)
		}
		else{
		 this.acbajo = false
		
		}
		}
     function arriba(){
	this.recorte=this.recorte-this.cantidad
	    if(this.y > this.desde){
		this.y = this.y-this.cantidad
		/* this.css.top = this.y
		this.css2.top = this.y */
		this.activa=true
		eval("this.css.clip='rect(0,1000,"+this.recorte+",0)'")
		eval("this.css2.clip='rect(0,1000,"+this.recorte+",0)'")
		subiendo=setTimeout(this.nombre+".arriba()",20)
		}
		else{
		this.activa = false
		eval("this.css.clip='rect(0,1000,0,0)'")
		eval("this.css2.clip='rect(0,1000,0,0)'")
		if (this.nombre == "lonks"){
		activada[2] = false
		}
		}
		}
	function control(){
	 if(primera == true){
	 eval(this.nombre+".abajo()")
	 antigua = this.nombre
	 primera = false
	 }
	 else{
	 if(this.nombre != antigua && (this.acbajo == false || this.activa == false)){
	 clearTimeout(bajando)
	 eval(this.nombre+".abajo()")
	 eval(antigua+".arriba()")
	 antigua = this.nombre
	 }
	 }
	}
	function controlWeb(){
	if(estado == false){
	 if(primer == true) {clearTimeout(subiendo)}
	 lonks.abajo()
	 primer = true
	 estado = true
	}
	else{ 
	 clearTimeout(bajando)
	 estado = false
	 lonks.arriba()
	 
	 }
	}	