if(window.attachEvent)
    window.attachEvent("onload",setListeners);

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    /*inputList = getElementsByClass("competition_editbox","document","INPUT");*/
    for(i=0;i<inputList.length;i++){
        inputList[i].attachEvent("onpropertychange",restoreStyles);
        inputList[i].style.backgroundColor = "#ffffff";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
        selectList[i].attachEvent("onpropertychange",restoreStyles);
        selectList[i].style.backgroundColor = "#ffffff";
    }
}

function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "#ffffff")
        event.srcElement.style.backgroundColor = "#ffffff";
}
