function scrollmenu(obj,mpos)
{
	this.obj=obj;//移动对象
	this.maxpos=mpos;//移动的最大个数
	this.leftpos=0;//向左移动的个数
	this.rightpos=0;//向右移动的个数
}
scrollmenu.prototype.scrollleft=function(pos)
{
	if(this.leftpos<this.maxpos && this.maxpos>0)
	{
		document.all['tdiv'].style.marginLeft=parseInt(document.all['tdiv'].style.marginLeft.replace("px",""))+pos;
		this.leftpos=this.leftpos+1;
		if(this.rightpos>0)this.rightpos=this.rightpos-1;
	}
	else
	{
		return;
	}
}
scrollmenu.prototype.scrollright=function(pos)
{
	if(this.rightpos<this.maxpos && this.leftpos!=0)
	{	
		document.all['tdiv'].style.marginLeft=parseInt(document.all['tdiv'].style.marginLeft.replace("px",""))+pos;
		this.rightpos=this.rightpos+1;
		if(this.leftpos>0)this.leftpos=this.leftpos-1;
	}
	else
	{
		return;
	}
}	
scrollmenu.prototype.autoscroll=function(count,pos)
{
	for(i=1;i<=count;i++){this.scrollleft(pos);}
}
