/*
$ js/AJAX.js | 2008/05/16 14:20 | 2008/07/15 08:35 $
*/

function AJAX() {
  if (window.XMLHttpRequest) {
    xmlhttp = new XMLHttpRequest(); // Mozilla, Firefox, Opera, stb.
  }
  else if (window.ActiveXObject) {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // IE
  }
  else {
    xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); // IE
  }

  return xmlhttp;
}

function setContactNote(id, element, lang) {
  var xmlhttp = AJAX();

  if (!xmlhttp) {
    alert("Your browser don't support this function!");
  }
  else {
    xmlhttp.open('GET', '/Kontakt/AJAX_setNote.cgi?form_id=' + id + '&lang=' + lang, true);
    xmlhttp.onreadystatechange = function() {
      if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
        document.getElementById(element).innerHTML = xmlhttp.responseText;
      }
    }

    xmlhttp.send(null);
  }
}
