﻿var box = {
    obj : GetHttpRequest(),//new XMLHttpRequest() == null ? new ActiveXObject("Microsoft.XMLHttp") : new XMLHttpRequest(),
    p : {},
    process : function()
    {
        if(box.obj.readyState == 4 && box.obj.status == 200)
        {
            box.p(box.obj.responseText);
        }
    },
    request : function(page , pp)
    {
        this.p = pp;
        this.obj.open("get" , page , true);
        this.obj.onreadystatechange = this.process;
        this.obj.send(null);
    }
};

var box1 = {
    obj1 : GetHttpRequest(),//new XMLHttpRequest() == null ? new ActiveXObject("Microsoft.XMLHttp") : new XMLHttpRequest(),
    p : {},
    process : function()
    {
        if(box1.obj1.readyState == 4 && box1.obj1.status == 200)
        {
            box1.p(box1.obj1.responseText);
        }
    },
    request : function(page , pp)
    {
        this.p = pp;
        this.obj1.open("get" , page , true);
        this.obj1.onreadystatechange = this.process;
        this.obj1.send(null);
    }
};
var box2 = {
    obj2 : GetHttpRequest(),//new XMLHttpRequest() == null ? new ActiveXObject("Microsoft.XMLHttp") : new XMLHttpRequest(),
    p : {},
    process : function()
    {
        if(box2.obj2.readyState == 4 && box2.obj2.status == 200)
        {
            box2.p(box2.obj2.responseText);
        }
    },
    request : function(page , pp)
    {
        this.p = pp;
        this.obj2.open("get" , page , true);
        this.obj2.onreadystatechange = this.process;
        this.obj2.send(null);
    }
};
var box3 = {
    obj3 : GetHttpRequest(),//new XMLHttpRequest() == null ? new ActiveXObject("Microsoft.XMLHttp") : new XMLHttpRequest(),
    p : {},
    process : function()
    {
        if(box3.obj3.readyState == 4 && box3.obj3.status == 200)
        {
            box3.p(box3.obj3.responseText);
        }
    },
    request : function(page , pp)
    {
        this.p = pp;
        this.obj3.open("get" , page , true);
        this.obj3.onreadystatechange = this.process;
        this.obj3.send(null);
    }
};
var box4 = {
    obj4 : GetHttpRequest(),//new XMLHttpRequest() == null ? new ActiveXObject("Microsoft.XMLHttp") : new XMLHttpRequest(),
    p : {},
    process : function()
    {
        if(box4.obj4.readyState == 4 && box4.obj4.status == 200)
        {
            box4.p(box4.obj4.responseText);
        }
    },
    request : function(page , pp)
    {
        this.p = pp;
        this.obj4.open("get" , page , true);
        this.obj4.onreadystatechange = this.process;
        this.obj4.send(null);
    }
};

function GetHttpRequest()
{
    var effect
    try
    {
        effect = new XMLHttpRequest();
    }
    catch(e)
    {
        effect = new ActiveXObject("Microsoft.XMLHttp");
    }
    return effect;
}