// JavaScript Document
window.onerror=null
//Global
var isCSS, isW3C, isIE4, isNN4, isIE6CSS;
var currNav;
var backgroundSrcs = new Array("banner1.jpg");

function pickimage() 
{
//This line picks an image at random from the list you entered above 
var bgimage=backgroundSrcs[(Math.round(Math.random()*(backgroundSrcs.length-1)))] 

//This line applies the background image to your masthead 
document.getElementById("Header").style.backgroundImage = "url('/images/header/" + bgimage + "')"; 
}  

function initAPI(){
	if(document.images){
		isCSS = (document.body && document.body.style) ? true : false;
		isW3C = (isCSS && document.getElementById) ? true : false;
		isIE4 = (isCSS && document.all) ? true : false;
		isNN4 = (document.layers) ? true : false
		isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
	}
}
function initPage(){
	pickimage();
	initAPI();
	soopaPopSetup();
}

//set event handler
window.onload = initPage;

function BookMark(){
if ((navigator.appVersion.indexOf("MSIE") > 0)&& (parseInt(navigator.appVersion) >= 4)){window.external.AddFavorite(self.document.location.href, document.title);}
else {alert('Why not bookmark this web site?')}
}

function PrintPage(){
if (navigator.appName.indexOf("Netscape") != -1){alert("Sorry, Netscape does not offer the option to print this way,\nplease use your printer option from the browser itself.")}
window.print();
}

function preloadImages(){
	image1 = new Image();
	image1.src = "/images/blue_corner.gif";
}

function seekLayer(doc,name){
	var theObj;
	for (var i =0; i< doc.layers.length; i++){
	if(doc.layers[i].name == name){
	theObj = doc.layers[i];
	break;
	}
//Dive into nested layers if necessary
if (doc.layers[i].document.layers.length > 0){
		theObj =  seekLayer(document.layers[i].document, name);
		}
	}
	return theObj;
}
	
// Convert object name string or object reference
// into a valid element object reference

function getRawObject(obj){
	var theObj;
	if(typeof obj == "string") {
		if(isW3C){
				theObj = document.getElementById(obj);
			} else if (isIE4) {
				theObj = document.all(obj);
			} else if (isNN4) {
				theObj = seekLayer(document, obj);
			}
		} else {
			//pass through object reference
			theObj = obj;
		}
			return theObj;
	}
	
//Convert object name string or object reference
//into a valid style (orNN4 layer) reference
function getObject(obj){
	var theObj = getRawObject(obj);
	if(theObj && isCSS) {
	theObj = theObj.style;
	}
	return theObj;
}
function setStatus(msg){
	window.status = msg;
	return true;
}
function soopaPopSetup() {
	var a;
	for (var i = 0; (a = document.links[i]); i++) {
		if (a.target && a.target.indexOf("_soopaPop") == 0) {
			a.onclick = soopaPop;
		}
	}
}

function soopaPop() {
	var a = this.target.split(":");
	var sFeatures = a[1];
	window.open(this.href, a.length > 2 ? a[2] : String((new Date()).getTime()), sFeatures);
	return false;
}

