window.onload = function () {	if (!document.getElementsByTagName) return true;	ourForms = document.getElementsByTagName('form');	var numForms = ourForms.length;	for (var i=0;i<numForms;i++) {		var numFormElements = ourForms[i].elements.length;		for (var j=0;j<numFormElements;j++) {			var el = ourForms[i].elements[j];			if (el.type == "submit") continue;			if (el.type == "text") {				var ourClassName = el.className;				if (ourClassName.match('auto-select') || ourClassName.match('auto-clear') || ourClassName.match('populate')) {									if (el.value == '') el.value = el.title;				}				if (el.className.match('auto-select')) {					el.onfocus = function () {						if (this.value == this.title) this.select();					}					if (el.captureEvents) el.captureEvents(Event.FOCUS);				}				else if (el.className.match('auto-clear')) {					el.onfocus = function () {						if (this.value == this.title) this.value = '';					}					if (el.captureEvents) el.captureEvents(Event.FOCUS);					el.onblur = function () {						if (this.value == '') this.value = this.title;					}					if (el.captureEvents) el.captureEvents(Event.BLUR);				}			}			if (el.type == "textarea") {				var ourClassName = el.className;				if (ourClassName.match('auto-select') || ourClassName.match('auto-clear') || ourClassName.match('populate')) {					if (el.value == '') el.value = el.title;				}				if (el.className.match('auto-select')) {					el.onfocus = function () {						if (this.value == this.title) this.select();					}					if (el.captureEvents) el.captureEvents(Event.FOCUS);				}				else if (el.className.match('auto-clear')) {					el.onfocus = function () {						if (this.value == this.title) this.value = '';					}					if (el.captureEvents) el.captureEvents(Event.FOCUS);					el.onblur = function () {						if (this.value == '') this.value = this.title;					}					if (el.captureEvents) el.captureEvents(Event.BLUR);				}			}		}	}}
