/* Author: Simon Willison http://simon.incutio.com/archive/2004/05/26/addLoadEvent */
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


/*
This script will add a class value of 'over' to LIs (or any other node specified)
to mimic the :hover pseudo-class that are available in other browsers).

You determine which ID-ed element has your child nodes and which element node to add the class to.
*/

function ieHovers() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("playlists");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}


/* onchange/onsubmit functionality for browse other programs area */
function browseprograms() {
	// find submit button and hide it
	var submitbtn = document.getElementById("browseprograms");
	submitbtn.style.display = "none";
	
	// add an onchange and onsubmit function to the drop down
	var selectseries = document.getElementById("sotherseries");
	selectseries.onchange = function() {
		changetoseries(this);
	}
}

function changetoseries(series) {
	var selectseries = document.getElementById("sotherseries");
	selectvalue = selectseries.value;
	
	location.href = selectvalue;
}

//addLoadEvent(initbios);
addLoadEvent(browseprograms);
addLoadEvent(ieHovers);