// JavaScript Document

	function scroll(obj)
	{
		this.oScroll = obj;
		this.s = this.oScroll.getElementsByTagName('li')[0].offsetWidth+1;
		this.tt = 5;
		this.t = 0;
		this.v0 = 50;
		this.a = 2*(this.s/this.tt - this.v0)/this.tt;
		this.oLeft = this.oScroll.currentStyle ? parseInt(this.oScroll.currentStyle.left) : parseInt(document.defaultView.getComputedStyle(this.oScroll, "").getPropertyValue("left"));
	}
	timeoutid = null;
	intervalId = null;
	scroll.prototype.init = function()
	{
		if(intervalId){clearInterval(intervalId)}
		if(timeoutid != null){clearTimeout(timeoutid)}
		var t = this.t;
		var a = this.a;
		var v = this.v0;
		var oS = this.oScroll;
		var oL = this.oLeft;
		gooo = this.init.caller
		if(this.way == 'left')
		{
			intervalId = setInterval(function()
									{
										t += 0.5;
										oS.style.left = (oL -(v * t + (a * t * t)/2)) + 'px';
										if((50 + a * t) <= 0)
										{
											clearInterval(intervalId);
											oS.appendChild(oS.getElementsByTagName('li')[0]);
											oS.style.left = '-99px';
											timeoutid = setTimeout('gooo()' , 3000);
										}
									} , 50);
		}
		else if(this.way == 'right') {
			intervalId = setInterval(function()
									{
										t += 0.5;
										oS.style.left = (oL + (v * t + (a * t * t)/2)) + 'px';
										if((50 + a * t) <= 0)
										{
											clearInterval(intervalId);
											theLast = oS.lastChild;											
											while(theLast.nodeType == 3)
											{
												theLast = theLast.previousSibling;
											}
											oS.insertBefore(theLast,oS.getElementsByTagName('li')[0]);
											oS.style.left = '-99px';
											timeoutid = setTimeout('gooo()' , 3000);
										}
									} , 50);
		}
	};
	window.onload = function()
	{
		var objj = document.getElementById('scroll');
		obj_scroll = new scroll(objj);
		obj_scroll.way = 'right';
		obj_scroll.init();
		arr = objj.getElementsByTagName('li');
		for(i=0 ; i< arr.length ; i++)
		{
			arr[i].onmouseover = function()
			{
				if(intervalId){clearInterval(intervalId)}
				if(timeoutid != null){clearTimeout(timeoutid)}
			}
			arr[i].onmouseout = function()
			{
				obj_scroll.init();
			}
		}
	}

