// XMLHttpRequest
HttpRequest.XMLHttpRequest =
	(window.XMLHttpRequest) ? XMLHttpRequest :
	(window.ActiveXObject)  ? function () {	// IE
		var msxmls = new Array(
			'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0',
			'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0',
			'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP');
		for (var i = 0; i < msxmls.length; i++) {
			try { return new ActiveXObject( msxmls[i] ); }
			catch (e) {}
		}
		return null;
	} : null;


// HttpRequest
function HttpRequest (method, url, funcs, cache) {
    this.req = new HttpRequest.XMLHttpRequest();    // XMLHttpRequest 
    if (!this.req) return null; 

    // call function 
    this.func = (typeof funcs == 'object') ? funcs : []; 
    this.req.onreadystatechange = function (self) {
    	return function () {
	        var rs = self.req.readyState; 
	        if (self.func[rs]) self.func[rs](self.req); 
		};
    }(this);

    // open and send 
    this.req.open(method, url, true);
	if (!cache) this.req.setRequestHeader('If-Modified-Since', new Date());	// no cache ?
    this.req.send(null); 
    return this; 
};
