
var getTransferObject = function(){    return null;    };
if(window.ActiveXObject){
    // Check if the browser has support for ActiveXObject (IE Usually)
    try{
        // Check for the new version of XMLHttp compoment
        var x= new ActiveXObject("MSXML2.XMLHTTP");
        getTransferObject = function(){ return new ActiveXObject("MSXML2.XMLHTTP"); }
        delete x;
    }catch(_ex){
        try{ // Check for late version of XMLHTTP compoment
            var x = new ActiveXObject("Microsoft.XMLHTTP");
            getTransferObject = function(){ return new ActiveXObject("Microsoft.XMLHTTP"); }
            delete x;
        }catch(ex){
            // Otherwise the version of IE is too old
        }
    }
}else if(window.XMLHttpRequest){
    // XMLHttpRequest object supported by Opera, Firefox and Safari - may too in IE 7.
    getTransferObject = function(){ return new XMLHttpRequest(); }
}


function include(xUrl,xId) {

var wait_obj =  document.getElementById("wait");
var d_obj = document.getElementById("wait");

if (d_obj.style.display=="") {

d_obj.style.display="none"

}
else
{
wait_obj.style.display = "";

  var xmlhttp = getTransferObject();
  
 
  xmlhttp.open("GET",xUrl + "&r="+Math.random() ,true);
  //xmlhttp.open("GET",xUrl ,true);

//xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=windows-1255";
//xmlhttp.SetRequestHeader("encoding", "windows-1255");
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

   xmlhttp.onreadystatechange=function() {

          if(xmlhttp.readyState==4){
            if(xmlhttp.status==200){
                if (xmlhttp.responseText=="login_err"){ 
                            window.close();
                            }
                
                document.getElementById(xId).innerHTML = xmlhttp.responseText;
                
               d_obj.style.display = "";
               wait_obj.style.display = "none"
          }
        }
  }
  xmlhttp.send(null)

 }
}
