// 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() {
	if(!document.getElementById) {
		return false;
	}
	else {
		if (!window.XMLHttpRequest) {
			start_ie_nav();
		}
	}	
}


var slider = "";
function init_scroller() {
	slider = new Control.Slider('handle', 'track', {
		axis: 'vertical',
		range:$R(0,100),
		sliderValue:0,
		onSlide: function(v) { scrollVertical(v, $('scrollable'), slider);  },
		onChange: function(v) { scrollVertical(v, $('scrollable'), slider); }
	});
	
	// mozilla
	Event.observe('scrollable', 'DOMMouseScroll', wheel);
	Event.observe('track', 'DOMMouseScroll', wheel);
	// IE/Opera
	Event.observe('scrollable', 'mousewheel', wheel);
	Event.observe('track', 'mousewheel', wheel);
	
	// control arrows
	var intervalId;
	Event.observe('track-top', 'mouseover', function(e) {intervalId = setInterval("moveScroll(1)",100)});
	//Event.observe('track-top', 'mouseup', function(e) {clearInterval(intervalId)});
	Event.observe('track-top', 'mouseout', function(e) {clearInterval(intervalId)});
	Event.observe('track-bot', 'mouseover', function(e) {intervalId = setInterval("moveScroll(-1)",100)});
	//Event.observe('track-bot', 'mouseup', function(e) {clearInterval(intervalId)});
	Event.observe('track-bot', 'mouseout', function(e) {clearInterval(intervalId)});
	
	// disable vertical scrolling if text doesn't overflow the div
	if ($('scrollable').scrollHeight <= $('scrollable').offsetHeight) {
		slider.setDisabled();
		$('wrap').hide();
	}
}

function year_select(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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()");
plo_add("init_scroller()");
set_plos();