/* Скрипт управления анкетой КАСКО */ var form=document.request_form; function only_exactly(sender) { if ($(sender).attr("checked")) { $(".compBoxPare").show(); }else { $(".compBoxPare").hide(); } } function update_credit() { /*if (form.credit.checked && document.getElementById('firstTimeId').checked) { $("#id_submit").val("Отримайте пропозиції по кредитуванню"); $("#jq_comps_block").hide(); $("#id_credit_text").show(); $("#id_protection_block").hide(); }else { $("#id_submit").val("Розрахувати вартість полісу"); $("#jq_comps_block").show(); $("#id_credit_text").hide(); $("#id_protection_block").show(); }*/ } var upr_visible=1; function add_upr(sender) { /*var c = $("#jq_kasko_upr tbody tr.drc:visible").length;*/ $("#jq_kasko_upr tbody tr.drc input[type=button]").show(); $("#upr_tr_"+(upr_visible+1)).show(); $("input[name=kasko_upr_count]").val($("input[name=kasko_upr_count]").val()*1+1); if (upr_visible==4) $(sender).attr("disabled","disabled"); upr_visible++; } function del_upr(sender) { var c = $(sender).parent().parent().attr("upr_id")-1; if (c<4) { for (i=c+1;i<4;i++) { $("#upr_tr_"+i+" select:eq(0)").val($("#upr_tr_"+(i+1)+" select:eq(0)").val()); $("#upr_tr_"+i+" select:eq(1)").val($("#upr_tr_"+(i+1)+" select:eq(1)").val()); $("#upr_tr_"+i+" select:eq(2)").val($("#upr_tr_"+(i+1)+" select:eq(2)").val()); } } $("input[name=kasko_upr_count]").val($("input[name=kasko_upr_count]").val()*1-1); $("#upr_tr_5 select").val(""); $("#upr_tr_"+upr_visible).hide(); upr_visible--; if (upr_visible==1) $("#jq_kasko_upr tbody tr.drc:eq(0) input[type=button]").hide(); if (upr_visible<5) $(".addDriver").attr("disabled",""); /*$("#upr_tr_"+$("#jq_kasko_upr tbody tr.drc:visible").length).hide(); if ($("#jq_kasko_upr tbody tr.drc:visible").length==1) $("#jq_kasko_upr tbody tr.drc:eq(0) input[type=button]").hide(); if ($("#jq_kasko_upr tbody tr.drc:visible").length<5) $(".addDriver").attr("disabled","");*/ } function new_click() { if (!this.checked) { if(this.id=='id_block_new') { flip_hidden(this,['info_box']); document.getElementById('s_bb').className="mag"; }else { flip_hidden(this,['bank_box']); document.getElementById('bank_m').className="mag"; } } else { if (this.id=='id_block_new') { flip_hidden(this,['info_box']); document.getElementById('s_bb').className="mag wh"; }else { flip_hidden(this,['bank_box']); document.getElementById('bank_m').className="mag wh"; } } update_credit(); } form['new'].onclick=new_click; form['credit'].onclick=new_click; form['mark'].options[0] = new Option('','0'); for (i=0;i0) form.model.options[form.model.options.length]= new Option('інша модель ...',-1); document.getElementById("tr_model").style.display='none'; form.model_custom.value=''; } form.model.onchange=function () { if (this.value==-1) { document.getElementById("tr_model").style.display=''; }else { document.getElementById("tr_model").style.display='none'; document.request_form.model_custom.value=''; } } var d = new Date(); form.vip_year.options[0]=new Option(''); for (var i=d.getFullYear()+1;i>d.getFullYear()-7;i--) form.vip_year.options[d.getFullYear()+1-i+1]=new Option(i,i); /*Неизвестна мощность двигателя*/ document.getElementById('id_powerUnknown').onclick=function() { form.dvig_power.selectedIndex=form.dvig_power.length-1; return false; } form.cost.onkeypress=function() { return onlynum(event); } /*Неизвестна цена*/ document.getElementById('id_costUnknown').onclick=function() { form.cost.value='не знаю'; return false; } form.credit_bank_1.onchange=function() { if (this.value=='other') document.getElementById('idBankOther').style.display=""; else document.getElementById('idBankOther').style.display="none"; } form.credit_bank_3.onchange=function() { if (this.value=='other') document.getElementById('idBankOther2').style.display=""; else document.getElementById('idBankOther2').style.display="none"; }