if(window.attachEvent)
window.attachEvent("onload",setListeners);

function setListeners(){
inputList = document.getElementsByTagName("INPUT");
for(i=0;i<inputList.length;i++)
inputList[i].attachEvent("onpropertychange",restoreStyles);
selectList = document.getElementsByTagName("SELECT");
for(i=0;i<selectList.length;i++)
selectList[i].attachEvent("onpropertychange",restoreStyles);
}

function restoreStyles(){
if(event.srcElement.style.backgroundColor != "")
event.srcElement.style.backgroundColor = "";
}

function toggle(theid){
	if(document.getElementById(theid).style.display==''){
		document.getElementById(theid).style.display='none';
	}else{
		document.getElementById(theid).style.display='';
	}
}
function swapimg(theid,orgsrc,newsrc){
	if(document.getElementById(theid).src==orgsrc){
		document.getElementById(theid).src=newsrc;
	}else{
		document.getElementById(theid).src=orgsrc;
	}
}
function swapclass(theid,orgclass,newclass){
	if(theid.className==orgclass){
		theid.className=newclass;
	}else{
		theid.className=orgclass;
	}
}
