/*
    Code for getting call count with XHR + animation code
*/
var countertimer=null;
function startcallcounter() {
  var xmlHttp;
  countertimer=null;
  try {
    xmlHttp = new XMLHttpRequest();
  } catch (e) {
    try {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        alert("");
        return false;
      }
    }
  }
  xmlHttp.onreadystatechange = function() {
    if(xmlHttp.readyState == 4)
      //jQuery('#callcounter').html(xmlHttp.responseText);
      newcallcount(parseInt(xmlHttp.responseText));
      if (countertimer==null) { 
        countertimer=setTimeout('startcallcounter()',3000);
      }
  }
  xmlHttp.open("GET", "callcount.php", true);
  xmlHttp.send(null);
}

