var Ajax = new Object();
Ajax.showMessage=1;
Ajax.Message='';

Ajax.Request = function(url, callbackMethod)
{
	Ajax.request = Ajax.createRequestObject();
	Ajax.request.onreadystatechange = callbackMethod;
	Ajax.request.open("POST", url, true);
	Ajax.request.send(url);
}

Ajax.setMessage = function (message)
{
	Ajax.Message=message;
}

Ajax.setShowMessage = function (m)
{
	Ajax.showMessage=m;
}

Ajax.createRequestObject = function()
{
	var obj;
	if(window.XMLHttpRequest)
	{
		obj = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		obj = new ActiveXObject("MSXML2.XMLHTTP");
	}
	return obj;
}

Ajax.CheckReadyState = function(obj)
{
//	alert(Ajax.showMessage);
	if ( Ajax.showMessage == 0 ) 
	{	
		//document.getElementById('transLoading').style.display = "none";
	}
	else
	{
		//document.getElementById('transLoading').style.display = "none";
	}

	//var newwidth  = (Page.top + Page.height/2)-100;
	//var newheight = (Page.width/2-75);

	if(obj.readyState < 4) {	
		//document.getElementById('loadingbox').style.top = Math.round(newwidth)+"px";
		//document.getElementById('loadingbox').style.left = Math.round(newheight)+"px";
		//document.getElementById('loadingbox').style.position = "absolute";
		//document.getElementById('loadingbox').innerHTML = '<table border=0 cellpadding=0 cellspacing=1 width=100 bgcolor="#000000"><tr><td align=center bgcolor="#ffffff" class=loading height="22px"><font color="#ff0000">Fetching..</font></td></tr></table>';
	}
	//if(obj.readyState == 1) { document.getElementById('loading').innerHTML = "Loading..."; }
	//if(obj.readyState == 2) { document.getElementById('loading').innerHTML = "Loading..."; }
	//if(obj.readyState == 3) { document.getElementById('loading').innerHTML = "Loading..."; }
	if( obj.readyState == 4 )
	{
		if(obj.status == 200)
		{
			return true;
		}
	}
}


function PostAjaxNew(strURL, pMethodName) 
{
	var xmlHttpReq = false;
	var self = this;

	if (window.XMLHttpRequest) 
	{
		self.xmlHttpReq = new XMLHttpRequest();
	}
	else if (window.ActiveXObject) 
	{
		self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}

	self.xmlHttpReq.open('get', strURL, true);
	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	self.xmlHttpReq.onreadystatechange = function() 
	{
		if(self.xmlHttpReq.readyState == 4) 
		{
			pContent = self.xmlHttpReq.responseText;
			eval(pMethodName + '("' + pContent + '")');			
		}
	}
	self.xmlHttpReq.send(null);
}

function createRequestObject(){
	var xmlHttp;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();

	}catch (e)	{
		// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e)	{
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e)	{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}

	return xmlHttp;

}//createRequestObject
