//
// BASIC FUNCTIONS
//
function xmlObject(){
  try{
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
  }catch (e){
    // Internet Explorer
    try{
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){
      try{
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }catch (e){
        alert("Your browser does not support AJAX!");
        return false;
      }
    }
  }
  return xmlHttp;
}
function doXmlRequest(xmlUrl, functionByValue) {
  xmlObj = new xmlObject();
  xmlObj.onreadystatechange = function(){
    if (xmlObj.readyState == 4) {
      globalXmlData = xmlObj.responseText;
      functionByValue(xmlObj.responseText);
    }
  }
  xmlObj.open('GET', xmlUrl , true);
  xmlObj.send(null);
}
function doXmlPOSTRequest(xmlUrl, params, functionByValue) {
  xmlObj = new xmlObject();
  xmlObj.open("POST", xmlUrl, true);
  //Send the proper header information along with the request
  xmlObj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlObj.setRequestHeader("Content-length", params.length);
  xmlObj.setRequestHeader("Connection", "close");
  
  xmlObj.onreadystatechange = function() {//Call a function when the state changes.
      if (xmlObj.readyState == 4) {
        globalXmlData = xmlObj.responseText;
        functionByValue(xmlObj.responseText);
      }
  }
  xmlObj.send(params);
}
function showTR(trid){
	if (document.all)
		document.all[trid].style.display = 'block';
	else if (document.getElementById)
		document.getElementById(trid).style.display = 'block';
}
function hideTR(trid){
	if (document.all)
		document.all[trid].style.display = 'none';
	else if (document.getElementById)
		document.getElementById(trid).style.display = 'none';
}
function toggleTR(trid) {
	if (document.all)
		document.all[trid].style.display = (document.all[trid].style.display == 'none') ? 'block' : 'none';
	else if (document.getElementById)
		document.getElementById(trid).style.display = (document.getElementById(trid).style.display == 'none') ? 'block' : 'none';
}
function busyError(){
   alert('Het systeem is nog bezig met de vorige actie te verwerken. Probeer opnieuw binnen enkele seconden. \nDruk op F5 als het probleem zich blijft voordoen.'+cf);
}
var cf;
//
// END BASIC FUNCTIONS
//


