/*
Random image slideshow- By Tyler Clarke (tyler@ihatecoffee.com)
For this script and more, visit http://www.javascriptkit.com
*/

var delay=3000 //set delay in miliseconds
var curindex=0

var randomimages=new Array()

	randomimages[0]="../../i/antiques.gif"
	randomimages[1]="../../i/bct.gif"
	randomimages[2]="../../i/blenheim.gif"
	randomimages[3]="../../i/danda.gif"
	randomimages[4]="../../i/dockers.gif"
	randomimages[5]="../../i/fearMaster.gif"
	randomimages[6]="../../i/greggs.gif"
	randomimages[7]="../../i/handmadeburger.gif"
	randomimages[8]="../../i/island-delight.gif"
	randomimages[9]="../../i/levi.gif"
	randomimages[10]="../../i/magazineweek.gif"
	randomimages[11]="../../i/ragley.gif"
	randomimages[12]="../../i/rco.gif"
	randomimages[13]="../../i/rehabuk.gif"
	randomimages[14]="../../i/solihull.gif"
	randomimages[15]="../../i/touchwood.gif"
	randomimages[16]="../../i/tustains.gif"
	randomimages[17]="../../i/ukgear.gif"

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" 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()",delay)

