$(function (){ if($('.io_lightbox').length){ io_lightbox(); //подключаем попап } //runmenu(); if($('input[name="balkondoor"]').length){ var elem = $('input[name="balkondoor"]'); var imgdoor = $('#imgtypedoor'); if(elem.attr('checked')){ $('#doorblock').toggleClass('dn'); } elem.click(function (){ $('#doorblock').toggleClass('dn'); }); $('select[name="door"]').bind('change', function (){ var elem = $(this); if(elem.attr('value') == 2){ imgdoor.attr('src', '/i/calc/door1.png'); } else { if(elem.attr('value') == 3){ imgdoor.attr('src', '/i/calc/door2.png'); } } }); } /*if($('a[href="/about/"]').length){ var a_about = $('a[href="/about/"]'); a_about.next('.submenu_d').hide();*/ /*a_about.click(function(){ a_about.blur().next('.submenu_d').toggle(); return false; });*/ /*} $('.menuleft a').click(function(){ $(this).parent().next().show(); });*/ if($('#pslink').length){ lnk = $('#pslink a'); winlo = $('#winlog'); clse = $('#winlog .closewinlog'); lnk.click(function (){ if(!lnk.hasClass('enterlog')){ lnk.blur(); winlo.removeClass('showlog'); return false; } }); clse.click(function (){ winlo.addClass('showlog'); }); } }); function checkbfrm(){ if ($("#telefsend").val()==''){ alert('Уважаемый клиент: вы не указали телефон!') }else{ $.ajax({ type: "POST", url: "/ajax.php", data: "do=send_phone&phone="+$("#telefsend").val()+"&time="+$("#time").val(), success: function(msg){ // alert(msg); alert("Спасибо! Мы вам перезвоним!"); $("#phone_cont").hide(); } }); } } function checkbfrm2(){ if ($("#telefsend").val()==''){ alert('Уважаемый клиент: вы не указали телефон!') }else{ $.ajax({ type: "POST", url: "/ajax.php", data: "do2=send_phone&phone="+$("#telefsend").val()+"&time="+$("#time").val(), success: function(msg){ // alert(msg); alert("Спасибо! Мы вам перезвоним!"); $("#phone_cont").hide(); } }); } } function checkbfrm3(form){ if ($('input[name="telefsend"]', $(form)).val()==''){ alert('Уважаемый клиент: вы не указали телефон!') }else{ $.ajax({ type: "POST", url: "/ajax.php", data: "do2=send_phone&phone="+$('input[name="telefsend"]', $(form)).val()+"&time="+$('input[name="time"]', $(form)).val(), success: function(msg){ // alert(msg); alert("Спасибо! Мы вам перезвоним!"); $(form).parents("#phone_cont").hide(); } }); } } $(document).ready(function() { $("#various2").fancybox(); }); $(document).ready(function() { $("#tablerows tr:nth-child(1)").css({ 'background-color':'#003c75', 'color': '#ffffff' }); $("#tablerows tr:nth-child(even)").css({ 'background-color':'#e6e6e6' }); }) jQuery(document).ready(function(){ var form_init = true; jQuery('.phoneover a, .phoneover2 a').click(function(){ var current = jQuery('#TB_window').find('form'); jQuery('#responseTarget').hide(); current.parent().show(); if (form_init){ var interv = setInterval(function(){ if (typeof(current) != 'undefined'){ clearInterval(interv); current._ajax_form({ 'response' : true, 'responseClear' : true, 'responseTarget' : '#responseTarget', 'beforeSend' : function(){ current.parent().hide(); }, 'callBack' : function(){ setTimeout(function(){ jQuery('#TB_closeWindowButton').click(); }, 15000); } }); form_init = false; } }, 100); } }) });