checkSearch = function() {
  var sTerm = document.mainsearch.topsearch.value;
  var sType = document.mainsearch.search.value;
  if (sTerm != "") {
  window.location = "/search.asp?topsearch=" + sTerm + "&search=" + sType
  }
}
open_window = function(url) {
  mywin = window.open(url,"win",'toolbar=1,location=1,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=800,height=475');
  }
resourcesHover = function() {
	var nav = document.getElementById("resources-nav");
	if(!nav) {
		return;
0	}
	nav.onmouseover=function() {
		this.className+=" hover";
	}
	nav.onmouseout=function() {
		this.className=this.className.replace(new RegExp(" hover\\b"), "");
	}
}

if (window.attachEvent) window.attachEvent("onload", resourcesHover);

function TreeView() {
	this.element = document.getElementById("content");
	if (!this.element) return false;
	this.nodes = this.element.getElementsByTagName("li");
	this.parents = new Array();
	this.children = new Array();
	this.initiate();
	this.bind();
}

TreeView.prototype.initiate = function() {
	for(var i = 0; i < this.nodes.length; i++) {
		if (this.nodes[i].className == "tree") {
			var link = this.nodes[i].getElementsByTagName("a")[0];
			var ul = this.nodes[i].getElementsByTagName("ul")[0];
			this.parents.push(link);
			this.children.push(ul);
		}
	}
}

TreeView.prototype.bind = function() {
	var o = this;
	for(var i = 0; i < this.parents.length; i++) {
		this.parents[i].onclick = function() { o.expand(this); return false; };
	}
}

TreeView.prototype.expand = function(caller) {
	for(var i = 0; i < this.parents.length; i++) {
		var parent = this.parents[i];
		if (parent == caller) {
			this.collapse();
			parent.className = "active";
			this.children[i].className = "";
		}
	}
}

TreeView.prototype.collapse = function() {
	for(var i = 0; i < this.parents.length; i++) {
		this.parents[i].className = "";
		this.children[i].className = "off-left";
	}
}
