var id=1; var question=0; var answ=0; var check=0; var nr=0; next=new Array(); //next['id des radiobuttons'] = "name des layers, der erscheinen soll" next['q1_1']= "question1_1"; next['q1_2']= "question2_1"; next['q1_3']= "question3_1"; next['q1_4']= "question4_1"; next['q1_5']= "produkt5"; next['q1_1_1']= "pers_beratung1_1_1"; next['q1_1_2']= "pers_beratung1_1_2"; //next['q1_1_1']= "pers_beratung"; //next['q1_1_2']= "pers_beratung"; next['q1_1_3']= "produkt1_3"; next['q2_1_1']= "pers_beratung2_1_1"; next['q2_1_2']= "pers_beratung2_1_2"; //next['q2_1_1']= "pers_beratung"; //next['q2_1_2']= "pers_beratung"; next['q2_1_3']= "produkt2_3"; next['q3_1_1']= "pers_beratung3_1_1"; //next['q3_1_1']= "pers_beratung"; next['q3_1_2']= "produkt3_2"; next['q3_1_3']= "produkt3_3"; next['q4_1_1']= "question4_1_1"; next['q4_1_2']= "produkt4_1_1_2";/*pers_beratung4_1_1_2";*/ //next['q4_1_2']= "pers_beratung"; next['q4_1_3']= "produkt4_3_1"; //next['q4_1_3']= "question4_1_3"; //3. Was ist Ihnen bei der Gestaltung Ihres Darlehens wichtig? next['q4_1_1_1']= "produkt4_1_1"; next['q4_1_1_2']= "produkt4_1_2"; //3. 3. Wieviele Baumaßnahmen haben Sie geplant /* next['q4_1_3_1']= "produkt4_3_1"; next['q4_1_3_2']= "produkt4_3_2"; */ function check_answer(elementx){ answ=0; var count= document.formBausparen.elements['q'+elementx].length; for (var i =1; i<=count;i++){ if (document.getElementById('qid'+elementx+'_'+i).checked){ answ= document.getElementById('qid'+elementx+'_'+i).value; nr=i; } } if (answ==0){ alert ('Bitte wählen Sie eine Antwort aus.') }else { document.getElementById('question'+elementx).style.visibility = 'hidden'; document.getElementById(next['q'+elementx+'_'+nr]).style.visibility = 'visible'; } } function go_back(q_visible,q_hidden){ document.getElementById(q_visible).style.visibility = 'visible'; document.getElementById(q_hidden).style.visibility = 'hidden'; } function go_back_rechner(q_visible,q_hidden,q_hidden2, q_hidden3, q_hidden4, q_hidden5){ document.getElementById(q_visible).style.visibility = 'visible'; document.getElementById(q_hidden).style.visibility = 'hidden'; document.getElementById(q_hidden2).style.visibility = 'hidden'; document.getElementById(q_hidden3).style.visibility = 'hidden'; document.getElementById(q_hidden4).style.visibility = 'hidden'; document.getElementById(q_hidden5).style.visibility = 'hidden'; } function go_next(q_visible,q_hidden){ document.getElementById(q_visible).style.visibility = 'visible'; document.getElementById(q_hidden).style.visibility = 'hidden'; } function get_link(link_left, y_add){ var url= "https://bausparen.si-bausparen.de/bausparer-web-sib?"; now = new Date(); var yr = now.getFullYear() + y_add; var mName = now.getMonth() + 1; var dName = now.getDay() + 1; var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate(); // String to display current date. var end_date =(" " + "01" //+ dayNr + "." + mName + "." + yr); var new_url= url + link_left + y_add; alert (new_url); } function get_date(y_add){ now = new Date(); var yr = now.getFullYear() + y_add; var mName = now.getMonth() + 1; var dName = now.getDay() + 1; var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate(); // String to display current date. var end_date =(" " + "01" //+ dayNr + "." + mName + "." + yr); alert (end_date) return end_date; } var win = null; function popwindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',toolbar=no,status=no,resizable=no' win = window.open(mypage,myname,settings) if(win.window.focus){win.window.focus();} } function oeffnen(url) { document.opener.location.href = url; self.focus(); } function rechne(){ bild1 = new Image(); bild1.src = "/design_images/haus_1.gif"; bild2 = new Image(); bild2.src = "/design_images/haus_2.gif"; bild3 = new Image(); bild3.src = "/design_images/haus_3.gif"; var finanzbedarf = 0; //var zinssatz = 4.4; //var sparrate = 0.155; var zinssatz = 3.58; var sparrate = 0.155; var ergebnis = 0; var bausparsumme = 0; var sparbeitrag = 0; var rate_vorausdarlehen = 0; var konstant_rate = 0; finanzbedarf = document.formRechner.finanzbedarf.value; bausparsumme = finanzbedarf * 1.2 sparbeitrag = (bausparsumme / 100) * sparrate rate_vorausdarlehen = (bausparsumme / 100) * zinssatz /12; konstant_rate = sparbeitrag + rate_vorausdarlehen; //alert(konstant_rate); //Zahlen mit Tausenderpunkten formatieren finanzbedarf = format(finanzbedarf); konstant_rate = format(konstant_rate); //regulaerer Ausdruck zum Formatieren der Tausenderpunkte /*var zahlFormat = /(\d)(?=(\d\d\d)+(?!\d))/g; var ergebnisString = ergebnis.toString(); var ergebnisAusgabe = ergebnisString.replace(zahlFormat, "$1."); var aufwandString = aufwand.toString(); var aufwandAusgabe = aufwandString.replace(zahlFormat, "$1."); var eigenkapitalString = eigenkapital.toString(); var eingenkapitalAusgabe = eigenkapitalString.replace(zahlFormat, "$1."); */ //ergebnisAusgabe = ergebnisString; var dChildAusgabe = document.createTextNode("Mit einem Finanzierungsbedarf von "+finanzbedarf+" Euro zahlen Sie von der ersten bis zur letzten Rate"); var kChildAusgabe = document.createTextNode(konstant_rate); document.getElementById("darlehnssumme_ausgabe").replaceChild(dChildAusgabe, document.getElementById('darlehnssumme_ausgabe').firstChild); document.getElementById("eigenkapital_ausgabe").style.visibility = "visible"; document.getElementById("konstantrate_ausgabe").replaceChild(kChildAusgabe, document.getElementById('konstantrate_ausgabe').firstChild); document.getElementById("result_table").style.visibility = "visible"; document.getElementById("konstantrate_ausgabe").style.visibility = "visible"; document.getElementById("darlehnssumme_ausgabe").style.visibility = "visible"; //Das Formular soll nicht abgeschickt werden. return false; } function checknum( field ) { //nur zahlen und ",","." zulassen var tmpString =""; var seperator = false; for (i=0;i<=field.value.length;i++){ c=field.value.charAt(i); if ((c=="1")|(c=="2")|(c=="3")|(c=="4")|(c=="5")|(c=="6")|(c=="7")|(c=="8")|(c=="9")|(c=="0")) tmpString+=c; else if ((c==",")|(c==".")) if (!seperator){ tmpString+="."; seperator=true; } } if (tmpString != field.value) field.value=tmpString; } function format( ft ) { if ( ft == 0 ) return "0,00"; else { var ftBig = Math.round( ft * 100 ); if ( ftBig < 10 ) return "0,0" + ftBig; else if ( ftBig < 100 ) return "0," + ftBig; else { var iUp, iLow; var strNumber, strResult; strResult = ""; strNumber = "" + Math.round( ft * 100 ); nLen = strNumber.length; for ( iLow = 0, iUp = (nLen-2-1)%3+1; iUp <= nLen-2; iUp += 3, iLow = iUp - 3 ) { if ( strResult.length > 0 ) strResult += '.'; strResult += strNumber.substring(iLow,iUp); } strResult += "," + strNumber.substring(nLen-2,nLen); return strResult; } } }