<!--

/*
=========
BASIC FUNCTIONS
=========
*/

var newWindow = null;
function popup(theURL, winName, features) { 
	closePopup(winName);
	newWindow=window.open(theURL,winName,features);
	newWindow.focus();
}
function closePopup(winName) {
	if (newWindow && newWindow.open && !newWindow.closed) newWindow.close();
}

/*
=========
DUMMY FUNCTIONS - REAL FUNCS INCLUDED USING CONDITIONAL COMMENTS FOR BROWSERS THAT REQUIRE THEM
=========
*/
function ieHoverFix(){
	// null
}
function menuFixSelects(){
	// null
}
/*
=========
DETECTION
=========
*/
if ((navigator.userAgent.indexOf('MSIE') != -1)
	&&
	(navigator.userAgent.indexOf('Mac') != -1)){
	var isIEMac = true;
}
if ((navigator.userAgent.indexOf('MSIE 5') != -1)
	&&
	(navigator.userAgent.indexOf('5.5') == -1)){
	var isIE5 = true;
}

/*
==========================
GET ELEMENTS BY CLASS NAME
==========================
*/
function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];      
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }   
    }
    return (arrReturnElements)
}
/*

==========================
INIT CALLED DOM HAS LOADED
==========================
*/
function initAfterDOMLoaded(){
 	// add hover events to dropdown menus (see dropdownMenu.js)
	menuFix();
	menuFixSelects();
	// reveal navigation bar, which was hidden by CSS
	//revealNav();
	// add css hovers for IE
	ieHoverFix();
}

/*
========================
INIT CALLED ON PAGE LOAD
========================
(in case browser doesn't support dom load measurement)
*/
function initOnLoad(){
 	// add hover events to dropdown menus (see dropdownMenu.js)
	menuFix();
	// reveal navigation bar, which was hidden by CSS
	//revealNav();
}

/*
======================
REVEAL NAVIGATION MENU
======================
*/
function revealNav(){
	document.getElementById('nav').style.visibility="visible";	
}

/*
====================================
SHOW EMPTY HREF IN LINK (for IE/Mac)
====================================
*/
function el(){
	if (isIEMac){
		document.write('<a class="btnLvl1" href="#">');
	} else {
		document.write('<a class="btnLvl1">');
	}
}

/*
==================
ADD DOM LOAD EVENT
==================
*/
// IE < 5.5 has problems with the Dom load detect script, so exclude IE5.0 + IE5.2/Mac
if (!isIEMac && !isIE5){
	addDOMLoadEvent(initAfterDOMLoaded);
}


/*
=======================
ADD WINDOW ONLOAD EVENT
=======================
*/
// allback in case dom load event detection doesn't work (IE5.0, IE5/Mac)
addLoadEvent(initOnLoad);


-->
