// general form handling functions
 
 function resetFields(whichform) {
	 for (var i=0; i<whichform.elements.length; i++) {
		 var element = whichform.elements[i];
		 if (element.type == "button") continue;
		 if (element.getAttribute("type") == "submit") continue;
		 if (element.getAttribute("type") == "reset") 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);
	 }
 }
 

//run the necessary functions

loadEvent(prepareForms);
