// Copyright Graham Nott of Star Global, 2000
function settoday() {
   months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
   var dt=new Date();
   var yr=dt.getFullYear();
   var mnth=dt.getMonth();
   var date=dt.getDate();

   var today="" + months[mnth] + " " + date + ", " + yr;
   return today;
}

function newWindow(a) {
      a.target = "_blank";
}

var browse;
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)){
   browse="ie4";
}
else {
   if((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3))
      browse="ns3";
}


function show (Name) {
 if (browse=="ns3" || browse=="ie4"){
    document [Name].src = eval(Name + 1 + ".src");
    return true;
 }
}

function hide (Name) {
 if (browse=="ns3" || browse=="ie4"){
    document [Name].src = eval(Name + 0 + ".src");
    return true;
 }
}

if (browse=="ns3" || browse=="ie4") {

        nav_generic0 = new Image();
	nav_generic0.src = "nav/nav_generic0.gif";
	nav_generic1 = new Image();
        nav_generic1.src = "nav/nav_generic1.gif";
}


function popup (url, name, w, h) {
  var details= "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizeable=yes,status=no,width=" + w + ",height= " + h + " ";
  window.open(url,name,details);
}


function popupView (url, name, w, h) {
  var details= "toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizeable=yes,status=no,width=" + w + ",height= " + h + " ";
  window.open(url,name,details);
}


function jumpURL(object) {
   if (object.options[object.selectedIndex].value != "") {
      newWindow = window.open('','quickLink');
      newWindow.location.href = object.options[object.selectedIndex].value;
   }
}

function newWindow(a) {
      a.target = "_blank";
}


function randomLogo() {

	////----Start of number selection----////
	// the highest key in the logoArray
	var logoArrayLength = logoArray.length;

	// array will be populated with random numbers representing the logos to be displayed
	var randNumbersArray = new Array();

	var x = 0;
	var tempNum;
	// this loop selects 1 random and unique numbers
	for(x=0;x<1;x++) {
	  tempNum = Math.floor(Math.random()*logoArrayLength);
		// if the random number is 1 the temp number will be one higher than the highest key in the
		// logoArray.  subtracting 1 from the tempNum will fix this.
		if (tempNum == logoArrayLength) {
			tempNum = tempNum - 1;
		}

		// check if tempNum is already in the randNumbersArray.
		var i = 0;
		var duplicateTest = 0;
		for(i=0;i<=randNumbersArray.length;i++) {
			if(tempNum == randNumbersArray[i]) {
				duplicateTest = 1;
			}
		}

		// If the number is not a duplicate add it to the array, other wise decrement the counter so an
		// extra loop is preformed, and a new number selected
		if(duplicateTest != 1) {
			randNumbersArray[x] = tempNum;
		} else {
			x--;
			duplicateTest = 0;
		}
	}
	////----End of number selection----////


	////---- Begin writing HTML Output ----////
	var logoHTML = "";
	var tempSrc;
	var tempWidth;
	var tempHeight;
	var tempAlt;
	var tempArrayNum;

	for(x=0;x<randNumbersArray.length;x++) {
		tempArrayNum = randNumbersArray[x];
		tempSrc = logoArray[tempArrayNum][0];
		tempWidth = logoArray[tempArrayNum][1];
		tempHeight = logoArray[tempArrayNum][2];
		tempAlt = logoArray[tempArrayNum][3];

		logoHTML = logoHTML + "<img src='/images/partners/" + tempSrc + ".gif' width='" + tempWidth + "' height='" + tempHeight + "' alt='" + tempAlt + "' />";
	}

	document.getElementById("partnerlogo").innerHTML=logoHTML;
	////----End of writing HTML Output----////

	// call the function after 5000 milliseconds delay, to rotate the logos
	setTimeout("randomLogo()",5000);
}