// JavaScript Document

var mainimage = new Array;
var thumbselected = 0;
var thumbchange = 5000;
var thumbint = 0;

function snapto(imgid){
	imgid = imgid * 1;
	clearInterval(thumbint);
	document.getElementById('main-image-image').src = mainimage[imgid];
	thumbselected = imgid;
}

function mout(){
	thumbint = setInterval("forwards()",thumbchange);
}

function forwards(){
	if ((thumbselected + 1) > thumbcount - 1){
		nextthumb = 0;
	}else{
		nextthumb = thumbselected + 1;
	}
	document.getElementById('main-image-image').src = mainimage[nextthumb];
	thumbselected = nextthumb;
}

function start(){
	img_array = new Array();
	for (counter in mainimage) {
		img_array[counter] = new Image();
		img_array[counter].src = mainimage[counter];
	}
	thumbint = setInterval("forwards()",thumbchange);
}

