﻿// JScript File
var __xmlHttpRequest = window.XMLHttpRequest;
window.XMLHttpRequest = XMLHttpRequest = function()
{
    var _xmlHttp = null;
    if (!__xmlHttpRequest)
    {
        try
        {
            _xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(ex) {}
    }
    else
    {
        _xmlHttp = new __xmlHttpRequest();
    }
    
    if (!_xmlHttp) return null;
    
    this.abort = function() {return _xmlHttp.abort();}
    this.getAllResponseHeaders = function() {return _xmlHttp.getAllResponseHeaders();}
    this.getResponseHeader = function(header) {return _xmlHttp.getResponseHeader(header);}
    this.open = function(method, url, async, user, password)
    {
        return _xmlHttp.open(method, url, false, user, password);
    }
    this.send = function(body)
    {
        _xmlHttp.send(body);
        this.readyState = _xmlHttp.readyState;
        this.responseBody = _xmlHttp.responseBody;
        this.responseStream = _xmlHttp.responseStream;
        this.responseText = _xmlHttp.responseText;
        this.onreadystatechange();
    }
    
    this.setRequestHeader = function(name, value) {return _xmlHttp.setRequestHeader(name, value);}
}

