function init(){
	var inp = $A(document.getElementsByTagName( "input" )).map(Element.extend);
	
	for(var i = 0; i < inp.length; i++) {
		if(inp[i].type == 'text') {
			if(inp[i].hasClassName('autoclear')) {
				inp[i].setAttribute('rel',inp[i].defaultValue)
				inp[i].onfocus = function() {
					if(this.value == this.getAttribute('rel')) {
						this.value = '';
						this.setStyle({ color: '#000'});
					} else {
						return false;
					}
				}
				inp[i].onblur = function() {
					if(this.value == '') {
						this.value = this.getAttribute('rel');
						this.setStyle({ color: '#666'});
					} else {
						return false;
					}
				}
				inp[i].ondblclick = function() {
					this.value = this.getAttribute('rel')
				}
			}
		}
	}
}
if(document.childNodes) {
	window.onload = init
}