function Clip(obj,capa){
	this.IE4 = (document.all) ? 1 : 0;
	this.NN4 = (document.layers) ? 1 : 0;
	this.doc = (this.IE4) ? "document.all." : "document.";
	this.stl = (this.IE4) ? ".style." : ".";
	this.topp = (this.IE4) ? "pixelTop" : "top";
	this.leff = (this.IE4) ? "pixelLeft" : "left";
	this.widz = (this.IE4) ? "pixelWidth" : "clip.width";
	this.heiz = (this.IE4) ? "pixelHeight" : "clip.height";
	this.tmr = 0;
	this.nameObj = obj;
	this.name = capa;
	eval("this.ancho = " + this.doc + this.name + this.stl + this.widz);
	eval("this.alto = " + this.doc + this.name + this.stl + this.heiz);
	this.cTop = 0;
	this.cRight = this.ancho;
	this.cBottom = this.alto;
	this.cLeft = 0;
	this.reset = reset;
	this.clipRH = clipRH;
	this.clipRV = clipRV;
	this.clipLH = clipLH;
	this.clipLV = clipLV;
	this.clipTH = clipTH;
	this.clipTV = clipTV;
	this.clipBH = clipBH;
	this.clipBV = clipBV;
	this.visible = visible;
	this.hide = hide;
	this.klip = klip;	
	this.klip(0,this.ancho,this.alto,0);
}

function reset(){
	this.klip(0,this.ancho,this.alto,0);
	clearTimeout(this.tmr);
	this.cTop = 0;
	this.cRight = this.ancho;
	this.cBottom = this.alto;
	this.cLeft = 0;
}

function clipRH(res,vel){
	this.klip(0,this.ancho,this.alto,this.cLeft);
	if(this.cLeft<this.ancho){
		this.cLeft+=res;
		this.tmr = setTimeout(this.nameObj + '.clipRH('+res+','+vel+')',vel);
	}
	else{
		clearTimeout(this.tmr);
		this.cLeft = 0;
	}
}

function clipRV(res,vel){
	this.klip(0,this.cLeft,this.alto,0);
	if(this.cLeft<this.ancho){
		this.cLeft+=res;
		this.tmr = setTimeout(this.nameObj + '.clipRV('+res+','+vel+')',vel);
	}
	else{
		clearTimeout(this.tmr);
		this.cLeft = 0;
	}
}

function clipLH(res,vel){
	this.klip(0,this.cRight,this.alto,0);
	if(this.cRight>0){
		this.cRight-=res;
		this.tmr = setTimeout(this.nameObj + '.clipLH('+res+','+vel+')',vel);
	}
	else{
		clearTimeout(this.tmr);
		this.cRight = this.ancho;
	}
}

function clipLV(res,vel){
	this.klip(0,this.ancho,this.alto,this.cRight);
	if(this.cRight>0){
		this.cRight-=res;
		this.tmr = setTimeout(this.nameObj + '.clipLV('+res+','+vel+')',vel);
	}
	else{
		clearTimeout(this.tmr);
		this.cRight = this.ancho;
	}
}

function clipTH(res,vel){
	this.klip(0,this.ancho,this.cBottom,0);
	if(this.cBottom>0){
		this.cBottom-=res;
		this.tmr = setTimeout(this.nameObj + '.clipTH('+res+','+vel+')',vel);
	}
	else{
		clearTimeout(this.tmr);
		this.cBottom = this.alto;
	}
}

function clipTV(res,vel){
	this.klip(this.cBottom,this.ancho,this.alto,0);
	if(this.cBottom>0){
		this.cBottom-=res;
		this.tmr = setTimeout(this.nameObj + '.clipTV('+res+','+vel+')',vel);
	}
	else{
		clearTimeout(this.tmr);
		this.cBottom = this.alto;
	}
}

function clipBH(res,vel){
	this.klip(this.cTop,this.ancho,this.alto,0);
	if(this.cTop<this.alto){
		this.cTop+=res;
		this.tmr = setTimeout(this.nameObj + '.clipBH('+res+','+vel+')',vel);
	}
	else{
		clearTimeout(this.tmr);
		this.cTop = 0;
	}
}

function clipBV(res,vel){
	this.klip(0,this.ancho,this.cTop,0);
	if(this.cTop<this.alto){
		this.cTop+=res;
		this.tmr = setTimeout(this.nameObj + '.clipBV('+res+','+vel+')',vel);
	}
	else{
		clearTimeout(this.tmr);
		this.cTop = 0;
	}
}

function visible(){
	eval(this.doc + this.name + this.stl + "visibility='visible'");
}

function hide(){
	eval(this.doc + this.name + this.stl + "visibility='hidden'");
}

function klip(a,b,c,d){
	if (this.IE4){
		eval(this.doc + this.name + this.stl + "clip='rect('+a+','+b+','+c+','+d+')'");
	}
	else{
		eval(this.doc + this.name + ".clip.top=" + a);
		eval(this.doc + this.name + ".clip.right=" + b);
		eval(this.doc + this.name + ".clip.bottom=" + c);
		eval(this.doc + this.name + ".clip.left=" + d);
	}
}