if (window.addEventListener)
	window.addEventListener("load",setListeners, false);
else if(window.attachEvent) 
	window.attachEvent("onload",setListeners);
else 
	window.onload=setListeners();
function setListeners(){
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
	
	inputList = document.getElementsByTagName("INPUT");
	for(i=0;i<inputList.length;i++){
		if(browser=="Microsoft Internet Explorer")
			inputList[i].attachEvent("onpropertychange",restoreStyles);
		else
			inputList[i].addEventListener("DOMAttrModified", restoreStylesMozilla, false);
		inputList[i].style.backgroundColor = "";
	}
	selectList = document.getElementsByTagName("SELECT");
	for(i=0;i<selectList.length;i++){
		if(browser=="Microsoft Internet Explorer")
			selectList[i].attachEvent("onpropertychange",restoreStylesSelect);
		else
			selectList[i].addEventListener("DOMAttrModified", restoreStylesSelectMozilla, false);
		selectList[i].style.backgroundColor = "";
	}
}

function restoreStyles(){
	if(event.srcElement.style.backgroundColor != "")
		event.srcElement.style.backgroundColor = "";
}
function restoreStylesMozilla(evt){
	if(evt.newValue != "")
		document.getElementById(evt.target.id).style.backgroundColor = "";
}
function restoreStylesSelect(){
	if(event.srcElement.style.backgroundColor != "")
		event.srcElement.style.backgroundColor = "";
}
function restoreStylesSelectMozilla(evt){
	if(evt.newValue != "")
		document.getElementById(evt.target.id).style.backgroundColor = "";
}