var mReq;
var mLastReqStatus;
function dxml_getsuggest_statechange() {
   if (mReq) {
      if (mReq.readyState == 4) {
         if (mReq.status == 200) {
            var sRes = mReq.responseXML.documentElement;
            if (sRes) {
               var sStatus = sRes.getElementsByTagName('status')[0].firstChild.data;
               var sMsgArea = document.getElementById("dxmlmsg");
               if (sStatus == "regfound") {
                  //do something here


               }
            } else {

               var sMsgArea = document.getElementById("dxmlmsg");
               var sMsg = "message communication problem <span style='cursor:pointer;color:blue;' onclick='dxml_getsuggest()'>try again</span>";
               if (sMsgArea) {
                  sMsgArea.style.background = "#FF0000";
                  sMsgArea.style.visibility = "visible";
                  sMsgArea.innerHTML = sMsg;
               } else {
                  alert("message communication problem");
               }
               mLastReqStatus = false;
               setTimeout('balive_ping()',60000);
            }
         } else {
            if (sMsgArea) {
               sMsgArea = document.getElementById("dxmlmsg");
               sMsgArea.style.background = "#FF0000";
               sMsgArea.style.visibility = "visible";
               sMsgArea.innerHTML = "service communication problem <span style='cursor:pointer;color:blue;' onclick='dxml_getsuggest()'>try again</span>";
            } else {
               alert("service communications problem, will try again");
            }
            mLastReqStatus = false;
            setTimeout('dxml_getsuggest()',60000);
         }
      }
   } else {
      //balive_init();
   }
}
function dxml_getsuggest() {
   if (mReq) {
      mReq.onreadystatechange = dxml_getsuggest_statechange;
      mReq.open("GET","http://www.cisarizona.org/sponsor.php?check",true);
      if (window.XMLHttpRequest) {
         mReq.send(null);
      } else
      if (window.ActiveXObject) {
         mReq.send();
      }
   }
}
function dxml_init() {
   if (window.XMLHttpRequest) {
      mReq = new XMLHttpRequest();
   } else
   if (window.ActiveXObject) {
      mReq = new ActiveXObject("Microsoft.XMLHTTP");
   }
   dxml_getsuggest();
}