var w3c = false;
var ie = false;
var ns = false;
var sa = false;
if (document.getElementById) {
	var w3c = true;
}
if (document.all) {
	var ie = true;
	var ua = window.navigator.userAgent;
	var msie = ua.indexOf ( "MSIE " );
	var ieVer = parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) );
}
if (document.layers) {
	var ns = true;
}
if ((navigator.userAgent).indexOf("Safari")!=-1) {
	var sa = true;
}

//self-submitting select
function selectBrowse(frameName,formName,selectName) {
	var temp = "document." + formName + "." + selectName + ".options[document." + formName + "." + selectName + ".options.selectedIndex].value";
	if (eval (temp) != "do_nothing") {
		if (frameName=="") {
			location.href = eval (temp);
		} else if (frameName=="new") {
			window.open(eval (temp))
		} else {
			temp = frameName + ".location.href = " + temp;
			eval (temp);
		}
	}
}

//add row color on hover to the table
function availSongsTableRows() {
    var within = document.getElementById('availSongsTable');
    if (within) {
        var elem = within.getElementsByTagName('tr');
        for(var i = 0; i < elem.length; i++) {
        		if (elem[i].id == '' || elem[i].id == undefined || elem[i].id == null) {
            	thisOver = elem[i].onmouseover;
           		thisOut = elem[i].onmouseout;
            	availSongsTrId = 'availSongsTr'+i;
            	elem[i].id = availSongsTrId;
            	elem[i].onmouseover = function () {document.getElementById(this.id).style.backgroundColor='#ccc';}
					elem[i].onmouseout = function () {document.getElementById(this.id).style.backgroundColor='#fff';}
				}
        }
    }
}

function onLoadCaller() {
	//call all scripts that should load with the page here
	availSongsTableRows();
}
if (window.addEventListener) {
	window.addEventListener("load", onLoadCaller, false);
} else if (window.attachEvent) {
	window.attachEvent("onload", onLoadCaller);
} else {
	window.onload=onLoadCaller;
}