function createAjaxObj()
{
	var httprequest=false
	if(window.XMLHttpRequest)
	{ // if Mozilla, Safari etc
		httprequest=new XMLHttpRequest()
		if (httprequest.overrideMimeType)
			httprequest.overrideMimeType('text/xml')
	}
	else if (window.ActiveXObject)
	{ // if IE
		try 
		{
			httprequest=new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e)
		{
			try
			{
				httprequest=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
			}
		}
	}
	return httprequest
}

var ajaxObj=null
function sendAjaxRequest( callback, page, params )
{
	if( ajaxObj != null )
		delete ajaxObj;
		
  ajaxObj = createAjaxObj()

	//0: The request is uninitialized (before you've called open()). 
	//1: The request is set up, but not sent (before you've called send()). 
	//2: The request was sent and is in process (you can usually get content headers from the response at this point). 
	//3: The request is in process; often some partial data is available from the response, but the server isn't finished with its response. 
	//4: The response is complete; you can get the server's response and use it. 
	if( ajaxObj != null && (ajaxObj.readyState == 0 || ajaxObj.readyState == 4) )
	{
	  ajaxObj.onreadystatechange = callback
		if( params.length > 0 )
		{
			page = page + "?" + params
		}
    page = page + "&time=" + (new Date()).getTime();
    
		ajaxObj.open('GET', page, true)
		ajaxObj.send(null)
		}
}

function submitRequest( func, call)
{
  sendAjaxRequest( func, call, "" );
}

