// site wide javascript
function start_ie_nav() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("navigation");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					curCname = this.className;
					this.className="over";
				}
				node.onmouseout=function() {
					if(!curCname) {
							this.className=this.className.replace("over","out");
					}
					else {
						//alert(curCname);
						this.className=this.className.replace("over",curCname);
					}
				}
			}
		}
	}
}

function show_nav() {
	// nav refers to tier, as in top-level, second-level, third-level
	// level actually refers to which of the top-level nav items to choose
	if(!document.getElementById) {
		return false;
	}
	else {
		var a = $('navigation').getElementsBySelector('a');
		if (window.location.href.substr(location.href.length - 1, 1) == '/') {
			var loc = window.location.href + 'index.php'; 
		}
		else {
			var loc = window.location.href.replace('#','');
		}
		for(var i=0; i < a.length; i++) {
			if (a[i].href == loc) {
				a[i].setAttribute("class", "over");
				a[i].setAttribute("className", "over");
			}
		}	
		if (!window.XMLHttpRequest) {
			start_ie_nav();
		}
	}	
}

function pop_up(URL,w,h,s) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars="+s+",location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",left="+winl+",top="+wint+"');");
}

function set_plos() {
	window.onload = plos_go;
}
function plos_go() {
	for(var i = 0;i < plos.length;i++)
		eval(plos[i]);
}
function plo_add(jso) {
	plos[plos.length] = jso;
}
var plos = new Array();
plo_add("show_nav()");
set_plos();