function createRequestObject() {
  var ro;
  try {ro = new XMLHttpRequest();}
  catch(e) {
    try {ro = new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e) {
      try {ro = new ActiveXObject("Microsoft.XMLHTTP");}
      catch(e) {
        alert("Your browser does not support AJAX!");
        return false;
      }
    }
  }
  return ro;
}

var newHTTP = createRequestObject(); 
var theForm;


function postLogin(theID, thePass){
	
	//alert('theid='+theID+'thepass='+thePass);
	newHTTP.open('get', 'loginbyajax.php?theid='+theID+'&thepass='+thePass);
	//newHTTP.open('get', 'loginbyajax.php');
	newHTTP.onreadystatechange = getLogin;
	newHTTP.send(null);
}

function getLogin(){
	if(newHTTP.readyState == 4){
		
		if(newHTTP.status == 200){
			var response = newHTTP.responseText;
			//alert(response);
			if(response == 2){
				//document.getElementById('site_error_msg').innerHTML = "Login Failed! Please check your username or password and try again.";	
				//alert("Login Failed! Please check your username or password and try again.");
			}
			//alert(response);
			//document.login_form.submit();	
			document.testFrm.submit();
			return false;
		}
	}
}
