

/*
	Random Image Generator for JavaScript by Phil Barnes, at BX3.COM -- http://www.bx3.com
	Works with NN 2+, MSIE 3+
	You are free to copy and distribute, please include (at least) the first comment line in your code.
	This version is limited to 60 images, but could easily be adapted to 1000 by using the getTime() method.
	This program can easily be adapted to for banner advertisment linking purposes without CGI and SSI problems.
	Make sure to pre-define the arrays in the HEAD of the document.
	Note: In JavaScript Arrays (as in C++, PERL etc...) 0 is the first 

*/

NumberOfImages = 48;

ImageFiles = new Array (NumberOfImages); // Use the relative or absolute path to the image file location.
        ImageFiles[0] = "http://www.automotiveforums.com/random/1s.jpg";
        ImageFiles[1] = "http://www.automotiveforums.com/random/2s.jpg";
        ImageFiles[2] = "http://www.automotiveforums.com/random/3s.jpg";
        ImageFiles[3] = "http://www.automotiveforums.com/random/4s.jpg";
				ImageFiles[4] = "http://www.automotiveforums.com/random/5s.jpg";
				ImageFiles[5] = "http://www.automotiveforums.com/random/6s.jpg";
				ImageFiles[6] = "http://www.automotiveforums.com/random/7s.jpg";
				ImageFiles[7] = "http://www.automotiveforums.com/random/8s.jpg";        
				ImageFiles[8] = "http://www.automotiveforums.com/random/9s.jpg";
        ImageFiles[9] = "http://www.automotiveforums.com/random/10s.jpg";
        ImageFiles[10] = "http://www.automotiveforums.com/random/11s.jpg";
        ImageFiles[11] = "http://www.automotiveforums.com/random/12s.jpg";
				ImageFiles[12] = "http://www.automotiveforums.com/random/13s.jpg";
				ImageFiles[13] = "http://www.automotiveforums.com/random/14s.jpg";
				ImageFiles[14] = "http://www.automotiveforums.com/random/15s.jpg";
				ImageFiles[15] = "http://www.automotiveforums.com/random/16s.jpg";
				ImageFiles[16] = "http://www.automotiveforums.com/random/17s.jpg";
        ImageFiles[17] = "http://www.automotiveforums.com/random/18s.jpg";
        ImageFiles[18] = "http://www.automotiveforums.com/random/19s.jpg";
        ImageFiles[19] = "http://www.automotiveforums.com/random/20s.jpg";
				ImageFiles[20] = "http://www.automotiveforums.com/random/21s.jpg";
				ImageFiles[21] = "http://www.automotiveforums.com/random/22s.jpg";
				ImageFiles[22] = "http://www.automotiveforums.com/random/23s.jpg";
				ImageFiles[23] = "http://www.automotiveforums.com/random/24s.jpg";
				ImageFiles[24] = "http://www.automotiveforums.com/random/25s.jpg";
				ImageFiles[25] = "http://www.automotiveforums.com/random/26s.jpg";
				ImageFiles[26] = "http://www.automotiveforums.com/random/27s.jpg";
				ImageFiles[27] = "http://www.automotiveforums.com/random/28s.jpg";
				ImageFiles[28] = "http://www.automotiveforums.com/random/29s.jpg";
				ImageFiles[29] = "http://www.automotiveforums.com/random/30s.jpg";
				ImageFiles[30] = "http://www.automotiveforums.com/random/31s.jpg";
				ImageFiles[31] = "http://www.automotiveforums.com/random/32s.jpg";
				ImageFiles[32] = "http://www.automotiveforums.com/random/33s.jpg";
				ImageFiles[33] = "http://www.automotiveforums.com/random/34s.jpg";
				ImageFiles[34] = "http://www.automotiveforums.com/random/35s.jpg";
				ImageFiles[35] = "http://www.automotiveforums.com/random/36s.jpg";
				ImageFiles[36] = "http://www.automotiveforums.com/random/37s.jpg";
				ImageFiles[37] = "http://www.automotiveforums.com/random/38s.jpg";
				ImageFiles[38] = "http://www.automotiveforums.com/random/39s.jpg";
				ImageFiles[39] = "http://www.automotiveforums.com/random/40s.jpg";
				ImageFiles[40] = "http://www.automotiveforums.com/random/41s.jpg";
				ImageFiles[41] = "http://www.automotiveforums.com/random/42s.jpg";
				ImageFiles[42] = "http://www.automotiveforums.com/random/43s.jpg";
				ImageFiles[43] = "http://www.automotiveforums.com/random/44s.jpg";
				ImageFiles[44] = "http://www.automotiveforums.com/random/45s.jpg";
				ImageFiles[45] = "http://www.automotiveforums.com/random/46s.jpg";
				ImageFiles[46] = "http://www.automotiveforums.com/random/47s.jpg";
ImageFiles[47] = "http://www.automotiveforums.com/random/48s.jpg";

LinkURL = new Array (NumberOfImages);  	// You can use abreviated URIs or Full URLs, depending on how you are set up.
        LinkURL[0] = "http://www.automotiveforums.com/random/1.jpg";
        LinkURL[1] = "http://www.automotiveforums.com/random/2.jpg";
        LinkURL[2] = "http://www.automotiveforums.com/random/3.jpg";
        LinkURL[3] = "http://www.automotiveforums.com/random/4.jpg";
				LinkURL[4] = "http://www.automotiveforums.com/random/5.jpg";
				LinkURL[5] = "http://www.automotiveforums.com/random/6.jpg";
				LinkURL[6] = "http://www.automotiveforums.com/random/7.jpg";
				LinkURL[7] = "http://www.automotiveforums.com/random/8.jpg";        
				LinkURL[8] = "http://www.automotiveforums.com/random/9.jpg";
        LinkURL[9] = "http://www.automotiveforums.com/random/10.jpg";
        LinkURL[10] = "http://www.automotiveforums.com/random/11.jpg";
        LinkURL[11] = "http://www.automotiveforums.com/random/12.jpg";
				LinkURL[12] = "http://www.automotiveforums.com/random/13.jpg";
				LinkURL[13] = "http://www.automotiveforums.com/random/14.jpg";
				LinkURL[14] = "http://www.automotiveforums.com/random/15.jpg";
				LinkURL[15] = "http://www.automotiveforums.com/random/16.jpg";
				LinkURL[16] = "http://www.automotiveforums.com/random/17.jpg";
        LinkURL[17] = "http://www.automotiveforums.com/random/18.jpg";
        LinkURL[18] = "http://www.automotiveforums.com/random/19.jpg";
        LinkURL[19] = "http://www.automotiveforums.com/random/20.jpg";
				LinkURL[20] = "http://www.automotiveforums.com/random/21.jpg";
				LinkURL[21] = "http://www.automotiveforums.com/random/22.jpg";
				LinkURL[22] = "http://www.automotiveforums.com/random/23.jpg";
				LinkURL[23] = "http://www.automotiveforums.com/random/24.jpg";
				LinkURL[24] = "http://www.automotiveforums.com/random/25.jpg";
				LinkURL[25] = "http://www.automotiveforums.com/random/26.jpg";
				LinkURL[26] = "http://www.automotiveforums.com/random/27.jpg";
				LinkURL[27] = "http://www.automotiveforums.com/random/28.jpg";
				LinkURL[28] = "http://www.automotiveforums.com/random/29.jpg";
				LinkURL[29] = "http://www.automotiveforums.com/random/30.jpg";
				LinkURL[30] = "http://www.automotiveforums.com/random/31.jpg";
				LinkURL[31] = "http://www.automotiveforums.com/random/32.jpg";
				LinkURL[32] = "http://www.automotiveforums.com/random/33.jpg";
				LinkURL[33] = "http://www.automotiveforums.com/random/34.jpg";
				LinkURL[34] = "http://www.automotiveforums.com/random/35.jpg";
				LinkURL[35] = "http://www.automotiveforums.com/random/36.jpg";
				LinkURL[36] = "http://www.automotiveforums.com/random/37.jpg";
				LinkURL[37] = "http://www.automotiveforums.com/random/38.jpg";
				LinkURL[38] = "http://www.automotiveforums.com/random/39.jpg";
				LinkURL[39] = "http://www.automotiveforums.com/random/40.jpg";
				LinkURL[40] = "http://www.automotiveforums.com/random/41.jpg";
				LinkURL[41] = "http://www.automotiveforums.com/random/42.jpg";
				LinkURL[42] = "http://www.automotiveforums.com/random/43.jpg";
				LinkURL[43] = "http://www.automotiveforums.com/random/44.jpg";
				LinkURL[44] = "http://www.automotiveforums.com/random/45.jpg";
				LinkURL[45] = "http://www.automotiveforums.com/random/46.jpg";
				LinkURL[46] = "http://www.automotiveforums.com/random/47.jpg";
LinkURL[47] = "http://www.automotiveforums.com/random/48.jpg";

AltText = new Array (NumberOfImages);
        AltText[0] = "Click to enlarge";

ImageWidth = new Array (NumberOfImages);
        ImageWidth[0] = 150;

ImageHeight = new Array (NumberOfImages);
        ImageHeight[0] = 100;

Border = new Array (NumberOfImages);
		Border[0] = 1;

HorizontalSpace = new Array(NumberOfImages);
		HorizontalSpace[0] = 0;

VerticalSpace = new Array(NumberOfImages);
		VerticalSpace[0] = 10;


function GenerateRandom(max) {
	var TodaysDate;
	var Seconds;
	var Random;
	
	TodaysDate = new Date();
	Seconds = TodaysDate.getSeconds();
	Random = Seconds%max;
	return Random;
}

function WriteBanner(max) {
	var x;	
	x = GenerateRandom(max);
	
	document.write(LT+"A HREF=\""+LinkURL[x]+"\""+GT+LT+"IMG SRC=\"" + ImageFiles[x]+"\" BORDER=\"" + Border[0] +"\" HSPACE=\"" + HorizontalSpace[0] +"\" VSPACE=\"" + VerticalSpace[0] +"\" ALT=\""+AltText[0]+"\""+GT+LT+"/A"+GT);
}
//WIDTH=\""+ImageWidth[x]+"\" HEIGHT=\""+ImageHeight[x]+"\"
// I did this because some non-JS browser's close the comment tag whenever they see a gt sign.
// This method reduces the amount of JS code that will be shown on their screen if this happens.

LT = "<"; 
GT = ">"; 
