var clb_timer, clb_timer_ref, clb_autoload_timer; var first = true; var agent_wts=9; var agent_wte=21; var agent_is_developer=false; var agent_build_id=6448; if(typeof jQuery == 'undefined'){ var oScriptElem = document.createElement("script"); oScriptElem.type = "text/javascript"; oScriptElem.src = "https://agentguru.ru/script/jquery-1.9.1.min.js"; document.head.insertBefore(oScriptElem, document.head.getElementsByTagName("script")[0]) } window.onload = function() { if (first) { first = false; MakeCallbackWidget(); } }; function MakeCallbackWidget() { $('.ag_phone_cont, .callback_form').show(); $('.ag_phone_cont em').html('+7 (812) 425-XX-XX'); if (typeof(gaUserId) == 'undefined') gaUserId = ''; $('.ag_get_phone').bind('click',function(){ if ($('.ag_get_phone').data('set')!=1) { $.ajax({ type: "POST", url: "https://agentguru.ru/api/v2/redirect", data: JSON.stringify({ resource: { s_id: '', id: 4931, source: 1, uid: gaUserId } }), success: function(phone) { if (phone=='') $('.ag_phone_cont').hide(); else { if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { mobile = true; } else mobile = false; $('.ag_phone_r').each(function(){ style = $(this).attr('style'); if (style==undefined) style=''; style=style+';text-decoration:none !important;color:'+$(this).css("color")+' !important;font-size:'+$(this).css("font-size")+' !important;font-weight:'+$(this).css("font-weight")+' !important;'; if (mobile) { text = $(this).html(); if (text != 'Позвонить') text = phone; $(this).replaceWith(''+text+''); } else $(this).replaceWith(''+phone+''); }); $('head').append(''); $('.ag_phone_cont').addClass('ag_phone_set'); if (mobile) window.location.assign($('a.ag_phone_set:eq(0)').attr('href')); } $('.ag_get_phone').data('set',1); } }); } return false; }); if ($('#awidget').attr('data-company-name')!=undefined) b_name='Хотите связаться с "'+$('#awidget').attr('data-company-name')+'"'; else b_name='Интересует Апартаменты W residence'; if( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { $('body').append('
'+b_name+'?

Давайте мы перезвоним Вам за 40 секунд и ответим на интересующие вопросы?

00:39:99или выбрать удобное время для звонка
'); $("head").append(""); if (typeof(jQuery.ui) != 'undefined' && typeof(jQuery.ui.draggable) != 'undefined'){ $("#callback_phone").draggable(); } $.getScript( "https://agentguru.ru/script/jquery.maskedinput.min.js", function( data, textStatus, jqxhr ) { $('.callback_modal input[name=phone]').mask('+7 (999) 999-99-99', { placeholder: "+7 (___) ___-__-__" }); if ($('#flats_info input[name=phone]').length>0) $('#flats_info input[name=phone]').mask('+7 (999) 999-99-99', { placeholder: "+7 (___) ___-__-__" }); }); $('#callback_phone').bind('click',function(){ $('body > *:not(.callback_modal,.callback_modal_back)').addClass('callback_blur'); $('.callback_modal_back, .callback_modal, #callback_phone').toggle(); clearTimeout(clb_autoload_timer); }); $('.callback_modal > i, .callback_modal_back').bind('click',function(){ $('.callback_modal .s1').remove(); $('.callback_modal *').show(); $('.callback_modal_back, .callback_modal, #callback_phone').toggle(); $('body > *').removeClass('callback_blur'); $('.callback_modal em').text('00:39:99'); $(".callback_modal button").text("Жду звонка!").removeClass('st1'); clearInterval(clb_timer_ref); }); $(".callback_modal input[name=agree]").bind("change",function(){ button = $(".callback_modal button"); if ($(this).is(":checked")) button.removeAttr("disabled"); else button.attr("disabled","disabled"); }); $('.callback_modal button').bind('click',function(){ if (/\+7 \([0-9]{3}\) [0-9]{3}-[0-9]{2}-[0-9]{2}/.test($('.callback_modal input[name=phone]').val())) { $('.callback_modal input[name=phone]').removeClass('e'); phone = $('.callback_modal input[name=phone]').val(); $('.callback_modal input[name=phone]').val(''); if ($('.callback_modal div.s1').length==1) { date = $("#clb_dt").text(); time = $("#clb_tm").text(); date0=date; $('.callback_modal *:not(i)').hide(); $('.callback_modal .s1').remove(); $('.callback_modal').append('Спасибо за обращение!

Мы позвоним Вам '+date0+' в '+time+' на номер '+phone+' по Апартаменты W residence.

'); $.post("https://spbguru.ru/main/callback_schedule", { id: "6448", p: phone, d: date, t: time }); } else { $('.callback_modal div:not(.agree_cnt) *:not(em)').hide(); $('.callback_modal div.agree_cnt').hide(); $('.callback_modal div:not(.agree_cnt)').prepend('Мы соединяем Вас с менеджером...'); $.post("https://spbguru.ru/main/callback", { id: "6448", p: phone }); clb_timer = 4000; clb_timer_ref = setInterval(function(){ clb_timer--; s = clb_timer; ms = s % 100; s = (s - ms) / 100; secs = s % 60; s = (s - secs) / 60; mins = s % 60; ms = ms.toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping:false }); secs = secs.toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping:false }); mins = mins.toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping:false }); str = mins + ':' + secs + ':' + ms; $('.callback_modal em').text(str); if (clb_timer==0) { $('.callback_modal em').hide(); $('.callback_modal .s1').remove(); $('.callback_modal *:not(i)').hide(); $('.callback_modal').append('Вам позвонил наш менеджер?ДаНет'); $('.clb_y').bind('click',function(){ $('.callback_modal i').click(); return false; }); $('.clb_n').bind('click',function(){ $('.callback_modal .s1').remove(); $('.callback_modal > div, .callback_modal > div *').show(); $('.callback_modal span.t span').click(); $('.callback_modal').prepend('Приносим наши извинения'); $('.callback_modal p.s1').text('Давайте мы попробуем еще раз Вам позвонить'); $('.callback_modal input[name=phone]').val(phone); return false; }); clearInterval(clb_timer_ref); } },10); } } else $('.callback_modal input[name=phone]').addClass('e'); }); $('.callback_modal input[name=phone]').bind('keyup',function(){ phone = $(this).val(); if (phone.substr(0,6)=="+7 (79" || phone.substr(0,6)=="+7 (89") { if ($('#phone_hint').length==0) $(this).after('
'); $('#phone_hint').text("Вероятней всего вы указали лишнюю цифру "+phone.substr(4,1)+". Проверьте правильность номера."); } else $('#phone_hint').remove(); }); $('.callback_modal span.t span').bind('click',function(){ $('.callback_modal p, .callback_modal em, .callback_modal span').hide(); var d1 = new Date(); var d2 = new Date(); var d3 = new Date(); d1.setDate(d1.getDate()+2); d2.setDate(d2.getDate()+3); d3.setDate(d3.getDate()+4); $('.callback_modal b').after('

Выберите удобное время для звонка

сегодня
  • сегодня
  • завтра
  • '+d1.toLocaleDateString()+'
  • '+d2.toLocaleDateString()+'
  • '+d3.toLocaleDateString()+'
в
10:00
  • 10:00
  • 11:00
  • 12:00
  • 13:00
  • 14:00
  • 15:00
  • 16:00
  • 17:00
  • 18:00
  • 18:30
'); $('.callback_modal div.s1 div span').bind('click',function(){ $(this).next().toggle(); }); $('.callback_modal div.s1 div li').bind('click',function(){ $(this).parent().prev().text($(this).text()); $(this).parent().hide(); if ($(this).parent().prev().attr("id")=="clb_dt") { if ($("#clb_dt").text()=="сегодня") { var d = new Date(); t=d.getHours()+1; t=("0" + t).slice(-2); t+=":00"; $("#t_list li").each(function(){ if ($(this).text() < t) $(this).hide(); }); if ($('#t_list li:not([style*="display: none"]):first').length==1) $('#t_list li:not([style*="display: none"]):first').click(); else { $("#d_list li:eq(0)").hide(); $("#d_list li:eq(1)").click(); } } else { $("#t_list li").show(); } } }); $("#d_list").find("li:eq(0)").click(); $(".callback_modal button").text("Заказать звонок").addClass('st1'); }); } if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { $('.callback_modal').addClass('callback_mini'); $('.callback_modal span.t span').text('Выбрать удобное время для звонка'); } }