//<![CDATA[

/* 
 * addLoadEvent(func) takes a function and appends it to the list of functions for the onload event.  
 * Written by Simon Willison (http://simon.incutio.com/)
 * 
 */ 
function addLoadEvent(func) {
	var oldonload = window.onload; 
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

/*
 * parseNavigation(ob) is called by the the Library Quick Find drop-down menu in the header.
 * 
 */
function parseNavigation(ob) {
	toBeBrokenDown = ob.options[ob.selectedIndex].value.split("|");
	targetWindow = toBeBrokenDown[0];
	targetURL    = toBeBrokenDown[1];
    if (targetWindow!=='') {
		// if a new Window name is specified, then it will
		// open in a new Window.
		window.open(targetURL,targetWindow,'resizable=1,status=1,menubar=1,toolbar=1,scrollbars=1,location=1,directories=1,width=600,height=400,top=60,left=60');
		// if we open a new window, then we have to re-set
		// the select box to the first option
		// which should have no value
		ob.selectedIndex = 0;
	} else {
		// or else it will open in the current window        
		window.open(targetURL,'_top')
    }
}

/*
 * init() initializes the header navigation.
 *
 */
function init_header() {
	cssjsmenu('navbar');
	if (document.getElementById) {
		var kill = document.getElementById('hoverJS'); 
		kill.disabled = true;
	}
}

// Set the init functions for event onload
addLoadEvent(init_header);

//]]>