function AjaxObject() {
  this.XmlHttp = this.GetHttpObject();
}
 
AjaxObject.prototype.GetHttpObject = function() { 
	var xmlhttp;

	/*@cc_on
		@if (@_jscript_version >= 5)
			try {
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e) {
				try {
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch (E) {
					xmlhttp = false;
				}
			}
		@else
			xmlhttp = false;
		@end 
	@*/

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} 
		catch (e) {
			xmlhttp = false;
		}
	}

	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} 
		catch (e) {
			xmlhttp=false;
		}
	}

	return xmlhttp;
}
 
AjaxObject.prototype.Get = function( url ) {
	if( this.XmlHttp ) {
		if ( this.XmlHttp.readyState == 4 || this.XmlHttp.readyState == 0 ) {
			var thisObj = this;
			this.XmlHttp.open( 'GET', url, true );
			this.XmlHttp.onreadystatechange = function() {
				thisObj.ReadyStateChange();
			}
			this.XmlHttp.send( null );
		}
	}
}
	
AjaxObject.prototype.AbortCallBack = function() {
	if( this.XmlHttp )
		this.XmlHttp.abort();
}

AjaxObject.prototype.Free = function() {
	delete this.XmlHttp;
	this.OnLoading = window.undefined;
	this.OnLoaded = window.undefined;
	this.OnInteractive = window.undefined;
	this.OnComplete = window.undefined;
	this.OnAbort = window.undefined;
	this.OnError = window.undefined;
}
 
AjaxObject.prototype.OnLoading = function() {
	// Loading
}
 
AjaxObject.prototype.OnLoaded = function() {
	// Loaded
}
 
AjaxObject.prototype.OnInteractive = function() {
	// Interactive
}
 
AjaxObject.prototype.OnComplete = function( responseText ) {
  // Complete
}
 
AjaxObject.prototype.OnAbort = function() {
  // Abort
}
 
AjaxObject.prototype.OnError = function(status, statusText) {
  // Error
}
 
AjaxObject.prototype.ReadyStateChange = function() {
	switch( this.XmlHttp.readyState ) {
		case 1:
			this.OnLoading();
			break;
		case 2:
			this.OnLoaded();
			break;
		case 3:
			this.OnInteractive();
			break;
		case 4:
			switch( this.XmlHttp.status ) {
				case 0:
					this.OnAbort();
					break;
				case 200:
					this.OnComplete( this.XmlHttp.responseText );
					break;
				default:
					this.OnError( this.XmlHttp.status, this.XmlHttp.statusText, this.XmlHttp.responseText );
					break;
			}
			this.Free();
			break;
	}
}