var timerid=null;
var i=0;
var iTotal=10;
var myPhotos = new Array();


function startTimer()
{
	timerid = setInterval ( "swicthImage()", 5000 );
}


function stopTimer()
{
	clearInterval (timerid);
}

function swicthImage()
{
	i=i+1;
	
	if (i == iTotal)
	{
		i=0;
	}

	document.getElementById("previewImage").src = myPhotos[i].src;
	document.getElementById("previewLink").href = myPhotos[i].src;
}

function preloadImages()
{
	myPhotos[0] = new Image();myPhotos[0].src='photos/SL270019.JPG';
	myPhotos[1] = new Image();myPhotos[1].src='photos/SL270284.JPG';
	myPhotos[2] = new Image();myPhotos[2].src='photos/SL270291.JPG';
	myPhotos[3] = new Image();myPhotos[3].src='photos/SL270290.JPG';
	myPhotos[4] = new Image();myPhotos[4].src='photos/SL270423.JPG';
	myPhotos[5] = new Image();myPhotos[5].src='photos/SL270755.JPG';
	myPhotos[6] = new Image();myPhotos[6].src='photos/SL270727.JPG';
	myPhotos[7] = new Image();myPhotos[7].src='photos/SL270792.JPG';
	myPhotos[8] = new Image();myPhotos[8].src='photos/SL270770.JPG';
	myPhotos[9] = new Image();myPhotos[9].src='photos/SL270793.JPG';
	
	
}
