var playInterval = false;
var nowPlaying = "";

function initRollovers() {
	var movieThumbs = new Array();
	for (var i = 0; i < document.images.length; i++) {
		if (document.images[i].className == "movieThumb") movieThumbs.push( document.images[i] );
	}
	for (i = 0; i < movieThumbs.length; i++) {
		movieThumbs[i].onmouseover = startThumb;
		if (movieThumbs[i].captureEvents) movieThumbs[i].captureEvents(Event.MOUSEOVER);
		
		movieThumbs[i].onmouseout = stopThumb;
		if (movieThumbs[i].captureEvents) movieThumbs[i].captureEvents(Event.MOUSEOUT);
	}
}

function startThumb( e ) {
	if (!e) e = window.event;
//	alert( this );
	if (playInterval) stopThumb(e);
	nowPlaying = this;
	playThumb();
	playInterval = setInterval( "playThumb()", 500 );
}

function playThumb() {
	if (!nowPlaying.style.left) nowPlaying.style.left = "0px";
	var left = parseInt( nowPlaying.style.left ) - 92;
	if (Math.abs( left ) > 459)
		left = 0;
	nowPlaying.style.left = left+"px";
	
//	alert( "frame played" );
}

function stopThumb( e ) {
	if (!e) e = window.event;
	clearInterval( playInterval );
	playInterval = false;
//	alert( e.type );
}

