function Ajax()
{
	try
	{
		this.obj=new XMLHttpRequest()
	}
	catch(e)
	{
		try
		{
			this.obj=new ActiveXObject('Msxml2.XMLHTTP')
		}
		catch(e)
		{
			try
			{
				this.obj=new ActiveXObject('Microsoft.XMLHTTP')
			}
			catch(e)
			{
				this.obj=null
			}
		}
	}
}

Ajax.prototype.callback=function(){alert('No callback defined')}
Ajax.prototype.response=''
Ajax.prototype.parse=function(obj,loading)
{
	if(obj.obj.readyState==4&&obj.obj.status==200)
	{
		obj.response=this.obj.responseText
		obj.callback()
	}
	else if(obj.obj.readyState==1)
	{
		obj.response='LOADING'
		obj.callback()
	}
}
Ajax.prototype.send=function(url,params,method,callback,loading)
{
	url='../../../../../'+url
	this.callback=callback
	var obj=this
	if(arguments.length<2)
		loading=true
	if(method=='get')
	{
		this.obj.open('get',url+(params.length?'?'+params:''),true)
		this.obj.onreadystatechange=function(){obj.parse(obj,loading)}
		this.obj.send(null)
	}
	else if(method=='post')
	{
		this.obj.open('post',url,true)
		this.obj.onreadystatechange=function(){obj.parse(obj)}
		this.obj.setRequestHeader('Content-type','application/x-www-form-urlencoded')
		this.obj.setRequestHeader('Content-length',params.length)
		this.obj.setRequestHeader('Connection','close')
		this.obj.send(params)
	}
}
