/** Скрипт Смартреспондер*/ function SR_IsListSelected(el) { for (var i = 0; i < el.length; i ++) if (el[i].selected || el[i].checked) return i; return -1; } function SR_trim(f) { return f.toString().replace(/^[ ]+/, '').replace(/[ ]+$/, ''); } function SR_submit(f) { f["field_email"].value = SR_trim(f["field_email"].value); f["field_name_first"].value = SR_trim(f["field_name_first"].value); if ((SR_focus = f["field_email"]) && f["field_email"].value.replace(/^[ ]+/, '').replace(/[ ]+$/, '').length < 1 || (SR_focus = f["field_name_first"]) && f["field_name_first"].value.replace(/^[ ]+/, '').replace(/[ ]+$/, '').length < 1) { alert("Укажите значения всех обязательных для заполнения полей (помечены звездочкой)"); SR_focus.focus(); return false; } if (!f["field_email"].value.match(/^[\+A-Za-z0-9][\+A-Za-z0-9\._-]*[\+A-Za-z0-9_]*@([A-Za-z0-9]+([A-Za-z0-9-]*[A-Za-z0-9]+)*\.)+[A-Za-z]+$/)) { alert("Некорректный синтаксис email-адреса!"); f["field_email"].focus(); return false; } return true; } /** Конец Скрипт Смартреспондер*/ /** Скрипт Одноклассников*/ !function (d, id, did, st) { var js = d.createElement("script"); js.src = "http://web.archive.orghttps://connect.ok.ru/connect.js"; js.onload = js.onreadystatechange = function () { if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") { if (!this.executed) { this.executed = true; setTimeout(function () { OK.CONNECT.insertGroupWidget(id,did,st); }, 0); } }} d.documentElement.appendChild(js); }(document,"ok_group_widget","52385419493549","{width:300,height:220}"); /** Конец Скрипта Одноклассников*/ $(document).ready(function(){ var touch = $('#touch-menu'); var menu = $('.cat ul'); $(touch).on('click', function(e) { e.preventDefault(); menu.slideToggle(); }); $(window).resize(function(){ var wid = $(window).width(); if(wid > 800 && menu.is(':hidden')) { menu.removeAttr('style'); } }); }); $(document).ready(function(){$("#toTop").hide();$(function(){$(window).scroll(function(){if($(this).scrollTop()>100){$("#toTop").fadeIn()}else{$("#toTop").fadeOut()}});$("#toTop a").click(function(){$("body,html").animate({scrollTop:0},500);return false})})}); $(document).on('click', '.social_share', function(){ Share.go(this); }); Share = { /** * Показать пользователю дилог шаринга в сооветствии с опциями * Метод для использования в inline-js в ссылках * При блокировке всплывающего окна подставит нужный адрес и ползволит браузеру перейти по нему * * @example like+ * * @param Object _element - элемент DOM, для которого * @param Object _options - опции, все необязательны */ go: function(_element, _options) { var self = Share, options = jQuery.extend( { type: 'vk', // тип соцсети url: location.href, // какую ссылку шарим count_url: location.href, // для какой ссылки крутим счётчик title: document.title, // заголовок шаринга image: '', // картинка шаринга text: '', // текст шаринга }, jQuery(_element).data(), // Если параметры заданы в data, то читаем их _options // Параметры из вызова метода имеют наивысший приоритет ); if (self.popup(link = self[options.type](options)) === null) { // Если не удалось открыть попап if ( jQuery(_element).is('a') ) { // Если это , то подставляем адрес и просим браузер продолжить переход по ссылке jQuery(_element).prop('href', link); return true; } else { // Если это не , то пытаемся перейти по адресу location.href = link; return false; } } else { // Попап успешно открыт, просим браузер не продолжать обработку return false; } }, // ВКонтакте vk: function(_options) { var options = jQuery.extend({ url: location.href, title: document.title, image: '', text: '', }, _options); return 'http://web.archive.orghttp://vkontakte.ru/share.php?' + 'url=' + encodeURIComponent(options.url) + '&title=' + encodeURIComponent(options.title) + '&description=' + encodeURIComponent(options.text) + '&image=' + encodeURIComponent(options.image) + '&noparse=true'; }, // Одноклассники ok: function(_options) { var options = jQuery.extend({ url: location.href, text: '', }, _options); return 'http://web.archive.orghttp://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1' + '&st.comments=' + encodeURIComponent(options.text) + '&st._surl=' + encodeURIComponent(options.url); }, // Facebook fb: function(_options) { var options = jQuery.extend({ url: location.href, title: document.title, image: '', text: '', }, _options); return 'http://web.archive.orghttp://www.facebook.com/sharer.php?s=100' + '&p[title]=' + encodeURIComponent(options.title) + '&p[summary]=' + encodeURIComponent(options.text) + '&p[url]=' + encodeURIComponent(options.url) + '&p[images][0]=' + encodeURIComponent(options.image); }, // Живой Журнал lj: function(_options) { var options = jQuery.extend({ url: location.href, title: document.title, text: '', }, _options); return 'http://web.archive.orghttp://livejournal.com/update.bml?' + 'subject=' + encodeURIComponent(options.title) + '&event=' + encodeURIComponent(options.text + '
' + options.title + '') + '&transform=1'; }, // Твиттер tw: function(_options) { var options = jQuery.extend({ url: location.href, count_url: location.href, title: document.title, }, _options); return 'http://web.archive.orghttp://twitter.com/share?' + 'text=' + encodeURIComponent(options.title) + '&url=' + encodeURIComponent(options.url) + '&counturl=' + encodeURIComponent(options.count_url); }, // Mail.Ru mr: function(_options) { var options = jQuery.extend({ url: location.href, title: document.title, image: '', text: '', }, _options); return 'http://web.archive.orghttp://connect.mail.ru/share?' + 'url=' + encodeURIComponent(options.url) + '&title=' + encodeURIComponent(options.title) + '&description=' + encodeURIComponent(options.text) + '&imageurl=' + encodeURIComponent(options.image); }, // Google+ gg: function (_options) { var options = jQuery.extend({ url: location.href }, _options); return 'http://web.archive.orghttps://plus.google.com/share?url=' + encodeURIComponent(options.url); }, // Открыть окно шаринга popup: function(url) { return window.open(url,'','toolbar=0,status=0,scrollbars=1,width=626,height=436'); } } /* playback timings (ms): LoadShardBlock: 42.26 (3) esindex: 0.009 captures_list: 65.41 CDXLines.iter: 9.586 (3) PetaboxLoader3.datanode: 39.289 (4) exclusion.robots: 0.275 exclusion.robots.policy: 0.261 RedisCDXSource: 11.03 PetaboxLoader3.resolve: 15.735 load_resource: 25.218 */