epiton.utils.Ajax=function(){
	var _public={
		ResultMap:function(){
			this.success=true;
		},
		createXMLHttpRequest: function() {
			try { return new XMLHttpRequest(); } catch(e) {}
			try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
			try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
			return null;
		},
		get: function(path,onReadyFunc){
			var xhReq = epiton.utils.Ajax.createXMLHttpRequest();
			function onReadReady(){
				if(xhReq.readyState==4){
					onReadyFunc(xhReq);
				}
			}
			xhReq.open("GET", path, true);
			if(onReadyFunc){
				xhReq.onreadystatechange = onReadReady;
			}
			xhReq.send(null);
		},
		post: function(path, onReadyFunc, body){
			var xhReq = epiton.utils.Ajax.createXMLHttpRequest();
			function onReadReady(){
				if(xhReq.readyState==4){
					onReadyFunc(xhReq);
				}
			}
			xhReq.open('POST', path, true);
			xhReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xhReq.setRequestHeader("Content-length", body.length);
			xhReq.setRequestHeader("Connection", "close");
			if(onReadyFunc){
				xhReq.onreadystatechange = onReadReady;
			}
			xhReq.send(body);
		}
	}
	
	return _public;
}();
epiton.classloader.setLoaded("utils.ajax");