var SNSBankExtra={};var SNSBankAccount={};var SNSBankAccountEx={};var SNSLocation={};var SNSAutoFillCustomerData={};var SNSInterestOnAccount={};var SNSInterestOnProduct={};var SNSAccountProperties={};var SNSasyncPostcode={};var SNSNearestOffice={};var SNSLogoutOnUnload={};var SNSAutoLogout={};var SNSAccountDropdown={};var SNSDigipasLimit={};var SNSCustomerDropdown={};var SNSCustomerProperties={};var SNSAutoFillForm={};SNSBankExtra.init=function(){SNSBankAccount.init();SNSBankAccountEx.init();SNSInterestOnAccount.init();SNSInterestOnProduct.init();SNSAutoFillCustomerData.init();SNSasyncPostcode.init();SNSNearestOffice.init();SNSLogoutOnUnload.init();SNSAutoLogout.init();SNSDigipasLimit.init();SNSAccountProperties.init();SNSAutoFillForm.init();disableEnterOnRadioButton()};function trimStr(A){A=A.replace(/^\s+/,"");A=A.replace(/\s+$/,"");return A}function dateChanged2(D){var B,A,C;if(document.getElementById){B=document.getElementById("day_"+D);A=document.getElementById("month_"+D);C=document.getElementById("year_"+D);valueel=document.getElementById("wmformfragment_"+D)}else{B=document.all["day_"+D];A=document.all["month_"+D];C=document.all["year_"+D];valueel=document.all["wmformfragment_"+D]}dateChangedGeneric(B,A,C,valueel);$(".datefield").trigger("change");return true}function dateChanged(B){var K,G,I,F,C,M,A,J;if(document.getElementById){F=document.getElementById("datepickerDay"+B);C=document.getElementById("datepickerMonth"+B);M=document.getElementById("datepickerYear"+B);A=document.getElementById("datepickerWMformpart"+B)}else{F=document.all["datepickerDay"+B];C=document.all["datepickerMonth"+B];M=document.all["datepickerYear"+B];A=document.all["datepickerWMformpart"+B]}if(F.value==""||C.value==""||M.value==""){J=""}else{if(F.value.length==1){realdayel="0"+F.value}else{realdayel=F.value}if(C.value.length==1){realmonthel="0"+C.value}else{realmonthel=C.value}J=realdayel+"-"+realmonthel+"-"+M.value}A.value=J;var L=A.className;var D;var H;if(L.indexOf("WVcheckage")>=0){L=L.replace(/WVcheckage/g,"+#");arr_check=L.split("+");for(var E=0;E<arr_check.length;E++){if(arr_check[E].substring(0,1)=="#"){if(!J==""){WvAgeCheck(F.value,C.value,M.value,arr_check[E])}else{H=trimStr("WVmelding"+arr_check[E].substring(1));if(document.getElementById(H)){document.getElementById(H).style.display="none"}}}}}return true}function dateChangedGeneric(D,A,E,C){var C,B;if(D.value==""||A.value==""||E.value==""){B=""}else{if(D.value.length==1){realdayel="0"+D.value}else{realdayel=D.value}if(A.value.length==1){realmonthel="0"+A.value}else{realmonthel=A.value}B=realdayel+"-"+realmonthel+"-"+E.value}C.value=B;if(!B==""){if(C.className.indexOf("WVcheckage")>=0){WvAgeCheck(D.value,A.value,E.value)}}else{if(document.getElementById("WVmelding")&&C.className.indexOf("WVcheckage")>=0){document.getElementById("WVmelding").style.display="none"}}return true}function WvAgeCheck(K,I,J,D){var B="lt";var E=18;D=trimStr(D);if(D!=""&&D.substring(0,1)=="#"){D=trimStr(D.substring(1)).toLowerCase()}else{return }if(D!=""){B=D.substring(0,2);E=parseInt(D.substring(2))}if(!document.getElementById("WVmelding"+D)){return }var H=new Date(J,I-1,K);var A=new Date();var L=new Date(A.getFullYear()-E,A.getMonth(),A.getDate());var G=false;if(B=="lt"){if(H>L){G=true}}else{if(B=="gt"){if(H<L){G=true}}else{if(B=="le"){if(H>=L){G=true}}else{if(B=="ge"){if(H<=L){G=true}}}}}var C=document.getElementById("WVmelding"+D);if(C!=null){if(G==true){C.style.display="block";while(C.tagName!="FIELDSET"){C=C.parentNode}C.style.backgroundColor="#ff0";var F=new YAHOO.util.ColorAnim(C,{backgroundColor:{to:"#fff"}},3,YAHOO.util.Easing.easeOut);F.onComplete.fire=onCompleteHandlerFire;F.animate()}else{C.style.display="none"}}}function dateLoad(B){var L,H,J,G,C,O,A,K;if(document.getElementById){G=document.getElementById("datepickerDay"+B);C=document.getElementById("datepickerMonth"+B);O=document.getElementById("datepickerYear"+B);A=document.getElementById("datepickerWMformpart"+B)}else{G=document.all["datepickerDay"+B];C=document.all["datepickerMonth"+B];O=document.all["datepickerYear"+B];A=document.all["datepickerWMformpart"+B]}var N=A.value;if(N==""||N.split("-").length!=3){G.value="";C.value="";O.value=""}else{var E=N.split("-");G.value=E[0];C.value=E[1];O.value=E[2]}var M=A.className;var D;var I;var K=N;if(M.indexOf("WVcheckage")>=0){M=M.replace(/WVcheckage/g,"+#");arr_check=M.split("+");for(var F=0;F<arr_check.length;F++){if(arr_check[F].substring(0,1)=="#"){if(!K==""){WvAgeCheck(G.value,C.value,O.value,arr_check[F])}else{I=trimStr("WVmelding"+arr_check[F].substring(1));if(document.getElementById(I)){document.getElementById(I).style.display="none"}}}}}}function gup(B){B=B.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var A="[\\?&]"+B+"=([^&#]*)";var D=new RegExp(A);var C=D.exec(window.location.href);if(C==null){return""}else{return C[1]}}function removeAllOptions(A){var B;for(B=A.options.length-1;B>=0;B--){A.remove(B)}A.options.length=0}function addOption(B,D,C,E){var A=document.createElement("OPTION");A.text=D;A.value=C;if(E){A.id=E}B.options.add(A)}function isVisible(A){var B=true;while(A){if(A.style.display=="none"){return false}if(A.parentNode.tagName!="FORM"){A=A.parentNode}else{A=null}}return B}function onCompleteHandlerFire(A){el=this.scope.getEl();el.style.background="transparent"}function clientAction(I,A){var F=0;itemNode=document.getElementById(I+"_"+F);while(itemNode){var E=0;var G=0;actionNode=document.getElementsByName(itemNode.value);if(actionNode.length==0){actionNode=document.getElementsByTagName("span")}while(actionNode[E]){if(actionNode[E].getAttribute("name")==itemNode.value){realActionNode=actionNode[E].parentNode;if(itemNode.nodeName=="OPTION"){if(A==""){G=1}realActionNode.style.display=itemNode.selected?"block":"none"}else{realActionNode.style.display=itemNode.checked?"block":"none"}if(itemNode.checked&&A==""){G=1}if(G==1){var J=realActionNode.getElementsByTagName("FIELDSET");for(var D=0;D<J.length;D++){if(J[D].className.indexOf("conditional")>=0){J[D].style.backgroundColor="#ff0";var C=new YAHOO.util.ColorAnim(J[D],{backgroundColor:{to:"#fff"}},3,YAHOO.util.Easing.easeOut);C.onComplete.fire=onCompleteHandlerFire;C.animate()}}var B=realActionNode.getElementsByTagName("P");for(var D=0;D<B.length;D++){if(B[D].className.indexOf("conditional")>=0){B[D].style.backgroundColor="#ff0";var C=new YAHOO.util.ColorAnim(B[D],{backgroundColor:{to:"#fff"}},3,YAHOO.util.Easing.easeOut);C.onComplete.fire=onCompleteHandlerFire;C.animate()}}}var H=null;if(realActionNode.childNodes[1].name=="formpartcode"){H=document.getElementsByName(realActionNode.childNodes[1].value)[0]}else{if(realActionNode.childNodes[2]&&realActionNode.childNodes[2].name=="formpartcode"){H=document.getElementsByName(realActionNode.childNodes[2].value)[0]}}if((H&&H.className.indexOf("clearvalue conditional")!=-1)){H.value=""}}E++}F++;itemNode=document.getElementById(I+"_"+F)}}function colorAnim(F,B,H){var A=document.getElementById(H);F=F.replace(".","_");var D=document.getElementById(F);var C=null;var G=A;if(G.className.indexOf("formsectionelement")!=-1){C=G}else{C=G.parentNode}if(C&&D&&D.className.indexOf("nocoloranim")==-1){C.style.backgroundColor="#ff0";var E=new YAHOO.util.ColorAnim(C,{backgroundColor:{to:"#fff"}},3,YAHOO.util.Easing.easeOut);E.onComplete.fire=onCompleteHandlerFire;E.animate()}}function clientPrefilling(C,A){itemNode=document.getElementById(C);if(itemNode){fill_inputs=(itemNode.checked);var B=0;actionNode=document.getElementsByName("clientprefill");while(actionNode[B]){prev_node=actionNode[B].previousSibling;while(prev_node&&prev_node.tagName!="INPUT"){prev_node=prev_node.previousSibling}if(prev_node&&prev_node.tagName=="INPUT"){if(A=="noClear"){if(fill_inputs){prev_node.value=actionNode[B].value}}else{prev_node.value=fill_inputs?actionNode[B].value:""}}B++}}}function convertAccountNr(A){if(A.charAt(0)=="0"){A=A.substring(1)}if(A.length==10){A=A.replace(/(\S{7})/i,"$1.");A=A.replace(/(\S{5})/i,"$1.");A=A.replace(/(\S{3})/i,"$1.")}else{if(A.length==9){A=A.replace(/(\S{6})/i,"$1.");A=A.replace(/(\S{4})/i,"$1.");A=A.replace(/(\S{2})/i,"$1.")}else{}}return A}function formatNumber(B,A){divider=10;switch(A){case 0:divider=1;break;case 1:divider=10;break;case 2:divider=100;break;default:divider=1000}if(B=="0"){return B+",00"}workNum=Math.abs((Math.round(B*divider)/divider));workStr=""+workNum;if(workStr.indexOf(".")==-1){dStr=workStr;dNum=dStr-0;if(dNum>=1000){dLen=dStr.length;dStr=parseInt(""+(dNum/1000))+"."+dStr.substring(dLen-3,dLen)}if(dNum>=1000000){dLen=dStr.length;dStr=parseInt(""+(dNum/1000000))+"."+dStr.substring(dLen-7,dLen)}retval=dStr;if(B.indexOf("-")==-1){return retval+",00"}else{return retval="-"+retval+",00"}}else{dStr=workStr.substr(0,workStr.indexOf("."));dNum=dStr-0;pStr=workStr.substr(workStr.indexOf("."));if(pStr=="."){pStr=""}if(dNum>=1000){dLen=dStr.length;dStr=parseInt(""+(dNum/1000))+"."+dStr.substring(dLen-3,dLen)}if(dNum>=1000000){dLen=dStr.length;dStr=parseInt(""+(dNum/1000000))+"."+dStr.substring(dLen-7,dLen)}if(pStr.length<3){pStr=pStr+"0"}pStr=pStr.replace(".",",");retval=dStr+pStr;if(B.indexOf("-")==-1){return retval}else{return retval="-"+retval}}}function popup(C,B){var D=screen.width-100;var A=screen.height-100;var F=(screen.width-D)/2;var E=(screen.height-A)/2;var G="width="+D+", height="+A;G+=", top="+E+", left="+F;G+=", directories=no";G+=", location=no";G+=", menubar=no";G+=", resizable=no";G+=", scrollbars=yes";G+=", status=no";G+=", toolbar=no";newwin=window.open(C,B,G);if(window.focus){newwin.focus()}return newwin}function fireAjaxRequest(B,C,A){if(window.XMLHttpRequest){C.ajaxRequest=new XMLHttpRequest()}else{if(window.ActiveXObject){C.ajaxRequest=new ActiveXObject("Microsoft.XMLHTTP")}}C.ajaxRequest.open("Post","/web/wcbservlet/nl.gx.snsbank.snsbankhandling.ajaxservlet?ep="+C.headerId,true);if(C.ajaxRequest.overrideMimeType){C.ajaxRequest.overrideMimeType("text/xml")}C.ajaxRequest.setRequestHeader("SNS_Async_Request",C.headerId);C.ajaxRequest.onreadystatechange=function(){processAjaxResponse(C,A)};C.ajaxRequest.send(B)}function processAjaxResponse(C,A){if(C.ajaxRequest==null){processResult(null,C);return }if(C.ajaxRequest.readyState==4){if(C.ajaxRequest.status==200){try{A(C.ajaxRequest.responseXML,C)}catch(B){A(null,C)}}else{A(null,C)}}}function getElementsByAttribute(H,I,J,D){var E=(I=="*"&&H.all)?H.all:H.getElementsByTagName(I);var C=new Array();var G=(typeof D!="undefined")?new RegExp("(^|\\s)"+D+"(\\s|$)"):null;var A;var F;for(var B=0;B<E.length;B++){A=E[B];F=A.getAttribute&&A.getAttribute(J);if(typeof F=="string"&&F.length>0){if(typeof D=="undefined"||(G&&G.test(F))){C.push(A)}}}return C}function getChildContents(C,B){var A=C.getElementsByTagName(B);if(A.length>0){if(A[0].childNodes.length>0){if(A[0].childNodes[0].nodeType==3){return A[0].childNodes[0].nodeValue}return""}}return null}SNSasyncPostcode.formData=new Array();SNSasyncPostcode.init=function(){var A=[];allForms=document.getElementsByTagName("FORM");for(var C=0;C<allForms.length;C++){if((allForms[C].element&&allForms[C].getAttribute("name")=="f"+allForms[C].element.value+"f")||(allForms[C].getAttribute("id")!=null&&allForms[C].getAttribute("id").indexOf("wmform")!=-1)){formName=allForms[C].getAttribute("name");allFields=getElementsByClassName("SNSasyncPostcode","input",allForms[C]);SNSasyncPostcode.formData[formName]=new Array();SNSasyncPostcode.formData[formName]["form"]=allForms[C];for(var B=0;B<allFields.length;B++){if(allFields[B].id.indexOf("postcode")!=-1||allFields[B].id.indexOf("zipcode")!=-1){if(SNSasyncPostcode.formData[formName]["zipcodeField"]==null){SNSasyncPostcode.formData[formName]["zipcodeField"]=new Array()}SNSasyncPostcode.formData[formName]["zipcodeField"][allFields[B].id]=allFields[B];if(SNSasyncPostcode.formData[formName]["zipcodeFieldId"]==null){SNSasyncPostcode.formData[formName]["zipcodeFieldId"]=new Array()}SNSasyncPostcode.formData[formName]["zipcodeFieldId"][allFields[B].id]=allFields[B].getAttribute("name");Main.addEvent(SNSasyncPostcode.formData[formName]["zipcodeField"][allFields[B].id],"blur",function(){SNSasyncPostcode.find(this,SNSasyncPostcode.formData[formName])});if(SNSasyncPostcode.formData[formName]["cachedZipcodeValue"]==null){SNSasyncPostcode.formData[formName]["cachedZipcodeValue"]=new Array()}SNSasyncPostcode.formData[formName]["cachedZipcodeValue"][allFields[B].id]=""}if(allFields[B].id.indexOf("huisnummer")!=-1||allFields[B].id.indexOf("housenumber")!=-1){if(SNSasyncPostcode.formData[formName]["housenumberField"]==null){SNSasyncPostcode.formData[formName]["housenumberField"]=new Array()}SNSasyncPostcode.formData[formName]["housenumberField"][allFields[B].id]=allFields[B];SNSasyncPostcode.formData[formName]["housenumberField"][allFields[B].id].supressError=false;A.push(allFields[B]);if(SNSasyncPostcode.formData[formName]["housenumberFieldId"]==null){SNSasyncPostcode.formData[formName]["housenumberFieldId"]=new Array()}SNSasyncPostcode.formData[formName]["housenumberFieldId"][allFields[B].id]=allFields[B].getAttribute("name");Main.addEvent(SNSasyncPostcode.formData[formName]["housenumberField"][allFields[B].id],"blur",function(){SNSasyncPostcode.find(this,SNSasyncPostcode.formData[formName])});if(SNSasyncPostcode.formData[formName]["cachedHousenumberValue"]==null){SNSasyncPostcode.formData[formName]["cachedHousenumberValue"]=new Array()}SNSasyncPostcode.formData[formName]["cachedHousenumberValue"][allFields[B].id]=""}if(allFields[B].id.indexOf("woonplaats")!=-1||allFields[B].id.indexOf("city")!=-1){if(SNSasyncPostcode.formData[formName]["cityField"]==null){SNSasyncPostcode.formData[formName]["cityField"]=new Array()}SNSasyncPostcode.formData[formName]["cityField"][allFields[B].id]=allFields[B];SNSasyncPostcode.formData[formName]["cityField"][allFields[B].id].readOnly=true;SNSasyncPostcode.formData[formName]["cityField"][allFields[B].id].className=SNSasyncPostcode.formData[formName]["cityField"][allFields[B].id].className+" disabled"}if(allFields[B].id.indexOf("straat")!=-1||allFields[B].id.indexOf("street")!=-1){if(SNSasyncPostcode.formData[formName]["streetField"]==null){SNSasyncPostcode.formData[formName]["streetField"]=new Array()}SNSasyncPostcode.formData[formName]["streetField"][allFields[B].id]=allFields[B];SNSasyncPostcode.formData[formName]["streetField"][allFields[B].id].readOnly=true;SNSasyncPostcode.formData[formName]["streetField"][allFields[B].id].className=SNSasyncPostcode.formData[formName]["streetField"][allFields[B].id].className+" disabled"}}if(SNSasyncPostcode.formData[formName]==null||(SNSasyncPostcode.formData[formName]["cityField"]==null)||(SNSasyncPostcode.formData[formName]["streetField"]==null)||(SNSasyncPostcode.formData[formName]["zipcodeField"]==null)||(SNSasyncPostcode.formData[formName]["housenumberField"]==null)){SNSasyncPostcode.formData[formName]=null}else{SNSasyncPostcode.formData[formName]["headerId"]="betrokkenpartij";SNSasyncPostcode.formData[formName]["ajaxRequest"]=null;SNSasyncPostcode.formData[formName]["errorMessage"]="Deze combinatie van postcode en huisnummer is niet bij ons bekend, vul de woonplaats en straat zelf in.";SNSasyncPostcode.formData[formName]["method"]="findPostcode";for(k=0;k<A.length;k++){A[k].supressError=true;SNSasyncPostcode.find(document.getElementById(A[k].id),SNSasyncPostcode.formData[formName])}}}}};SNSasyncPostcode.find=function(E,D){var B;var A;if(E&&E.target){E=E.target}if(typeof (event)!="undefined"){if(event.srcElement){E=event.srcElement}}current_id=E.id;if(current_id.indexOf("huisnummer")!=-1||current_id.indexOf("housenumber")!=-1){B=current_id;if(current_id.indexOf("huisnummer")!=-1){A=current_id.replace("huisnummer","postcode")}else{A=current_id.replace("housenumber","zipcode")}}else{if(current_id.indexOf("postcode")!=-1||current_id.indexOf("zipcode")!=-1){A=current_id;if(current_id.indexOf("postcode")!=-1){B=current_id.replace("postcode","huisnummer")}else{B=current_id.replace("zipcode","housenumber")}}else{D.housenumberField[B].supressError=false;return }}removeError(D.form,D.housenumberFieldId[B]);removeError(D.form,D.zipcodeFieldId[A]);if(D.zipcodeField[A]!=null&&(D.zipcodeField[A].value=="")||(D.housenumberField[B].value=="")){D.cachedZipcodeValue[A]="";D.cachedHousenumberValue[B]="";D.housenumberField[B].supressError=false;return }if((D.zipcodeField[A].value==D.cachedZipcodeValue[A])&&(D.housenumberField[B].value==D.cachedHousenumberValue[B])){D.housenumberField[B].supressError=false;return }formattedZipcodeField=SNSasyncPostcode.format(D.zipcodeField[A].value);if(formattedZipcodeField==null&&SNSasyncPostcode.supressError==false){setError(D.form,D.zipcodeFieldId[A],"Dit is geen juiste postcode. Vul een postcode in die bestaat uit vier cijfers en twee letters.");addErrorForOmniture();D.housenumberField[B].supressError=false;return }D.zipcodeField[A].value=formattedZipcodeField;D.cachedZipcodeValue[A]=formattedZipcodeField;D.cachedHousenumberValue[B]=D.housenumberField[B].value;D.current_id=E.id;var C='<?xml version="1.0"?>';C+="<asyncRequest>";C+="<method>"+D.method+"</method>";C+="<parameters>";C+="<postcode>"+formattedZipcodeField+"</postcode>";C+="<houseNumber>"+D.housenumberField[B].value+"</houseNumber>";C+="</parameters>";C+="</asyncRequest>";fireAjaxRequest(C,D,SNSasyncPostcode.processResult)};SNSasyncPostcode.format=function(A){expr=/^\d{4}\s*[a-zA-Z]{2}\s*$/;if(!expr.test(A)){return null}A=A.replace(/^\s+|\s+$/g,"");if(A.length==6){A=A.substring(0,4)+" "+A.substring(4)}return A.toUpperCase()};SNSasyncPostcode.processResult=function(C,E){current_id=E.current_id;if(current_id.indexOf("huisnummer")!=-1||current_id.indexOf("housenumber")!=-1){if(current_id.indexOf("huisnummer")!=-1){hnField=current_id;zipField=current_id.replace("huisnummer","postcode");cityField=current_id.replace("huisnummer","woonplaats");streetField=current_id.replace("huisnummer","straat")}else{hnField=current_id;zipField=current_id.replace("housenumber","zipcode");cityField=current_id.replace("housenumber","city");streetField=current_id.replace("housenumber","street")}}else{if(current_id.indexOf("postcode")!=-1||current_id.indexOf("zipcode")!=-1){if(current_id.indexOf("postcode")!=-1){hnField=current_id.replace("postcode","huisnummer");zipField=current_id;cityField=current_id.replace("postcode","woonplaats");streetField=current_id.replace("postcode","straat")}else{hnField=current_id.replace("zipcode","housenumber");zipField=current_id;cityField=current_id.replace("zipcode","city");streetField=current_id.replace("zipcode","street")}}else{return }}removeError(E.form,E.housenumberFieldId[hnField]);removeError(E.form,E.zipcodeFieldId[zipField]);var A="";var B="";var D="";if(C!=null){A=C.getElementsByTagName("faultcode");B=getChildContents(C,"city");D=getChildContents(C,"address")}if(((B==""||!B)&&(D==""||!D))||A.length>0){E.cityField[cityField].readOnly=false;E.streetField[streetField].readOnly=false;if(E.housenumberField[hnField].supressError==false){setError(E.form,E.housenumberFieldId[hnField],E.errorMessage)}addErrorForOmniture();E.housenumberField[hnField].supressError=false;return }E.cityField[cityField].value=B;E.cityField[cityField].readOnly=true;E.streetField[streetField].value=D;E.streetField[streetField].readOnly=true;E.housenumberField[hnField].supressError=false};function SNSmap(A,B){this.name=A;this.value=B}var SNScalculation={};SNScalculation.calculate=function(C,A,B){if(C==""){C='"calculatorForm"'}formNode=document.forms[C];inputs=SNScalculation.listFormInputs(formNode);var D="";for(i=0;i<inputs.length;i++){if(inputs[i].name=="type"){D=inputs[i].value}}var E='<?xml version="1.0"?>';E+="<asyncRequest>";E+="<method>"+D+"</method>";E+="<parameters>";for(i=0;i<inputs.length;i++){E+="<"+inputs[i].name+">"+inputs[i].value+"</"+inputs[i].name+">"}E+="</parameters>";E+="</asyncRequest>";formData=new Array();formData.headerId=B;formData.type=D;formData.requestXml=E;fireAjaxRequest(E,formData,A)};SNScalculation.listFormInputs=function(B){var A=new Array();inputNodes=B.getElementsByTagName("INPUT");for(i=0;i<inputNodes.length;i++){if(inputNodes[i].type=="text"||inputNodes[i].type=="hidden"){A.push(new SNSmap(inputNodes[i].name,inputNodes[i].value))}}selectNodes=B.getElementsByTagName("SELECT");for(i=0;i<selectNodes.length;i++){A.push(new SNSmap(selectNodes[i].name,selectNodes[i].options[selectNodes[i].selectedIndex].value))}return A};function showHiddenContainer(C){var B=new Array();var D;var A;D=document;B=getElementsByClassName(C);for(i=0;i<B.length;i++){B[i].className=B[i].className.replace(C,"")}}var SNShiddenFields={};SNShiddenFields.fill=function(A){var B=document.getElementById(A);if(B==null){return }inputNodes=B.getElementsByTagName("INPUT");for(i=0;i<inputNodes.length;i++){if(inputNodes[i].type=="hidden"&&inputNodes[i].id!=null&&inputNodes[i].id.indexOf("hidden")==0){if(document.getElementById(inputNodes[i].id.substring(6))){if(document.getElementById(inputNodes[i].id.substring(6)).nodeName=="SPAN"){inputNodes[i].value=document.getElementById(inputNodes[i].id.substring(6)).innerHTML}else{inputNodes[i].value=document.getElementById(inputNodes[i].id.substring(6)).value}}}}};var SNSInterest={};SNSInterest.GetInterestlist=function(C,A,B){if(C==""){C='"interestForm"'}formNode=document.forms[C];inputs=SNScalculation.listFormInputs(formNode);var D="";for(i=0;i<inputs.length;i++){if(inputs[i].name=="type"){D=inputs[i].value}}var E='<?xml version="1.0"?>';E+="<asyncRequest>";E+="<method>"+D+"</method>";E+="<parameters>";for(i=0;i<inputs.length;i++){E+="<"+inputs[i].name+">"+inputs[i].value+"</"+inputs[i].name+">"}E+="</parameters>";E+="</asyncRequest>";formData=new Array();formData.headerId=B;formData.type=D;formData.requestXml=E;fireAjaxRequest(E,formData,A)};function FormatNumberBy3(B,C,A){if(arguments.length==2){A=","}if(arguments.length==1){A=",";C="."}B=B.toString();a=B.split(C);x=a[0];y=a[1];z="";if(typeof (x)!="undefined"){for(i=x.length-1;i>=0;i--){z+=x.charAt(i)}z=z.replace(/(\d{3})/g,"$1"+A);if(z.slice(-A.length)==A){z=z.slice(0,-A.length)}x="";for(i=z.length-1;i>=0;i--){x+=z.charAt(i)}if(typeof (y)!="undefined"&&y.length>0){x+=C+y}}return x}function FormatMortgageNumber(A){return FormatNumberBy3(Math.round(A),",",".")+",-"}function StripFormatMortgageNumber(A){return A.replace(/\./g,"").replace(/,/g,"").replace(/-/g,"")}function setCutoffParameters(D,A,C){if(C>=1){return""}var E="&hascutofflist=1";var B=Math.round(C*(A-D));E="&cutoff_4=75,"+(B+D)+E;B=Math.round(C*(B));E="&cutoff_3=50,"+(B+D)+E;B=Math.round(C*(B));E="&cutoff_2=25,"+(B+D)+E;E="&cutoff_1=0,"+D+E;return E}SNSBankAccount.init=function(){if(typeof (SNSBankAccount.is_klant)=="undefined"||SNSBankAccount.is_klant=="ja"){return }var B=getElementsByClassName("SNSBankAccount");for(var A=0;A<B.length;A++){if(obj.addEventListener){Main.addEvent(B[A],"change",function(){SNSBankAccount.check(this.name)})}else{Main.addEvent(B[A],"change",function(){SNSBankAccount.check(event.srcElement.name)})}}};SNSBankAccount.check=function(B){var C="";var A="";if(document.getElementsByName("type").length>0){C=document.getElementsByName("type")[0].value}if(document.getElementsByName(B).length>0){A=document.getElementsByName(B)[0].value}var D='<?xml version="1.0"?>';D+="<asyncRequest>";D+="<method>"+C+"</method>";D+="<parameters>";D+="<rekeningnummer>"+A;D+="</rekeningnummer>";D+="</parameters>";D+="</asyncRequest>";formData=new Array();formData.headerId="account";formData.type=C;formData.inputName=B;formData.requestXml=D;fireAjaxRequest(D,formData,SNSBankAccount.processResult)};SNSBankAccount.processResult=function(A,B){if(A!=null){if(getChildContents(A,"sns_rekening")=="true"){if(document.getElementById("error_"+B.inputName)){removeCheckAccountError(B.inputName)}setCheckAccountError(B.inputName)}else{removeCheckAccountError(B.inputName)}}};SNSBankAccountEx.init=function(){var C=getElementsByClassName("SNSBankAccountExStatus");var B=getElementsByClassName("SNSBankAccountEx");if(B.length==C.length){for(var A=0;A<B.length;A++){addClass(C[A],B[A].name);if(obj.addEventListener){Main.addEvent(B[A],"change",function(){SNSBankAccountEx.check(this.name)})}else{Main.addEvent(B[A],"change",function(){SNSBankAccountEx.check(event.srcElement.name)})}}}};SNSBankAccountEx.check=function(B){var C="check_sns_account";var A="";if(document.getElementsByName("type").length>0){C=document.getElementsByName("type")[0].value}if(document.getElementsByName(B).length>0){A=document.getElementsByName(B)[0].value}statusElement=getElementsByClassName(B);if(statusElement.length>0){statusElement=statusElement[0]}var D='<?xml version="1.0"?>';D+="<asyncRequest>";D+="<method>"+C+"</method>";D+="<parameters>";D+="<rekeningnummer>"+A;D+="</rekeningnummer>";D+="</parameters>";D+="</asyncRequest>";formData=new Array();formData.headerId="account";formData.type=C;formData.inputName=B;formData.resultformpart=statusElement;formData.requestXml=D;fireAjaxRequest(D,formData,SNSBankAccountEx.processResult)};SNSBankAccountEx.processResult=function(A,B){if(A!=null){if(getChildContents(A,"error_accountservice")&&getChildContents(A,"error_accountservice").length>0){B.resultformpart.value="unknown"}else{B.resultformpart.value=getChildContents(A,"sns_rekening")}}};SNSAutoFillCustomerData.init=function(){fields=getElementsByClassName("SNSAutoFillCustomerData");for(var A=0;A<fields.length;A++){Main.addEvent(fields[A],"change",autoFillCustomerData)}};SNSInterestOnProduct.init=function(){var A="";if(SNSInterestOnProduct.subFormIdentifier!=="undefined"&&SNSInterestOnProduct.subFormIdentifier!==""){A=SNSInterestOnProduct.subFormIdentifier+"_"}SNSInterestOnProduct.timeyear_id=null;fields=getElementsByClassName("SNSInterestOnProduct");for(var B=0;B<fields.length;B++){Main.addEvent(fields[B],"change",SNSInterestOnProduct.getInterest);if(fields[B].id==="wmtext_"+A+"eenmalige_inleg"){SNSInterestOnProduct.amount_id=fields[B]}if(fields[B].id==="wmdropdown_"+A+"looptijd_jaar"){SNSInterestOnProduct.timeyear_id=fields[B]}if(fields[B].id==="wmtext_"+A+"looptijd_maand"){SNSInterestOnProduct.timemonth_id=fields[B]}}if(document.getElementById("wmtext_"+A+"product_rsc")){SNSInterestOnProduct.productid_id=document.getElementById("wmtext_"+A+"product_rsc")}if(typeof (SNSInterestOnProduct.formNodeId)=="undefined"){node=SNSInterestOnProduct.amount_id;while(node&&node.tagName!="FORM"){node=node.parentNode}if(node){SNSInterestOnProduct.formNodeId=node.id}}if(SNSInterestOnProduct.productid_id&&SNSInterestOnProduct.amount_id){fields=getElementsByClassName("SNSInterestOnAccountMinValue");for(var B=0;B<fields.length;B++){if(fields[B].id=="looptijd_maand"){SNSInterestOnProduct.timemonth_id=fields[B];alert("kamer van koophandler"+$("input[@name=sf_stp_product_deposito.rente_bijschrijven_per]:checked").val());var C='<?xml version="1.0"?>';C+="<asyncRequest>";C+="<method>geefProducteigenschappen</method>";C+="<parameters>";C+="<productid>"+SNSInterestOnProduct.productid_id.value+"</productid>";C+="</parameters>";C+="</asyncRequest>";formData=new Array();formData.headerId="ProductInterest";formData.requestXml=C;fireAjaxRequest(C,formData,SNSInterestOnProduct.processResultMinValue)}}}else{SNSInterestOnProduct.getInterest()}};SNSInterestOnProduct.getInterest=function(){var C=null,D=null,F=null,G="year";if(SNSInterestOnProduct.amount_id){D=SNSInterestOnProduct.amount_id.value}if(SNSInterestOnProduct.timeyear_id&&SNSInterestOnProduct.timeyear_id.parentNode.parentNode.style.display!=="none"){if(SNSInterestOnProduct.timeyear_id.options[SNSInterestOnProduct.timeyear_id.selectedIndex].value>0){var B=SNSInterestOnProduct.timeyear_id.options[SNSInterestOnProduct.timeyear_id.selectedIndex].value;F=B*12}else{F=""}}else{if(SNSInterestOnProduct.timemonth_id&&SNSInterestOnProduct.timemonth_id.parentNode.parentNode.style.display!=="none"){F=SNSInterestOnProduct.timemonth_id.value;G="month"}else{return }}if(SNSInterestOnProduct.productid_id){if($("input[@name=sf_stp_product_deposito.rente_bijschrijven_per]:checked").val()=="maand"){C="869"}else{C="868"}}else{return }var A=null;if(C&&D&&F){A="geefRentepercentage"}else{if(C){A="checkInput"}}var E='<?xml version="1.0"?>';E+="<asyncRequest>";E+="<method>"+A+"</method>";E+="<parameters>";E+="<productid>"+C+"</productid>";E+="<time>"+F+"</time>";E+="<period>"+G+"</period>";E+="<amount>"+D+"</amount>";E+="</parameters>";E+="</asyncRequest>";formData=new Array();formData.headerId="ProductInterest";formData.requestXml=E;fireAjaxRequest(E,formData,SNSInterestOnProduct.processResult)};SNSInterestOnProduct.processResult=function(A,D){if(A!=null){var F=getChildContents(A,"interest_formatted");var C=getChildContents(A,"eenmaligeinleg");var E=getChildContents(A,"looptijd_maand");var B=getChildContents(A,"looptijd_jaar");if(F==null){F="??";document.getElementById("SNSInterestOnProductextra").style.display="block";document.getElementById("SNSInterestOnProductInterest").style.display="none"}else{document.getElementById("SNSInterestOnProductextra").style.display="none";document.getElementById("SNSInterestOnProductInterest").style.display="block"}formNode=document.getElementById(SNSInterestOnProduct.formNodeId);if(formNode){removeError(formNode,SNSInterestOnProduct.amount_id.name);if(SNSInterestOnProduct.timeyear_id){removeError(formNode,SNSInterestOnProduct.timeyear_id.name)}removeError(formNode,SNSInterestOnProduct.timemonth_id.name);if(C!=null){setError(formNode,SNSInterestOnProduct.amount_id.name,C);addErrorForOmniture()}if(SNSInterestOnProduct.timeyear_id&&SNSInterestOnProduct.timeyear_id.parentNode.parentNode.style.display!="none"){if(B!=null){setError(formNode,SNSInterestOnProduct.timeyear_id.name,B);addErrorForOmniture()}}else{if(E!=null&&SNSInterestOnProduct.timemonth_id.parentNode.parentNode.style.display!="none"){setError(formNode,SNSInterestOnProduct.timemonth_id.name,E);addErrorForOmniture()}}}if(document.getElementById(SNSInterestOnProduct.result_id)){document.getElementById(SNSInterestOnProduct.result_id).innerHTML='<strong style="font-size:1.3 em;">'+F+"%</strong>";document.getElementById(SNSInterestOnProduct.interest_id).value=F}}};SNSInterestOnAccount.init=function(){SNSInterestOnAccount.timeyear_id=null;fields=getElementsByClassName("SNSInterestOnAccount");for(var A=0;A<fields.length;A++){Main.addEvent(fields[A],"change",SNSInterestOnAccount.getInterest);if(fields[A].id=="eenmaligeinleg"){SNSInterestOnAccount.amount_id=fields[A]}if(fields[A].id=="klimrenteinleg"){SNSInterestOnAccount.amount_id=fields[A]}if(fields[A].id=="looptijd_jaar"){SNSInterestOnAccount.timeyear_id=fields[A]}if(fields[A].id=="looptijd_maand"){SNSInterestOnAccount.timemonth_id=fields[A]}}if(document.getElementById("product_rsc")){SNSInterestOnAccount.productid_id=document.getElementById("product_rsc")}else{if(document.getElementById("product_rsc_jaar")){SNSInterestOnAccount.productid_id_jaar=document.getElementById("product_rsc_jaar")}if(document.getElementById("product_rsc_maand")){SNSInterestOnAccount.productid_id_maand=document.getElementById("product_rsc_maand")}if(document.getElementById("product_rsc_klimrente")){SNSInterestOnAccount.productid_id_maand=document.getElementById("product_rsc_klimrente")}}if(typeof (SNSInterestOnAccount.formNodeId)=="undefined"){node=SNSInterestOnAccount.amount_id;while(node&&node.tagName!="FORM"){node=node.parentNode}if(node){SNSInterestOnAccount.formNodeId=node.id}}if(SNSInterestOnAccount.productid_id&&SNSInterestOnAccount.amount_id){fields=getElementsByClassName("SNSInterestOnAccountMinValue");for(var A=0;A<fields.length;A++){if(fields[A].id=="looptijd_maand"){SNSInterestOnAccount.timemonth_id=fields[A];var B='<?xml version="1.0"?>';B+="<asyncRequest>";B+="<method>geefProducteigenschappen</method>";B+="<parameters>";B+="<productid>"+SNSInterestOnAccount.productid_id.value+"</productid>";B+="</parameters>";B+="</asyncRequest>";formData=new Array();formData.headerId="ProductInterest";formData.requestXml=B;fireAjaxRequest(B,formData,SNSInterestOnAccount.processResultMinValue)}}}else{SNSInterestOnAccount.getInterest()}};SNSInterestOnAccount.getInterest=function(){var A=null,B=null,D=null,E="year";if(SNSInterestOnAccount.amount_id){B=SNSInterestOnAccount.amount_id.value}if(SNSInterestOnAccount.timeyear_id&&SNSInterestOnAccount.timeyear_id.parentNode.parentNode.style.display=="block"){if(SNSInterestOnAccount.timeyear_id.value!=""){D=SNSInterestOnAccount.timeyear_id.value*12}else{D=SNSInterestOnAccount.timeyear_id.value}}else{if(SNSInterestOnAccount.timemonth_id){D=SNSInterestOnAccount.timemonth_id.value;E="month"}else{return }}if(SNSInterestOnAccount.productid_id){A=SNSInterestOnAccount.productid_id.value}else{if(SNSInterestOnAccount.productid_id_jaar||SNSInterestOnAccount.productid_id_maand){if(E=="month"){A=SNSInterestOnAccount.productid_id_maand.value}else{if(E=="year"){A=SNSInterestOnAccount.productid_id_jaar.value}}}else{return }}if(A&&B&&D){srvFunction="geefRentepercentage"}else{if(A){srvFunction="checkInput"}}var C='<?xml version="1.0"?>';C+="<asyncRequest>";C+="<method>"+srvFunction+"</method>";C+="<parameters>";C+="<productid>"+A+"</productid>";C+="<time>"+D+"</time>";C+="<period>"+E+"</period>";C+="<amount>"+B+"</amount>";C+="</parameters>";C+="</asyncRequest>";formData=new Array();formData.headerId="ProductInterest";formData.requestXml=C;fireAjaxRequest(C,formData,SNSInterestOnAccount.processResult)};SNSInterestOnAccount.processResult=function(A,D){if(A!=null){var F=getChildContents(A,"interest_formatted");var C=getChildContents(A,"eenmaligeinleg");var E=getChildContents(A,"looptijd_maand");var B=getChildContents(A,"looptijd_jaar");if(F==null){F="??"}formNode=document.getElementById(SNSInterestOnAccount.formNodeId);if(formNode){removeError(formNode,SNSInterestOnAccount.amount_id.name);if(SNSInterestOnAccount.timeyear_id){removeError(formNode,SNSInterestOnAccount.timeyear_id.name)}removeError(formNode,SNSInterestOnAccount.timemonth_id.name);if(C!=null){setError(formNode,SNSInterestOnAccount.amount_id.name,C);addErrorForOmniture()}if(SNSInterestOnAccount.timeyear_id&&SNSInterestOnAccount.timeyear_id.parentNode.parentNode.style.display=="block"){if(B!=null){setError(formNode,SNSInterestOnAccount.timeyear_id.name,B);addErrorForOmniture()}}else{if(E!=null){setError(formNode,SNSInterestOnAccount.timemonth_id.name,E);addErrorForOmniture()}}}if(document.getElementById(SNSInterestOnAccount.result_id)){document.getElementById(SNSInterestOnAccount.result_id).innerHTML='<strong style="font-size:1.3 em;">'+F+"%</strong>"}}};SNSInterestOnAccount.processResultMinValue=function(A,B){if(A!=null){SNSInterestOnAccount.timemonth_id.value=getChildContents(A,"minLooptijd")}};SNSNearestOffice.init=function(){allFields=getElementsByClassName("SNSNearestOffice");for(var A=0;A<allFields.length;A++){if(obj.addEventListener){Main.addEvent(allFields[A],"blur",function(){SNSNearestOffice.find(this.name)})}else{Main.addEvent(allFields[A],"blur",function(){SNSNearestOffice.find(event.srcElement.name)})}if(document.getElementById("searchOffice_0")){Main.addEvent(document.getElementById("searchOffice_0"),"change",function(){SNSNearestOffice.fillSessionValueRadio0()})}if(document.getElementById("searchOffice_1")){Main.addEvent(document.getElementById("searchOffice_1"),"change",function(){SNSNearestOffice.fillSessionValueRadio1()})}if(document.getElementById("lstSearchOffice_choice")){Main.addEvent(document.getElementById("lstSearchOffice_choice"),"change",function(){SNSNearestOffice.fillSessionValueRadio1()})}}if(document.getElementById("searchOfficeSessionValue")!=null){SNSNearestOffice.loadFromSession(document.getElementById("searchOfficeSessionValue").value)}};SNSNearestOffice.find=function(B){var A="";if(document.getElementsByName(B).length>0){A=document.getElementsByName(B)[0].value}if(SNSasyncPostcode.format(A)!=null){var C='<?xml version="1.0"?>';C+="<asyncRequest>";C+="<method>singlesearchlocation</method>";C+="<parameters>";C+="<postcode>"+SNSasyncPostcode.format(A);C+="</postcode>";C+="</parameters>";C+="</asyncRequest>";formData=new Array();formData.headerId="location";formData.type="singlesearchlocation";formData.inputName=B;formData.requestXml=C;fireAjaxRequest(C,formData,SNSNearestOffice.processResult)}};SNSNearestOffice.processResult=function(A,B){if(A!=null){if((getChildContents(A,"nearestOfficeCode")!=null&&getChildContents(A,"nearestOfficeCode")!=""&&getChildContents(A,"nearestOfficeCode")!="null")&&(getChildContents(A,"nearestOfficeName")!=null&&getChildContents(A,"nearestOfficeName")!=""&&getChildContents(A,"nearestOfficeName")!="null")){if(document.getElementById("searchOffice_0")){document.getElementById("searchOffice_0").disabled=false;document.getElementById("searchOffice_0").checked=true;document.getElementById("searchOffice_0").value=getChildContents(A,"nearestOfficeCode")}if(document.getElementById("lblSearchOffice_default")){document.getElementById("lblSearchOffice_default").innerHTML=getChildContents(A,"nearestOfficeName")}if(document.getElementById("searchOfficeSessionValue")){document.getElementById("searchOfficeSessionValue").value=getChildContents(A,"nearestOfficeCode")+"|"+getChildContents(A,"nearestOfficeName")+"|searchOffice_0"}}else{if(document.getElementById("searchOffice_0")){document.getElementById("searchOffice_0").disabled=true;document.getElementById("searchOffice_0").checked=false;if(document.getElementById("searchOffice_1")){document.getElementById("searchOffice_1").checked=true}document.getElementById("searchOffice_0").value=""}if(document.getElementById("lblSearchOffice_default")&&document.getElementById("hiddenOfficeDefaultText")){document.getElementById("lblSearchOffice_default").innerHTML=document.getElementById("hiddenOfficeDefaultText").value}if(document.getElementById("searchOfficeSessionValue")){SNSNearestOffice.fillSessionValueRadio1()}}}};SNSNearestOffice.fillSessionValueRadio0=function(){var A="";if(document.getElementById("searchOffice_0")!=null&&document.getElementById("lblSearchOffice_default")!=null){A=document.getElementById("searchOffice_0").value;A+="|";A+=document.getElementById("lblSearchOffice_default").innerHTML;A+="|";A+="searchOffice_0";if(document.getElementById("searchOfficeSessionValue")){document.getElementById("searchOfficeSessionValue").value=A}}};SNSNearestOffice.fillSessionValueRadio1=function(){var A="";if(document.getElementById("searchOffice_1")&&document.getElementById("searchOffice_1").checked){if(document.getElementById("lstSearchOffice_choice")&&document.getElementById("searchOfficeSessionValue")){var C=document.getElementById("lstSearchOffice_choice");for(var B=0;B<C.length;B++){if(C.options[B].selected){A=C.options[B].value;A+="|";A+=C.options[B].text}}A+="|";A+="searchOffice_1";document.getElementById("searchOfficeSessionValue").value=A}}};SNSNearestOffice.loadFromSession=function(B){if(B.length>0){var F=B.split("|");if(F.length==3){var G=F[0];var A=F[1];var D=F[2];if(document.getElementById(D)){document.getElementById(D).checked=true}if(D=="searchOffice_0"&&document.getElementById("searchOffice_0")&&document.getElementById("lblSearchOffice_default")){document.getElementById("searchOffice_0").disabled=false;document.getElementById("searchOffice_0").value=G;document.getElementById("lblSearchOffice_default").value=A}else{if(document.getElementById("searchOffice_0")&&document.getElementById("lstSearchOffice_choice")){var E=document.getElementById("lstSearchOffice_choice");for(var C=0;C<E.length;C++){if(E.options[C].value==G){E.options[C].selected==true;document.getElementById("searchOffice_0").disabled=true}}}}}}};SNSLogoutOnUnload.url="";SNSLogoutOnUnload.postop="";SNSLogoutOnUnload.posleft="";SNSLogoutOnUnload.winwidth=250;SNSLogoutOnUnload.winheight=50;SNSLogoutOnUnload.notified=false;SNSLogoutOnUnload.init=function(){allFields=getElementsByClassName("SNSLogoutOnUnload snshidden");if(allFields.length>0){SNSLogoutOnUnload.url=allFields[0].value;try{SNSLogoutOnUnload.postop=parseInt((window.screen.width-SNSLogoutOnUnload.winwidth)/2);SNSLogoutOnUnload.posleft=parseInt((window.screen.height-SNSLogoutOnUnload.winheight)/2)}catch(B){SNSLogoutOnUnload.postop,SNSLogoutOnUnload.posleft=300}Main.addEvent(window,"unload",SNSLogoutOnUnload.extUnload);Main.eventCache.add(window,"unload",SNSLogoutOnUnload.extUnload,false);allLinks=document.getElementsByTagName("A");for(var A=0;A<allLinks.length;A++){if(allLinks[A].target==""||allLinks[A].target=="_blank"||allLinks[A].target=="_self"&&allLinks[A].target=="_top"&&allLinks[A].target=="_parent"){if(allLinks[A].className!="readposition"&&allLinks[A].className!="printposition"&&allLinks[A].className!="underline"&&allLinks[A].className!="nologoutclass"){if(allLinks[A].className=="arrow-left"||allLinks[A].className=="arrow-right"||allLinks[A].parentNode.className=="button-holder right"||allLinks[A].parentNode.parentNode.className=="button-holder right"){Main.addEvent(allLinks[A],"click",SNSLogoutOnUnload.silentUnload);Main.eventCache.add(allLinks[A],"click",SNSLogoutOnUnload.silentUnload,false)}else{Main.addEvent(allLinks[A],"click",SNSLogoutOnUnload.unload);Main.eventCache.add(allLinks[A],"click",SNSLogoutOnUnload.unload,false)}}}}allLinks=document.getElementsByTagName("INPUT");for(var A=0;A<allLinks.length;A++){if(allLinks[A].type=="button"||allLinks[A].type=="submit"||(allLinks[A].type=="image"&&allLinks[A].name!="dummybutton")){Main.addEvent(allLinks[A],"click",SNSLogoutOnUnload.unload);Main.eventCache.add(allLinks[A],"click",SNSLogoutOnUnload.unload,false)}}}return };SNSLogoutOnUnload.silentUnload=function(){SNSLogoutOnUnload.notified=true};SNSLogoutOnUnload.extUnload=function(A){if(!SNSLogoutOnUnload.notified){if(typeof (event)!="undefined"){if(event.srcElement){SNSLogoutOnUnload.unload()}else{}}else{if(A&&A.target==null){SNSLogoutOnUnload.unload()}else{}}}};SNSLogoutOnUnload.unload=function(){if(!SNSLogoutOnUnload.notified){SNSLogoutOnUnload.notified=true;handle=window.open(SNSLogoutOnUnload.url,"Uitloggen","width="+SNSLogoutOnUnload.winwidth+", height="+SNSLogoutOnUnload.winheight+", left="+SNSLogoutOnUnload.posleft+", top="+SNSLogoutOnUnload.postop+", screenX="+SNSLogoutOnUnload.posleft+", screenY="+SNSLogoutOnUnload.postop+",toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no",true);if(handle){handle.focus()}}};SNSAutoLogout.logoutUrl=null;SNSAutoLogout.init=function(){allFields=getElementsByClassName("SNSAutoLogout");if(allFields.length>0){SNSAutoLogout.logoutUrl=allFields[0].value.split("|");if(!SNSAutoLogout.logoutUrl||SNSAutoLogout.logoutUrl.length==0){return }for(i=0;i<SNSAutoLogout.logoutUrl.length;i++){if(SNSAutoLogout.logoutUrl[i]!=""){SNSAutoLogout.asyncLogout(SNSAutoLogout.logoutUrl[i])}}}};SNSAutoLogout.asyncLogout=function(A){if(window.XMLHttpRequest){ajaxRequest=new XMLHttpRequest()}else{if(window.ActiveXObject){ajaxRequest=new ActiveXObject("Microsoft.XMLHTTP")}}ajaxRequest.open("GET",A,true);ajaxRequest.onreadystatechange=function(){};ajaxRequest.send(null)};var SNSAccountDropdown={};SNSAccountDropdown.filling=false;SNSAccountDropdown.to=null;SNSAccountDropdown.textField=null;SNSAccountDropdown.fillListTo=function(){if(SNSAccountDropdown.to!=null){window.clearTimeout(SNSAccountDropdown.to)}if(!SNSAccountDropdown.filling){SNSAccountDropdown.to=window.setTimeout(SNSAccountDropdown.fillList,600)}};SNSAccountDropdown.fillList=function(){SNSAccountDropdown.filling=true;baselist=document.getElementById("debitaccount");sublist=document.getElementById("debitcard");if(baselist&&sublist){removeAllOptions(sublist);for(i=0;i<lists[baselist.options[baselist.selectedIndex].value].length;i++){if(lists[baselist.options[baselist.selectedIndex].value][i]!=null){addOption(sublist,lists[baselist.options[baselist.selectedIndex].value+"_txt"][i],lists[baselist.options[baselist.selectedIndex].value][i])}}}SNSAccountDropdown.filling=false};SNSAccountDropdown.initUnblockable=function(){allFields=document.getElementsByName("SNSAccountDropdownBP");if(allFields.length==1){SNSAccountDropdown.textField=allFields[0]}};SNSAccountDropdown.isDebitCardUnblockable=function(){SNSAccountDropdown.initUnblockable();debitcardList=document.getElementById("debitcard");selectedIndex=debitcardList.selectedIndex;selectedDebitcardId=debitcardList.options[selectedIndex].value;baselist=document.getElementById("debitaccount");selectedAccountNr=baselist.options[baselist.selectedIndex].value;isDebitCardUnblockable=unblockableDebitcardsList[selectedAccountNr+"-"+selectedDebitcardId];if(SNSAccountDropdown.textField!=null){if(!isDebitCardUnblockable){SNSAccountDropdown.textField.parentNode.style.backgroundColor="#ff0";SNSAccountDropdown.textField.parentNode.style.display="";var A=new YAHOO.util.ColorAnim(SNSAccountDropdown.textField.parentNode,{backgroundColor:{to:"#fff"}},3,YAHOO.util.Easing.easeOut);A.onComplete.fire=onCompleteHandlerFire;A.animate()}else{SNSAccountDropdown.textField.parentNode.style.display="none"}}};var SNSCustomerDropdown={};SNSCustomerDropdown.filling=false;SNSCustomerDropdown.to=null;SNSCustomerDropdown.changeVisibility=function(G){var D=null;var J=null;var F=null;var B=null;var C=null;var A=null;var H=null;var E=null;var I=null;if(document.getElementById("existing")){J=document.getElementById("existing")}if(document.getElementById("new")){D=document.getElementById("new")}if(document.getElementById("ILS")){F=document.getElementById("ILS")}if(document.getElementById("new_basis")){B=document.getElementById("new_basis")}if(document.getElementById("new_legitimatie")){C=document.getElementById("new_legitimatie")}role="";if(document.getElementById("hiddenWVklantnummer")){role="WV"}else{if(document.getElementById("hiddenMHklantnummer")){role="MH"}else{if(document.getElementById("hiddenGMklantnummer")){role="GM"}}}if(document.getElementById(role+"name")){A=document.getElementById(role+"name")}if(document.getElementById("hidden"+role+"name")){hiddenName=document.getElementById("hidden"+role+"name")}if(document.getElementById(role+"firstname")){H=document.getElementById(role+"firstname")}if(document.getElementById("hidden"+role+"firstname")){hiddenFirstName=document.getElementById("hidden"+role+"firstname")}if(document.getElementById(role+"prepositionname")){E=document.getElementById(role+"prepositionname")}if(document.getElementById("hidden"+role+"prepositionname")){hiddenPrepositionName=document.getElementById("hidden"+role+"prepositionname")}if(document.getElementById(role+"lastname")){I=document.getElementById(role+"lastname")}if(document.getElementById("hidden"+role+"lastname")){hiddenLastName=document.getElementById("hidden"+role+"lastname")}if(document.getElementById(role+"birthdate")){birthdate=document.getElementById(role+"birthdate")}if(document.getElementById("hidden"+role+"birthdate")){hiddenBirthdate=document.getElementById("hidden"+role+"birthdate")}if(document.getElementById("hidden"+role+"klantnummer")){hiddenKlantnummer=document.getElementById("hidden"+role+"klantnummer");hiddenKlantnummer.value="0"}if(document.getElementById("hidden"+role+"ILS")){hiddenILS=document.getElementById("hidden"+role+"ILS")}if(document.getElementById("hidden"+role+"huisnummer")){hiddenHuisnummer=document.getElementById("hidden"+role+"huisnummer")}if(document.getElementById("hidden"+role+"postcode")){hiddenHuisnummer=document.getElementById("hidden"+role+"postcode")}if(document.getElementById("hidden"+role+"bsn")){hiddenHuisnummer=document.getElementById("hidden"+role+"bsn")}if(J){J.style.display="none"}if(D){D.style.display="none"}if(B){B.style.display="none"}if(F){F.style.display="none"}if(C){C.style.display="none"}sourceValue="";if(document.getElementById(G)){sourceObject=document.getElementById(G);sourceValue=sourceObject.value}if(sourceValue=="new"){if(D){D.style.display="block"}if(B){B.style.display="block";if(F){F.style.display="block"}if(C){C.style.display="block"}}}else{if(sourceValue!=""&&J){if((A!=null)&&(A!="")){A.innerHTML=SNSCustomerProperties.initials[sourceValue]+" "+SNSCustomerProperties.names[sourceValue];hiddenName.value=SNSCustomerProperties.initials[sourceValue]+" "+SNSCustomerProperties.names[sourceValue]}if((H!=null)&&(H!="")){H.innerHTML=SNSCustomerProperties.initials[sourceValue];hiddenFirstName.value=SNSCustomerProperties.initials[sourceValue]}if((E!=null)&&(E!="")){E.innerHTML=SNSCustomerProperties.preposition[sourceValue];hiddenPrepositionName.value=SNSCustomerProperties.preposition[sourceValue]}if((I!=null)&&(I!="")){I.innerHTML=SNSCustomerProperties.names[sourceValue];hiddenLastName.value=SNSCustomerProperties.names[sourceValue]}birthdate.innerHTML=SNSCustomerProperties.birthdates[sourceValue];hiddenBirthdate.value=SNSCustomerProperties.birthdates[sourceValue];hiddenKlantnummer.value=SNSCustomerProperties.klantnummers[sourceValue];hiddenILS.value=SNSCustomerProperties.ILS[sourceValue];J.style.display="block";if(SNSCustomerProperties.ILS[sourceValue]&&F){F.style.display="none"}else{F.style.display="block"}}else{if(!J&&D){D.style.display="block"}if(!J&&B){B.style.display="block";if(F){F.style.display="block"}if(C){C.style.display="block"}}}}};var SNSDigipasLimit={};SNSDigipasLimit.fields=new Array();SNSDigipasLimit.to=null;SNSDigipasLimit.checking=false;SNSDigipasLimit.init=function(){allFields=getElementsByClassName("SNSDigipasLimiet");if(allFields.length>0){for(i=0;i<allFields.length;i++){switch(allFields[i].tagName){case"INPUT":SNSDigipasLimit.fields.input=allFields[i];Main.addEvent(allFields[i],"mouseup",SNSDigipasLimit.checkLimit);Main.addEvent(allFields[i],"keyup",SNSDigipasLimit.checkLimitTo);Main.eventCache.add(allFields[i],"mouseup",SNSDigipasLimit.checkLimit,false);Main.eventCache.add(allFields[i],"keyup",SNSDigipasLimit.checkLimitTo,false);break;case"P":if(allFields[i].className.indexOf("high")>=0){SNSDigipasLimit.fields.msg_high=allFields[i]}else{SNSDigipasLimit.fields.msg_low=allFields[i]}break;case"DIV":SNSDigipasLimit.fields["listnode-permanent"]=null;SNSDigipasLimit.fields["listnode-tijdelijk"]=null;var A=allFields[i].firstChild;while(A&&(SNSDigipasLimit.fields["listnode-permanent"]==null||SNSDigipasLimit.fields["listnode-tijdelijk"]==null)){if(A.tagName=="INPUT"&&A.value=="permanent"){SNSDigipasLimit.fields["listnode-permanent"]=A}if(A.tagName=="INPUT"&&A.value=="tijdelijk"){SNSDigipasLimit.fields["listnode-tijdelijk"]=A}A=A.nextSibling}break}}SNSDigipasLimit.checkLimit()}};SNSDigipasLimit.checkLimitTo=function(){if(SNSDigipasLimit.to!=null){window.clearTimeout(SNSDigipasLimit.to)}if(!SNSDigipasLimit.checking){SNSDigipasLimit.to=window.setTimeout(SNSDigipasLimit.checkLimit,600)}};SNSDigipasLimit.checkLimit=function(){SNSDigipasLimit.checking=true;if(SNSDigipasLimit.fields.input&&SNSDigipasLimit.fields.msg_high&&SNSDigipasLimit.fields.msg_low&&SNSDigipasLimit.fields["listnode-permanent"]&&SNSDigipasLimit.fields["listnode-tijdelijk"]){if(parseInt(SNSDigipasLimit.fields.input.value)==0){removeClass(SNSDigipasLimit.fields.msg_low,"snshidden")}else{addClass(SNSDigipasLimit.fields.msg_low,"snshidden")}if(parseInt(SNSDigipasLimit.fields.input.value)>100000){SNSDigipasLimit.fields["listnode-permanent"].checked="";SNSDigipasLimit.fields["listnode-tijdelijk"].checked="checked";removeClass(SNSDigipasLimit.fields.msg_high,"snshidden")}else{addClass(SNSDigipasLimit.fields.msg_high,"snshidden")}SNSDigipasLimit.fields["listnode-permanent"].disabled=(parseInt(SNSDigipasLimit.fields.input.value)>100000)?"true":""}SNSDigipasLimit.checking=false};var SNSAccountProperties={};SNSAccountProperties.fields=new Array();SNSAccountProperties.formId="";SNSAccountProperties.select_current=null;SNSAccountProperties.busy=null;SNSAccountProperties.reactionTo=null;SNSAccountProperties.init=function(){allFields=getElementsByClassName("SNSAccountProperties");if(allFields.length>0){for(i=0;i<allFields.length;i++){switch(allFields[i].tagName){case"SELECT":SNSAccountProperties.fields.input=allFields[i];SNSAccountProperties.formId=allFields[i].id;removeAllOptions(SNSAccountProperties.fields.input);addOption(SNSAccountProperties.fields.input,"Maak een keuze","",allFields[i].id+"_0");if(SNSAccountProperties.accounts.length==SNSAccountProperties.accountTexts.length){for(A=0;A<SNSAccountProperties.accounts.length;A++){if(SNSAccountProperties.accounts[A]!=null){addOption(SNSAccountProperties.fields.input,SNSAccountProperties.accountTexts[A],SNSAccountProperties.accounts[A],allFields[i].id+"_"+A+1)}}}for(var A=0,B;B=allFields[i].options[A];A++){if(B.value==""&&A>0){B.disabled="disabled";B.style.color="#aaa"}}isIE6=navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1;isIE7=navigator.userAgent.toLowerCase().indexOf("msie 7")!=-1;if(isIE6||isIE7){Main.addEvent(allFields[i],"focus",function(){SNSAccountProperties.select_current=SNSAccountProperties.fields.input.selectedIndex});Main.addEvent(allFields[i],"change",function(){SNSAccountProperties.restore()})}if(allFields[i].className.indexOf("checkBlocked")>=0){Main.addEvent(allFields[i],"change",SNSAccountProperties.getProperties);Main.eventCache.add(allFields[i],"change",SNSAccountProperties.getProperties,false)}break;case"P":if(allFields[i].className.indexOf("blocked")>=0){SNSDigipasLimit.fields.blocked=allFields[i]}allFields[i].style.color="red";break}}}};SNSAccountProperties.restore=function(){if(SNSAccountProperties.fields.input.options[SNSAccountProperties.fields.input.selectedIndex].disabled){SNSAccountProperties.fields.input.selectedIndex=SNSAccountProperties.select_current}};SNSAccountProperties.getPropertiesTo=function(){if(SNSAccountProperties.reactionTo!=null){window.clearTimeout(SNSAccountProperties.reactionTo)}if(SNSAccountProperties.busy==null){SNSAccountProperties.reactionTo=window.setTimeout(SNSAccountProperties.getProperties,600)}};SNSAccountProperties.clearTimeout=function(){selectObj.disabled="";if(SNSAccountProperties.busy!=null){window.clearTimeout(SNSAccountProperties.busy);SNSAccountProperties.busy=null}};SNSAccountProperties.getProperties=function(){selectObj=SNSAccountProperties.fields.input;if(SNSAccountProperties.busy==null&&selectObj!=null&&selectObj.options[selectObj.selectedIndex].value!=""){SNSAccountProperties.busy=window.setTimeout(SNSAccountProperties.clearTimeout,30000);selectObj.disabled="disabled";var A='<?xml version="1.0"?>';A+="<asyncRequest>";A+="<method>check_account_blocked</method>";A+="<parameters>";A+="<rekeningnummer>"+selectObj.options[selectObj.selectedIndex].value;A+="</rekeningnummer>";A+="</parameters>";A+="</asyncRequest>";formData=new Array();formData.headerId="account";formData.type="accountproperties";formData.requestXml=A;fireAjaxRequest(A,formData,SNSAccountProperties.processResult)}};SNSAccountProperties.processResult=function(A,B){if(A==null){SNSAccountProperties.clearTimeout();return }if(document.getElementById("error_"+SNSAccountProperties.formId)!=null){addClass(document.getElementById("error_"+SNSAccountProperties.formId),"snshidden")}if(getChildContents(A,"blocked")=="true"){removeClass(SNSDigipasLimit.fields.blocked,"snshidden")}else{addClass(SNSDigipasLimit.fields.blocked,"snshidden")}SNSAccountProperties.clearTimeout()};function checkMVTSNSCookie(){if(document.cookie.length>0){offset=document.cookie.indexOf("MVT_SNS");if(offset!=-1){protocol="http:";url="//www6.tmvtp.com/allocator/execute/17454767912426030803";if(document.location.protocol=="https:"){protocol="https:"}url=protocol+url;document.write('<script src="',url,'" type="text/javascript"><script>')}}}SNSBankExtra.BBcodeToHTML=function(B){var A;A=B;search=new Array(/\[br\]/g,/\[url=(.*?)\](.*?)\[\/url\]/g,/\[b\](.*?)\[\/b\]/g,/\[small\](.*?)\[\/small\]/g);replace=new Array("<br/>",'<a target="_blank" class="dummy" style="cursor:pointer; text-decoration:underline; color:#FF0000" href="$1">$2</a>',"<strong>$1</strong>","<small>$1</small>");for(i=0;i<search.length;i++){A=A.replace(search[i],replace[i])}return A};SNSAutoFillForm.init=function(){var D=getElementsByClassName("autofillform");var B;var A;for(i=0;i<D.length;i++){if(D[i]!=null){var C=D[i].getElementsByTagName("input");for(j=0;j<C.length;j++){if(C[j].id.length>0){B=gup(C[j].id);if(B.length>0){A=C[j].maxLength;if(A!=null){B=B.substring(0,A)}C[j].value=B}}}}}};function fireEvent(B,C){if(document.createEventObject){var A=document.createEventObject();return B.fireEvent("on"+C,A)}else{var A=document.createEvent("HTMLEvents");A.initEvent(C,true,true);return !B.dispatchEvent(A)}}function limitText(B,A){if(B.value.length>A){B.value=B.value.substring(0,A)}}function disableEnterOnRadioButton(){var B=document.getElementsByTagName("input");for(i=0;i<B.length;i++){if(B[i].type=="radio"){B[i].onkeypress=function A(C){if(window.event&&window.event.keyCode==13){return false}else{if(C&&C.which==13){return false}else{return false}}}}}}Main.addEvent(window,"load",SNSBankExtra.init);Main.eventCache.add(window,"load",SNSBankExtra.init,false);
