var	frames=680;					// Number of frames in the animation.
var	position=0;					// Horizontal position
var	loop=6000;						// Run cycle 600 times
var  framewidth=1;			// Animation increments (pixels)
var  windowwidth=1024;		// Viewing Width (pixels) Can be 1340px 1040px
var	frameheight=39;		// Height pixels of frame
var	speed=24;					// Animation speed (10 fast) (99 slow)
var	pause=0;						// Pause before restarting sequence (0=none) (900=1 second)
var framecount=frames;

	function animate() 
{
		document.getElementById("image").style.width=windowwidth+"px";
		document.getElementById("image").style.height=frameheight+"px";
		if(framecount>1) 
	{
			position-=framewidth;			// nudge framewidth pixels
			// Sets the background position (negative) using position 
			document.getElementById("image").style.backgroundPosition=position+"px";
			// Decreases frames 
			framecount--
			// Call animate
			setTimeout("animate()",speed);
	}

		 else 
	{
			// Reset params except the number of loops
			framecount=frames;
			position=0;
			// Call again while loops remain
			if(loop>1) 
		{
				loop--;
				setTimeout("animate()",pause);
		}
	}
}
