function XMLDoc(method, data, async){
	var me=this;
	var req=null;

	if(window.XMLHttpRequest){
		try{
			req=new XMLHttpRequest();
			
			this.request=req;
			this.loadXMLDoc=function(url, loadHandler){
				if(this.request){
					this.request.open(method, url, async);
					if(async) this.request.onreadystatechange=function(){loadHandler(me)};
					this.request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
					
					if(method=='GET')
						this.request.send("");
					else if(method=='POST')
						this.request.send(data);
						
					// This can be dangerous. But it works!
					// If you found a better way to do this, email me at kelvlim88@yahoo.com
					if(!async) loadHandler(me);
				}
			}
		}
		catch(e){
			req=null;
		}
	}
	else if(window.ActiveXObject){
		try{
			req=new ActiveXObject("Msxml2.XMLHTTP");
			
			this.request=req;
			this.loadXMLDoc=function(url, loadHandler){
				if(this.request){
					this.request.open(method, url, async);
					this.request.onreadystatechange=function(){loadHandler(me)};
					this.request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
					
					if(method=='GET')
						this.request.send("");
					else if(method=='POST')
						this.request.send(data);
				}
			}
		}
		catch(e){
			try{
				req=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				req=null;
			}
		}
	}
	else{
		alert("Browser XML support required.");
	}
}
