var ajaxdiv = 'reload';
function loadXMLdata(url) {
  if(window.XMLHttpRequest) {
    xmlhttp=new XMLHttpRequest();
    xmlhttp.onreadystatechange=state_Change;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
  }
  else if(window.ActiveXObject) {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if(xmlhttp) {
      xmlhttp.onreadystatechange=state_Change;
      xmlhttp.open("GET",url,true);
      xmlhttp.send();
    }
  }
}
function state_Change() {
  var arr,tmp,i;
  if(xmlhttp.readyState==4) {
    var source = xmlhttp.responseText;
    if(source && source!='') {
      DomWriteIn(ajaxdiv,source);
    }
  }
}
function DomWriteIn(whichid,str) {
  var o;
  o = new getObj(whichid);
  o.obj.innerHTML = str;
}
function getObj(name) {
  if(document.getElementById) {
    this.obj = document.getElementById(name);
    this.style = document.getElementById(name).style;
  }
  else if (document.all) {
    this.obj = document.all[name];
    this.style = document.all[name].style;
  }
  else if (document.layers) {
    this.obj = document.layers[name];
    this.style = document.layers[name];
  }
}
function AjaxReload(uri) {
  timer++;
  loadXMLdata(uri+'?'+timer);
  setTimeout('AjaxReload("'+uri+'")', 2000);
}
