Insgesamt Tarifkombinationen geprüft.'}),new b("div.products-tax",{html:'Alle Beiträge in Euro inkl. '+this.calculator.formatValue("tax",null,{unit:"%"})+" VSt."}),a)}})}(window); !function(a){var b=function(a,c,d,e,f){var g;return c&&!a.hasClass("hidden")||!c&&a.hasClass("hidden")?(g=e&&e(),b):(a.get("slide").setOptions({resetHeight:!0}).addEvent("complete:once",function(){g=d?d():a.getForm().validate(Object.merge({showErrors:!1},f||{})),g=e&&e()})["slide"+(c?"In":"Out")](),b)},c=function(a,b){return $(a).getElement(b)},d=function(a){return a?"checkbox"===a.get("type")?a.checked:!(1!=a.value||!a.checked):null},e=window.Calculator;e.implement({toggleBezugsberechtigt:function(a){var e=c(a.getParent(".form-grid").getForm().element,".sonstiger-bezugsberechtigter"),f=!d(a);b(e,f)}})}(document),function(){var a=new Class({Extends:Component,property:"KinderForm",initialize:function(a,b){if(this.parent(a,b),this.occlude())return this.occluded},toggleKinder:function(a){var b=!(1!=a.value||!a.checked),c=$$(".mitversicherte-kinder-order")[0],d=a.getParent(".form-grid");b?d.addClass("form-collapse-bottom"):c.retrieve("slide")&&"auto"===c.get("slide").wrapper.getStyle("height")&&(c.get("slide").wrapper.setStyle("height",c.get("slide").wrapper.getSize().y),c.setStyle("height",c.getSize().y)),c.get("slide").addEvent("complete:once",function(){b?(this.wrapper.setStyle("height","auto"),c.setStyle("height","auto")):d.removeClass("form-collapse-bottom"),a.getForm().validate({showErrors:!1})}),c.slide(b?"in":"out")},add:function(a){var b,c=a.getForm(),d=(this.element.getElements(".mitversicherte-kinder-form"),$$(".mitversicherte-kinder-template")[0].cloneNode(!0)),e=this.element.getElement("input[name=mitversicherte_kinder_index]"),f=parseInt(e.get("value"))+1,g=function(a,b){return a.get(b)&&a.set(b,a.get(b).replace("##",f)),g},h={};e.set("value",f),d.removeClass("mitversicherte-kinder-template").removeClass("form").removeClass("form-pseudo").addClass("mitversicherte-kinder-form").inject(a,"before"),b=$$(".mitversicherte-kinder-form .mitversicherte-kinder-delete"),b.length>2&&(b=$$(b.getLast())),d.getElements("input,textarea,button").each(function(a){g(a,"name")(a,"id"),c.addField(a)}),d.getElements("label").each(function(a){g(a,"id")(a,"for")}),document.Initializer.run(d),b.each(function(a,b){h[b]={opacity:1}}),new Fx.Elements(b.setStyle("opacity",0).removeClass("hidden")).start(h),d.get("slide").addEvent("complete",function(){c.validate({showErrors:!1})}).slideIn()},remove:function(a){var b,c=a.getForm(),d=a.getParent(".mitversicherte-kinder-form");d.get("slide").addEvent("complete",function(){this.wrapper.dispose(),$$(".mitversicherte-kinder-add").removeClass("hidden"),c.validate({showErrors:!1})}).slideOut(),3==$$(".mitversicherte-kinder-delete").length&&(b=$$(".mitversicherte-kinder-delete").erase(a),new Fx.Elements(b).addEvent("complete",function(){b.addClass("hidden")}).start({0:{opacity:1}}))}}),b=new Class({Extends:Component,property:"Gesundheitsfrage",initialize:function(a,b){if(this.parent(a,b),this.occlude())return this.occluded},toggleGesundheitsfrage:function(a){var b=a.getParent(".gesundheitsfrage").getElement(".krankheiten-form"),c=this.element.getForm(),d=this.slide=this.slide||b.get("slide").addEvent("complete",function(){c.validate({showErrors:!1})});return d["slide"+(1==a.value&&a.checked?"Out":"In")](),this}});document.Initializer.add({selector:".mitversicherte-kinder",Class:a}),document.Initializer.add({selector:".gesundheitsfrage",Class:b})}(); !function(){var a=[{property:"geburtsdatum",customer:"geburtsdatum",check:!0},{property:"vorname",customer:"vorname_person"},{property:"nachname",customer:"nachname_person"}],b=new Class({Extends:Component,property:"VpForm",initialize:function(a,b){if(this.parent(a,b),this.occlude())return this.occluded},add:function(a){var b,c=a.getForm(),d=this.element.getElement(".versicherteperson-template").cloneNode(!0),e=this.element.getElements(".versicherteperson-form"),f=e.length,g=this.options.max,h=this.options.min,i=function(a,b){return a.get(b)&&a.set(b,a.get(b).replace("##",f)),i},j={};d.removeClass("versicherteperson-template").removeClass("form").removeClass("form-pseudo").addClass("versicherteperson-form").inject(a,"before"),e.push(d),b=this.element.getElements(".versicherteperson-form .form-grid .versicherteperson-delete"),b.length>h+1&&(b=$$(b.getLast())),d.getElements("input,textarea,button").each(function(a){i(a,"name")(a,"id"),c.addField(a)}),d.getElements("label").each(function(a){i(a,"id")(a,"for")}),d.getElement(".form-caption").set("html",d.getElement(".form-caption").get("html").replace("##",f+1)),d.getElements(".pseudo-input").removeClass("pseudo-input"),document.Initializer.run(d),d.hasClass("versicherteperson-inheritance")&&(d.removeClass("versicherteperson-inheritance"),this.inheritance(d,f)),b.each(function(a,b){j[b]={opacity:1}}),new Fx.Elements(b.setStyle("opacity",0).removeClass("hidden")).start(j),g&&e.length===g&&a.addClass("disabled"),d.get("slide").addEvent("complete",function(){c.validate({showErrors:!1})}).slideIn()},inheritance:function(a,b){elements=a.getElements("input[type=text],input[type=checkbox]"),elements.each(function(a){return elemTemplateName=a.name.replace("["+b+"]","[0]"),elemTemplate=$$$('input[name="'+elemTemplateName+'"]'),"checkbox"==a.type?void(a.checked!==elemTemplate.checked&&a.click()):a.getParent().hasClass("dateinput")?void a.retrieve("DateInput").setValue(elemTemplate.retrieve("DateInput").Date).format():a.hasClass("select-value")?void a.retrieve("SelectBox").setValue(elemTemplate.value):void 0})},remove:function(a){var b,c=a.getForm(),d=this,e=d.element.getElements(".versicherteperson-form"),f=a.getParent(".versicherteperson-form"),g=(this.options.max,this.options.min),h=0,i=function(a,b){return a.get(b)&&a.set(b,a.get(b).replace(/\[\d+\]/,"["+h+"]")),i};e.each(function(a){a!==f&&(a.getElements("input,textarea,button").each(function(a){i(a,"name")(a,"id")}),a.getElements("label").each(function(a){i(a,"id")(a,"for")}),a.getElement(".form-caption").set("html",a.getElement(".form-caption").get("html").replace(/\d+$/,h+1)),h++)}),f.get("slide").addEvent("complete",function(){this.wrapper.dispose(),d.element.getElement(".form-grid-add").removeClass("disabled"),c.validate({showErrors:!1})}).slideOut(),e.length-1===g&&(b=$$(".versicherteperson-form .form-grid-delete").erase(a),new Fx.Elements(b).addEvent("complete",function(){b.addClass("hidden")}).start({0:{opacity:1}}))},checkVnPossibility:function(b){return a.filter(function(a){return a.check}).every(function(a){var c=this.element.getParentStep().getFirst().element,d=c.getElement('input[name="Vertrag_Kunde_'+a.customer+'"]'),e=b.getElement('input[name="Vertrag_versichertepersonen['+b.getDataAttribute("index")+"]["+a.property+']"]');return d.get("value")===e.get("value")},this)},checkVnPossibilities:function(){var a=!1,b=this.element.getElement(".versicherteperson-form.toggler-changed .vn-toggler:checked");return b&&(this.checkVnPossibility(b.getParent(".versicherteperson-form"))||(a=!0,b.set("checked",!1).setDisabled(!0))),this.element.getElements(".versicherteperson-form:not(.toggler-changed)").each(function(b){this.checkVnPossibility(b)?(b.getElement(".vn-toggler").setDisabled(!1),a||(a=!0,b.getElement(".vn-toggler").set("checked",!0))):b.getElement(".vn-toggler").set("checked",!1).setDisabled(!0)},this),this.toggleIsVnTogglers()},toggleIsVnTogglers:function(){return this.element.getElements(".vn-toggler").each(function(a){this.toggleIsVn(a,!0)},this),this},toggleIsVn:function(a,b,c,d){var e=a.getParent(".versicherteperson-form");return b||e.addClass("toggler-changed"),a.checked?(c||this.element.getElements(".vn-toggler:checked").each(function(b){a!==b&&(b.set("checked",!1),this.toggleIsVn(b,!0,!0,!0))},this),this.syncVpForm(e,null,null,!0)):this.unsyncVpForm(e,!0),d||this.element.getForm().validate({showErrors:!1}),this},watchVnFields:function(){return a.each(function(a){var b,c,d=this.element.getParentStep().getFirst().element.getElement('input[name="Vertrag_Kunde_'+a.customer+'"]');c=(this.options.sync.contains(a.property)?function(c){(b=this.element.getElement(".vn-toggler:checked"))&&this.syncVpForm(b.getParent(".versicherteperson-form"),[d],[a])}:function(){this.checkVnPossibilities()}).bind(this),d.addEvents({change:c,validationPassed:c,validationFailed:c})},this),this},syncVpForm:function(b,c,d,e){(d||a.filter(function(a){return this.options.sync.contains(a.property)},this)).each(function(a,d){var e=c&&c[d]||this.element.getParentStep().getFirst().element.getElement('input[name="Vertrag_Kunde_'+a.customer+'"]'),f=b.getElement('input[name="Vertrag_versichertepersonen['+b.getDataAttribute("index")+"]["+a.property+']"]');f.setDisabled(!0),f.retrieve("origValue",f.get("value")),f.retrieve("DateInput")?f.retrieve("DateInput").setDisabled(!0).setValue(f.retrieve("DateInput")):f.set("value",e.get("value"))},this),e||this.element.getForm().validate({showErrors:!1})},unsyncVpForm:function(b,c){a.filter(function(a){return this.options.sync.contains(a.property)},this).each(function(a,c){var d=b.getElement('input[name="Vertrag_versichertepersonen['+b.getDataAttribute("index")+"]["+a.property+']"]'),e=d.retrieve("origValue","");d.eliminate("origValue",""),d.setDisabled(!1),d.retrieve("DateInput")?d.retrieve("DateInput").setDisabled(!1).setValue(e):d.set("value",e)}),c||this.element.getForm().validate({showErrors:!1})},toggleVpFieldGroup:function(a){var b=a.closest(".form-grid").querySelector(".subgroup");if(a.checked)return void new Fx.Slide(b).slideIn();new Fx.Slide(b).slideOut()}});window.Order=Class.refactor(window.Order,{initialize:function(){this.previous.apply(this,arguments),this.element.addEvent("reload",function(){document.Initializer.addEvent("complete:once",function(){this.element.getElement(".versichertepersonen").retrieve("VpForm").watchVnFields().checkVnPossibilities()}.bind(this))}.bind(this))}}),document.Initializer.add({selector:".versichertepersonen",Class:b})}();