function GetXmlHttpObject()
{
  var xmlHttp=null;
  try { // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
  }
  catch (e) { // Internet Explorer
    try {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }

  return xmlHttp;
}

function parseXMLText(tekst)
{
	var xmlDoc
	try //Internet Explorer
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async="false";
		xmlDoc.loadXML(tekst);
	}
	catch(e)
	{
		try //Firefox, Mozilla, Opera, etc.
		{
			parser=new DOMParser();
			xmlDoc=parser.parseFromString(tekst,"text/xml");
		}
		catch(e)
		{
			alert(e.message);
			return;
		}
	}
	return xmlDoc;
}

function geefAjaxValues(functie, actie, extratekst){
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp!=null) {
		xmlHttp.onreadystatechange=functie;
		xmlHttp.open("GET","ajax.asp?actie="+actie+extratekst,true);
		xmlHttp.send(null);
	}
}

function insertLabelAanmaak(actie, inschrId, groepID) {
    xmlHttp = GetXmlHttpObject();
    if (xmlHttp != null) {
        xmlHttp.open("GET", "ajax.asp?actie=" + actie + inschrId + groepID, false);
        xmlHttp.send(null);
    }
}

function CheckDataHeftruckArbo( ArboID, HeftruckID )
{
	if( isNaN(ArboID) || isNaN(HeftruckID) ) return -1;
	var iDagen = 0;

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp!=null) {
		xmlHttp.onreadystatechange=function() {
			if( xmlHttp.readyState==4 ) {
				iDagen = xmlHttp.responseText;
			}
		}
		xmlHttp.open("GET",'DET_vtlplanning.asp?plArbo=' +ArboID+'&PlHeftruck=' +HeftruckID,false);
		xmlHttp.send(null);
		return iDagen;
	}
}
