// JavaScript Document

	var xmlHttpfunction;


	
	function GetXmlHttpObject()
	{
		var xmlHttp=null;
		try
		 {
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
		 }
		catch (e)
		 {
		 //Internet Explorer
		 try
		  {
		  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		 catch (e)
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		 }
		return xmlHttp;
	}
	
	

	function actionAjaxPost(url, params, responseFunction)
	{
		//Get current date
		var thisdate = new Date();
		
		//Grab teh url and add a random number to the end of it to bypass IEs stupid caching problem
		params += "&timecalled=" +  thisdate.getTime();
		

		
		url = "" + url;
		
	//	alert(url);
		//alert(params);
		
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert("ERROR: Could not initialise AJAX");
			return;
		}


		xmlHttp.open("POST", url, true);


		//Send the proper header information along with the request
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");

		eval("xmlHttp.onreadystatechange=" + responseFunction + ";");


		
		

		xmlHttp.send(params);
	}

	function actionAjax(url, responseFunction)
	{
		//Get current date
		var thisdate = new Date();
		
		//Grab teh url and add a random number to the end of it to bypass IEs stupid caching problem
		url = "" + url + "&timecalled=" +  thisdate.getTime();
		
		
		
	//	alert(url);
		
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert("ERROR: Could not initialise AJAX");
			return;
		}
		
		eval("xmlHttp.onreadystatechange=" + responseFunction + ";");
		
		
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	