function xhttp(){
	function fetch(inURI, inCall){
		var
			inMethod=(arguments[0].method)?arguments[0].method:'GET',
			inType=(arguments[0].type)?arguments[0].type:'XML',
			inErrorStr=(arguments[0].errorString)?arguments[0].errorString:'something broke',
			inIsAsync=(arguments[0].isAsync)?arguments[0].isAsync:true,
			inCache=(arguments[0].cache)?arguments[0].cache:null,
			data = null;
			
		if (inCache){
			switch(inCache){
				case(inCache=false):
					var xCache = new Date().getTime();
				break;
				default:
					var xCache = null;
				break;
			}
		}

		try{
			var req = new XMLHttpRequest();
			try{
				req.overrideMimeType('text/xml');
			}catch(e){
				e = null;
			}
		}catch(e){
			try{
				var req = new ActiveXObject('Msxml2.XMLHTTP');
			}catch(E){
				try{
					var req = new ActiveXObject('Microsoft.XMLHTTP');
				}catch(e){
					eval(inCall + '(inErrorStr)');
				}
			}
		}

		switch(inMethod){
			case(inMethod='POST'):
				data = (inURI.split('?')[1])?inURI.split('?')[1]+'&xCache=' + xCache : 'xCache=' + xCache;
				req.open('POST', inURI, inIsAsync);
			break;
			default:
				data=null;
				inURI += (inURI.split('?')[1])?'&xCache=' + xCache : '?xCache=' + xCache;
				req.open('GET', inURI, inIsAsync);
			break;
		}

		req.onreadystatechange=function(){
			// only if req shows "loaded"
			if (req.readyState == 4){
				// only if "OK"
				if (req.status == 200){
					responseType = (inType=='text')?'responseText':'responseXML';
					eval(inCall + '(req.' + responseType + ')');
				}else{
					eval(inCall + '(inErrorStr)');
				}
			}
		}
		req.send(data);
	}
	this.fetch = fetch;
}