var delay=8000
var curindex=0
var randomimages=new Array()
randomimages[0]="themes/static/img/banner_1.png"
randomimages[1]="themes/static/img/banner_2.png"
randomimages[2]="themes/static/img/banner_3.png"
randomimages[3]="themes/static/img/banner_4.png"
randomimages[4]="themes/static/img/banner_5.png"
randomimages[5]="themes/static/img/banner_6.png"
randomimages[6]="themes/static/img/banner_7.png"
randomimages[7]="themes/static/img/banner_8.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" 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)