function XmlHttp(target) {
  this.target = target;
  this.request = null;
  this.remembers = {};
  this.currentPage = 'home';
  this.requestedPage = null;
}

XmlHttp.prototype.onStateChanged = function() {
  if (this.request.readyState == 4) {
    if (this.request.status == 200) {
      this.currentPage = this.requestedPage;
      FindDOM.getObject(this.target).innerHTML = this.request.responseText;
    } else {
      location.href = 'index.php?page=' + pageName;  
    }
  }
};

XmlHttp.prototype.getPage = function(pageName) {
  this.request = window.XMLHttpRequest ? new XMLHttpRequest() : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : null;
  if (this.request === null || pageName == 'blog' || pageName == 'group') {
    location.href = 'index.php?page=' + pageName;
  } else {
    this.request.onreadystatechange = (function(refThis) {
      return function() {
        refThis.onStateChanged();
      }
    })(this);
    this.requestedPage = pageName;
    this.request.open('POST', 'index.php?page=' + pageName, true);
    this.request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    this.request.send('div_only=true');
  }
};