
/*
	Random Image Generator for JavaScript by Phil Barnes, at BX3.COM -- http://www.bx3.com
	Works with NN 2+, MSIE 3+
	limited to 60 images. could easily be adapted to 1000 by using the getTime() method.
	pre-define the arrays in the HEAD of the document.
	Note: In JavaScript Arrays (as in C++, PERL etc...) 0 is the first 
*/

NumberOfImages = 3;

ImageFiles = new Array (NumberOfImages); // Use relative or absolute path
        
	ImageFiles[0] = "../images/temp.gif";
	ImageFiles[1] = "../images/ubmica.jpg";
	ImageFiles[2] = "../images/MLABeef.gif";

	//This is where the ads themselves are located
	//ImageFiles[1] = "../images/ubmica.jpg";
        	//ImageFiles[2] = "../images/MLABeef.gif";
        //ImageFiles[3] = "../images/seaboardy.gif";
        //ImageFiles[4] = "../images/sealandy.gif";

LinkURL = new Array (NumberOfImages);  	// use abreviated URIs or Full URLs
        LinkURL[0] = "http://www.micausa.org/info.asp?fname=mail"
        LinkURL[1] = "http://www.urnerbarry.com/"	
        LinkURL[2] = "http://www.australian-beef.com/"	

	//   This is where links go for ads
	//LinkURL[1] = "http://www.urnerbarry.com/";
	//LinkURL[2] = "http://www.australian-beef.com/";
        //LinkURL[3] = "http://www.seaboardmarine.com/";
        //LinkURL[4] = "http://www.maersksealand.com/";

AltText = new Array (NumberOfImages);
        AltText[0] = "Questions?";
        AltText[1] = "This is Banner 2";
        AltText[2] = "This is Banner 3";
        AltText[3] = "This is Banner 4";

ImageWidth = new Array (NumberOfImages);
        ImageWidth[0] = 60;
        ImageWidth[1] = 60;
        ImageWidth[2] = 60;
        ImageWidth[3] = 60;

ImageHeight = new Array (NumberOfImages);
        ImageHeight[0] = 460;
        ImageHeight[1] = 460;
        ImageHeight[2] = 460;
        ImageHeight[3] = 460;

Border = new Array (NumberOfImages);
		Border[0] = 1;
		Border[1] = 1;
		Border[2] = 1;
		Border[3] = 1;

HorizontalSpace = new Array(NumberOfImages);
		HorizontalSpace[0] = 0;
		HorizontalSpace[1] = 0;
		HorizontalSpace[2] = 0;
		HorizontalSpace[3] = 0;

VerticalSpace = new Array(NumberOfImages);
		VerticalSpace[0] = 10;
		VerticalSpace[1] = 10;
		VerticalSpace[2] = 10;
		VerticalSpace[3] = 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[x] +"\" HSPACE=\"" + HorizontalSpace[x] +"\" VSPACE=\"" + VerticalSpace[x] +"\" ALT=\""+AltText[x]+"\""+GT+LT+"/A"+GT);
	//document.write(LT+"A HREF=\""+LinkURL[x]+"\""+GT+LT+"IMG SRC=\"" + ImageFiles[x]+"\" WIDTH=\""+ImageWidth[x]+"\" HEIGHT=\""+ImageHeight[x]+"\" BORDER=\"" + Border[x] +"\" HSPACE=\"" + HorizontalSpace[x] +"\" VSPACE=\"" + VerticalSpace[x] +"\" ALT=\""+AltText[x]+"\""+GT+LT+"/A"+GT);


}

// 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 screen if this happens.

LT = "<"; 
GT = ">";

WriteBanner(NumberOfImages);
