
/*
Random image slideshow- By Tyler Clarke (tyler@ihatecoffee.com)
For this script and more, visit http://www.javascriptkit.com
*/

var delayV=1500 //set delayIV in miliseconds
var curindexV=0

var randomimagesV=new Array()

	randomimagesV[0]="textures/blue-pearl-granite-t.jpg"
	randomimagesV[1]="textures/onyx-moonstone-t.jpg"
	randomimagesV[2]="textures/picasso-granite-t.jpg"
	randomimagesV[3]="textures/red-crystal-t.jpg"
	randomimagesV[4]="textures/red-granite-t.jpg"	


var preload=new Array()

for (n=0;n<randomimagesV.length;n++)
{
	preload[n]=new Image()
	preload[n].src=randomimagesV[n]
}

document.write('<img name="defaultimageV" src="'+randomimagesV[Math.floor(Math.random()*(randomimagesV.length))]+'">')

function rotateimageV()
{

if (curindexV==(tempindex=Math.floor(Math.random()*(randomimagesV.length)))){
curindexV=curindexV==0? 1 : curindexV-1
}
else
curindexV=tempindex

	document.images.defaultimageV.src=randomimagesV[curindexV]
}

setInterval("rotateimageV()",delayV)


