/*
Random image slideshow- By Tyler Clarke (tyler@ihatecoffee.com)
For this script and more, visit http://www.javascriptkit.com
*/



var delay=9500//set delay in miliseconds
var curindex=0

var randomimages=new Array()

	randomimages[0]="graphics/quotes/quote1.png"
	randomimages[1]="graphics/quotes/quote2.png"
	randomimages[2]="graphics/quotes/quote3.png"
	randomimages[3]="graphics/quotes/quote4.png"


var preload=new Array()

for (n=0;n<randomimages.length;n++)
{
	preload[n]=new Image()
	preload[n].src=randomimages[n]
}

document.write('<img name="defaultimage" class="floatright" src="'+randomimages[Math.floor(Math.random()*(randomimages.length))]+'">')

function rotateimage()
{

if (curindex==(tempindex=Math.floor(Math.random()*(randomimages.length)))){
curindex=curindex==0? 1 : curindex-1
}
else
curindex=tempindex

	document.images.defaultimage.src=randomimages[curindex]
}

setInterval("rotateimage(4)",delay)
