//To add anothe banner, update the Random Number function and the changeLink funtion

function generateRandomNumber() {
//    generates a randam number between 1 and the number%2, which can be changed

          var now=new Date();
          var num=(now.getSeconds())%5;
          var num=num+1;
          return num;
      }



function loadpage() {
//checks broswer version and calls the first image to start rotating

browver= parseInt(navigator.appVersion);
browtype = navigator.appName;
browsertype = "old";
//this is a browser check
	if (browtype == "Netscape" && !(browver < 3)) {
		browsertype = "new"; 
	}

	if (browtype == "Microsoft Internet Explorer" && !(browver < 4)) {
		browsertype = "new";
	}
	
//Calls function that generates random pics
	if (browsertype == "new") {

	changeImage();

	}
}




function changeImage() {
//randomly selects a number and applies the pic associated with it

	var banneradcode = generateRandomNumber();

//alert('first bannerad:'+banneradcode);

	if (browsertype == "new") {

		imagesource= "/images/banners_fp/feature-" + banneradcode + ".jpg";
		window.document.banneradPic.src=imagesource;
		
	}
	else if (browsertype == "old") {
	}

	thetimer = setTimeout("changeImage()", 15000);

}



function changeLink() {
//Checks to see what the picture is, then sets the link accordingly  Copy another case line, and enter the appropriate file to link to.

switch ( window.document.banneradPic.src ) {

   case "../images/banners_fp/feature-1.jpg": 
		Window1 = window.open("../resources/index.htm");
      break;

   case "../images/banners_fp/feature-2.jpg": 
		Window1 = window.open("../resources/index.htm");
      break;

	case "../images/banners_fp/feature-3.jpg": 
		Window1 = window.open("../resources/index.htm");
      break;

	case "../images/banners_fp/feature-4.jpg": 
		Window1 = window.open("../resources/index.htm");
      break;

		case "../images/banners_fp/feature-5.jpg": 
		Window1 = window.open("../resources/index.htm");
      break;

   default : 
		Window1 = window.location("../resources/index.htm");


}


}
 
