function addClass(target, theClass) {
	if (!target.className) 
		target.className = theClass;
	else 
		if (target.className.indexOf(theClass) == -1) target.className += ' ' + theClass;
}

function removeClass(target, theClass) {
	var pattern = new RegExp("(^| )" + theClass + "( |$)");
	target.className = target.className.replace(pattern, "$1");
	target.className = target.className.replace(/ $/, "");
}


function onWindowLoad() {
	if (!document.getElementsByTagName || !document.getElementById) return false;	
	var ie6=(document.body.className.indexOf("ie6") >= 0);
	var obj=document.getElementsByTagName("input");
	for (i=0; i<obj.length; i++) {
		if (obj[i].type=="submit") {
			obj[i].onmouseover=function() { this.style.backgroundPosition='left bottom'; }
			obj[i].onmouseout=function() { this.style.backgroundPosition='left top'; }
		}
		if (obj[i].value!='') 
			obj[i].onfocus=function() { 
				if (this.className.indexOf('value_do_not_clear')==-1) {
					this.value=''; 
					addClass(this, 'value_do_not_clear');
				}
			}
	}
}

window.onload=onWindowLoad;

