function addQspToUrl(uri, key, value) { var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); var separator = uri.indexOf('?') !== -1 ? "&" : "?"; if (uri.match(re)) { return uri.replace(re, '$1' + key + "=" + value + '$2'); } else { return uri + separator + key + "=" + value; } } function trackPageview(debugmode, taalId, profielId, dotId, objId, page, indialog) { var url = (debugmode === 1 ? 'https://apimeeestersinitnl.interxl.com/' : 'https://api.meeestersinit.nl/') + '1.0/createPageview/'; url = addQspToUrl(url, 'iwk', 'miitnl'); url = addQspToUrl(url, 'twk', 'nl'); url = addQspToUrl(url, 'at', getCookie('actat')); var usertokenId = getCookie('ut'); var sessiontokenId = getCookie('st'); var trackingtokenId = getCookie('tt'); var post = 'usertokenid=' + (usertokenId === null ? '' : usertokenId); post = post + '&sessiontokenid=' + (sessiontokenId === null ? '' : sessiontokenId); post = post + '&trackingtokenid=' + (trackingtokenId === null ? '' : trackingtokenId); post = post + '&taalid=' + (taalId === null ? '' : taalId); post = post + '&profielid=' + (profielId === null ? '' : profielId); post = post + '&dotid=' + (dotId === null ? '' : dotId); post = post + '&objid=' + (objId === null ? '' : objId); post = post + '&page=' + (page === null ? '' : page); post = post + '&indialog=' + (indialog === null ? 0 : indialog); post = post + '&title=' + escape(document.title); post = post + '&url=' + escape(document.URL); post = post + '&screenwidth=' + screen.width; post = post + '&screenheight=' + screen.height; post = post + '&screeninnerwidth=' + window.innerWidth; post = post + '&screeninnerheight=' + window.innerHeight; post = post + '&refererfortracking=' + escape(document.referrer); post = post + '&useragentfortracking=' + escape(navigator.userAgent); var xmlHttp = new XMLHttpRequest(); xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { if (debugmode == 1) {console.log(xmlHttp.responseText);}; responseObj = JSON.parse(xmlHttp.responseText); if (responseObj.status == 'ok') { setCookie(window.location.hostname, 'tt', responseObj.trackingtoken, 365) setCookie(window.location.hostname, 'st', responseObj.sessiontoken, null) setCookie(window.location.hostname, 'ut', responseObj.usertoken, null) } } } xmlHttp.send(post); } function share(debugmode, taalId, platformId, profielId, dotId, objId, platformAspId) { var popupurl = ''; var width, height; if (platformAspId == 1) { popupurl = 'https://www.linkedin.com/shareArticle' popupurl = addQspToUrl(popupurl, 'url', window.location.href); width = 600; height = 460; } else if (platformAspId == 2) { popupurl = 'https://www.facebook.com/sharer.php' popupurl = addQspToUrl(popupurl, 'p[url]', window.location.href); width = 600; height = 460; } else if (platformAspId == 3) { popupurl = 'https://twitter.com/share' popupurl = addQspToUrl(popupurl, 'url', window.location.href); width = 600; height = 260; } if (popupurl.length > 0) { var trackurl = (debugmode === 1 ? 'https://apimeeestersinitnl.interxl.com/' : 'https://api.meeestersinit.nl/') + '1.0/createShare/'; trackurl = addQspToUrl(trackurl, 'iwk', ''); trackurl = addQspToUrl(trackurl, 'twk', 'nl'); trackurl = addQspToUrl(trackurl, 'at', getCookie('actat')); var usertokenId = getCookie('ut'); var sessiontokenId = getCookie('st'); var trackingtokenId = getCookie('tt'); var post = 'usertokenid=' + (usertokenId === null ? '' : usertokenId); post = post + '&sessiontokenid=' + (sessiontokenId === null ? '' : sessiontokenId); post = post + '&trackingtokenid=' + (trackingtokenId === null ? '' : trackingtokenId); post = post + '&taalid=' + (taalId === null ? '' : taalId); post = post + '&platformid=' + (platformId === null ? '' : platformId); post = post + '&profielid=' + (profielId === null ? '' : profielId); post = post + '&dotid=' + (dotId === null ? '' : dotId); post = post + '&objid=' + (objId === null ? '' : objId); post = post + '&refererfortracking=' + escape(document.referrer); post = post + '&useragentfortracking=' + escape(navigator.userAgent); var xmlHttp = new XMLHttpRequest(); xmlHttp.open("POST", trackurl, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { if (debugmode == 1) {console.log(xmlHttp.responseText);}; responseObj = JSON.parse(xmlHttp.responseText); if (responseObj.status == 'ok') { setCookie(window.location.hostname, 'tt', responseObj.trackingtoken, 365) setCookie(window.location.hostname, 'st', responseObj.sessiontoken, null) setCookie(window.location.hostname, 'ut', responseObj.usertoken, null) } } } xmlHttp.send(post); window.open(popupurl, '','width=' + width + ', height=' + height + ', left=' + (screen.width / 2 - width / 2) + ', top=' + (screen.height / 2 - height / 2) + ', scrollbars=yes, toolbar=no, location=yes'); } } function makeFullHeight() { $('.ixlheaderspacer').css('min-height', $('.ixlheader').height() + 'px'); $('.makefullheight').css('min-height', '0px'); var minheight = $(document).height() - $('#ixlheader').height() - $('#ixlfooter').height() - 2 + 'px'; // -2 voor de border onder header en boven footer $('.makefullheight').css('min-height', minheight); } function openDialog(dialogname) { document.getElementById('ixldialog').style.display = 'block'; document.getElementById('ixldialogcontainer').style.display = 'none'; document.getElementById('ixldialogloading').style.display = 'block'; try { var xmlHttpObj = new XMLHttpRequest(); } catch (e) { try { xmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP"); } } if (xmlHttpObj == null) { alert('Browser not supported.'); return; } xmlHttpObj.onreadystatechange = function() { if (this.readyState == 4) { if (this.status == 200) { processDialogXml(this.responseXML); } else { closeDialog(); alert("Error loading dialog: " + this.status); }; }; }; xmlHttpObj.open('GET', '/ajaxcall.asp?dn=' + dialogname, true); xmlHttpObj.send(); } function processDialogXml(xmlObj) { var dlName = (xmlObj.getElementsByTagName('name')[0].firstChild != null) ? xmlObj.getElementsByTagName('name')[0].firstChild.nodeValue : ''; var dlSmall = (xmlObj.getElementsByTagName('small')[0].firstChild != null) ? xmlObj.getElementsByTagName('small')[0].firstChild.nodeValue : ''; var dlRedirurl = (xmlObj.getElementsByTagName('redirurl')[0].firstChild != null) ? xmlObj.getElementsByTagName('redirurl')[0].firstChild.nodeValue : ''; var dlHtml = (xmlObj.getElementsByTagName('html')[0].firstChild != null) ? xmlObj.getElementsByTagName('html')[0].firstChild.nodeValue : ''; var dlJs = (xmlObj.getElementsByTagName('js')[0].firstChild != null) ? xmlObj.getElementsByTagName('js')[0].firstChild.nodeValue : ''; if (dlRedirurl.length != 0) { document.location.href = dlRedirurl; } else { document.getElementById('ixldialogloading').style.display = 'none'; document.getElementById('ixldialogcontainer').style.display = 'block'; document.location.href = '#' + dlName; var dialogWidth = 1000; if (dlSmall == '1') { var dialogWidth = 500; }; $('#ixldialogcontainer').css('maxWidth', dialogWidth); document.getElementById('ixldialogcontent').innerHTML = dlHtml; if (dlJs.length != 0) { var dialogscript = document.createElement('script'); dialogscript.type = 'text/javascript'; dialogscript.id = 'dialogscript'; try { dialogscript.appendChild(document.createTextNode(dlJs)); document.body.appendChild(dialogscript); } catch (e) { dialogscript.text = dlJs; document.body.appendChild(dialogscript); } } } } function closeDialog() { var dialogscript = document.getElementById('dialogscript'); if (dialogscript != null) { document.body.removeChild(dialogscript); }; document.getElementById('ixldialogcontent').innerHTML = ''; // leegmaken anders blijven forms met validators actief etc document.getElementById('ixldialog').style.display = 'none'; window.history.replaceState('', '', document.location.href.replace(document.location.hash, '')); } function getPrijsFlt(prijsFlt) { return Math.round(prijsFlt * 100) / 100; } function getPrijsStr(prijsFlt) { var prijsStr = String(prijsFlt); if (prijsStr.indexOf('.') == -1) { prijsStr += '.00'; } else if (prijsStr.length - prijsStr.indexOf('.') < 3) { prijsStr += '0'; } return prijsStr.replace(".", ","); } function toggleVisDiv(divIdStr) { if (getDivVis(divIdStr)) { setVisDivToInVis(divIdStr); } else { setVisDivToVis(divIdStr); } } function getDivVis(divIdStr) { var divobj = document.getElementById(divIdStr); if (typeof divobj == 'object' && divobj != null) { return(divobj.className.indexOf('ixlvisible') >= 0) } } function setVisDivToVis(divIdStr) { var divobj = document.getElementById(divIdStr); if (typeof divobj == 'object' && divobj != null) { divobj.className = divobj.className.replace('ixlinvisible', 'ixlvisible'); } } function setVisDivToInVis(divIdStr) { var divobj = document.getElementById(divIdStr); if (typeof divobj == 'object' && divobj != null) { divobj.className = divobj.className.replace('ixlvisible', 'ixlinvisible'); } } function togglesAllNone(allnoneToggle, namePrefixStr) { var frm = allnoneToggle.form; for (var i=0; i < frm.elements.length; i++) { var actToggle = frm.elements[i]; if (actToggle.checked != allnoneToggle.checked) { if (actToggle.name.substring(0, namePrefixStr.length) == namePrefixStr) { actToggle.checked = allnoneToggle.checked; } } } } function setRadioValue(radioHTMLNaamStr, valueStr, checkedBool) { var radiosArray = document.getElementsByName(radioHTMLNaamStr); for(var i = 0; i < radiosArray.length; i++) { if (radiosArray[i].value == valueStr) { radiosArray[i].checked = checkedBool; } } } function getRadioValue(radioHTMLNaamStr) { var radiosArray = document.getElementsByName(radioHTMLNaamStr); for(var i = 0; i < radiosArray.length; i++) { if (radiosArray[i].checked) { return radiosArray[i].value; } } return ''; } function setCookie(domain, name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/; domain=" + domain; } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } function eraseCookie(name) { createCookie(name, "", -1); } function validateEmail(obj, naam) { melding = "E-mail adres is niet geldig" if (languageKeyword == 'UK') { melding = "Email address is invalid" } var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if (!(re.test(obj.value))) { alert(melding); obj.focus(); return(false); } return(true); } function controleerNumberRangeMetMelding(obj, minVal, maxVal, naam) { melding1 = "Minimale waarde voor veld " + naam + " is " + minVal melding2 = "Maximale waarde voor veld " + naam + " is " + maxVal if (languageKeyword == 'UK') { melding1 = "Minimum value of " + naam + " is " + minVal melding2 = "Maximum value of " + naam + " is " + maxVal } if (eval(minVal) > eval(obj.value)) { alert(melding1); obj.focus(); return(false); } if (eval(obj.value) > eval(maxVal)) { alert(melding2); obj.focus(); return(false); } return(true); } function controleerVeldIngevuld(obj, naam) { melding1 = "Veld " + naam + " is verplicht" if (languageKeyword == 'UK') { melding1 = "Field " + naam + " is required" } if (obj.value == "") { alert(melding1); obj.focus(); return (false); } return(true); } function controleerVeldIngevuldNoFocus(obj, naam) { melding1 = "Veld " + naam + " is verplicht" if (languageKeyword == 'UK') { melding1 = "Field " + naam + " is required" } if (obj.value == "") { alert(melding1); return (false); } return(true); } function controleerLengteString(obj, minNumChars, maxNumChars, numChars, naam) { if (!controleerLengteStringByValue(obj.value, minNumChars, maxNumChars, numChars, naam)) { obj.focus(); return(false); } return (true); } function controleerLengteStringZonderMelding(obj, minNumChars, maxNumChars, numChars) { if (numChars != obj.value.length && 0 < numChars) { return(false); } if (minNumChars > obj.value.length && 0 <= minNumChars) { return(false); } if (maxNumChars < obj.value.length && 0 <= maxNumChars) { return(false); } return (true); } function controleerLengteStringByValue(objValue, minNumChars, maxNumChars, numChars, naam) { melding1 = "Het veld " + naam + " moet uit " + numChars + " karakters bestaan"; melding2 = "Het veld " + naam + " bevat te weinig karakters (minimaal: " + minNumChars + ")"; melding3 = "Het veld " + naam + " bevat te veel karakters (maximaal: " + maxNumChars + ")"; if (languageKeyword == 'UK') { melding1 = "This record has to consist of " + numChars + " characters"; melding2 = "This record requires a minimum number of characters of " + minNumChars; melding3 = "This record requires a maximum number of characters of " + maxNumChars; } if (numChars != objValue.length && 0 < numChars) { alert(melding1); return(false); } if (minNumChars > objValue.length && 0 <= minNumChars) { alert(melding2); return(false); } if (maxNumChars < objValue.length && 0 <= maxNumChars) { alert(melding3); return(false); } return (true); } function checkStringContentMetMelding(obj, allowedChars, naam) { melding1 = "In het veld " + naam + " komen karakters voor die niet zijn toegestaan (toegestaan: " + allowedChars + ")" if (languageKeyword == 'UK') { melding1 = "Characters in string that are not allowed (allowed: " + allowedChars + ")" } for (var i = 0; i < obj.value.length; i++) { var c = obj.value.charAt(i) if (allowedChars.indexOf(c) == -1) { alert(melding1); obj.select(); obj.focus(); return (false); } } return (true); } function controleerIntegerSyntaxMetMelding(obj, naam) { melding1 = "In veld " + naam + " mogen alleen getallen worden ingevoerd" if (languageKeyword == 'UK') { melding1 = "Field " + naam + " only allows numbers" } for (var i=0;i= "0" && digit <= "9")) && (!(digit == "-"))) { alert(melding1); obj.focus(); return (false); } } return(true); } function controleerFloatSyntaxMetMelding(obj, naam) { melding1 = "In veld " + naam + " mogen alleen decimale getallen worden ingevoerd" if (languageKeyword == 'UK') { melding1 = "Field " + naam + " only allows decimal numbers" } sepFound = 0; for (var i=0;i= "0" && digit <= "9") && ((!(digit == ",")) || (digit == "," && sepFound == 1)) && ((!(digit == ".")) || (digit == "." && sepFound == 1))) { alert(melding1); obj.focus(); return (false); } if (digit == "," || digit == ".") { sepFound = 1; } } return(true); } function controleerInteger(getal) { for (var i=0;i= "0" && digit <= "9")) { return (false); } } return(true); } function controleerFloat(getal) { for (var i=0;i= "0" && digit <= "9") && !(digit == ".") && !(digit == ",")) { return (false); } } return(true); } function bedrijfSetVisAfleveradres() { setVisDivToVis('ixlpropsitem_ixlpropsitem_146'); setVisDivToVis('ixlpropsitem_ixlpropsitem_147'); setVisDivToVis('ixlpropsitem_ixlpropsitem_148'); setVisDivToVis('ixlpropsitem_ixlpropsitem_149'); if (document.getElementById('ixlpropsitem_145').checked) { setVisDivToInVis('ixlpropsitem_ixlpropsitem_146'); setVisDivToInVis('ixlpropsitem_ixlpropsitem_147'); setVisDivToInVis('ixlpropsitem_ixlpropsitem_148'); setVisDivToInVis('ixlpropsitem_ixlpropsitem_149'); } } function preventEnter(e) { if (e.which == 13) { e.preventDefault(); } } // ----------------------------------------------------------------- // PERSITS PROGRESSBAR // ----------------------------------------------------------------- var xmlHttpObj; var progressIdStr; var timeoutIdStr; function showPersitsProgress(pidStr) { try { xmlHttpObj = new XMLHttpRequest(); } catch (e) { try { xmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP"); } } if (xmlHttpObj == null) { alert('Browser not supported.'); return; } document.getElementById('ixlpagina').className = document.getElementById('ixlpagina').className.replace('ixlvisible', 'ixlinvisible'); document.getElementById('ixlprogress').className = document.getElementById('ixlprogress').className.replace('ixlinvisible', 'ixlvisible'); makeFullHeight(); progressIdStr = pidStr; updatePersitsProgress(); } function updatePersitsProgress() { xmlHttpObj.open('GET','/_script/persitsprogress.asp?pid=' + progressIdStr, (navigator.userAgent.indexOf('Chrome') >= 0 || navigator.userAgent.indexOf('Safari') >= 0)); xmlHttpObj.onreadystatechange = persitsProgressStateChanged; xmlHttpObj.send(null); } function persitsProgressStateChanged() { if (xmlHttpObj.readyState == 4) { if (xmlHttpObj.responseText == "") { clearTimeout(timeoutIdStr); timeoutIdStr = setTimeout('updatePersitsProgress()', 1000); return; } var xmlObj = xmlHttpObj.responseXML; if (!(xmlObj.getElementsByTagName('RemainingBytes')[0].firstChild.nodeValue == 0)) { document.getElementById('ixlprogresscontainer').innerHTML = '' + '
' + '
' + xmlObj.getElementsByTagName('UploadedBytes')[0].firstChild.nodeValue + ' / ' + xmlObj.getElementsByTagName('TotalBytes')[0].firstChild.nodeValue + '
' } clearTimeout(timeoutIdStr); timeoutIdStr = setTimeout('updatePersitsProgress()', 1000); } }