function trim(str) {
return( ("" + str).replace(/^\s+/,'').replace(/\s+$/,'') );
}

function checkFields(fArray, sButton) {
var missinginfo = "";
	for (var i=0; i < fArray.length; i++) {
		if ( trim(fArray[i].value) == null || trim(fArray[i].value) == "" ) {
			missinginfo += "- " + document.getElementById(fArray[i].name).getAttribute('title') + "\n";
			fArray[i].value = "";
			fArray[i].style.backgroundColor = '#ffcccc';
		} else {
			fArray[i].style.backgroundColor = '#ffffff';
		}
	}
	
	if (missinginfo != "") {
		alert("Please complete the required fields before submitting!\n\n" + missinginfo);
		return false;
	} else {
		sButton.disabled = true;
		return true;
	}
}



function selectChange ( url, formName ) {
	var queryName = formName.name;
	var queryValue = formName.options[formName.selectedIndex].value;
	queryString = '&' + queryName + '=' + queryValue;
	location.href =  url + queryString;
}


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

window.onload = startList;