<!--//--><![CDATA[//><!--

asHover = function() {
	// Support the standard nav without a class of nav.
	var el = document.getElementById("menu").getElementsByTagName("ul");
	if(!/\bsubnav\b/.test(el.className) && el.tagName == "UL")
		setHover(el);

	// Find all unordered lists.
	var ieNavs = document.getElementsByTagName('ul');
	for(i=0; i<ieNavs.length; i++) {
		var ul = ieNavs[i];
		// If they have a class of nav add the menu hover.
		if(/\bsubnav\b/.test(ul.className))
			setHover(ul);
	}
}

function setHover(nav) {
	var ieULs = nav.getElementsByTagName('ul');
	if (navigator.appVersion.substr(22,3)!="5.0") {
		// IE script to cover <select> elements with <iframe>s
		for (j=0; j<ieULs.length; j++) {
			var ieMat=document.createElement('iframe');
			if(document.location.protocol == "https:")
				ieMat.src="//0";
			else if(window.opera != "undefined")
				ieMat.src="";
			else
				ieMat.src="javascript:false";
			ieMat.scrolling="no";
			ieMat.frameBorder="0";
			ieMat.style.width=ieULs[j].offsetWidth+"px";
			ieMat.style.height=ieULs[j].offsetHeight+"px";
			ieMat.style.zIndex="-1";
			ieULs[j].insertBefore(ieMat, ieULs[j].childNodes[0]);
			ieULs[j].style.zIndex="101";
		}
		// IE script to change class on mouseover
		var ieLIs = nav.getElementsByTagName('li');
		for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
			
			// Add a sfhover class to the li.
			ieLIs[i].onmouseover=function() {
				if(!/\bsfhover\b/.test(this.className))
					this.className+=" sfhover";
			}
			ieLIs[i].onmouseout=function() {
				if(!this.contains(event.toElement))
					this.className=this.className.replace(' sfhover', '');
			}
		}
	} else {
		// IE 5.0 doesn't support iframes so hide the select statements on hover and show on mouse out.
		// IE script to change class on mouseover
		var ieLIs = document.getElementById('nav').getElementsByTagName('li');
		for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
			ieLIs[i].onmouseover=function() {this.className+=" sfhover";hideSelects();}
			ieLIs[i].onmouseout=function() {this.className=this.className.replace(' sfhover', '');showSelects()}
		}
	}
}

// If IE 5.0 hide and show the select statements.
function hideSelects(){
	var oSelects=document.getElementsByTagName("select");
	for(var i=0;i<oSelects.length;i++)
		oSelects[i].className+=" hide";
}

function showSelects(){
	var oSelects=document.getElementsByTagName("select");
	for(var i=0;i<oSelects.length;i++)
		oSelects[i].className=oSelects[i].className.replace(" hide","");
}

asAccessible = function() {
	var asEls = document.getElementById("nav").getElementsByTagName("A");
	for (var i=0; i<asEls.length; i++) {
		asEls[i].onfocus=function() {
			this.className+=(this.className.length>0? " ": "") + "sffocus"; //a:focus
			this.parentNode.className+=(this.parentNode.className.length>0? " ": "") + "sfhover"; //li < a:focus
			if(this.parentNode.parentNode.parentNode.nodeName == "LI") {
				this.parentNode.parentNode.parentNode.className+=(this.parentNode.parentNode.parentNode.className.length>0? " ": "") + "sfhover"; //li < ul < li < a:focus
				if(this.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "LI") {
					this.parentNode.parentNode.parentNode.parentNode.parentNode.className+=(this.parentNode.parentNode.parentNode.parentNode.parentNode.className.length>0? " ": "") + "sfhover"; //li < ul < li < ul < li < a:focus
				}
			}
		}
		asEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp("( ?|^)sffocus\\b"), "");
			this.parentNode.className=this.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
			if(this.parentNode.parentNode.parentNode.nodeName == "LI") {
				this.parentNode.parentNode.parentNode.className=this.parentNode.parentNode.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
				if(this.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "LI") {
					this.parentNode.parentNode.parentNode.parentNode.parentNode.className=this.parentNode.parentNode.parentNode.parentNode.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
				}
			}
		}
	}
}

asRollover = function() {
	var asEls = document.getElementsByTagName("A");
	for (var i=0; i<asEls.length; i++) {
		if (asEls[i].rel == "rollover") {
			preload_image = new Image(1,1); 
			preload_image.src = asEls[i].childNodes[0].src.substring(0,asEls[i].childNodes[0].src.lastIndexOf('.')) + '-hover' + asEls[i].childNodes[0].src.substring(asEls[i].childNodes[0].src.lastIndexOf('.'));	
			
			asEls[i].childNodes[0].onmouseover=function() {
				this.src = this.src.substring(0,this.src.lastIndexOf('.')) + '-hover' + this.src.substring(this.src.lastIndexOf('.'));
			}
			asEls[i].childNodes[0].onmouseout=function() {
				this.src = this.src.substring(0,this.src.lastIndexOf('.') - 6) + this.src.substring(this.src.lastIndexOf('.'));
			}
		}		
	}
}

asMaps = function() {

        var divEls = document.getElementById('content').getElementsByTagName('div');
        for (var i=0; i < divEls.length; i++) {
                if (divEls[i].className == "expandBox") {
                        //divEls[i].style.visibility = 'hidden';
                        new Effect.toggle(divEls[i].id, 'slide', {duration:0.5});
                }
        }
}

// only ie needs the sfHover script. all need the accessibility script...
// thanks http://www.brothercake.com/site/resources/scripts/onload/
if (window.addEventListener) {						// gecko, safari, konqueror and standard
	window.addEventListener('load', asAccessible, false);
	window.addEventListener('load', asRollover, false);
	window.addEventListener('load', asMaps, false);
} else if (document.addEventListener) {					// opera 7
	document.addEventListener('load', asAccessible, false);
	document.addEventListener('load', asRollover, false);
	document.addEventListener('load', asMaps, false);
}
else if (window.attachEvent) { 						// win/ie
	if (document.all && !window.opera && window.XMLHttpRequest) {
		window.attachEvent('onload', asAccessible);
		window.attachEvent('onload', asRollover);	
		window.attachEvent('onload', asMaps);	
	} else {
		window.attachEvent('onload', asHover);
		window.attachEvent('onload', asAccessible);
		window.attachEvent('onload', asRollover);	
		window.attachEvent('onload', asMaps);	
	}
} else { 								// mac/ie5
	if (typeof window.onload == 'function') {
		var existing = onload;
		window.onload = function() {
			asHover();
			asAccessible();
			asRollover();
		}
	} else {
		window.onload = function() {
			asHover();
			asAccessible();
			asRollover();
		}
	}
}

//--><!]]>