var i = 23;// Number of banners that you have
var last_change = 0;


banner1 = new Image();
banner1.src = "thumbnails/thumb_20050929140342_dsc_0050.jpg"; 
banner2 = new Image();
banner2.src = "thumbnails/thumb_20050930203112_dsc_0081.jpg";
banner3 = new Image();
banner3.src = "thumbnails/thumb_20050930220157_dsc_0084_2.jpg";
banner4 = new Image();
banner4.src = "thumbnails/thumb_20051018190857__dsc0226_2.jpg";
banner5 = new Image();
banner5.src = "thumbnails/thumb_20051029144123_dsc_0256.jpg";
banner6 = new Image();
banner6.src = "thumbnails/thumb_20070612160448_dsc_0249.jpg";
banner7 = new Image();
banner7.src = "thumbnails/thumb_20051113153825_dsc_0342.jpg";
banner8 = new Image();
banner8.src = "thumbnails/thumb_20051228205119_dsc_0198.jpg";
banner9 = new Image();
banner9.src = "thumbnails/thumb_20060122165826_dsc_0688.jpg";
banner10 = new Image();
banner10.src = "thumbnails/thumb_20060305163625__dsc0422.jpg";
banner11 = new Image();
banner11.src = "thumbnails/thumb_20060305165543__dsc0379_1.jpg";
banner12 = new Image();
banner12.src = "thumbnails/thumb_20060305214535__dsc0401.jpg";
banner13 = new Image();
banner13.src = "thumbnails/thumb_20060318190042_generated hdr - tone mapped.jpg";
banner14 = new Image();
banner14.src = "thumbnails/thumb_20060325155900__dsc0494.jpg";
banner15 = new Image();
banner15.src = "thumbnails/thumb_20060402140223__dsc0621_1.jpg";
banner16 = new Image();
banner16.src = "thumbnails/thumb_20060504212520__dsc0641.jpg";
banner17 = new Image();
banner17.src = "thumbnails/thumb_20060604100955__dsc0732_1.jpg";
banner18 = new Image();
banner18.src = "thumbnails/thumb_20060816200839_dscn0206.png";
banner19 = new Image();
banner19.src = "thumbnails/thumb_20060904163720__dsc0986.jpg";
banner20 = new Image();
banner20.src = "thumbnails/thumb_20060904163827__dsc0938.jpg";
banner21 = new Image();
banner21.src = "thumbnails/thumb_20050923160307_dsc_0034.jpg";
banner22 = new Image();
banner22.src = "thumbnails/thumb_20060605115614_dsc0724.jpg";
banner23 = new Image();
banner23.src = "thumbnails/thumb_20060117213410_dsc_0668.jpg";


//you may add as many as needed
links = new Array

links[1] = "" 
links[2] = "" 
links[3] = "" 
links[4] = ""
links[5] = ""
links[6] = ""
links[7] = ""
links[8] = ""
links[9] = ""
links[10] = ""
links[11] = ""
links[12] = ""
links[13] = ""
links[14] = ""
links[15] = ""
links[16] = ""
links[17] = ""
links[18] = ""
links[19] = ""
links[20] = ""
links[21] = ""
links[22] = ""
links[23] = ""

//be sure to ad numbers consecutively
description = new Array
description[1] = ""
description[2] = ""
description[3] = ""
description[4] = ""
description[5] = ""
description[6] = ""
description[7] = ""
description[8] = ""
description[9] = ""
description[10] = ""
description[11] = ""
description[12] = ""
description[13] = ""
description[14] = ""
description[15] = ""
description[16] = ""
description[17] = ""
description[18] = ""
description[19] = ""
description[20] = ""
description[21] = ""
description[22] = ""
description[23] = ""


//be sure to ad message numbers consecutively 


function startTime(){
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	closeTime=hours*3600+mins*60+secs;
	closeTime+=3;	// How many seconds until the next banner rotation
	Timer();
}
function Timer(){
	var randomnumber = Math.random();
	var img_num = 1;
	var img_src = i;
	
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	curTime=hours*3600+mins*60+secs

	if (curTime>=closeTime){
		var cont = "N";
		
		//pic which picture to change
		img_num = Math.round( (6) * randomnumber) + 1;
		
		if(img_num == last_change)
		{
			img_num = Math.round( (6) * randomnumber) + 1;
		}
		last_change = img_num;
		
		//pick which image to use
		var cnt = 0;
		img_src = Math.round( (i - 1) * randomnumber) + 1;
		
		while(cont == "N" && cnt < 10)
		{
			if(document.img_1.src != eval("banner" + img_src + ".src")
				&& document.img_2.src != eval("banner" + img_src + ".src")
				&& document.img_3.src != eval("banner" + img_src + ".src")
				&& document.img_4.src != eval("banner" + img_src + ".src")
				&& document.img_5.src != eval("banner" + img_src + ".src")
				&& document.img_6.src != eval("banner" + img_src + ".src")
				&& document.img_7.src != eval("banner" + img_src + ".src")
				)
				{
					cont = "Y";	
				}
				else
				{
					if(img_src < i)
						img_src = img_src + 1;
					else
						img_src = 1;
					
					cnt = cnt + 1;
				}
			
			
		}
		
		if(img_num == 1)
		{
			document.img_1.src = eval("banner" + img_src + ".src");
		}
		else if(img_num == 2)
		{
			document.img_2.src = eval("banner" + img_src + ".src");
		}
		else if(img_num == 3)
		{
			document.img_3.src = eval("banner" + img_src + ".src");
		}
		else if(img_num == 4)
		{
			document.img_4.src = eval("banner" + img_src + ".src");
		}
		else if(img_num == 5)
		{
			document.img_5.src = eval("banner" + img_src + ".src");
		}
		else if(img_num == 6)
		{
			document.img_6.src = eval("banner" + img_src + ".src");
		}
		else if(img_num == 7)
		{
			document.img_7.src = eval("banner" + img_src + ".src");
		}
		
		startTime();
	}
	else{
	window.setTimeout("Timer()",1000)}
}

function clickLink(){
	top.location = links[i]
}

function descript(){
	window.status = description[i]
}

// -->