
function bIsNull(a_uVar) {
"use strict";
return (a_uVar === null);
}
function bIsBoolean(a_uVar) {
"use strict";
if (bIsNull(a_uVar)) {
return false;
} else {
return (typeof (a_uVar) === "boolean");
}
}
function bIsString(a_uVar) {
"use strict";
if (bIsNull(a_uVar)) {
return false;
} else {
return (typeof (a_uVar) === "string");
}
}
function bIsDefined(a_uVar) {
"use strict";
return (typeof (a_uVar) !== "undefined");
}
function bIsFunction(a_uVar) {
"use strict";
if (bIsNull(a_uVar)) {
return false;
} else {
return (typeof (a_uVar) === "function");
}
}
function bIsObject(a_uVar) {
"use strict";
if (bIsNull(a_uVar)) {
return false;
} else {
return (typeof (a_uVar) === "object");
}
}
function sURLEncode(a_sText, a_bSaveRes, a_bToSpecialHTMLEntities) {
var bSaveRes = (!bIsDefined(a_bSaveRes) ? true : a_bSaveRes);
var bToSpecialHTMLEntities = (!bIsDefined(a_bToSpecialHTMLEntities) ? false : a_bToSpecialHTMLEntities);
if (bToSpecialHTMLEntities) {
a_sText = a_sText.replace(/€/g, '&euro;');
}
a_sText = a_sText.replace(/%/g, '%25');
a_sText = a_sText.replace(/ /g, '%20');
a_sText = a_sText.replace(/"/g, '%22');
a_sText = a_sText.replace(/</g, '%3C');
a_sText = a_sText.replace(/>/g, '%3E');
a_sText = a_sText.replace(/#/g, '%23');
a_sText = a_sText.replace(/</g, '%3C');
a_sText = a_sText.replace(/{/g, '%7B');
a_sText = a_sText.replace(/}/g, '%7D');
a_sText = a_sText.replace(/\|/g, '%7C');
a_sText = a_sText.replace(/\\/g, '%5C');
a_sText = a_sText.replace(/\^/g, '%5E');
a_sText = a_sText.replace(/~/g, '%7E');
a_sText = a_sText.replace(/\[/g, '%5B');
a_sText = a_sText.replace(/\]/g, '%5D');
a_sText = a_sText.replace(/`/g, '%60');
a_sText = a_sText.replace(/\n/g, '%0A');
if (!bSaveRes) {
a_sText = a_sText.replace(/\$/g, '%24');
a_sText = a_sText.replace(/&/g, '%26');
a_sText = a_sText.replace(/\+/g, '%2B');
a_sText = a_sText.replace(/,/g, '%2C');
a_sText = a_sText.replace(/\//g, '%2F');
a_sText = a_sText.replace(/:/g, '%3A');
a_sText = a_sText.replace(/;/g, '%3B');
a_sText = a_sText.replace(/=/g, '%3D');
a_sText = a_sText.replace(/\?/g, '%3F');
a_sText = a_sText.replace(/@/g, '%40');
}
return a_sText;
}
var oSimpleAjaxRequestObject = new Object();
var aAjaxSimpleReceiveFunction = new Object();
var iAjaxSimpleRequestId = 10000;
function vSimpleAjaxSend(a_sURL, a_sPost, a_hReceiveFunction, a_sMimeType, a_iNr) {
var sMimeType = (a_sMimeType ? a_sMimeType : 'text/xml');
var iNr = (a_iNr ? a_iNr : 0);
try {
if (oSimpleAjaxRequestObject[iNr]) {
oSimpleAjaxRequestObject[iNr].abort();
}
oSimpleAjaxRequestObject[iNr] = new XMLHttpRequest();
if (oSimpleAjaxRequestObject[iNr].overrideMimeType) {
oSimpleAjaxRequestObject[iNr].overrideMimeType(sMimeType);
}
} catch (e) {
try
{
if (oSimpleAjaxRequestObject[iNr]) {
oSimpleAjaxRequestObject[iNr].abort();
}
oSimpleAjaxRequestObject[iNr] = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e)
{
try
{
if (oSimpleAjaxRequestObject[iNr]) {
oSimpleAjaxRequestObject[iNr].abort();
}
oSimpleAjaxRequestObject[iNr] = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e)
{
hErrorFunction(2, 3, "Deze browser ondersteunt geen Ajax");
return false;
}
}
}
aAjaxSimpleReceiveFunction[iNr] = a_hReceiveFunction;
oSimpleAjaxRequestObject[iNr].onreadystatechange = vSimpleAjaxProccesState;
protocolLength = a_sURL.indexOf(":") + 1;
if ( window.location.protocol.length != protocolLength )
{
a_sURL = window.location.protocol + a_sURL.substr(protocolLength);
}
oSimpleAjaxRequestObject[iNr].open('POST', a_sURL, true);
oSimpleAjaxRequestObject[iNr].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
a_sPost = a_sPost + (a_sPost == '' ? '?' : '&' ) + 'iAjaxRequestId=' + iAjaxSimpleRequestId;
iAjaxSimpleRequestId++;
oSimpleAjaxRequestObject[iNr].send(sURLEncode(a_sPost));
return true;
}
function vSimpleAjaxProccesState() {
var iAjaxNr = -1;
for (var iNr in oSimpleAjaxRequestObject) {
if (oSimpleAjaxRequestObject.hasOwnProperty(iNr)) {
if (oSimpleAjaxRequestObject[iNr].readyState == 4) {
iAjaxNr = iNr;
break;
}
}
}
if (iAjaxNr < 0) return;
if (oSimpleAjaxRequestObject[iAjaxNr].status == 200) {
if (aAjaxSimpleReceiveFunction[iAjaxNr] !== null) aAjaxSimpleReceiveFunction[iAjaxNr](oSimpleAjaxRequestObject[iAjaxNr]);
} else {
if (oSimpleAjaxRequestObject[iAjaxNr].status > 0) hErrorFunction(0, 2, "Opdracht kon niet worden uitgevoerd. Status: " + oSimpleAjaxRequestObject[iAjaxNr].status + ", " + oSimpleAjaxRequestObject[iAjaxNr].responseText);
}
vSimpleAjaxClear(iAjaxNr);
}
function vSimpleAjaxClear(a_iNr) {
var iNr = (a_iNr ? a_iNr : 0);
delete oSimpleAjaxRequestObject[iNr];
delete aAjaxSimpleReceiveFunction[iNr];
}

