function createXMLHttpRequest(){
	try{
		xmlHttp=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
	}catch(e){
		alert('There was a problem creating the XMLHttpRequest object'); 
	}
	return xmlHttp;
}

function createXMLHttpRequest1(){
	try{
		xmlHttp1=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
	}catch(e){
		alert('There was a problem creating the XMLHttpRequest object'); 
	}
	return xmlHttp1;
}



function updateStat(){
    var xmlHttp = createXMLHttpRequest();
	xmlHttp.open("POST","include/moduleStat.asp",false);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
	xmlHttp.setRequestHeader('Content-length', '0');
	xmlHttp.send('');
	//xmlHttp.onreadystatechange=function(){ 
	if(xmlHttp.readyState==4&&xmlHttp.status==200){			

			document.getElementById("updateStat").innerHTML=xmlHttp.responseText;
  	        setTimeout("updateStat()", 500000);
		}

	//}
	//xmlHttp.send(null);
}

function getkey(e)
{
if (window.event)
   return window.event.keyCode;
else if (e)
   return e.which;
else
   return null;
}

function goodchars(e, goods,keyValue)
{
	
var key, keychar;
key = getkey(e);
if (key == null) return true;

// get character
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();
goods = goods.toLowerCase();

// check goodkeys
if (goods.indexOf(keychar) != -1)
	return true;

// control keys
if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
   return true;

// else return false
return false;
}
