﻿var XMLHttpArray = [function() {return new XMLHttpRequest()},function() {return new ActiveXObject("Msxml2.XMLHTTP")},function() {return new ActiveXObject("Msxml2.XMLHTTP")},function() {return new ActiveXObject("Microsoft.XMLHTTP")}];
function createXMLHTTPObject(){ var xmlhttp = false;for(var i=0; i<XMLHttpArray.length; i++){try{xmlhttp = XMLHttpArray[i]();}catch(e){continue;}break;}return xmlhttp;}
function AjaxRequest(url,callback,method){
        var req = createXMLHTTPObject();
        req.onreadystatechange= function(){if(req.readyState != 4) return;if(req.status != 200) return;callback(req);}
        req.open(method,url,true);
        req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
        req.send(null);
}
function AjaxResponse(req){
        var respXML=req.responseXML;
        if(!respXML) return;
        var respVAL=respXML.getElementsByTagName('family')[0].getAttribute('result');
        document.getElementById("status").innerHTML += respVAL;
}
function ClearResponse(){
        mdiv=document.getElementById("status");
        mdiv.innerHTML = "";
}
function MakeRequst(){
        AjaxRequest("ajax.xml",AjaxResponse,"get");
}
