function ajax(filename, post, replace, loadingImage, debug)
{
	this.filename = filename;
	this.post = post;
	this.replace = replace;
	this.loadingImage = loadingImage;
	if(loadingImage != null)
	{
		loadingImage.style.display = "";
	}
	try{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}    
			catch (e)
			{
				return false;
			}
		}
	}
	this.http = xmlHttp;	
	this.http.onreadystatechange=
	function(){
		if(this.http.readyState==4)
		{
			if (this.replace != null)
			{
				this.replace.innerHTML = this.http.responseText;
				
				if(this.loadingImage != null)
				{
					this.loadingImage.style.display = "none";
				}
			}
		}
	}
	if (this.post != null) 
	{
		this.http.open("POST",this.filename,true);
		this.http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
		this.http.send(this.post);
	}
	else
	{
		this.http.open("GET",this.filename,true);
		this.http.send(null);
	}
}