function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length,c.length); } } return ""; } $(document).ready(function(){ if(location.href.indexOf('utm_medium=cpc') > 0 || getCookie('eSource') == 'adv'){ // ADV setCookie('eSource', 'adv', 365); // Верхний $('p.phone_alloka').html('+7 (495) 649-09-70'); // Нижний $('span.phone_alloka .number-down').html('+7 (495) 649-09-70 — Москва'); // Контактная карточка $('div.contacts-card span.phone_alloka').html('+7 (495) 649-09-70'); }else if( document.referrer.indexOf('yandex.ru/clck/jsredir') > 0 || document.referrer.indexOf('google.') > 0 || getCookie('eSource') == 'seo' ){ // SEO setCookie('eSource', 'seo', 365); // Верхний $('p.phone_alloka').html('+7 (495) 649-09-76'); // Нижний $('span.phone_alloka .number-down').html('+7 (495) 649-09-76 — Москва'); // Контактная карточка $('div.contacts-card span.phone_alloka').html('+7 (495) 649-09-76'); }; $('.efxCallBackFormHolder').find('form').submit(function(){ L = "/templates/template84/cb/cb.php"; p = 1; a = '?a='; if($(this).find('.error').length == 0){ yaCounter29143270.reachGoal('send-free'); $.post(L+a+p, $(this).serialize(), function(D){ alert(D); }); } return false; }); setTimeout(function(){ $('#efixedshow').trigger('click'); yaCounter29143270.reachGoal('open-free');}, 30000); });