function Ajax()
{
	this.req = null;
	this.url = null;
	this.method = "GET";
	this.async = true;
	this.postData = null;
	this.mimeType = null;
	
	this.responseFormat = 'text';	// 'text', 'xml', or 'object'
	this.responseText = null;
	this.responseXML = null;
	
	this.handleResp = null;
	this.handleErr = null;
	
	// ???
	this.readyState = null;
	this.status = null;
	this.statusText = "";
	
	
	
	/*
	*	Default function to handle a Valid Server response
	*/
	this.init = function()
	{
		if(!this.req) {
			try {
				// Try to create object for Firefox, Safari, IE7, etc.
				this.req = new XMLHttpRequest();
			}
			catch(e) {
				try {
					// Try to create object for later versions of IE.
					this.req = new ActiveXObject('MSXML2.XMLHTTP');
				}
				catch(e) {
					try {
						// Try to create object for early versions of IE.
						this.req = new ActiveXObject('Microsoft.XMLHTTP');
					}
					catch(e) {
						// Could not create an XMLHttpRequest object.
						this.req = null;
					}
				}
			}
		}
		
		//	Return the cuurent value
		return this.req;
	}
	
	
	
	/*
	*	
	*/
	this.doReq = function()
	{
		// Validate that the Request object exist
		// Else the Browser does not support Ajax
		if(!this.init()) {
			alert('Could not create XMLHttpRequest object.');
			return;
		}
		
		// Open the connection
		this.req.open(this.method, this.url, this.async);
		
		// Listen the server response
		var self = this; // Fix loss-of-scope in inner function
		this.req.onreadystatechange = function() {
			var resp = null;
			if(self.req.readyState == 4) {
				switch(self.responseFormat) {
					case 'text':
						resp = self.req.responseText;
						break;
					case 'xml':
						resp = self.req.responseXML;
						break;
					case 'object':
						resp = req;
						break;
				}
				
				// Validate the server response type
				if(self.req.status >= 200 && self.req.status <= 299) {
					self.handleResp(resp);
				}else {
					self.handleErr(resp);
				}
			}
		}
		
		// Send data to the server
		this.req.send(this.postData);
	}
	
	
	
	/*
	*	Default function to handle a Valid Server response
	*/
	this.handleResp = function(resp)
	{
		alert("GOOD\n" + resp);
	}
	
	
	
	/*
	*	Default function to handle a Server response Error
	*/
	this.handleErr = function(resp)
	{
		alert("ERROR\n" + resp);
	}
	
	

	
	
	/*
	*	Validate that the code use a valide type of data
	*	when the type will be set
	*	Possible return value | 'text' or 'xml' or 'object'
	*/
	this.validateFormat = function(formatType)
	{
		if(formatType && typeof(formatType) == "string") {
			var str = formatType.toLowerCase();
			if(str == "xml" || str == "object") { return str; }
		}
		
		return "text";
	}

	
	
	/*
	*	Function used to set vars before doing the connection
	*	with the server
	*/
	this.doGet = function(url, hand, format)
	{

		if(hand && typeof(hand) == "function") { this.handleResp = hand; }
		this.url = url;
		this.responseFormat = this.validateFormat(format);
		this.doReq();
	}
	
}


