function createXMLHttpRequest() {

  var xmlReq = false;

  // branch for native XMLHttpRequest object
  if(window.XMLHttpRequest) {

    try {
      xmlReq = new XMLHttpRequest();
    } catch(e) {
      xmlReq = false;
    }

  // branch for IE/Windows ActiveX version
  } else if(window.ActiveXObject) {
    try {
      xmlReq = new  ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
      try {
        xmlReq = new  ActiveXObject("Microsoft.XMLHTTP");
      } catch(e) {
        xmlReq = false;
      }
    }
  }

  return xmlReq;


}


// open needs url
function getwork(strURL){

    document.getElementById('result').innerHTML = '<table width="100%" height="110"><tr align="center"><td align="center" valign="middle"><img src="/auth/auth_load.gif" id="ajax"></td></tr></table>';
 var reqr = createXMLHttpRequest(); // fuction to get xmlhttp object
     if (reqr){
           reqr.onreadystatechange = function(){
           if (reqr.readyState == 4) { //data is retrieved from server
             if (reqr.status == 200 || reqr.status == "OK") { // which reprents ok status
             document.getElementById('result').innerHTML=reqr.responseText;
             }else{ alert("got problem while using XMLHTTP:\n " + reqr.statusText); }
             }
           }

     reqr.open("GET", strURL, true); //open url using post method
     reqr.send(null);
     }
}
