function FAjax(http){
	this.http = http;
	this.errors = new Array();
	this.responseText = "";

	this.State = function(){
		try{return this.http.readyState;}
		catch(e){this.errors.push(e.toString);return "";}
	}
	this.Content = function(){
		try{return this.http.responseText;}
		catch(e){this.errors.push(e.toString);return "";}
	}
	this.Request = function(url,method,async,postdata){
	    try{
			if(!this.Open(url,method,async)) return false;
			if(method=="POST"){
			    this.http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			}
			if(!this.Send(postdata)) return false;
			return true;
		}catch(e){this.errors.push(e.toString);return false;}
		return false;
	}
	this.Open = function(url,method,async){
		try{this.http.open(method,url,async);}
		catch(e){this.errors.push(e.toString);return false;}
		return true;
	}
	this.Send = function(arg){
		try{this.http.send(arg);}
		catch(e){this.errors.push(e.toString);return false;}
		return true;
	}
}

function FCreateAjax(){
	try{
	    var requester = TryFunctions(
	        function(){return new XMLHttpRequest();},
			function(){if(!ActiveXObject) return null; return new ActiveXObject("Msxml2.XMLHTTP");},
			function(){if(!ActiveXObject) return null; return new ActiveXObject("Microsoft.XMLHTTP");}
		);
		if(!requester) return null;
		return new FAjax(requester);
	}catch(e){return null;}
}

function TryFunctions(){
	var res;
	for(var i=0;i<arguments.length;i++){
	    try{res = arguments[i]();}
		catch(e){continue;}
	    if(res){return res;}
	}
	return null;
}