function AjaxUtil(){
	this.URL="";
	this.Method="GET";
	this.IsAsyn=true;
	this.XmlHttp=false;
	this.PostBack=function(){}
	
	var parameters={};
	var headers={};
	var queryString="";
	
	if(window.XMLHttpRequest){
		this.XmlHttp = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		this.XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else this.XmlHttp=false;
		
	this.SetParameter = function(key,value,overRide){
		var overRide = typeof(overRide)=="undefined" ? true : overRide ;
		if(overRide) parameters[key] = value;
		else queryString += ( "&" + encodeURIComponent(key) + "=" + encodeURIComponent(value) );
	}
	
	this.SetHeader = function(key,value){
		headers[key] = value;
	}
	
	this.Send = function(){
		var key;
		var self = this;
		for(key in parameters) queryString += ( "&" + encodeURIComponent(key) + "=" + encodeURIComponent(parameters[key]) );	
		if(this.XmlHttp){
			this.XmlHttp.onreadystatechange = function(){
				if (self.XmlHttp.readyState == 4){
					if(self.XmlHttp.status == 200) self.PostBack(); 
					else alert("Error occurred \n"+self.XmlHttp.status+" : "+self.XmlHttp.statusText);
				}
			}
			
			switch(this.Method){
				case "GET":
					if(this.URL.indexOf("?")==-1) queryString=queryString.replace(/^&/,"?");
					this.XmlHttp.open("GET",this.URL+queryString,this.IsAsyn);
					for(key in headers) this.XmlHttp.setRequestHeader(key,headers[key]);
					this.XmlHttp.send(null);
					break;
				case "POST":
					queryString=queryString.replace(/^&/,"");
					this.XmlHttp.open("POST",this.URL,this.IsAsyn);
					this.XmlHttp.setRequestHeader("Content-Length",queryString.length);
					this.XmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
					for(key in headers) this.XmlHttp.setRequestHeader(key,headers[key]);
					this.XmlHttp.send(queryString);
					break;
				default:
					alert("The Method Is inCorrect !");
					return;
			}
		}
		else alert("Your Browser Does not Support the XML Http Request!");
	}
}
