<!--
/********************************************************
 * SCRIPT NAME:  banner.js				*
 * PURPOSE:      JAVASCRIPT FUNCTIONS FOR DISPLAYING	*
 *               BANNER ADS ON THE PAGE			*
 * AUTHOR:       ANTHONY SURALTA			*
 * CREATED:      APRIL 5, 2000				*
 ********************************************************/

// There are three things you need to do
// if you add new banners: 
// 1. Increment the intNumOfBanners variable
//    to the number of banners added.
// 2. Add new array to hold the banner graphics file
//    under changePage function.
// 3. Add new condition to check link for banner ad
//    under changePage function.

//Increment as you add banners
var intNumOfBanners = 5

// Loads the initial image
function loadpage() {
	browver= parseInt(navigator.appVersion);
	browtype = navigator.appName;
	browsertype = "old";

	// Define image size
	var imgWidth = 468
	var imgHeight = 60
	
	if (browtype == "Netscape" && !(browver < 3)) {
		browsertype = "new"; 
	}

	if (browtype == "Microsoft Internet Explorer" && !(browver < 4)) {
		browsertype = "new";
	}

	if (browsertype == "new") {
		thetimer = setTimeout("changeimage()", 3000);
		banneradcode = 0;

		// Array of banner ads
		listofimages = new Array(intNumOfBanners+1);

		// Filnet 
		listofimages[0] = new Image(imgWidth,imgHeight)
		listofimages[0].src = "ads/filnet-0.gif"

		// Goldilocks
		listofimages[1] = new Image(imgWidth,imgHeight)
		listofimages[1].src = "ads/filnet-1.gif"

		// Trainingnet
		listofimages[2] = new Image(imgWidth,imgHeight)
		listofimages[2].src = "ads/filnet-2.gif"

		// Filnet
		listofimages[3] = new Image(imgWidth,imgHeight)
		listofimages[3].src = "ads/filnet-3.gif"

		// Childhood Balloons
		listofimages[4] = new Image(imgWidth,imgHeight)
		listofimages[4].src = "ads/filnet-4.gif"

		// Childhood Balloons
		listofimages[5] = new Image(imgWidth,imgHeight)
		listofimages[5].src = "ads/filnet-5.gif"
	}
}


// Changes the image sequentially
function changeimage(){
	if (browsertype == "new") {
		banneradcode = banneradcode + 1
		if (banneradcode == (intNumOfBanners+1)) {
			banneradcode = 0
                 }
                 imagesource = "ads/filnet-" + banneradcode + ".gif"
                 window.document.bannerad.src = imagesource
                 thetimer = setTimeout("changeimage()", 5000);
	}
	else if (browsertype == "old") {
	}
}


// Directs the user to the hyperlink
function changepage() {
	if (browsertype == "new") {

		// Add hyperlinks as you add new banners


		// Link to filnet
		if (banneradcode == 0) {
			newlocation = "http://www.filnet.bc.ca"
		}

		// Link to goldilocks
		else if (banneradcode == 1) {
			newlocation = "http://www.goldilocks.com"
		}

		// Link to trainingnet
		else if (banneradcode == 2) {
			newlocation = "http://www.trainingnet.com"
		}

		// Link to filnet
		else if (banneradcode == 3) {
			newlocation = "http://www.filnet.bc.ca"
		}

		// Since childhood balloons has no website
		// Link to filnet
		else if (banneradcode == 4) {
			newlocation = "http://www.filnet.bc.ca"
		}

		// Since childhood balloons has no website
		// Link to filnet
		else if (banneradcode == 5) {
			newlocation = "http://www.filnet.bc.ca"
		}

		location = newlocation
	}
	else if (browsertype == "old") {
                 location = "http://www.filnet.bc.ca"
	}
}

// -->
