$(document).ready(function(){$('select[name=city]').append('<option value="Санкт-Петербург">Санкт-Петербург</option><option value="Ленинградская область">Ленинградская область</option>');$('select[name=reg]').append('<option value="Санкт-Петербург">Санкт-Петербург</option><option value="Ленинградская область">Ленинградская область</option>');$(":input").blur(function(){input_val=$(this).val();input_name=$(this).attr("name");$.cookie(input_name,input_val);});$(":input").each(function(){input_name=$(this).attr("name");input_type=$(this).attr("type");if(input_type!='submit'&&$.cookie(input_name)!=null){$(this).val($.cookie(input_name));}});$(".calculator").find('form').validate({rules:{fio:"required",country:"required",model:"required",phone:"required",reg:"required",mail:"required email",email:"required email",},});$(".lojack").find('form').validate({rules:{age1:"required",stage1:"required",name:"required",model:"required",phone:"required",mail:"required email",},});});$(document).ready(function(){$(".stdr").find('form').validate({rules:{fio:"required",model:"required",phone:"required",mail:"required email",email:"required email",},});});$(document).ready(function(){$(".newsp").find('form').validate({rules:{fio:"required",model:"required",phone:"required",mail:"required email",email:"required email",},});});$(document).ready(function(){$("#method").change(function(){var current_method=this.value;if(current_method=='Кредит'){$('#bankid').fadeIn("slow");}
if(current_method=='Наличные'){$('#bankid').fadeOut("slow");}});$("#bez_polis").change(function(){var current_method1=this.value;if(current_method1=='Да'){$('#polis_company').fadeIn("slow");}
if(current_method1=='Нет'){$('#polis_company').fadeOut("slow");}});$("#admitted").change(function(){var current=this.value;if(current==1){$('#u1').show("slow");$('#u2').hide("fast");$('#u3').hide("fast");$('#u4').hide("fast");$('#u5').hide("fast");}
if(current==2){$('#u1').show("slow");$('#u2').show("slow");$('#u3').hide("fast");$('#u4').hide("fast");$('#u5').hide("fast");}
if(current==3){$('#u1').show("slow");$('#u2').show("slow");$('#u3').show("slow");$('#u4').hide("fast");$('#u5').hide("fast");}
if(current==4){$('#u1').show("slow");$('#u2').show("slow");$('#u3').show("slow");$('#u4').show("slow");$('#u5').hide("fast");}
if(current==5){$('#u1').show("slow");$('#u2').show("slow");$('#u3').show("slow");$('#u4').show("slow");$('#u5').show("slow");}});});
