function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function resetFields(whichform) {
	for(var i=0; i<whichform.elements.length; i++) {
		var element = whichform.elements[i];
		if (element.type == "submit" || element.type == "radio" || element.type == "checkbox" || element.type == "textarea") continue; 
		if (!element.defaultValue) continue;
		element.onfocus = function(){
			if(this.value == this.defaultValue) {
				this.value = "";
			}
		}
		element.onblur = function(){			
			if(this.value == "") {
				this.value = this.defaultValue;
			}
		}
	}
}

function prepareForms() {
	for(var i=0; i<document.forms.length; i++){
		var thisform = document.forms[i];
		resetFields(thisform);
	}
}


function startNavigation(){
	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() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}


addLoadEvent(prepareForms);
addLoadEvent(startNavigation);

