/*
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/brandauer.gif"
	randomimages[1]="../i/eandh.gif"
	randomimages[2]="../i/granada.gif"
	randomimages[3]="../i/iod.gif"
	randomimages[4]="../i/kingspan.gif"
	randomimages[5]="../i/linford.gif"
	randomimages[6]="../i/magpix.gif"
	randomimages[7]="../i/man.gif"
	randomimages[8]="../i/mas.gif"
	randomimages[9]="../i/maxeyMoverley.gif"
	randomimages[10]="../i/qcom.gif"
	randomimages[11]="../i/spLegal.gif"
	randomimages[12]="../i/spm.gif"
	randomimages[13]="../i/virgin.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)

