if(document.getElementById('wicontainer') != null) throw 'ALREADY INIT'; var firsttime = 1530310191, onsitetime = 0; (function(s){var w,f={},o=window,l=console,m=Math,z='postMessage',x='HackTimer.js by turuslan: ',v='Initialisation failed',p=0,r='hasOwnProperty',y=[].slice,b=Worker;function d(){do{p=0x7FFFFFFF>p?p+1:0}while(f[r](p))return p}try{s=o.URL.createObjectURL(new Blob(["var f={},p=postMessage,r='hasOwnProperty';onmessage=function(e){var d=e.data,i=d.i,t=d[r]('t')?d.t:0;switch(d.n){case'a':f[i]=setInterval(function(){p(i)},t);break;case'b':if(f[r](i)){clearInterval(f[i]);delete f[i]}break;case'c':f[i]=setTimeout(function(){p(i);if(f[r](i))delete f[i]},t);break;case'd':if(f[r](i)){clearTimeout(f[i]);delete f[i]}break}}"]))}catch(e){}if(typeof(b)!=='undefined'){try{w=new b(s);o.setInterval=function(c,t){var i=d();f[i]={c:c,p:y.call(arguments,2)};w[z]({n:'a',i:i,t:t});return i};o.clearInterval=function(i){if(f[r](i))delete f[i],w[z]({n:'b',i:i})};o.setTimeout=function(c,t){var i=d();f[i]={c:c,p:y.call(arguments,2),t:!0};w[z]({n:'c',i:i,t:t});return i};o.clearTimeout=function(i){if(f[r](i))delete f[i],w[z]({n:'d',i:i})};w.onmessage=function(e){var i=e.data,c,n;if(f[r](i)){n=f[i];c=n.c;if(n[r]('t'))delete f[i]}if(typeof(c)=='string')try{c=new Function(c)}catch(k){l.log(x+'Error parsing callback code string: ',k)}if(typeof(c)=='function')c.apply(o,n.p)};w.onerror=function(e){l.log(e)};}catch(e){l.log(x+v);l.error(e)}}else l.log(x+v+' - HTML5 Web Worker is not supported')})('HackTimerWorker.min.js'); var referer = document.referrer, kw = getCookie('enterkw'), utm = '', lastTextId = 1, root = '/eb978875ce1c73f28c41da14c6ae225b/', noclickevent = false, superhider = 0, zvonim = 0, millisec = 0, onSiteTimer = null, leaveShown = false, seconds = 59, timer, viewport = '', autoShown = false, sendPerezvonokMail = function() { }, PEREZVONOK_LOADED = false, PEREZVONOK_CHAT_OPENNED = false, PEREZVONOK_WINDOW_TYPE = 1, knopkaScroll = null, previousKnopkaTopOffset = -1, textToPrint = '', strTemp = null, PEREZVONOK_SITE_ID = 1924, PEREZVONOK_TELEGRAM_HASH = '', PEREZVONOK_TELEGRAM_TITLE = '', PEREZVONOK_TELEGRAM_HELLO = ''; if(/utm=([^&]+)/.test(window.top.location)) { var temp = window.top.location.toString().match(/utm=([^&]+)/); utm = temp[1]; } if(!kw && /text=([^&]+)/.test(referer)) { referer = referer.match(/text=([^&]+)/); kw = referer[1]; setCookie('enterkw', kw, { expires: 3600, path: '/'}); } if(!kw) { kw = ''; } if (!window.location.href.match('xn--80akxcjhhbct3g.xn--p1ai')) { if(!/[а-яА-Я]+/.test('xn--80akxcjhhbct3g.xn--p1ai') || !window.location.href.match('xn--80akxcjhhbct3g.xn--p1ai')) { throw new Error("my error message"); } } function setWorktime(how) { if(how) { jQuery('.worktime').show(); jQuery('.notworktime').hide(); } else { jQuery('.notworktime').show(); jQuery('.worktime').hide(); } } function perezvonokChangeOffice(name, poyas) { jQuery('.perezvonok-select-office').text(name); jQuery('#perezvonok-office').val(name); var plus = parseInt(poyas.split(':')[0].replace('+', '')) * 60, siteZone = 180; var minInDay = 1440, nowDayMin = 69, dif = plus - siteZone; for(var i = 1; i <= 2; ++i) { var suf = i == 1 ? '' : '2'; if(jQuery('#pday'+suf).length < 1) continue; jQuery('#pday'+suf+' option').show(); jQuery('#pday'+suf).val(jQuery('#pday'+suf+' option').eq(0).attr('value')).trigger('change'); var isToday = jQuery('#pday'+suf+' option').eq(0).text() == 'Сегодня'; if(dif == 0) { setWorktime(false); } else if(dif + nowDayMin > minInDay || (dif > 0 && !isToday)) { var offset = isToday ? 1 : 0, nextDay = jQuery('#pday'+suf+' option').eq(offset).val(); jQuery('#pday'+suf).val(nextDay).trigger('change'); var nextDayTime = dif + nowDayMin - minInDay, wtime = jQuery('#pday'+suf+' option').eq(offset).data('hours').split('-'), wfrom = parseInt(wtime[0].split(':')[0]) * 60 + parseInt(wtime[0].split(':')[1]), wtill = parseInt(wtime[1].split(':')[0]) * 60 + parseInt(wtime[1].split(':')[1]), isWorkTime = nextDayTime >= wfrom && nextDayTime < wtill; setWorktime(isWorkTime); if(!isWorkTime && nextDayTime >= wtill) { offset = 1; nextDay = jQuery('#pday'+suf+' option').eq(offset).val(); jQuery('#pday'+suf).val(nextDay).trigger('change'); } if(offset > 0) { jQuery('#pday'+suf+' option').eq(0).hide(); } } else if(dif > 0) { var times = jQuery('#phour'+suf+' option'), selected = '', wtime = isToday ? nowDayMin + dif : nowDayMin + dif - minInDay; for(var j = times.length - 2; j >=0; --j) { var v = jQuery(times[j]).attr('value'), h = parseInt(v.split(':')[0]) * 60 + parseInt(v.split(':')[1]); if(jQuery(times[j]).css('display') != 'block') { continue; } //alert(wtime + " / " + h + " / " + v); if(wtime > h) { if(jQuery(times[j + 1]).css('display') == 'none') { break; } setWorktime(isToday); selected = jQuery(times[j + 1]).attr('value'); jQuery('#phour'+suf).val(selected); break; } } if(selected != '') { jQuery('#phour'+suf + ' option').each(function() { if(jQuery(this).attr('value') == selected) { return false; } jQuery(this).hide(); }); } else { jQuery('#pday'+suf).val(jQuery('#pday'+suf+' option').eq(1).attr('value')).trigger('change'); times = jQuery('#phour'+suf+' option'); setWorktime(false); for(var j = 0; j < times.length; ++j) { if(jQuery(times[j]).css('display') == 'block') { jQuery('#phour'+suf).val(selected); break; } } jQuery('#pday'+suf+' option').eq(0).hide(); } } else if (dif < 0) { if(isToday) { var interval = jQuery('#pday'+suf+' option').eq(0).data('hours').split('-'), s = parseInt(interval[0].split(':')[1]) + parseInt(interval[0].split(':')[0]) * 60, po = parseInt(interval[1].split(':')[1]) + parseInt(interval[1].split(':')[0]) * 60; if(s <= nowDayMin + dif && nowDayMin + dif <= po) { setWorktime(true); } else if (s >= nowDayMin + dif) { jQuery('#phour'+suf).val(interval[0]).trigger('change'); setWorktime(false); } } } } } function chasi(now, dh, suff, servHour, servMins, servDay) { dh = dh || now; suff = suff || ''; servHour = servHour || 01; servMins = servMins || 09; servDay = servDay || 6; jQuery('#phour' + suff + ' option').hide().prop('disabled', true); var ft = dh.split("-"), fromh = ft[0].split(":"), toh = ft[1].split(":"), okiop = 0, first = null, serverhours = servHour, servermins = servMins, serverday = servDay, dayToday = jQuery('#pday' + suff + ' option:selected').text() == 'Сегодня'; for (var i = Math.round(fromh[0]); i <= Math.round(toh[0]); ++i) { if(i < serverhours && dayToday) { continue; } var zeroI = i < 10 ? '0' + i : i; for(var j = 0; j < 60; j += 15) { var zeroJ = j < 10 ? '0' + j : j; if((toh[0] == i && j > toh[1]) || (i == serverhours && j < servermins && dayToday) || (i == serverhours && j == servermins && dayToday) || (i == Math.round(fromh[0]) && j < fromh[1])) { continue; } if(first == null) { first = jQuery("#phour" + suff + " option[value='"+zeroI+":"+zeroJ+"']").first().text(); } jQuery('#phour' + suff + " option[value='"+zeroI+":"+zeroJ+"']").show().prop('disabled', false); } } if(first != null) { jQuery('#phour' + suff).val(first); } } function yandexGoal(eventId) { } function clb_send(form) { form = form || ''; if (zvonim == 1) { alert("Мы вам уже звоним"); return false } zvonim = 1; yandexGoal('perezvonok_send'); setCookie('perezvonok_send', 1, { expires: 3600 * 24, path: '/'}); //console.log("call init"); jQuery("#clb_send" + form).hide(); jQuery("#wi_resultnotime3" + form).show(); var phour = '', pmin = '', pday = ''; if(document.getElementById("phour" + form) != null && document.getElementById("phour" + form).value != '') { phour = document.getElementById("phour" + form).value; phour = phour.split(':'); pmin = phour[1]; phour = phour[0]; } if(document.getElementById("pday" + form) && document.getElementById("pday" + form).value) pday = document.getElementById("pday" + form).value; var element = document.createElement('div'), tel = document.getElementById("clb_phone" + form).value, notime = jQuery('.worktime').length == 0 || jQuery('.worktime').css('display') == 'none', o = jQuery('#perezvonok-office').length == 1 ? jQuery('#perezvonok-office').val() : ''; element.innerHTML = ' '; element.id = 'x340_caller'; document.body.appendChild(element); var hides = document.getElementsByClassName('hide-after-send'); for(var i = 0; i < hides.length; ++i) { hides[i].style.display = 'none'; } hides = document.getElementsByClassName('show-after-send'); for(var i = 0; i < hides.length; ++i) { hides[i].style.display = 'block'; } } function getCookie(name) { var matches = document.cookie.match(new RegExp( "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" )); return matches ? decodeURIComponent(matches[1]) : undefined; } function wi_nwitimme() { if(document.getElementById('yatimer') == null) { return; } if (millisec<=1) { millisec=9 seconds-=1 } millisec-=1 var seconds2 = seconds; if (seconds < 10) seconds2 = "0"+seconds; jQuery('#yatimer').stop(true,true).html('00:'+seconds2+'.'+millisec+'9'); if (seconds == 0 && millisec == 1) { //blockshowhide("wix_call","wix_fin"); document.getElementById('yatimer').innerHTML='00:00.00'; jQuery('#prerezvonok-voteus, .worktime.clb_timer').toggle(); return false; } timer = setTimeout(wi_nwitimme, 104); } function magicc(type, textId, auto, yandexEvent) { //if(!PEREZVONOK_LOADED) return; //console.log(noclickevent + '1'); if(jQuery("#clb_div").css('display') != 'none') return; auto = auto || false; textId = textId || 1; type = type || PEREZVONOK_WINDOW_TYPE; if(noclickevent) { noclickevent = false; return; } yandexGoal('perezvonok_open_' + (yandexEvent || 'click')); //console.log(document.getElementById("clb_div").style.display); if(document.getElementById("clb_div").style.display == 'block') { return; } if(auto) { if(autoShown) { return; } autoShown = true; } switch(type) { case 1: //slide try { jQuery('#clb_div_ban').animate({right: 0}, {"duration":10, "queue": false}); } catch (e) { document.getElementById('clb_div_ban').style.right = '0px'; } break; case 2: //mobile break; default: var altag = document.body.childNodes; for(var v in altag) { altag[v].className = altag[v].className + ' iblur'; } break; } jQuery("#clb_div").fadeIn(250); jQuery('.perezvonok-mobile').addClass('perezvonok-mobile-open').removeClass('perezvonok-mobile'); chasi("10:00-17:00", jQuery('#pday option:selected').data('hours')); if(document.getElementById('pday2') != null) { chasi("10:00-17:00", jQuery('#pday2 option:selected').data('hours'), 2); } if(document.getElementById('pday3') != null) { chasi("10:00-17:00", jQuery('#pday3 option:selected').data('hours'), 3); } document.querySelector("#wicontainer").className = ""; jQuery('.perezvonok-knopka, .perezvonok-text').hide(); lastTextId = textId; jQuery('#perezvonok-text-' + textId).show(); } function printStart(selector) { if(jQuery('.perezvonok-text[data-printed]').length > 0 || jQuery(selector).length == 0) { return; } if(!jQuery(selector).attr('data-offset')) { jQuery(selector).attr('data-offset', 0); } var nextChar = ''; if(textToPrint === '') { var html = jQuery(selector).html(); jQuery(selector).css('height', jQuery(selector).height() + 'px').attr('data-length', html.length + 2).html(''); textToPrint = '— ' + html.replace(/\<\s*br\s*\/?\s*\>/ig, "\n"); } do { var offset = parseInt(jQuery(selector).attr('data-offset')), prevHtml = jQuery(selector).html().substr(0, jQuery(selector).html().length - 1); nextChar = textToPrint.substr(offset, 1); jQuery(selector).html(prevHtml + (nextChar == "\n" ? '
' : nextChar) + "_").attr('data-offset', offset + 1); } while(nextChar == "\n") if(parseInt(jQuery(selector).attr('data-length')) >= jQuery(selector).html().length) { setTimeout(function() { printStart(selector); }, 35); } else { jQuery(selector).attr('data-printed', 'true').html( jQuery(selector).html().substr(0, jQuery(selector).html().length - 1) ); } } function whide(type) { switch(type) { case 1: jQuery('#clb_div_ban').css('right', '-350px'); //setTimeout(function() { //document.getElementById("clb_div").style.display="none"; jQuery('#clb_div').fadeOut(); jQuery('body').removeClass('perezvonok-popup-open'); jQuery('.perezvonok-mobile').removeClass('perezvonok-mobile-open'); jQuery('.perezvonok-mobile').addClass('perezvonok-mobile'); //}, 250); break; case 2: jQuery('#clb_div').fadeToggle(200); jQuery('body').removeClass('perezvonok-popup-open'); break; default: var elems = document.body.childNodes; for (var i in elems) { if (elems[i].className) { elems[i].className = elems[i].className.replace('iblur', ''); } } jQuery('#clb_div').fadeToggle(200); break; } jQuery('.perezvonok-knopka').show(); } function setCookie(name, value, options) { options = options || {}; var expires = options.expires; if (typeof expires == "number" && expires) { var d = new Date(); d.setTime(d.getTime() + expires*1000); expires = options.expires = d; } if (expires && expires.toUTCString) { options.expires = expires.toUTCString(); } value = encodeURIComponent(value); var updatedCookie = name + "=" + value; for(var propName in options) { updatedCookie += "; " + propName; var propValue = options[propName]; if (propValue !== true) { updatedCookie += "=" + propValue; } } document.cookie = updatedCookie; } var elementWi = document.createElement('div'); elementWi.id = 'wicontainer'; elementWi.innerHTML = '
'; if (superhider == 0) { document.body.appendChild(elementWi); } function showPanel(number) { var panels = document.getElementsByClassName('panels'); for(var i = 0; i < panels.length; ++i) { panels[i].style.display = 'none'; } document.getElementById('clb-panel_' + number).style.display = 'block'; if(null != document.getElementById('imgTab' + number)) { var tabs = document.getElementsByClassName('ptabs'); for(var i = 0; i < tabs.length; ++i) { tabs[i].style.backgroundColor = '#c6cccf !important'; tabs[i].setAttribute('class', 'ptabs item_img'); } document.getElementById('imgTab' + number).setAttribute('class', 'ptabs selected item_img'); } jQuery('.show-after-send').hide(); } var checkForm = function(form) { var s1 = "Обязательно для заполнения", s2 = "Некорректный e-mail", s3 = "Некорректное имя", classN = "error", errorCount = 0; /*if(form.client_phone.value.length != 18){ addError('callback_application_submit_result', 'applicationForm_client_phone', s1, classN); errorCount++; } else { removeError('callback_application_submit_result', 'applicationForm_client_phone', classN); }*/ if(!checkEmail(form.client_email.value)) { addError('applicationForm_email_em', 'applicationForm_email', (form.client_email.value.length > 0)?s2:s1, classN);errorCount++; } else { removeError('applicationForm_email_em', 'applicationForm_email', classN); } if(!checkName(form.client_name.value)){ addError('applicationForm_name_em', 'client_name', (form.client_name.value.length > 0)?s3:s1, classN);errorCount++; }else { removeError('applicationForm_name_em', 'client_name', classN); } if(errorCount == 0) { sendPerezvonokMail(form); } return false; function addError(idMsg, idInput, msg, cName){ document.getElementById(idMsg).innerHTML = msg; document.getElementById(idInput).classList.add(cName); } function removeError(idMsg, idInput, cName){ if(document.getElementById(idInput).classList.contains(cName)){ document.getElementById(idMsg).innerHTML = ""; document.getElementById(idInput).classList.remove(cName); } } function checkEmail(email){ reg = /^[-._a-z0-9]+@(?:[a-z0-9][-a-z0-9]+\.)+[a-z]{2,6}$/; if (!email.match(reg) || (0 == email.length)) { return false; } return true; } function checkName(name){ var rep = /[0-9,'"-+*~=\/\.)(?!@#$%^&]/; if (rep.test(name) || (2 > name.length)) { return false; } return true; } } function getOffsetTop(element) { var offset = 0; do { offset += element.offsetTop; } while (element = element.offsetParent); return offset; } function jsSetServerCookie(type) { jQuery('body').append(' '); } var readyCallback = function($) { PEREZVONOK_LOADED = true; if(jQuery('#fiveBtn').length > 0) { jQuery(window).scroll(function () { jQuery('#fiveBtn').addClass('active-knopkafive'); setTimeout(function(){jQuery('#fiveBtn').removeClass('active-knopkafive')}, 700); }); } jQuery('.clb_banner').click(function() { jQuery('.perezvonok-offices').hide(); }); }; function addOnloadEvent(fnc){ if ( typeof window.addEventListener != "undefined" ) window.addEventListener( "load", fnc, false ); else if ( typeof window.attachEvent != "undefined" ) { window.attachEvent( "onload", fnc ); } else { if ( window.onload != null ) { var oldOnload = window.onload; window.onload = function ( e ) { oldOnload( e ); window[fnc](); }; } else window.onload = fnc; } } addOnloadEvent(function(e) { onSiteTimer = setInterval(function() { ++onsitetime; if(getCookie('perezvonok_send') == 1) { clearInterval(onSiteTimer); onSiteTimer = null; return; } if(!PEREZVONOK_CHAT_OPENNED && onSiteTimer != null && onsitetime >= 90) { magicc(1, 3, true, 'time'); jsSetServerCookie('time'); clearInterval(onSiteTimer); onSiteTimer = null; } }, 1000); //jquery var script = document.createElement("script"); script.type = 'text/javascript'; var jVersion = typeof jQuery != 'undefined' ? parseFloat(jQuery.fn.jquery.split('.')[0]) + parseFloat(jQuery.fn.jquery.split('.')[1]) / 10 : 0; //console.log('Jquery v' + jVersion); if (jVersion < 1.7) { script.src = root + 'js/callscripts.js?' + Math.random(); } else { script.src = root + 'js/ouibounce.js?' + Math.random(); } document.getElementsByTagName("head")[0].appendChild(script); var checkReady = function(callback) { //console.log(typeof jQuery + ' / ' + typeof ouibounce); if (typeof jQuery != 'undefined' && typeof ouibounce != 'undefined') { callback(jQuery); var script = document.createElement('script'); script.type = "text/javascript"; script.src = root + "jquerymask.js?" + Math.random(); document.getElementsByTagName('head')[0].appendChild(script); /*var jqTag = document.createElement('script'); jqTag.type = 'text/javascript'; jqTag.src = '//code.jquery.com/jquery-2.2.0.min.js';*/ perezvonokJquery(); } else { setTimeout(function() { checkReady(callback); }, 500); } }; checkReady(readyCallback); sendPerezvonokMail = function(form) { var $this = jQuery(form), office = ''; var c = encodeURIComponent(jQuery('#applicationForm_comment').val()); var n = encodeURIComponent(jQuery('#client_name').val()); var element = document.createElement('div'); if(jQuery('#applicationForm_office').length == 1) { office = jQuery('#applicationForm_office').val(); } element.innerHTML = ' '; element.style.display = 'none'; element.id = 'callapplication'; document.body.appendChild(element); $this.html('
Спасибо!

Мы получили Ваше сообщение. Наш менеджер свяжется с Вами в ближайшее время.
'); return false; } }); var zvonok = document.getElementsByClassName('perezvonok-knopka').length > 0 ? document.getElementsByClassName('perezvonok-knopka')[0] : null; if(zvonok) { zvonok.style.position = 'fixed'; } function getCoords(elem) { var box = elem.getBoundingClientRect(), body = document.body; var docEl = document.documentElement, scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop; var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft; var clientTop = docEl.clientTop || body.clientTop || 0, clientLeft = docEl.clientLeft || body.clientLeft || 0; var top = box.top + scrollTop - clientTop, left = box.left + scrollLeft - clientLeft; return { top: top, left: left }; } if(zvonok) { //zvonok.style.position = 'fixed'; var dragClickOffset = 10, dragClickTime = 150; zvonok.onmousedown = function(e) { var coords = getCoords(zvonok), shiftX = e.pageX - coords.left, shiftY = e.pageY - coords.top, mouseDownTime = new Date().getTime(); zvonok.style.position = 'fixed'; //document.body.appendChild(zvonok); moveAt(e); function moveAt(e) { var top = window.pageYOffset || document.documentElement.scrollTop; var wasLeft = zvonok.style.left, wasTop = zvonok.style.top, newLeft = e.pageX - shiftX, newTop = e.pageY - shiftY - top; nodrag = wasLeft == '' || (newLeft + 'px' == wasLeft && wasTop == newTop + 'px'); if(newLeft + jQuery(zvonok).width() > jQuery(document).width()) { newLeft = jQuery(document).width() - jQuery(zvonok).width(); } else if(newLeft < 0) { newLeft = 0; } if(newTop < 0) { newTop = 0; } else if(newTop + jQuery(zvonok).height() > jQuery(document).height()) { newTop = jQuery(document).height() - jQuery(zvonok).height(); } zvonok.style.left = newLeft + 'px'; zvonok.style.top = newTop + 'px'; if(Math.abs(coords.left - newLeft) < dragClickOffset || Math.abs(coords.top - newTop) < dragClickOffset || Math.abs(new Date().getTime() - mouseDownTime) < dragClickTime) { return false; } return !nodrag; } document.onmousemove = function(e) { if(moveAt(e)) { noclickevent = true; }}; zvonok.onmouseup = function() { document.onmousemove = null; zvonok.onmouseup = null; }; } zvonok.ondragstart = function() { return false; }; } function disableLoadingMessage () { jQuery(document).on("mobileinit", function(){ jQuery.mobile.ajaxEnabled=false; jQuery.mobile.loadingMessage = false; jQuery.mobile.loader.prototype.options.disabled = true; }); } function perezvonokJquery() { jQuery.mobile = jQuery.mobile || jQuery.fn.mobile; if (!jQuery.mobile) { console.log(jQuery.mobile); console.log('!jQuery.mobile'); return; } jQuery.mobile.loading().hide(); jQuery(document).on('scrollstart load', function() { var el = jQuery("#perezvonok-mini"); el.hide(); }); var dlg, dlgInner, pinchToZoomCheckTimer; function perezvonokPos(noShow) { noShow = noShow || false; var vpHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; var scale = Math.max(window.innerWidth, window.innerHeight) / Math.max(screen.width, screen.height); scale = scale.toFixed(6); var w = jQuery(document), ww = jQuery(window), el = jQuery("#perezvonok-mini"); var elSize = 75 * scale; /*alert(document.documentElement.clientHeight); alert(window.innerHeight); alert(window.pageYOffset);*/ var doc_height = Math.max( document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight ); var h_value = document.documentElement.clientHeight; var bottom = h_value - window.pageYOffset - window.innerHeight + 15 * scale; //var bottom = 15 * scale; //console.log(document.documentElement.clientHeight + ' / ' + window.pageYOffset + ' / ' + window.innerHeight + ' / ' + doc_height) var left = (window.innerWidth - (el.length > 0 ? el.width() : 0)) * 0.9 + window.pageXOffset; //var bottom = 10 - window.pageYOffset * scale; //var left = (window.innerWidth - (el.length > 0 ? el.width() : 0)) * 0.95 + window.pageXOffset; //var left = (window.innerWidth + window.pageXOffset - 70) + 'px', //var bottom = (window.innerHeight + window.pageYOffset - 50) + 'px'; clearTimeout(pinchToZoomCheckTimer); pinchToZoomCheckTimer = setTimeout(function () { var width = window.innerWidth || document.documentElement.clientWidth; var height = window.innerHeight || document.documentElement.clientHeight; el.css({ left: left, bottom: bottom + 'px', position: 'absolute', width: elSize + 'px', height: elSize + 'px', }); jQuery('#perezvonok-mini-phone').css('top', '-' + 3.3 * elSize + 'px'); jQuery('#perezvonok-mini-email').css('top', '-' + 1.15 * elSize + 'px'); jQuery('#perezvonok-mini-email, #perezvonok-mini-phone').css({ height: elSize, width: elSize, }); var translate1 = 2 * (elSize + 0.15 * elSize); }); if(!noShow) jQuery("#perezvonok-mini").delay(800).fadeIn(200); }; jQuery(document).on('scrollstop load scroll tap orientationchange', function() { if(jQuery("#perezvonok-mini").hasClass('loaded-perezvon')) { perezvonokPos(); } else { perezvonokPos(true); jQuery("#perezvonok-mini").addClass('loaded-perezvon') } }); jQuery(document).on('click', '#perezvonok-mini-phone, #perezvonok-mini-email', function() { jQuery('body').addClass('perezvonok-popup-open'); }); jQuery('#perezvonok-mini-phone').click(function() { magicc(2,1,false); showPanel(1); }); jQuery(document).on('click', '#perezvonok-mini', function(e) { jQuery('body').addClass('perezvonok-popup-open'); magicc(2,1,false); showPanel(1); }); };