function ajaxRequest(){

 var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
 if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
  for (var i=0; i<activexmodes.length; i++){
   try{
    return new ActiveXObject(activexmodes[i])
   }
   catch(e){
    //suppress error
   }
  }
 }
 else if (window.XMLHttpRequest) // if Mozilla, Safari etc
  return new XMLHttpRequest()
 else
  return false
}



function GetDataByPost(dataSource,dataOutput,dataParameters){
//alert(dataParameters);
document.getElementById(dataOutput).innerHTML = "<img src='http://acp.primegaming.com/images/wait.gif'>";
var mypostrequest=new ajaxRequest()
mypostrequest.onreadystatechange=function(){
 if (mypostrequest.readyState==4){
  if (mypostrequest.status==200 || mypostrequest.status==500 || window.location.href.indexOf("http")==-1){
	if (mypostrequest.responseText == "No Session")
	{
		document.location.href="index.asp";
		return
	}
	
	else
	{
		//alert(dataSource);
		document.getElementById(dataOutput).innerHTML=mypostrequest.responseText
	}
  }
  else{
   alert("An error has occured making the request")
  }
 }
}

var parameters=dataParameters;
var ClearCache = (new Date()).getTime();
//alert(ClearCache);
mypostrequest.open("POST", dataSource + "?" + ClearCache, true)
mypostrequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
mypostrequest.send(parameters)
 
}
