!function($){var apiParams={colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,enableZoom:1,showTooltip:1,borderColor:1,borderWidth:1,borderOpacity:1,selectedRegions:1,multiSelectRegion:1},apiEvents={onLabelShow:"labelShow",onRegionOver:"regionMouseOver",onRegionOut:"regionMouseOut",onRegionClick:"regionClick",onRegionSelect:"regionSelect",onRegionDeselect:"regionDeselect"};$.fn.vectorMap=function(a){var b={map:"world_en",backgroundColor:"#a5bfdd",color:"#f4f3f0",hoverColor:"#c9dfaf",selectedColor:"#c9dfaf",scaleColors:["#b6d6ff","#005ace"],normalizeFunction:"linear",enableZoom:!0,showTooltip:!0,borderColor:"#818181",borderWidth:1,borderOpacity:.25,selectedRegions:null,multiSelectRegion:!1},c=this.data("mapObject");if("addMap"===a)WorldMap.maps[arguments[1]]=arguments[2];else if("set"===a&&apiParams[arguments[1]])c["set"+arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1)].apply(c,Array.prototype.slice.call(arguments,2));else{if("string"==typeof a&&"function"==typeof c[a])return c[a].apply(c,Array.prototype.slice.call(arguments,1));$.extend(b,a),b.container=this,this.css({position:"relative",overflow:"hidden"}),c=new WorldMap(b),this.data("mapObject",c);for(var d in apiEvents)b[d]&&this.bind(apiEvents[d]+".jqvmap",b[d])}};var VectorCanvas=function(a,b,c){if(this.mode=window.SVGAngle?"svg":"vml",this.params=c,"svg"==this.mode)this.createSvgNode=function(a){return document.createElementNS(this.svgns,a)};else{try{document.namespaces.rvml||document.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),this.createVmlNode=function(a){return document.createElement("')}}catch(a){this.createVmlNode=function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)")}"svg"==this.mode?this.canvas=this.createSvgNode("svg"):(this.canvas=this.createVmlNode("group"),this.canvas.style.position="absolute"),this.setSize(a,b)};VectorCanvas.prototype={svgns:"http://www.w3.org/2000/svg",mode:"svg",width:0,height:0,canvas:null,setSize:function(a,b){if("svg"==this.mode)this.canvas.setAttribute("width",a),this.canvas.setAttribute("height",b);else if(this.canvas.style.width=a+"px",this.canvas.style.height=b+"px",this.canvas.coordsize=a+" "+b,this.canvas.coordorigin="0 0",this.rootGroup){for(var c=this.rootGroup.getElementsByTagName("shape"),d=0,e=c.length;d0&&(b.setAttribute("stroke-width",this.params.borderWidth),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round")),this.params.borderOpacity>0&&b.setAttribute("stroke-opacity",this.params.borderOpacity),b.setFill=function(a){this.setAttribute("fill",a),null===this.getAttribute("original")&&this.setAttribute("original",a)},b.getFill=function(a){return this.getAttribute("fill")},b.getOriginalFill=function(){return this.getAttribute("original")},b.setOpacity=function(a){this.setAttribute("fill-opacity",a)};else{b=this.createVmlNode("shape"),b.coordorigin="0 0",b.coordsize=this.width+" "+this.height,b.style.width=this.width+"px",b.style.height=this.height+"px",b.fillcolor=WorldMap.defaultFillColor,b.stroked=!1,b.path=VectorCanvas.pathSvgToVml(a.path);var c=this.createVmlNode("skew");c.on=!0,c.matrix="0.01,0,0,0.01,0,0",c.offset="0,0",console.log(c),b.appendChild(c);var d=this.createVmlNode("fill");b.appendChild(d),b.setFill=function(a){this.getElementsByTagName("fill")[0].color=a,null===this.getAttribute("original")&&this.setAttribute("original",a)},b.getFill=function(a){return this.getElementsByTagName("fill")[0].color},b.getOriginalFill=function(){return this.getAttribute("original")},b.setOpacity=function(a){this.getElementsByTagName("fill")[0].opacity=parseInt(100*a,10)+"%"}}return b},createGroup:function(a){var b;return"svg"==this.mode?b=this.createSvgNode("g"):(b=this.createVmlNode("group"),b.style.width=this.width+"px",b.style.height=this.height+"px",b.style.left="0px",b.style.top="0px",b.coordorigin="0 0",b.coordsize=this.width+" "+this.height),a&&(this.rootGroup=b),b},applyTransformParams:function(a,b,c){"svg"==this.mode?this.rootGroup.setAttribute("transform","scale(0.94) translate(0, 0)"):(this.rootGroup.coordorigin=this.width-b+","+(this.height-c),this.rootGroup.coordsize=this.width/a+","+this.height/a)}},VectorCanvas.pathSvgToVml=function(a){var e,f,c=0,d=0;return a.replace(/([MmLlHhVvCcSs])((?:-?(?:\d+)?(?:\.\d+)?,?\s?)+)/g,function(a,b,g,h){g=g.replace(/(\d)-/g,"$1,-").replace(/\s+/g,",").split(","),g[0]||g.shift();for(var i=0,j=g.length;i").addClass("jqvmap-label").appendTo(jQuery("body")).hide(),a.enableZoom&&(jQuery("
").addClass("jqvmap-zoomin").text("+").appendTo(a.container),jQuery("
").addClass("jqvmap-zoomout").html("−").appendTo(a.container)),b.countries=[];for(var d in c.pathes){var e=this.canvas.createPath({path:c.pathes[d].path});e.setFill(this.color),e.id=b.getCountryId(d),b.countries[d]=e,"svg"==this.canvas.mode?e.setAttribute("class","jvectormap-region"):jQuery(e).addClass("jvectormap-region"),jQuery(this.rootGroup).append(e)}if(jQuery(a.container).delegate("svg"==this.canvas.mode?"path":"shape","mouseover mouseout",function(d){var e=d.target,f=d.target.id.split("_").pop(),g=$.Event("labelShow.jqvmap"),h=$.Event("regionMouseOver.jqvmap");if("mouseover"==d.type){if(jQuery(a.container).trigger(h,[f,c.pathes[f].name]),!h.isDefaultPrevented()){if("background"==f.substr(0,10))return!1;b.highlight(f,e)}a.showTooltip&&(b.label.text(c.pathes[f].name),jQuery(a.container).trigger(g,[b.label,f]),g.isDefaultPrevented()||(b.label.show(),b.labelWidth=b.label.width(),b.labelHeight=b.label.height()))}else b.unhighlight(f,e),b.label.hide(),jQuery(a.container).trigger("regionMouseOut.jqvmap",[f,c.pathes[f].name])}),jQuery(a.container).delegate("svg"==this.canvas.mode?"path":"shape","click",function(d){if(!a.multiSelectRegion)for(var e in c.pathes)b.countries[e].currentFillColor=b.countries[e].getOriginalFill(),b.countries[e].setFill(b.countries[e].getOriginalFill());var f=d.target,g=d.target.id.split("_").pop();jQuery(a.container).trigger("regionClick.jqvmap",[g,c.pathes[g].name]),regionClickEvent.isDefaultPrevented()||(-1!==b.selectedRegions.indexOf(g)?b.deselect(g,f):b.select(g,f))}),a.showTooltip&&a.container.mousemove(function(a){if(b.label.is(":visible")){var c=a.pageX-15-b.labelWidth,d=a.pageY-28-b.labelHeight;c<0&&(c=a.pageX+15),d<0&&(d=a.pageY+28),b.label.css({left:c,top:d})}}),this.setColors(a.colors),this.canvas.canvas.appendChild(this.rootGroup),this.applyTransform(),this.colorScale=new ColorScale(a.scaleColors,a.normalizeFunction,a.valueMin,a.valueMax),a.values&&(this.values=a.values,this.setValues(a.values)),a.selectedRegions)if(a.selectedRegions instanceof Array)for(var f in a.selectedRegions)this.select(a.selectedRegions[f].toLowerCase());else this.select(a.selectedRegions.toLowerCase());this.bindZoomButtons(),a.pins&&(this.pinHandlers=!1,this.placePins(a.pins,a.pinMode)),WorldMap.mapIndex++};WorldMap.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,countries:{},countriesColors:{},countriesData:{},zoomStep:1.4,zoomMaxStep:4,zoomCurStep:1,setColors:function(a,b){if("string"==typeof a)this.countries[a].setFill(b),this.countries[a].setAttribute("original",b);else{var c=a;for(var d in c)this.countries[d]&&(this.countries[d].setFill(c[d]),this.countries[d].setAttribute("original",c[d]))}},setValues:function(a){var d,b=0,c=Number.MAX_VALUE;for(var e in a)d=parseFloat(a[e]),d>b&&(b=a[e]),d&&d=0&&(this.selectedRegions.splice(this.selectedRegions.indexOf(a),1),$(this.container).trigger("regionDeselect.jqvmap",[a]),b.currentFillColor=b.getOriginalFill(),b.setFill(b.getOriginalFill()))},isSelected:function(a){return this.selectedRegions.indexOf(a)>=0},resize:function(){var a=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/a,this.transX*=this.baseScale/a,this.transY*=this.baseScale/a},reset:function(){this.countryTitle.reset();for(var a in this.countries)this.countries[a].setFill(WorldMap.defaultColor);this.scale=this.baseScale,this.transX=this.baseTransX,this.transY=this.baseTransY,this.applyTransform()},applyTransform:function(){var a,b,c,d;this.defaultWidth*this.scale<=this.width?(a=(this.width-this.defaultWidth*this.scale)/(2*this.scale),c=(this.width-this.defaultWidth*this.scale)/(2*this.scale)):(a=0,c=(this.width-this.defaultWidth*this.scale)/this.scale),this.defaultHeight*this.scale<=this.height?(b=(this.height-this.defaultHeight*this.scale)/(2*this.scale),d=(this.height-this.defaultHeight*this.scale)/(2*this.scale)):(b=0,d=(this.height-this.defaultHeight*this.scale)/this.scale),this.transY>b?this.transY=b:this.transYa?this.transX=a:this.transX1){a.transX,a.transY,a.scale;a.transX+=(a.width/(a.scale/a.zoomStep)-a.width/a.scale)/2,a.transY+=(a.height/(a.scale/a.zoomStep)-a.height/a.scale)/2,a.setScale(a.scale/a.zoomStep),a.zoomCurStep--,jQuery("#zoomSlider").css("top",parseInt(jQuery("#zoomSlider").css("top"),10)+b),a.container.trigger("zoomOut")}},setScale:function(a){this.scale=a,this.applyTransform()},getCountryId:function(a){return"jqvmap"+this.index+"_"+a},getPinId:function(a){return this.getCountryId(a)+"_pin"},placePins:function(a,b){var c=this;if((!b||"content"!=b&&"id"!=b)&&(b="content"),"content"==b?jQuery.each(a,function(a,b){if(0!=jQuery("#"+c.getCountryId(a)).length){var d=c.getPinId(a);jQuery("#"+d).length>0&&jQuery("#"+d).remove(),c.container.append('
'+b+"
")}}):jQuery.each(a,function(a,b){if(0!=jQuery("#"+c.getCountryId(a)).length){var d=c.getPinId(a);jQuery("#"+d).length>0&&jQuery("#"+d).remove(),c.container.append('
'),jQuery("#"+d).append(jQuery("#"+b))}}),this.positionPins(),!this.pinHandlers){this.pinHandlers=!0;var d=function(){c.positionPins()};this.container.bind("zoomIn",d).bind("zoomOut",d).bind("drag",d)}},positionPins:function(){var a=this,b=this.container.find(".jqvmap_pin");jQuery.each(b,function(b,c){c=jQuery(c);var d=a.getCountryId(c.attr("for")),e=jQuery("#"+d),f=document.getElementById(d).getBBox(),g=e.position(),h=a.scale,i=g.left+f.width/2*h-c.width()/2,j=g.top+f.height/2*h-c.height()/2;c.css("left",i).css("top",j)})},getPin:function(a){return jQuery("#"+this.getPinId(a)).html()},getPins:function(){var pins=this.container.find(".jqvmap_pin"),ret=new Object;return jQuery.each(pins,function(index,pinObj){pinObj=jQuery(pinObj);var cc=pinObj.attr("for"),pinContent=pinObj.html();eval("ret."+cc+"=pinContent")}),JSON.stringify(ret)},removePin:function(a){jQuery("#"+this.getPinId(a)).remove()},removePins:function(){this.container.find(".jqvmap_pin").remove()}},WorldMap.xlink="http://www.w3.org/1999/xlink",WorldMap.mapIndex=1,WorldMap.maps={};var ColorScale=function(a,b,c,d){a&&this.setColors(a),b&&this.setNormalizeFunction(b),c&&this.setMin(c),c&&this.setMax(d)};ColorScale.prototype={colors:[],setMin:function(a){this.clearMinValue=a,"function"==typeof this.normalize?this.minValue=this.normalize(a):this.minValue=a},setMax:function(a){this.clearMaxValue=a,"function"==typeof this.normalize?this.maxValue=this.normalize(a):this.maxValue=a},setColors:function(a){for(var b=0;b=0;)a-=b[e],e++;var g;for(g=e==this.colors.length-1?this.vectorToNum(this.colors[e]).toString(16):this.vectorToNum(this.vectorAdd(this.colors[e],this.vectorMult(this.vectorSubtract(this.colors[e+1],this.colors[e]),a/b[e]))).toString(16);g.length<6;)g="0"+g;return"#"+g},vectorToNum:function(a){for(var b=0,c=0;c';var frag= document.createDocumentFragment();while (div.firstChild.firstChild)frag.appendChild(div.firstChild.firstChild);return frag;}svg.appendChild(parseSVG('\\КУРОРТНЫЙ \КРОНШТАДТ\ЛОМОНОСОВ\ВЫБОРГСКИЙ\ПРИМОРСКИЙ\КАЛИНИНСКИЙ\КРАСНОГВАРДЕЙСКИЙ\ЦЕНТРАЛЬНЫЙ\НЕВСКИЙ\ФРУНЗЕНСКИЙ\КОЛПИНСКИЙ\ПУШКИНСКИЙ\ПАВЛОВСК\МОСКОВСКИЙ\КРАНОСЕЛЬСКИЙ\КИРОВСКИЙ\\В.О.\ПЕТРОДВОРЦОВЫЙ\ПЕТРОГРАДСКИЙ\'));$('.focus-region', svgdom).mouseover(function() {var iso = $(this).prop('id'),fregion = {};fregion[iso] = focusRegion;$('#vmap').vectorMap('set', 'colors', fregion);});$('.focus-region', svgdom).mouseout(function() {var iso = $(this).prop('id'),fregion = {};fregion[iso] = colorRegion;$('#vmap').vectorMap('set', 'colors', fregion);});});});(function($) {!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.svg4everybody=b()}):"object"==typeof module&&module.exports?module.exports=b():a.svg4everybody=b()}(this,function(){function a(a,b,c){if(c){var d=document.createDocumentFragment(),e=!b.hasAttribute("viewBox")&&c.getAttribute("viewBox");e&&b.setAttribute("viewBox",e);for(var f=c.cloneNode(!0);f.childNodes.length;)d.appendChild(f.firstChild);a.appendChild(d)}}function b(b){b.onreadystatechange=function(){if(4===b.readyState){var c=b._cachedDocument;c||(c=b._cachedDocument=document.implementation.createHTMLDocument(""),c.body.innerHTML=b.responseText,b._cachedTarget={}),b._embeds.splice(0).map(function(d){var e=b._cachedTarget[d.id];e||(e=b._cachedTarget[d.id]=c.getElementById(d.id)),a(d.parent,d.svg,e)})}},b.onreadystatechange()}function c(c){function e(){for(var c=0;c0)&&n(e,67)}var f,g=Object(c),h=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,i=/\bAppleWebKit\/(\d+)\b/,j=/\bEdge\/12\.(\d+)\b/,k=/\bEdge\/.(\d+)\b/,l=window.top!==window.self;f="polyfill"in g?g.polyfill:h.test(navigator.userAgent)||(navigator.userAgent.match(j)||[])[1]<10547||(navigator.userAgent.match(i)||[])[1]<537||k.test(navigator.userAgent)&&l;var m={},n=window.requestAnimationFrame||setTimeout,o=document.getElementsByTagName("use"),p=0;f&&e()}function d(a){for(var b=a;"svg"!==b.nodeName.toLowerCase()&&(b=b.parentNode););return b}return c});svg4everybody();})(jQuery);;(function() {!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Slideout=t()}}(function(){var t,e,n;return function i(t,e,n){function o(r,a){if(!e[r]){if(!t[r]){var u=typeof require=="function"&&require;if(!a&&u)return u(r,!0);if(s)return s(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var f=e[r]={exports:{}};t[r][0].call(f.exports,function(e){var n=t[r][1][e];return o(n?n:e)},f,f.exports,i,t,e,n)}return e[r].exports}var s=typeof require=="function"&&require;for(var r=0;rt._tolerance?t.open():t.close()}t._moved=false};this.panel.addEventListener(f.end,this._onTouchEndFn);this._onTouchMoveFn=function(e){if(r||t._preventOpen||typeof e.touches==="undefined"||d(e.target)){return}var n=e.touches[0].clientX-t._startOffsetX;var i=t._currentOffsetX=n;if(Math.abs(i)>t._padding){return}if(Math.abs(n)>20){t._opening=true;var o=n*t._orientation;if(t._opened&&o>0||!t._opened&&o<0){return}if(!t._moved){t.emit("translatestart")}if(o<=0){i=n+t._padding*t._orientation;t._opening=false}if(!(t._moved&&u.classList.contains("slideout-open"))){u.classList.add("slideout-open")}t.panel.style[h+"transform"]=t.panel.style.transform="translateX("+i+"px)";t.emit("translate",i);t._moved=true}};this.panel.addEventListener(f.move,this._onTouchMoveFn);return this};_.prototype.enableTouch=function(){this._touch=true;return this};_.prototype.disableTouch=function(){this._touch=false;return this};_.prototype.destroy=function(){this.close();a.removeEventListener(f.move,this._preventMove);this.panel.removeEventListener(f.start,this._resetTouchFn);this.panel.removeEventListener("touchcancel",this._onTouchCancelFn);this.panel.removeEventListener(f.end,this._onTouchEndFn);this.panel.removeEventListener(f.move,this._onTouchMoveFn);a.removeEventListener("scroll",this._onScrollFn);this.open=this.close=function(){};return this};e.exports=_},{decouple:2,emitter:3}],2:[function(t,e,n){"use strict";var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function o(t,e,n){var o,s=false;function r(t){o=t;a()}function a(){if(!s){i(u);s=true}}function u(){n.call(t,o);s=false}t.addEventListener(e,r,false);return r}e.exports=o},{}],3:[function(t,e,n){"use strict";var i=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};n.__esModule=true;var o=function(){function t(){i(this,t)}t.prototype.on=function e(t,n){this._eventCollection=this._eventCollection||{};this._eventCollection[t]=this._eventCollection[t]||[];this._eventCollection[t].push(n);return this};t.prototype.once=function n(t,e){var n=this;function i(){n.off(t,i);e.apply(this,arguments)}i.listener=e;this.on(t,i);return this};t.prototype.off=function o(t,e){var n=undefined;if(!this._eventCollection||!(n=this._eventCollection[t])){return this}n.forEach(function(t,i){if(t===e||t.listener===e){n.splice(i,1)}});if(n.length===0){delete this._eventCollection[t]}return this};t.prototype.emit=function s(t){var e=this;for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o 0) {if ($(this).children("ul").css("display") == "none") {$(this).children("ul").slideDown();$(this).children("ul").siblings("a").addClass("active");$(this).siblings().children("ul").slideUp();$(this).siblings().children("ul").siblings("a").removeClass("active");return false;} else {$(this).children("ul").slideUp();}if ($(this).children("ul").siblings("a").hasClass("active")) {$(this).children("ul").siblings("a").removeClass("active");}}if (!$(this).children("a").hasClass("menu-active")) {window.location.href = $(this).children("a").attr("href");}}});})(jQuery);(function($) {window.onload = function() {$('').attr({type: 'text/css',rel: 'stylesheet',href: '/templates/default/js/callme_lib/style.css'}).appendTo('head');}; $.get('/templates/default/js/callme_lib/form.html', function(d) {$('body').append(d);var cmeForm = $(".cme-form");function dl(f, t) { setTimeout(function() {eval(f + '()');}, t * 1000);}function cmeMsg(form, c, t) { var result = $(form).find('.callme-result');if (c && t) {result.html('
' + t + '
');} else if (!c && !t) {result.html('');}}function cmeClr() { $('.cme-form').find('[type=text], [type=tel], textarea').val('');}function cmeHide() { $('#cme-back').fadeOut('fast');$('html').css('overflow', 'auto');}function cmeShow(e, title, btn) {if (cmeForm.is(':visible')) {$('#cme-back').fadeOut('fast');} else {var dh = $(document).height(), wh = $(window).height(),dw = $(window).width(); lf_cr = dw / 2 - 200;tp_cr = wh / 2 - 220;if (tp_cr < 30) { tp_cr = 30;}$('.h6').text(title); $('.cme-form .cme-btn').text(btn); cmeForm.css('left', lf_cr);cmeForm.css('top', tp_cr);$('#cme-back').fadeToggle('fast');$('html').css('overflow', 'hidden');cmeClr();}}function cmeSend(e) { var cmeSent = Date.parse(getData('cmeSent')); if (cmeSent && new Date() - cmeSent < 60000 ){ cmeMsg(form, 'c_success', 'Cообщение уже отправлено');return false;}var err = false,allRequired = 1,form = $(e).closest('form');form.find('[type=text], [type=tel]').each(function() {if ($(this).attr('required') !== undefined) {allRequired = 0;}if ($(this).val().length < 3 && $(this).attr('required') !== undefined) {$(this).addClass('has-error');err = true;}if ($('input[type=tel]').val().length < 7) {$('input[type=tel]').addClass('has-error');err = true;}});console.log('err', err);if (err) {if (form.hasClass('cme')) {cmeMsg(form, 'c_error', 'ЗАПОЛНИТЕ ВСЕ ПОЛЯ');}return false;}cmeMsg(form, 'sending', 'ОТПРАВЛЯЕМ');var cs = [],os = [],api ='';form.find('[type=text], [type=tel], textarea').each(function() { var e = $(this);if (e.val() && e.val().length > 0) {cs.push(e.attr('name'));os.push(e.val());}});var cmeAttribute = getData('cmeAttribute');if (cmeAttribute != 'false') {cs.push('Атрибут ссылки');os.push(cmeAttribute);}cs.push('Страница'); os.push(location.href);var mapping = {Имя:'clientnamefirst', Номер:'clientphone', Комментарий:'comments', Тема:'custom_tema44', 'Email':'clientemail', Страница:'custom_stranitsa35'};cs.forEach(function(el,i){for (var key in mapping) {if (el == key){api += '&' + mapping[key] + '=' + os[i];}}});$.post('/templates/default/js/callme_lib/send.php', { cs: cs,os: os,api: api}, function(result) {data = JSON.parse(result);if (data.result && data.result.toLowerCase() == 'ok') {form.find('.cme-btn').attr('disabled', 'disabled');cmeMsg(form, 'c_success', 'Спасибо, сообщение отправлено');setData('cmeSent', new Date()); dl('cmeHide', 4);dl('cmeClr', 5);} else if (data.status){console.log ('Успешно в песочнице: ', data);} else {cmeMsg(form, 'c_error', 'Ошибка');console.log (data);}});}$(document).delegate('.callme_viewform', 'click', function(e) { e.preventDefault();var title = $(this).attr("data-title") || $(this).text(); var btn = title.match(/([a-zа-яё]+)/i)[1]; var cmeAttribute = $(this).attr('data-cme') || false;setData('cmeAttribute', cmeAttribute);cmeShow(e, title, btn);return false;});$(document).delegate('.cme-cls', 'click', function(e) { e.preventDefault();cmeHide();return false;});$(document).delegate('.cme-bg', 'click', function() { cmeHide();});$(document).delegate('.cme-btn', 'click', function(e) { e.preventDefault();cmeSend($(this));});$(document).delegate('#cme-form-main [type=text],#cme-form-main [type=tel], #cme-form-main textarea', 'keypress', function() {$(this).removeClass('has-error');});$(document).keyup(function(a) { if (a.keyCode == 27 && cmeForm.is(':visible')) {cmeHide();}});$(document).on('keyup', '.cme-phone', function() {$(this).val($(this).val().replace(/[^0-9]+/g, ''));});if (!getData('cmeRef') && (document.referrer)) { setData('cmeRef', document.referrer);}function getData(e) { return localStorage.getItem(e) || false;}function setData(e, v) { localStorage.setItem(e, v);}});})(jQuery);