thumbLayer=function(mask,capa){
	var self=this;
	this.anchoMask=document.getElementById(mask).offsetWidth;
	this.cont=document.getElementById(capa);
	this.cont.style.position='absolute';
	this.cont.style.top='0px';
	this.cont.style.left='0px';
	this.left=0.0;
	this.margen=8;
	this.anchoImg=87;
	if (document.all)
		this.ancho=(this.anchoImg+this.margen)*this.cont.childNodes.length;
	else{
		this.ancho=0;
		for (i=0;i<this.cont.childNodes.length;i++){
			if (this.cont.childNodes[i].tagName=='DIV')
				this.ancho=this.ancho+this.anchoImg+this.margen;
		}
	}
	this.cont.style.width=this.ancho+'px';
	
	var vecSeno=new Array();
	var aux=Math.PI/80;
	for (i=0;i<40;i++){
		vecSeno[i]=parseFloat(self.margen+self.anchoImg)*Math.sin(aux*i);
	}
	
	this.timeout=null;
	this.pos=0;
	this.next=function(){
		if (self.timeout==null){
			if ((self.ancho+self.left)>self.anchoMask)
				self.timeout=setInterval(self.alante, 10);
		}
	}
	this.prev=function(){
		if (self.timeout==null){
			if (self.left<0)
				self.timeout=setInterval(self.atras, 10);
		}
	}
	
	this.alante=function(){
		if (self.pos<40){
			self.leftAux=vecSeno[self.pos];
			self.cont.style.left=parseInt(self.left-self.leftAux)+'px';
			self.pos+=1;
		}else{
			self.pos=0;
			self.left=self.left-self.margen-self.anchoImg;
			self.cont.style.left=self.left+'px';
			clearInterval(self.timeout);
			self.timeout=null;
		}
	}
	this.atras=function(){
		if (self.pos<40){
			self.leftAux=vecSeno[self.pos];
			self.cont.style.left=(self.left+self.leftAux)+'px';
			self.pos+=1;
		}else{
			self.pos=0;
			self.left=self.left+self.margen+self.anchoImg;
			self.cont.style.left=self.left+'px';
			clearInterval(self.timeout);
			self.timeout=null;
		}
	}
	
}