SNS.hypotheken.widget={};SNS.hypotheken.widget.calculate=function(){if(SNS.hypotheken.widget.visible==""){var A='<?xml version="1.0"?>';A+="<asyncRequest>";A+="<method>maxmortgage</method>";A+="<parameters>";A+="<brutoJaarSalaris>"+SNS.hypotheken.widget.brutoJaarSalaris+"</brutoJaarSalaris>";A+="<brutoJaarSalarisPartner>"+SNS.hypotheken.widget.brutoJaarSalarisPartner+"</brutoJaarSalarisPartner>";A+="<eigenGeld>"+SNS.hypotheken.widget.eigenGeld+"</eigenGeld>";A+="<alimentatie>"+SNS.hypotheken.widget.alimentatie+"</alimentatie>";A+="<vasteMaandlasten>"+SNS.hypotheken.widget.vasteMaandlasten+"</vasteMaandlasten>";A+="<gewensteHypotheek>"+SNS.hypotheken.widget.gewensteHypotheek+"</gewensteHypotheek>";if(SNS.hypotheken.widget.gewensteHypotheekPlainFormat<SNS.hypotheken.widget.maximaalBedragPlainFormat){A+="<gewensteHypotheekGekozen>1</gewensteHypotheekGekozen>"}else{A+="<gewensteHypotheekGekozen>0</gewensteHypotheekGekozen>"}A+="<gewensteHypotheekInvoer>"+SNS.hypotheken.widget.gewensteHypotheek+"</gewensteHypotheekInvoer>";A+="<totaleBudgetkorting>"+SNS.hypotheken.widget.totaleBudgetkorting+"</totaleBudgetkorting>";A+="<typeAflosvorm>"+SNS.hypotheken.widget.typeHypotheek+"</typeAflosvorm>";A+="<aflosvorm1>"+SNS.hypotheken.widget.aflosvorm1+"</aflosvorm1>";A+="<aflosvorm2>"+SNS.hypotheken.widget.aflosvorm2+"</aflosvorm2>";A+="<percAflosvorm1>"+SNS.hypotheken.widget.percAflosvorm1+"</percAflosvorm1>";A+="<percAflosvorm2>"+SNS.hypotheken.widget.percAflosvorm2+"</percAflosvorm2>";A+="<rentevariant>"+SNS.hypotheken.widget.rentevariant+"</rentevariant>";A+="<rendementsvariant>"+SNS.hypotheken.widget.rendementsvariant+"</rendementsvariant>";A+="<risicoprofiel>"+SNS.hypotheken.widget.risicoprofiel+"</risicoprofiel>";A+="<motivatieId>"+SNS.hypotheken.widget.motivatieId+"</motivatieId>";A+="<overwaarde>"+SNS.hypotheken.widget.overwaarde+"</overwaarde>";A+="</parameters>";A+="</asyncRequest>";formData=new Array();formData.headerId="mortgageCalculator";formData.type="maxmortgage";formData.requestXml=A;fireAjaxRequest(A,formData,SNS.hypotheken.processResultWidget)}};SNS.hypotheken.processResultWidget=function(A,B){if(A!=null){document.getElementById("widgetGewensteHypotheek").innerHTML=getChildContents(A,"gewenst_bedrag");document.getElementById("widgetBruto").innerHTML=getChildContents(A,"bruto");document.getElementById("widgetNetto").innerHTML=getChildContents(A,"netto");document.getElementById("widgetRenteAflosvorm1").value=getChildContents(A,"rente_aflosvorm1");document.getElementById("widgetRenteAflosvorm2").value=getChildContents(A,"rente_aflosvorm2");document.getElementById("widgetType_aflosvorm").value=getChildContents(A,"type_aflosvorm");document.getElementById("widgetHypotheekbedrag_aflosvorm1").value=getChildContents(A,"hypotheekbedrag_aflosvorm1");document.getElementById("widgetHypotheekbedrag_aflosvorm2").value=getChildContents(A,"hypotheekbedrag_aflosvorm2");if(document.getElementById("repaymentsummaryBedrag1")){document.getElementById("repaymentsummaryBedrag1").innerHTML="(&euro; "+getChildContents(A,"hypotheekbedrag_aflosvorm1")+")"}if(document.getElementById("repaymentsummaryBedrag2")){if(getChildContents(A,"hypotheekbedrag_aflosvorm2")!="0,-"){document.getElementById("repaymentsummaryBedrag2").innerHTML="(&euro; "+getChildContents(A,"hypotheekbedrag_aflosvorm2")+")"}}document.getElementById("widgetBestaandeBouw").value=getChildContents(A,"bestaandeBouw");document.getElementById("widgetNieuwbouw").value=getChildContents(A,"nieuwbouw");document.getElementById("widgetMaximaleHypotheek").value=getChildContents(A,"maximale_hypotheek");if(typeof SNS.hypotheken.aflossingswijzer.enableGotoCompassButton=="function"){SNS.hypotheken.aflossingswijzer.enableGotoCompassButton()}}};SNS.hypotheken.widget.toggleToelichting=function(){document.getElementById("toelichtingLink").onclick=function(){if(document.getElementById("maandlastenToelichting").style.display=="block"){document.getElementById("maandlastenToelichting").style.display="none"}else{document.getElementById("maandlastenToelichting").style.display="block"}}};
