function ajaxcall (url, poststring)
{
	this.get 	= function (ajaxobj)
	{
		if (window.XMLHttpRequest)
			var XHR = new XMLHttpRequest();
		else if (window.ActiveXObject)
			var XHR = new ActiveXObject("Microsoft.XMLHTTP");
		XHR.onreadystatechange = function()
		{
			if (XHR.readyState ==2)
			{
				ajaxobj.load(XHR);
			}
			if (XHR.readyState ==4)
			{
				ajaxobj.onload(XHR);
			}
		};
		XHR.open("GET", url, true);
		XHR.send("");
	};
	this.post 	= function (ajaxobj)
	{
		if (window.XMLHttpRequest)
			var XHR = new XMLHttpRequest();
		else if (window.ActiveXObject)
			var XHR = new ActiveXObject("Microsoft.XMLHTTP");
		XHR.open("POST", url, true);
		XHR.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		XHR.onreadystatechange = function()
		{
			if (XHR.readyState ==2)
			{
				ajaxobj.load(XHR);
			}
			if (XHR.readyState ==4)
			{
				ajaxobj.onload(XHR);
			}
		};
		
		XHR.send(poststring);
	};
	this.toJSON	= function (XHR) {
		var json = "json = " + XHR.responseText + ";";
		eval (json);
		return json;
	};

	
	this.load = function ()
	{ };
	this.onload = function ()
	{ };
	if (poststring == undefined)
		this.get(this);
	else
		this.post(this);
}
