function AsyncRequest(){
	this.method;
	this.url;
	this.cache=false;
	this.data;
	this.callback;
	this.onError=null;
	this.xmlHttp=new function(){
		try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){}
		try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}
		try{return new XMLHttpRequest();}catch(e){}
		alert("XMLHttpRequest not supported. Please contact technical support.");
		return null;
	}
	this.send=function(){
		with(this){
			if(method=="GET"){
				if(data.left(1)!='?'){
					url=url+"?"+data;
				}else{
					url=url+data;
				}
				xmlHttp.open(method,url,true);
			}else{
				xmlHttp.open(method,url,true);
			}
			xmlHttp.onreadystatechange=function(){
				if(xmlHttp.readyState==4){
					var responseText=xmlHttp.responseText;
					switch(xmlHttp.status){
						case 404:
							if(onError==null){
								alert('Page Not Found. The requested url \''+url+'\' could not be found.');
							}else{
								onError('Page Not Found. The requested url \''+url+'\' could not be found.');
							}
						break;
						case 405:
							if(onError==null){
								alert('Cannot post form data to this page. The requested url \''+url+'\' could be missing.');
							}else{
								onError('Cannot post form data to this page. The requested url \''+url+'\' could be missing.');
							}
						break;
						case 500:
							if(onError==null){
								alert(responseText);
							}else{
								onError(responseText);
							}
						break;
						case 200:
							if(responseText.indexOf('Error:')>-1||responseText.indexOf('Debug:')>-1){
								if(onError==null){
									alert(responseText);
								}else{
									onError(responseText);
								}
							}else{
								callback(responseText);
							}
						break;
						default:
							if(onError==null){
								// alert('Undefined error code: '+xmlHttp.status+'. Please report this to technical support');
								// alert(responseText);
							}else{
								onError(responseText);
							}
						break;
					}
				}
			}
			xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			if(!cache&&method!="POST"){
				xmlHttp.setRequestHeader('If-Modified-Since','Mon, 1 Jan 1996 00:00:00 GMT');
			}
			if(method=="GET"){
				xmlHttp.send(null);
			}else{
				xmlHttp.send(data);
			}
		}
	}
}
function $(id){return document.getElementById(id);}