    if(window.attachEvent)
    {//Attach to onload event in IE
        window.attachEvent("onload",resetStyles);
    }
    else
    {//Attach to load event in Other Browser
        window.addEventListener("load",resetStyles,false);
     //Attach to focus event in other browsers to disable
     //background color change in tabbed browsing 
        window.addEventListener("focus",resetStyles,false);  
    }

    function resetStyles()
    {
        resetStyle('input');
        resetStyle('select');
    }

    function resetStyle(inputType)
    {
        var count=document.getElementsByTagName(inputType);
        for(var i=0;i<count.length;i++)
        {
            if(window.attachEvent)
            {//Attach to onpropertychange event in IE
                count[i].attachEvent('onpropertychange',resetBC);
            }
            else
            {//Apply the style reset onload
                resetOther(count[i]);
            }
        }
    }
   
    function resetOther(El)
    {
        if(El.style.backgroundColor!='')
            El.style.backgroundColor='';
    }
    function resetBC()
    {
        if(event.srcElement.style.backgroundColor!='')
            event.srcElement.style.backgroundColor='';
    }