var imageList=new Array(10);
var altList=new Array(10);
var titleList=new Array(10);
var nImageShown=new Array(5);
var nImageFree=new Array(5);

function rotatebanner()
{
var nBanner,nOldImage,nNewImage,i;
nBanner=Math.floor(Math.random()*5);
nOldImage=nImageShown[nBanner];
nNewImage=nImageFree[0];
nImageShown[nBanner]=nNewImage;
for (i=0;i<=3;i++) nImageFree[i]=nImageFree[i+1];
nImageFree[4]=nOldImage;
switch (nBanner)
{
case 0:document.ban1.src=imageList[nNewImage].src;break;
case 1:document.ban2.src=imageList[nNewImage].src;break;
case 2:document.ban3.src=imageList[nNewImage].src;break;
case 3:document.ban4.src=imageList[nNewImage].src;break;
case 4:document.ban5.src=imageList[nNewImage].src;break;
default:document.ban1.src=imageList[nNewImage].src;break;
}
switch (nBanner)
{
case 0:document.ban1.alt=altList[nNewImage];break;
case 1:document.ban2.alt=altList[nNewImage];break;
case 2:document.ban3.alt=altList[nNewImage];break;
case 3:document.ban4.alt=altList[nNewImage];break;
case 4:document.ban5.alt=altList[nNewImage];break;
default:document.ban1.alt=altList[nNewImage];break;
}
switch (nBanner)
{
case 0:document.ban1.title=titleList[nNewImage];break;
case 1:document.ban2.title=titleList[nNewImage];break;
case 2:document.ban3.title=titleList[nNewImage];break;
case 3:document.ban4.title=titleList[nNewImage];break;
case 4:document.ban5.title=titleList[nNewImage];break;
default:document.ban1.title=titleList[nNewImage];break;
}
window.setTimeout("rotatebanner()",2000);
}

function banner(path)
{
var nFirstImage,i,j;
nFirstImage=0;
for (i=1;i<=10;i++)
{
imageList[i-1]=new Image;
j=i+nFirstImage;
switch (path)
{
case 0:imageList[i-1].src="http://www.lulworthcovebedandbreakfast.com/images/hdr/"+j+"-ban.jpg";break;
case 1:imageList[i-1].src="http://www.lulworthcovebedandbreakfast.com/images/hdr/"+j+"-ban.jpg";break;
default:imageList[i-1].src="http://www.lulworthcovebedandbreakfast.com/images/hdr/"+j+"-ban.jpg";break;
}
}
altList[0]=document.ban1.alt;
altList[1]=document.ban2.alt;
altList[2]=document.ban3.alt;
altList[3]=document.ban4.alt;
altList[4]=document.ban5.alt;
altList[5]="Stair Hole";
altList[6]="Lulworth Church";
altList[7]="Lulworth Skipper";
altList[8]="Dolls House";
altList[9]="Mupe Bay";
titleList[0]=document.ban1.title;
titleList[1]=document.ban2.title;
titleList[2]=document.ban3.title;
titleList[3]=document.ban4.title;
titleList[4]=document.ban5.title;
titleList[5]="Stair Hole alongside Lulworth Cove";
titleList[6]="Holy Trinity Church, West Lulworth";
titleList[7]="The Lulworth Skipper";
titleList[8]="The Dolls House in Lulworth Cove";
titleList[9]="Mupe Bay in the Lulworth Ranges";
for (i=0;i<=4;i++)
{
nImageShown[i]=i;
nImageFree[i]=i+5;
}
rotatebanner();
}

