/* HFSA JavaScript File */

/*  browser sniff using object detection  */
var ope = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie7 = (document.all && window.XMLHttpRequest) ? true : false;
var ie6 = (navigator.userAgent.indexOf("MSIE 6") > 0)
if(ie6 !=true) {
var ie5 = (document.all && document.getElementById) ? true : false;
}
var moz = (document.getElementById && !document.all) ? true : false;
var saf = (navigator.userAgent.indexOf("Safari") > 0)
var ns6 = (navigator.product == 'Gecko' && !window.find && !saf) ? true : false;
var ns7 = (navigator.product == 'Gecko' && window.find) ? true : false;
var mac = (navigator.userAgent.indexOf("Mac") != -1) ? true : false;
var win = (navigator.userAgent.indexOf("Win") != -1) ? true : false;

var ie5mac = (mac && ie5 && !ie7 && !ope);
var ie5win = (win && ie5 && !ie7 && !ope);

/*  browser messages  */
function browserMsg()
{
if(ns4 || ns6 || ie4 || ie5win)
  { alert ("This website has been developed for W3C Standards Compliant Browsers. \n" +
  	   "We have detected that you have an older browser. This will significantly \n"   +
  	   "affect the way this web site looks and functions. We recommend that you \n"   +
  	   "change or upgrade to a Standards Compliant Browser before continuing. \n");
  }
else if(ie5mac)
  { alert ("This website has been developed for W3C Standards Compliant Browsers. \n" +
  	   "We have detected that you have a browser that is no longer supported. \n"   +
  	   "This will significantly affect the way this web site looks and functions. \n"   +
  	   "We recommend that you change to a Standards Compliant Browser before \n"   +
  	   "continuing. \n");
  }
else if(ie6 || moz || saf || ns7 || ope || ie7)
  { return false;
  }
else
  { alert ("This website has been developed for W3C Standards Compliant Browsers. \n" +
  	   "We were unable to detect what kind of browser you are using. This could \n"   +
  	   "significantly impact the way this web site looks and functions. We recommend \n"   +
  	   "that you change to a Standards Compliant Browser before continuing. \n");
  }
}

/*  function used to rotate graphics on main page  */

hfsaPix = new Array("graphics/main/Chavez_Statue.jpg",
		    "graphics/main/EastMall_Fountain.jpg",
		    "graphics/main/Littlefield_Fountain.jpg",
		    "graphics/main/Main_Arches.jpg",
		    "graphics/main/Tower_Littlefield.jpg",
		    "graphics/main/Tower_Trees.jpg")
		  
imgCt = hfsaPix.length 

function rotatePic() {
	if (document.images) {
	randomNum = Math.floor((Math.random() * imgCt))
//	alert("ImageTest"+"\n\nhfsaPix.length: "+hfsaPix.length+'\n\nrandomNum: ' + randomNum +"\n\nsrc=" + hfsaPix[randomNum]);
	document.images['swapImage'].src = hfsaPix[randomNum];
	} else {
	document.swapImage.src = hfsaPix[randomNum];	
	}
}

