function ajax_request()
{
	this.isIE=false;
	this.allow_use=use_enhanced_js?true:false;
	this.xmlhandler=null;
	this.error_string='';
	this.nocache=true;
	this.do_request_functon=function(){};
	this.loading_fired=0;
	this.centerdiv=null;
}
ajax_request.prototype.xml_init=function()
	{
		try
		{
			this.xmlhandler=new XMLHttpRequest();
			this.ie=false;
			this.allow_use=true;
			return true;
		}
		catch(e)
		{
			try
			{
				this.xmlhandler=new ActiveXObject('Microsoft.XMLHTTP');
				this.ie=true;
				this.allow_use=true;
				return true;
			}
			catch(e)
			{
				this.ie=true;
				this.allow_use=false;
				return false;
			}
		}
		};
ajax_request.prototype.process=function(url,type,post)
	{
		alert(url);
		type=type=="POST"?"POST":"GET";
		alert(this.nocache);
		if(this.nocache==true&&type=='GET')
		{
			alert("3");
			url=this.nocache_url(url);
			alert(url);
		}
		if(!this.xmlhandler)
		{

			this.xml_init();
		}
		if(!this.readystate_not_ready())
		{

			this.xmlhandler.open(type,url,true);
			if(type=="GET")
			{
			alert("1");
				this.xmlhandler.send(null);
			}
			else
			{
			alert("2");
				if(typeof(this.xmlhandler.setRequestHeader)!="undefined")
				{
					this.xmlhandler.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				}
				this.xmlhandler.send(post);
			}
			if(this.xmlhandler.readyState==4&&this.xmlhandler.status==200)
			{
				return true;
			}
		}
		return false;
};

ajax_request.prototype.nocache_url=function(url)
{
	var sep=(-1<url.indexOf("?"))?"&":"?";
	var mydate=new Date();
	var newurl=url+sep+"__="+mydate.getTime();
	return newurl;
};


ajax_request.prototype.readystate_not_ready=function()
{
	return(this.xmlhandler.readyState&&(this.xmlhandler.readyState<4));
};
ajax_request.prototype.readystate_ready_and_ok=function()
{
	return(this.xmlhandler.readyState==4&&this.xmlhandler.status==200)?true:false;
};
ajax_request.prototype.onreadystatechange=function(event)
{
	if(!this.xmlhandler){this.xml_init();
	}
	if(typeof(event)=='function')
	{
		this.xmlhandler.onreadystatechange=event;
	}
};


