function silentErrorHandler() {return true;}
window.onerror=silentErrorHandler;

alertTime=4;
chanceAlert=1; 

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
alertCount=0;
function initAlert(){
	if(!ns && !ie && !w3) return;
	if(ie)		alertDiv=eval('document.all.AlertDiv.style');
	else if(ns)	alertDiv=eval('document.layers["AlertDiv"]');
	else if(w3)	alertDiv=eval('document.getElementById("AlertDiv").style');
	randAlert=Math.ceil(Math.random()*chanceAlert);
        if (ie||w3)
        alertDiv.visibility="visible";
        else
        alertDiv.visibility ="show";
	if(randAlert==1) showAlert();
}
function showAlert(){
if(alertCount<alertTime*10){alertCount+=1;
	if (ie){documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-20;
	documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;}	
	else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
	documentHeight=window.innerHeight/2+window.pageYOffset-20;} 
	else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
	documentHeight=self.innerHeight/2+window.pageYOffset-20;} 
	alertDiv.left=documentWidth-200+calunit;alertDiv.top =documentHeight-100+calunit;
	setTimeout("showAlert()",100);}else closeAlert();
}
function closeAlert(){
if (ie||w3)
alertDiv.display="none";
else
alertDiv.visibility ="hide";
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


onload=initAlert;
  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);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }


