var eventListenerClass = {
addLoadListener:function(fn) {
	if (typeof window.addEventListener != 'undefined'){
		window.addEventListener('load', fn, false);
	} else if (typeof document.addEventListener != 'undefined')	{
		document.addEventListener('load', fn, false);
	} else if (typeof window.attachEvent != 'undefined'){
		window.attachEvent('onload', fn);
	} else {
		return false;
	}
	return true;
},
attachEventListener:function(target, eventType, functionRef, capture) {
    if (typeof target.addEventListener != "undefined") {
        target.addEventListener(eventType, functionRef, capture);
    } else if (typeof target.attachEvent != "undefined") {
        target.attachEvent("on" + eventType, functionRef);
    } else {
        return false;
    }
    return true;
}//end function
}; //end eventlistenerclass

var accessibilityClass = {
isUndefined:function(a) { 
	return typeof a == 'undefined' 
},
addPopUpLink:function(features) {
if(!document.getElementById || !document.createTextNode){return;}
var POPUP_FEATURES = 'location=0,scrollbars=1,statusbar=0,menubar=0,width=500,height=200';
var popupClass='smallpopup';
var popupMessage=' (Opens in new window)';
var pop, t;
var as=document.getElementsByTagName('a');	
//huntja features
if (accessibilityClass.isUndefined(features)) {
	features = POPUP_FEATURES;
} else {
	features = ('location=0,scrollbars=1,statusbar=0,menubar=0,' + features);
}//end features else
	for(var i=0; i<as.length; i++) {
		t=as[i].className;
		if(t && t.toString().indexOf(popupClass)!=-1) {
			if((as[i].firstChild.nodeName)!= 'IMG') {
				as[i].appendChild(document.createTextNode(popupMessage));
			}//end if img for forms
			as[i].onclick=function() {
				pop=window.open(this.href,'popup', features);
					//huntja window on top
					pop.focus();
					return false;
			}//end onclick function
		}//end if
	}//end for
}//end function
};//end accessibilityclass object

var navigationClass = {
getIDFromHref:function(strHref) {
  	var iOffsetLI = strHref.indexOf('/') + 4;
  	var iEndLI = strHref.length; 
  	//alert("IDfromHREF " + strHref.substring(iOffsetLI, iEndLI));
  	return strHref.substring(iOffsetLI, iEndLI);
  }, // end getIDFromHref	
// Function to add class="current" to the appropriate LI
addYouAreHere:function() {
if(!document.getElementById || !document.createTextNode){return;}
var strLocation = window.location.href;
var iOffset = strLocation.indexOf('/') + 4;
var iEnd = strLocation.length; 
var strMatch = (strLocation.substring(iOffset, iEnd));
//alert("URL STRING: " + strMatch);
	var listElement = document.getElementById("navlist");
	var objAnchors = listElement.getElementsByTagName('a');
    // Iterate through all anchors in the top navigation
        	for (var iCounter=0; iCounter<objAnchors.length; iCounter++) {
			//alert("first for: " + objAnchors[iCounter].href);
      	  	// Locate the associated li container,
          	// and style it
         	var strID = navigationClass.getIDFromHref(objAnchors[iCounter].href);
			if(strID == strMatch) {
				//alert("Match " + objAnchors[iCounter].nodeName);
				objAnchors[iCounter].className = 'current';
				}//end if match
		  	 }//end for
		}//end ur here
}; //end navigationClass object

