function setScrolled() { if($(window).scrollTop() + $(window).height() == $(document).height()) { $('.ixlpowerline').removeClass('ixlout'); $('.ixlsnlogobtm').removeClass('ixlin'); } else if($(window).scrollTop() > 0) { $('.ixlsite').removeClass('ixlnoscroll'); $('.ixlsite').addClass('ixlscrolled'); $('.ixlpowerline').addClass('ixlout'); $('.ixlsnlogobtm').addClass('ixlin'); } else { $('.ixlsite').removeClass('ixlscrolled'); $('.ixlsite').addClass('ixlnoscroll'); $('.ixlpowerline').removeClass('ixlout'); $('.ixlsnlogobtm').removeClass('ixlin'); } } 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', '/mijnprofiel/dialog/' + dialogname + '.asp', 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 = 900; 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 setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i= 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 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 getElementInDiv(div, elId) { var elm = {}; var elms = div.getElementsByTagName("*"); for (var i = 0; i < elms.length; i++) { if (elms[i].id === elId) { elm = elms[i]; break; } } return elm; } function scrollToGbIfHash(gbHash, gbId) { if (window.location.hash.toLowerCase() == '#'+gbHash.toLowerCase()) {scrollToDiv(gbId);} } function scrollToDiv(divId) { $('html, body').stop().animate({scrollTop: $('#'+divId).offset().top}, 1000); } 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 } else if (languageKeyword == 'FR') { melding1 = "Valeur minimale pour champ " + naam + " est " + minVal melding2 = "Valeur maximale pour champ " + naam + " est " + 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" } else if (languageKeyword == 'FR') { melding1 = "Champ " + naam + " est obligatoire" } 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" } else if (languageKeyword == 'FR') { melding1 = "Champ " + naam + " est obligatoire" } 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 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; } else if (languageKeyword == 'FR') { melding1 = "Le champ " + naam + " doit consister de " + numChars + " caractères"; melding2 = "Le champ " + naam + " contient trop peu de caractères (minimum: " + minNumChars + ")"; melding3 = "Le champ " + naam + " contient trop de caractères (maximum: " + 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 + ")" } else if (languageKeyword == 'FR') { melding1 = "Dans le champ " + naam + " apparaissent des caractères qui ne sont pas permis (permis: " + 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" } else if (languageKeyword == 'FR') { melding1 = "Dans champ " + naam + " vous pouvez insérer que des chiffres" } for (var i=0;i= "0" && digit <= "9")) { 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" } else if (languageKeyword == 'FR') { melding1 = "Dans champ " + naam + " vous pouvez insérer que des chiffres décimaux" } 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); }