function Ajax() {
  this.req = null;
  this.url = null;
  this.status = null;
  this.statusText = '';
  this.method = 'GET';
  this.async = true;
  this.dataPayload = null;
  this.readyState = null;
  this.responseText = null;
  this.responseXML = null;
  this.handleResp = null;
  this.responseFormat = 'text', // 'text', 'xml', 'object'
  this.mimeType = null;
  this.headers = [];


  this.init = function() {
    var i = 0;
    var reqTry = [
      function() {
         return new XMLHttpRequest(); },
      function() {
         return new ActiveXObject('Msxml2.XMLHTTP') },
      function() {
         return new ActiveXObject('Microsoft.XMLHTTP' )} ];
 
    while (!this.req && (i < reqTry.length)) {
      try {
        this.req = reqTry[i++]();
      }
      catch(e) {}
    }
    return true;
  };
  
 this.doReq = function() {
    var self = null;
    var req = null;
    var headArr = [];
 
    if (!this.init()) {
      alert('Could not create XMLHttpRequest object.');
      return;
    }
    req = this.req;
    req.open(this.method, this.url, this.async);
    if (this.method == "POST") {
       this.req.setRequestHeader(
       'Content-Type', 'application/x-www-form-urlencoded');
    }
    if (this.method == 'POST') {
       req.setRequestHeader(
       'Content-Type', 'application/x-www-form-urlencoded');
    }
    self = this;   // Fix loss of scope in inner function(s)
    req.onreadystatechange = function() {
      var resp = null;
      self.readyState = req.readyState;
      if (req.readyState == 4) {
 
        self.status = req.status;
        self.statusText = req.statusText;
        self.responseText = req.responseText;
        self.responseXML = req.responseXML;
 
        switch(self.responseFormat) {
          case 'text':
            resp = self.responseText;
            break;
          case 'xml':
            resp = self.responseXML;
            break;
          case 'object':
            resp = req;
            break;
        }
 
        if (self.status > 199 && self.status < 300) {
          if (!self.handleResp) {
            alert('No response handler defined ' +
              'for this XMLHttpRequest object.');
            return;
          }
          else {
            self.handleResp(resp);
          }
        }
 
        else {
          self.handleErr(resp);
        }
      }
    }
    req.send(this.dataPayload);
  };
  
  this.doGet = function(url, hand, format) {
    this.url = url;
    this.handleResp = hand;
    this.responseFormat = format || 'text';
    this.doReq();
  };
  
}


function setBirthday(Maand, Dag) {
      document.getElementById("geboortedatum_dag").options[Dag].selected = true;
      document.getElementById("geboortedatum_maand").options[Maand].selected = true;
      return;
}

function showBirthdaysMonth(Maand) {
  for(i=1;i<13;i++) {
    //document.getElementById("maand_" + i).style.visibility = "none";
    if(document.getElementById("maand_" + i) != undefined) {
      document.getElementById("maand_" + i).style.display = "none";
    
      if(i == Maand) {
       document.getElementById("maand_" + i).style.display = "block";
      }
    }
  } 
}


function confirmDeleteUserBirthday(name)
 {
    var is_confirmed = confirm("Weet u zeker dat u de verjaardag van "+ name +" wilt verwijderen?");
    if (is_confirmed) 
     {
      // Do nothing...
     }
    return is_confirmed;
 }

function ChangeColor(tableRow, highLight)
{
  if (highLight)
  {
    tableRow.className="m_over";
  }
  else
  {
    tableRow.className="";
  }
}

function ChangeColor2(tableRow, OrigClass, highLight)
{
  if (highLight)
  {
    tableRow.className=OrigClass + "m_over";
  }
  else
  {
    tableRow.className=OrigClass;
  }
}
  
function DoNav(theUrl)
{
  document.location.href = theUrl;
}

  
