(function(a){if(!a){a=window.Lego={}}a.messages=a.messages||{};a.message=function(c,b){return a.params.locale=="ru"?b:(a.messages[c]||b)}})(window.Lego);(function(){var a=function(){var b=document.documentElement.style;return typeof b.borderRadius==="string"||typeof b.WebkitBorderRadius==="string"||typeof b.KhtmlBorderRadius==="string"||typeof b.MozBorderRadius==="string"};document.documentElement.className+=a()?" m-border-radius":" m-no-border-radius"}());(function(b){if(!b){b=window.Lego={}}function a(c){return c.replace(/^(?:https?:)?\/\//,"")}b.c=function(d,c,j){var i=a((j&&j.host)||b.params["click-host"]||"clck.yandex.ru"),e=function(l,n,m,k){return n.indexOf("/dtype=")>-1?n:location.protocol+"//"+i+"/"+m+"/dtype="+l+"/rnd="+((new Date()).getTime()+Math.round(Math.random()*100))+(k?"/*"+(n.match(/^http/)?n:location.protocol+"//"+location.host+(n.match("^/")?n:"/"+n)):"/*data="+encodeURIComponent("url="+encodeURIComponent((n.match(/^http/)?n:location.protocol+"//"+location.host+(n.match("^/")?n:"/"+n)))))},g=function(){var k=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0];var h=document.createElement("script");h.setAttribute("src",e(d,location.href,"jclck"));k.insertBefore(h,k.firstChild)};if(c){if(c.className.match(/b-pseudo-link/)||(c.href&&c.href.match(/^mailto:/))||(j&&j.noRedirect===true)){g()}else{if(c.href){var f=c.href;c.href=e(d,f,"redir");setTimeout(function(){c.href=f},500)}else{if(c.form){if(c.type.match(/submit|button|image/)){var f=c.form.action;c.form.action=e(d,f,"redir",true);setTimeout(function(){c.form.action=f},500)}else{g()}}else{if(c.action){c.action=e(d,c.action,"redir",true)}else{throw"counter.js: not link and not form!"}}}}}else{g()}}})(window.Lego);(function(a){if(!a){a=window.Lego={}}a.cp=function(f,c,e,b,d){a.c("stred/pid="+f+"/cid="+c+(e?"/path="+e:""),b,d)}})(window.Lego);(function(a){if(!a){a=window.Lego={}}a.ch=function(c,b){if(a.params["show-counters"]){a.cp(0,2219,c,b)}}})(window.Lego);(function(a){if(!a){a=window.Lego={}}a.getCookie=function(h){var g=document.cookie;if(g.length<1){return false}var d=g.indexOf(h+"=");if(d==-1){return false}d+=(h.length+1);var f=g.indexOf(";",d);return decodeURIComponent((f==-1)?g.substring(d):g.substring(d,f))}})(window.Lego);(function(a){if(!a){a=window.Lego={}}a.isSessionValid=function(){return !!a.getCookie("yandex_login")}})(window.Lego);(function(b,a){if(!a){a=window.Lego={}}a.init||(a.init=function(c){(c=a.params=b.extend({id:"",login:a.isSessionValid()?a.getCookie("yandex_login")||"":"",yandexuid:a.getCookie("yandexuid"),locale:"ru",retpath:window.location.toString(),"passport-host":"//passport.yandex.ru","pass-host":"//pass.yandex.ru","passport-msg":c.id,"social-host":"//social.yandex.ru","lego-path":"/lego","show-counters-percent":100},c,a.params))["show-counters"]=Math.round(Math.random()*100)<=c["show-counters-percent"];b(function(){c.oframebust&&a.oframebust(c.oframebust)});return c});a.block||(a.block={});a.blockInit||(a.blockInit=function(c,d){c=c||document;d=d||".g-js";b(c).find(d).each(function(){var h=b(this),g=this.onclick?this.onclick():{},e=g.name||"",f=a.block[e];if(f&&!h.data(e)){f.call(h,g);h.data(e,true).addClass(e+"_js_inited")}})});a.blockInitBinded||(a.blockInitBinded=!!b(document).ready(function(){a.blockInit()}))})(jQuery,window.Lego);(function(a){a=a||{};a.oframebustMatchDomain=function(g,h){g=Object.prototype.toString.call(g)==="[object Array]"?g:(function(){var d=[];for(var e in g){g.hasOwnProperty(e)&&d.push(e)}return d}());for(var c=0,b=g.length;c<b;c++){var k=g[c];if(typeof(k)=="string"){if(/(\?|\*)/.test(k)){var f=k.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".{1}");if((new RegExp("^"+f+"$")).test(h)){return true}}else{if(h==k){return true}}}else{try{if(k.test(h)){return true}}catch(j){}}}}})(window.Lego);(function(a){if(!a){a=window.Lego={}}a.oframebust=function(c){if(location==top.location){return}var d=(location.search.match(/[&?]oframebust=([^&;]+)/)||[])[1];if(!d){top.location=location}if(a.oframebustMatchDomain(c,d)){var b=document.createElement("iframe");b.style.position="absolute";b.style.left="-999px";b.style.width="1px";b.src="//"+d+"/oframebust.html?"+encodeURIComponent(location.href);(function(){if(document.body&&document.body.firstChild){document.body.insertBefore(b,document.body.firstChild)}else{setTimeout(arguments.callee,0)}})();return}top.location=location}})(window.Lego);(function(e){var b=(function(){_}).toString().indexOf("_")>-1,a=e.browser.msie,c=a?["toString","valueOf"]:null,f=function(){};function d(h,g,i){var k=false;if(a){var j=[];e.each(c,function(){i.hasOwnProperty(this)&&(k=true)&&j.push({name:this,val:i[this]})});if(k){e.each(i,function(l){j.push({name:l,val:this})});i=j}}e.each(i,function(m,n){if(k){m=n.name;n=n.val}if(e.isFunction(n)&&(!b||n.toString().indexOf(".__base")>-1)){var l=h[m]||function(){};g[m]=function(){var p=this.__base;this.__base=l;var o=n.apply(this,arguments);this.__base=p;return o}}else{g[m]=n}})}e.inherit=function(){var h=e.isFunction(arguments[0]),n=h?arguments[0]:f,j=arguments[h?1:0]||{},l=arguments[h?2:1],g=j.__constructor||(h&&n.prototype.__constructor)?function(){this.__constructor.apply(this,arguments)}:function(){};if(!h){g.prototype=j;g.prototype.__self=g.prototype.constructor=g;return e.extend(g,l)}e.extend(g,n);var k=function(){},i=k.prototype=n.prototype,m=g.prototype=new k();m.__self=m.constructor=g;d(i,m,j);l&&d(n,g,l);return g};e.inheritSelf=function(j,h,i){var g=j.prototype;d(g,g,h);i&&d(j,j,i);return j}})(jQuery);(function(c){var a=0,d="__"+(+new Date),b=function(){return"uniq"+ ++a};c.identify=function(g,f){if(!g){return b()}var e="uniqueID" in g?"uniqueID":d;return f||e in g?g[e]:g[e]=b()}})(jQuery);(function(a){a.isEmptyObject||(a.isEmptyObject=function(c){for(var b in c){return false}return true})})(jQuery);(function(d){var a="__"+ +new Date+"storage",c=function(f,e){return d.identify(f)+(e?d.identify(e):"")},b={buildEventName:function(f){return f},on:function(o,j,p,s,m){if(typeof o=="string"){if(d.isFunction(j)){s=p;p=j;j=undefined}var f=c(p,s),l=this[a]||(this[a]={}),g=o.split(" "),h=0,q;while(o=g[h++]){o=this.buildEventName(o);q=l[o]||(l[o]={ids:{},list:{}});if(!(f in q.ids)){var n=q.list,r={fn:p,data:j,ctx:s,special:m};if(n.last){n.last.next=r;r.prev=n.last}else{n.first=r}q.ids[f]=n.last=r}}}else{var k=this;d.each(o,function(t,i){k.on(t,i,j,m)})}return this},onFirst:function(i,h,g,f){return this.on(i,h,g,f,{one:true})},un:function(p,q,t){if(typeof p=="string"||typeof p=="undefined"){var n=this[a];if(n){if(p){var h=p.split(" "),k=0,r;while(p=h[k++]){p=this.buildEventName(p);if(r=n[p]){if(q){var g=c(q,t),f=r.ids;if(g in f){var o=r.list,s=f[g],j=s.prev,l=s.next;if(j){j.next=l}else{if(s===o.first){o.first=l}}if(l){l.prev=j}else{if(s===o.last){o.last=j}}delete f[g]}}else{delete this[a][p]}}}}else{delete this[a]}}}else{var m=this;d.each(p,function(u,i){m.un(u,i,t)})}return this},trigger:function(j,h){var l=this,k=l[a],i;typeof j==="string"?j=d.Event(l.buildEventName(i=j)):j.type=l.buildEventName(i=j.type);if(k&&(k=k[j.type])){var g=k.list.first,f;while(g){j.data=g.data;f=g.fn.call(g.ctx||l,j,h);if(typeof f!=="undefined"){j.result=f;if(f===false){j.preventDefault();j.stopPropagation()}}g.special&&g.special.one&&l.un(i,g.fn,g.ctx);g=g.next}}return this}};d.observable=d.inherit(b,b)})(jQuery);(function(e,g){var d=[],f={},a={};function c(j,i,h){return(j?"__elem_"+j:"")+"__mod"+(i?"_"+i:"")+(h?"_"+h:"")}function b(i,h,j){e.isFunction(i)?(h[c(j,"*","*")]=i):e.each(i,function(l,k){e.isFunction(k)?(h[c(j,l,"*")]=k):e.each(k,function(m,n){h[c(j,l,m)]=n})})}this.BEM=e.inherit(e.observable,{__constructor:function(i,j,h){var k=this;k._modCache=i||{};k._processingMods={};k.params=e.extend(k.getDefaultParams(),j);h!==false?k._init():k.afterCurrentEvent(k._init)},_init:function(){var h=this;if("_modCache" in h&&!h.hasMod("js","inited")){h.setMod("js","inited").trigger("init")}return h},changeThis:function(i,h){var j=this;return function(){return i.apply(h||j,arguments)}},afterCurrentEvent:function(i,h){this.__self.afterCurrentEvent(this.changeThis(i,h))},trigger:function(i,h){this.__base(i=this.buildEvent(i),h).__self.trigger(i,h);return this},buildEvent:function(h){typeof h=="string"&&(h=e.Event(h));h.block=this;return h},hasMod:function(k,l,i){var h=arguments.length,m=false;if(h==1){i="";l=k;k=g;m=true}else{if(h==2){if(typeof k=="string"){i=l;l=k;k=g}else{i="";m=true}}}var j=this.getMod(k,l)===i;return m?!j:j},getMod:function(j,k){var h=typeof j;if(h==="string"||h==="undefined"){k=j||k;var i=this._modCache;return k in i?i[k]:i[k]=this._extractModVal(k)}return this._getElemMod(k,j)},_getElemMod:function(j,h,i){return this._extractModVal(j,h,i)},getMods:function(k){var i=k&&typeof k!="string",l=this,h=[].slice.call(arguments,i?1:0),j=l._extractMods(h,i?k:g);if(!i){h.length?e.each(h,function(n,m){l._modCache[m]=j[m]}):l._modCache=j}return j},setMod:function(k,o,p){if(typeof p=="undefined"){p=o;o=k;k=g}var l=this;if(!k||k[0]){var m=(k&&k[0]?e.identify(k[0]):"")+"_"+o;if(this._processingMods[m]){return l}var j,i=k?l._getElemMod(o,k,j=l.__self._extractElemNameFrom(k)):l.getMod(o);if(i===p){return l}this._processingMods[m]=true;var h=true,n=[o,p,i];k&&n.unshift(k);e.each([["*","*"],[o,"*"],[o,p]],function(){h=l._callModFn(j,this[0],this[1],n)!==false&&h});!k&&h&&(l._modCache[o]=p);h&&l._afterSetMod(o,p,k,j);delete this._processingMods[m]}return l},_afterSetMod:function(j,h,i){},toggleMod:function(j,k,i,m,l){if(typeof j=="string"){l=m;m=i;i=k;k=j;j=g}if(typeof m=="undefined"){m=""}else{if(typeof m=="boolean"){l=m;m=""}}var h=this.getMod(j,k);(h==i||h==m)&&this.setMod(j,k,typeof l==="boolean"?(l?i:m):this.hasMod(j,k,i)?m:i);return this},delMod:function(h,i){if(!i){i=h;h=g}return this.setMod(h,i,"")},_callModFn:function(k,j,h,i){var l=c(k,j,h);return this[l]?this[l].apply(this,i):g},_extractModVal:function(i,h){return""},_extractMods:function(h,i){return{}},channel:function(i,h){return this.__self.channel(i,h)},getDefaultParams:function(){return{}},del:function(i){var h=[].slice.call(arguments);typeof i=="string"&&h.unshift(this);this.__self.del.apply(this.__self,h);return this},destruct:function(){delete this._modCache}},{_name:"i-bem",blocks:f,decl:function(h,i,k){if(typeof h=="string"){h={block:h}}else{if(h.name){h.block=h.name}}if(h.baseBlock&&!f[h.baseBlock]){throw ('baseBlock "'+h.baseBlock+'" for "'+h.block+'" is undefined')}if(i.onSetMod){b(i.onSetMod,i);delete i.onSetMod}if(i.onElemSetMod){e.each(i.onElemSetMod,function(n,m){b(m,i,n)});delete i.onElemSetMod}var j=f[h.baseBlock||h.block]||this;if(h.modName){e.each(i,function(m,n){e.isFunction(n)&&(i[m]=function(){var p;if(this.hasMod(h.modName,h.modVal)){p=n}else{var o=j.prototype[m];o&&o!==i[m]&&(p=this.__base)}return p?p.apply(this,arguments):g})})}var l;h.block==j._name?(l=e.inheritSelf(j,i,k))._processLive(true):(l=f[h.block]=e.inherit(j,i,k))._name=h.block;return l},_processLive:function(h){return false},create:function(i,h){typeof i=="string"&&(i={block:i});return new f[i.block](i.mods,h)},getName:function(){return this._name},_extractElemNameFrom:function(h){},afterCurrentEvent:function(i,h){d.push({fn:i,ctx:h})==1&&setTimeout(function(){var j,k=d.splice(0,d.length);while(j=k.shift()){j.fn.call(j.ctx||this)}},0)},changeThis:function(i,h){return function(){return i.apply(h||this,arguments)}},del:function(l){var k=typeof l=="string",j=k?0:1,h=arguments.length;k&&(l=this);while(j<h){delete l[arguments[j++]]}return this},channel:function(i,h){if(typeof i=="boolean"){h=i;i=g}i||(i="default");if(h){if(a[i]){a[i].un();delete a[i]}return}return a[i]||(a[i]=new e.observable())}})})(jQuery);(function(i,b,a){var g="_",c="__",d="[a-zA-Z0-9-]+";function e(l,j,k){k.push(g,l,g,j)}function f(l,m,j,k){k.push(l);j&&e(m,j,k)}function h(n,l,m,j,k){f(n,a,a,k);k.push(c,l);j&&e(m,j,k)}i.INTERNAL={NAME_PATTERN:d,MOD_DELIM:g,ELEM_DELIM:c,buildModPostfix:function(m,j,k){var l=k||[];e(m,j,l);return k?l:l.join("")},buildClass:function(p,n,o,j,k){var m=typeof o;if(m=="string"){if(typeof j!="string"){k=j;j=o;o=n;n=a}}else{if(m!="undefined"){k=o;o=a}else{if(n&&typeof n!="string"){k=n;n=a}}}if(!(n||o||k)){return p}var l=k||[];n?h(p,n,o,j,l):f(p,o,j,l);return k?l:l.join("")},buildClasses:function(n,m,l,j){var k=j||[];m?h(n,m,a,a,k):f(n,a,a,k);l&&b.each(l,function(p,o){if(o){k.push(" ");m?h(n,m,p,o,k):f(n,p,o,k)}});return j?k:k.join("")}}})(BEM,jQuery);(function(a){var b=a.event.special.leftclick={setup:function(){a(this).bind("click",b.handler)},teardown:function(){a(this).unbind("click",b.handler)},handler:function(c){if(!c.button){c.type="leftclick";a.event.handle.apply(this,arguments);c.type="click"}}}})(jQuery);(function(a,d){if(typeof JSON!="undefined"){return a.stringify=JSON.stringify}var c=Object.prototype.toString,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,b={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};a.stringify=function(l){if(l===null){return"null"}if(typeof l==="undefined"){return d}switch(c.call(l)){case"[object String]":return'"'+(e.test(l)?l.replace(e,function(i){var m=b[i];return typeof m==="string"?m:"\\u"+("0000"+i.charCodeAt(0).toString(16)).slice(-4)}):l)+'"';case"[object Number]":case"[object Boolean]":return""+l;case"[object Array]":var k="[",j=0,f=l.length,h;while(j<f){h=a.stringify(l[j]);k+=(j++?",":"")+(typeof h=="undefined"?"null":h)}return k+"]";case"[object Object]":var k="{",j=0,h;for(var g in l){if(l.hasOwnProperty(g)){h=a.stringify(l[g]);typeof h!="undefined"&&(k+=(j++?",":"")+'"'+g+'":'+h)}}return k+"}";default:return d}}})(jQuery);(function(k,d,c){var g=k.INTERNAL,f=g.ELEM_DELIM,h={area:1,base:1,br:1,col:1,command:1,embed:1,hr:1,img:1,input:1,keygen:1,link:1,meta:1,param:1,source:1,wbr:1},i=g.buildClasses,j={};function e(l,m,n){(l[m]||(l[m]=[])).unshift(n)}function b(l,m){return m.modName?function(n){(n._currBlock.mods||{})[m.modName]===m.modVal&&l(n)}:l}function a(m,l){var o=d.isArray(l),n;d.isArray(m)?o?n=m.concat(l):(n=m).push(l):o?(n=l).unshift(m):n=[m,l];return n}k.HTML={decl:function(n,m){typeof n=="string"&&(n={name:n});var l=j[n.name]||(j[n.name]={});m.onBlock&&e(l,"_block",b(m.onBlock,n));if(m.onElem){d.isFunction(m.onElem)?e(l,"_elem",b(m.onElem,n)):d.each(m.onElem,function(p,o){e(l,"_elem"+(p==="*"?"":f+p),b(o,n))})}},build:function(m){var l=new this.Ctx(m);l._buildAll();return l._flush()},Ctx:d.inherit({__constructor:function(l){this._buffer=[];this._params=l;this._tParams=null;this._tParamsChanges=null;this._currBlock=c},pos:function(){return this._params._pos},isFirst:function(){return this._params._pos===1},isLast:function(){var l=this._params;return l._pos===l._siblingsCount},params:function(l){var m=this;if(typeof l=="undefined"){return m._params}m._params=l;return m},param:function(l,o,m,q){var p=this,n=p._params;if(typeof o=="undefined"){return n[l]}if(m||!(l in n)){n[l]=o}else{if(q){n[l]=d.extend(o,n[l])}}return p},attrs:function(m,l){return this.param("attrs",m,l,true)},attr:function(m,o,n){var p=this;if(typeof o=="undefined"){return(p._params.attrs||{})[m]}var l=p._params.attrs;l?(n||!(m in l))&&(l[m]=o):(p._params.attrs={})[m]=o;return p},tag:function(m,l){return this.param("tag",m,l)},cls:function(m,l){return this.param("cls",m,l)},mods:function(m,l){return this.param("mods",m,l,true)},mod:function(l,o,n){var p=this;if(typeof o=="undefined"){return(p._params.mods||{})[l]}var m=p._params.mods;m?(n||!(l in m))&&(m[l]=o):(p._params.mods={})[l]=o;return p},mix:function(n,l){var o=this,m=o._params;if(typeof n=="undefined"){return m.mix}if(l||!("mix" in m)){m.mix=n}else{m.mix=m.mix.concat(n)}return o},js:function(l){return this.param("js",l)},content:function(m,l){return this.param("content",m,l)},wrapContent:function(l){var n=this,m=n._params;l.content=m.content;m.content=l;return n},beforeContent:function(l){var n=this,m=n._params;m.content=a(l,m.content);return n},afterContent:function(l){var n=this,m=n._params;m.content=a(m.content,l);return n},wrap:function(l){var n=this,m=n._params;l.block||(l._currBlock=n._currBlock);l.content=m._wrapper?m._wrapper:m;m._wrapper=l;return n},tParam:function(l,o){var p=this,n=p._tParams||(p._tParams={});if(typeof o=="undefined"){return n[l]}var m=p._tParamsChanges||(p._tParamsChanges={});l in m||(m[l]=n[l]);n[l]=o;return p},generateId:function(){return d.identify()},_buildAll:function(){var s=this,m=s._buffer,r=s._params,p=typeof r;if(p=="string"||p=="number"){m.push(r)}else{if(d.isArray(r)){var o=0,l=r.length,n,q;while(o<l){s._params=n=r[o++];q=typeof n;if(q=="string"||q=="number"){m.push(n)}else{if(n){n._pos=o;n._siblingsCount=l;s._buildByDecl()}}}}else{if(r){s._params._pos=s._params._siblingsCount=1;s._buildByDecl()}}}},_build:function(){var q=this,m=q._buffer,p=q._params,l=p.tag||"div",o,n=p.block||p.elem;p.js&&((o={})[p.block]=p.js===true?{}:p.js);m.push("<",l);if(n||p.cls){m.push(' class="');if(n){i(p.block||q._currBlock.block,p.elem,p.mods,m);p.mix&&d.each(p.mix,function(r,s){if(s){m.push(" ");i(s.block,s.elem,s.mods,m);s.js&&((o||(o={}))[s.block]=s.js===true?{}:s.js)}})}p.cls&&m.push(n?" ":"",p.cls);o&&m.push(" i-bem");m.push('"')}o&&m.push(' onclick="return ',d.stringify(o).replace(/'/g,"\\'").replace(/"/g,"'"),'"');p.attrs&&d.each(p.attrs,function(r,s){typeof s!="undefined"&&s!==null&&s!==false&&m.push(" ",r,'="',s.toString().replace(/"/g,"&quot;"),'"')});if(h[l]){m.push("/>")}else{m.push(">");if(typeof p.content!="undefined"){q._params=p.content;q._buildAll()}m.push("</",l,">")}},_flush:function(){var l=this._buffer.join("");delete this._buffer;return l},_buildByDecl:function(){var o=this,r=o._currBlock,l=o._params;l._currBlock&&(o._currBlock=l._currBlock);l.block&&(o._currBlock=l);if(!l._wrapper){if(l.block||l.elem){var q=j[o._currBlock.block];if(q){var s;if(l.elem){s=q["_elem"+f+l.elem];q._elem&&(s=(s?s.concat(q._elem):q._elem))}else{s=q._block}if(s){var m=0,p;while(p=s[m++]){p(o)}}}}if(l._wrapper){l._currBlock=o._currBlock;o._params=l._wrapper;return o._buildAll()}}var t=o._tParamsChanges;o._tParamsChanges=null;o._build();o._currBlock=r;if(t){var n=o._tParams;d.each(t,function(u,v){typeof v=="undefined"?delete n[u]:n[u]=v})}}})}})(BEM,jQuery);(function(i,e,h){var d=e(window),x=e(document),m={},v={},z={},f={},p={},u=i.blocks,b=i.INTERNAL,k=b.NAME_PATTERN,o=b.MOD_DELIM,j=b.ELEM_DELIM,y=b.buildModPostfix,s=b.buildClass;function q(C,A){var B=C[0];e.each(r(B),function(D,F){c(F,B,D,A);var E=v[F.uniqId];if(E){E.domElem=E.domElem.add(C);e.extend(E.params,F)}else{a(D,C,F)}})}function a(H,D,C,A,I){if(typeof C=="boolean"){I=A;A=C;C=h}var E=D[0];C=c(C||r(E)[H],E,H);var G=C.uniqId;if(v[G]){return v[G]._init()}m[G]=m[G]?m[G].add(D):D;var F=u[H]||t.decl(H,{},{live:true});if(!(F._liveInitable=!!F._processLive())||A||C.live===false){var B=new F(m[G],C,!!A);delete m[G];I&&I.apply(B,Array.prototype.slice.call(arguments,4));return B}}function c(F,C,B,A){(F||(F={})).uniqId||(F.uniqId=(F.id?B+"-id-"+F.id:e.identify())+(A||e.identify()));var E=e.identify(C),D=z[E]||(z[E]={});D[B]||(D[B]=F);return F}function w(B,A,D){var C=B.find(A);return D?C:C.add(B.filter(A))}function r(A){var B=e.identify(A);return z[B]||(z[B]=g(A))}function g(C){var B=C.onclick||C.ondblclick;if(!B&&C.tagName.toLowerCase()=="body"){var D=e(C),A=D.attr("onclick")||D.attr("ondblclick");A&&(B=Function(A))}return B?B():{}}function l(A){delete z[e.identify(A)]}function n(){return x[0][e.support.boxModel?"documentElement":"body"]}e.fn.bem=function(A,B){return a(A,this,B,true)};var t=i.DOM=i.decl("i-bem__dom",{__constructor:function(B,C,A){var D=this;D.domElem=B;D._eventNameCache={};D._elemCache={};v[D._uniqId=C.uniqId||e.identify(D)]=D;D._needSpecialUnbind=false;D.__base(null,C,A)},findBlocksInside:function(A,B){return this._doBlocksMethod(this._buildFindBlocksParams("find",A,B))},findBlockInside:function(A,B){return this._doBlocksMethod(this._buildFindBlocksParams("find",A,B,true))},findBlocksOutside:function(A,B){return this._doBlocksMethod(this._buildFindBlocksParams("parents",A,B))},findBlockOutside:function(A,B){return this._doBlocksMethod(this._buildFindBlocksParams("closest",A,B))[0]},findBlocksOn:function(A,B){return this._doBlocksMethod(this._buildFindBlocksParams("",A,B))},findBlockOn:function(A,B){return this._doBlocksMethod(this._buildFindBlocksParams("",A,B,true))},_buildFindBlocksParams:function(A,B,D,C){return{select:A,elem:D?B:h,block:D||B,onlyFirst:C}},doBlocksMethodInside:function(B,C,D,A){return this._doBlocksMethod(this._buildDoBlocksMethodParams("find",B,C,D,A))},doBlocksMethodOutside:function(B,C,D,A){return this._doBlocksMethod(this._buildDoBlocksMethodParams("closest",B,C,D,A))},doBlocksMethodOn:function(B,C,D,A){return this._doBlocksMethod(this._buildDoBlocksMethodParams("",B,C,D,A))},doBlocksMethod:function(B,C,A){return this._doBlocksMethod({blocks:B,method:C,args:A})},_buildDoBlocksMethodParams:function(A,D,E,F,C){var B=typeof F=="string";return{select:A,elem:B?D:h,block:B?E:D,method:B?F:E,args:B?C:F}},_doBlocksMethod:function(B){var E=this;if(B.blocks){return e.map(B.blocks,function(J){return E._doBlockMethod(J,B.method,B.args)})}var D=B.elem?(typeof B.elem=="string"?this.findElem(B.elem):B.elem):this.domElem,C=typeof B.block=="string",I=C?B.block:B.block.blockName,A="."+(C?s(I):s(I,B.block.modName,B.block.modVal))+(B.onlyFirst?":first":""),F=D.filter(A);B.select&&(F=F.add(D[B.select](A)));if(B.onlyFirst){return F[0]?this._doBlockMethod(a(I,F.eq(0),true),B.method,B.args):null}if(B.method){return e.map(F,function(J){return E._doBlockMethod(a(I,e(J),true),B.method,B.args)})}var H=[],G={};e.each(F,function(J,K){var L=a(I,e(K),true);if(!G[L._uniqId]){G[L._uniqId]=true;H.push(L)}});return H},_doBlockMethod:function(B,C,A){return C?B[C].apply(B,A||[]):B},bindToDomElem:function(B,C,A){var D=this;A?B.bind(D._buildEventName(C),function(E){(E.data||(E.data={})).domElem=e(this);return A.apply(D,arguments)}):e.each(C,function(F,E){D.bindToDomElem(B,F,E)});return D},bindToDoc:function(B,A){this._needSpecialUnbind=true;return this.bindToDomElem(x,B,A)},bindToWin:function(B,A){this._needSpecialUnbind=true;return this.bindToDomElem(d,B,A)},bindTo:function(C,B,A){if(!B||e.isFunction(B)){A=B;B=C;C=this.domElem}else{if(typeof C=="string"){C=this.elem(C)}}return this.bindToDomElem(C,B,A)},unbindFromDomElem:function(A,B){A.unbind(this._buildEventName(B));return this},unbindFromDoc:function(A){return this.unbindFromDomElem(x,A)},unbindFromWin:function(A){return this.unbindFromDomElem(d,A)},unbindFrom:function(B,A){if(!A){A=B;B=this.domElem}else{if(typeof B=="string"){B=this.elem(B)}}return this.unbindFromDomElem(B,A)},_buildEventName:function(A){var B=this;return A.indexOf(" ")>1?e.map(A.split(" "),function(C){return B._buildOneEventName(C)}).join(" "):B._buildOneEventName(A)},_buildOneEventName:function(C){var E=this,A=E._eventNameCache;if(C in A){return A[C]}var D="."+E._uniqId;if(C.indexOf(".")<0){return A[C]=C+D}var B=".bem_"+E.__self._name;return A[C]=e.map(C.split("."),function(G,F){return F==0?G+B:B+"_"+G}).join("")+D},trigger:function(B,A){this.__base(B=this.buildEvent(B),A).domElem&&this._ctxTrigger(B,A);return this},_ctxTrigger:function(B,A){var E=this,D=f[E.__self._buildCtxEventName(B.type)],C={};D&&E.domElem.each(function(){var G=this,F=D.counter;while(G&&F){var I=e.identify(G,true);if(I){if(C[I]){break}var H=D.ctxs[I];if(H){e.each(H,function(K,J){J.fn.call(J.ctx||E,B,A)});F--}C[I]=true}G=G.parentNode}})},setMod:function(B,C,A){if(B&&typeof A!="undefined"&&B.length>1){var D=this;B.each(function(){D.setMod(e(this),C,A)});return D}return this.__base(B,C,A)},_extractModVal:function(E,B,D){var A=(B||this.domElem)[0],C;A&&(C=A.className.match(this.__self._buildModValRE(E,D||B)));return C?C[2]:""},_extractMods:function(A,E){var D={},B=!A.length,C=0;e.each((E||this.domElem)[0].className.match(this.__self._buildModValRE("("+(B?k:A.join("|"))+")",E,"g"))||[],function(F,G){var I=(G=e.trim(G)).lastIndexOf(o),H=G.substr(0,I-1).lastIndexOf(o);D[G.substr(H+1,I-H-1)]=G.substr(I+1);++C});C<A.length&&e.each(A,function(F,G){G in D||(D[G]="")});return D},_afterSetMod:function(G,C,E,F){var B=this.__self,A=B._buildModClassPrefix(G,F),D=B._buildModValRE(G,F),H=C==="";(E||this.domElem).each(function(){var I=this.className;I.indexOf(A)>-1?this.className=I.replace(D,(H?"":"$1"+A+C)+"$3"):H||e(this).addClass(A+C)});F&&this.dropElemCache(F,G,C)},findElem:function(D,F,E,C){if(arguments.length%2){C=E;E=F;F=D;D=this.domElem}else{if(typeof D=="string"){D=this.findElem(D)}}var B=this.__self,A="."+e.map(F.split(" "),function(G){return s(B._name,G,E,C)}).join(",.");return w(D,A)},_elem:function(B,D,A){var C=B+y(D,A);return this._elemCache[C]||(this._elemCache[C]=this.findElem(B,D,A))},elem:function(D,C,A){if(D.indexOf(" ")<0){return this._elem(D,C,A)}var B=e([]),E=this;e.each(D.split(" "),function(){B=B.add(E._elem(this,C,A))});return B},dropElemCache:function(D,C,A){if(D){var E=this,B=y(C,A);D.indexOf(" ")<0?delete E._elemCache[D+B]:e.each(D.split(" "),function(G,F){delete E._elemCache[F+B]})}else{this._elemCache={}}return this},elemParams:function(A){var B;if(typeof A=="string"){B=A;A=this.elem(A)}else{B=this.__self._extractElemNameFrom(A)}return g(A[0])[s(this.__self.getName(),B)]||{}},containsDomElem:function(A){return A.parents().andSelf().index(this.domElem)>-1},buildSelector:function(B,C,A){return this.__self.buildSelector(B,C,A)},destruct:function(B){var C=this,A=C.__self;C._isDestructing=true;C._needSpecialUnbind&&A.doc.add(A.win).unbind("."+C._uniqId);C.dropElemCache().domElem.each(function(D,E){e.each(r(E),function(F,G){var H=v[G.uniqId];H&&!H._isDestructing&&H.destruct()});l(E)});B||C.domElem.remove();delete v[C.un()._uniqId];delete C.domElem;delete C._elemCache;C.__base()}},{doc:x,win:d,_processLive:function(B){var D=this,C=D._liveInitable;if("live" in D){var A=typeof C=="undefined";if(A^B){if(e.isFunction(D.live)){C=D.live()!==false;D.live=function(){}}else{C=D.live}}}return C},init:function(B,D,C){if(!B||e.isFunction(B)){C=D;D=B;B=x}var A=e.identify();w(B,".i-bem").each(function(){q(e(this),A)});D&&this.afterCurrentEvent(function(){D.call(C||this,B)})},destruct:function(B,A,C){if(typeof B!="boolean"){C=A;A=B;B=h}w(A,".i-bem",C).each(function(){e.each(r(this),function(D,E){if(E.uniqId){var F=v[E.uniqId];F&&F.destruct(true)}});l(this)});B||(C?A.empty():A.remove())},update:function(A,B,D,C){this.destruct(A,true);this.init(A.html(B),D,C)},_buildCtxEventName:function(A){return this._name+":"+A},_liveClassBind:function(C,D,H,A){var G=this;if(D.indexOf(" ")>-1){e.each(D.split(" "),function(I,J){G._liveClassBind(C,J,H,A)})}else{var B=G._buildCtxEventName(D),F=p[B],E=e.identify(H);if(!F){F=p[B]={};x.bind(D,G.changeThis(G._liveClassTrigger,G))}F=F[C]||(F[C]={uniqIds:{},fns:[]});if(!(E in F.uniqIds)){F.fns.push({uniqId:E,fn:G._buildLiveEventFn(H,A)});F.uniqIds[E]=F.fns.length-1}}return this},_liveClassUnbind:function(D,E,H){var C=this._buildCtxEventName(E),G=p[C];if(G){if(H){if(G=G[D]){var F=e.identify(H);if(F in G.uniqIds){var B=G.uniqIds[F],A=G.fns.length-1;G.fns.splice(B,1);while(B<A){G.uniqIds[G.fns[B++].uniqId]=B-1}delete G.uniqIds[F]}}}else{delete G[D]}}return this},_liveClassTrigger:function(G){var F=p[this._buildCtxEventName(G.type)];if(F){var C=G.target,A=[];for(var H in F){F.hasOwnProperty(H)&&A.push(H)}do{var B=" "+C.className+" ",E=0;while(H=A[E++]){if(B.indexOf(" "+H+" ")>-1){var D=0,J=F[H].fns,I;while(I=J[D++]){I.fn.call(e(C),G)}if(G.isPropagationStopped()){return}A.splice(--E,1)}}}while(A.length&&(C=C.parentNode))}},_buildLiveEventFn:function(C,A){var B=this;return function(E){var D=[B._name,((E.data||(E.data={})).domElem=e(this)).closest(B.buildSelector()),true],F=a.apply(null,A?D.concat([C,E]):D);F&&(A||C.apply(F,arguments))}},liveInitOnEvent:function(B,A,C){return this.liveBindTo(B,A,C,true)},liveBindTo:function(E,B,D,A){if(!D){D=B;B=E;E=h}if(!E||typeof E=="string"){E={elemName:E}}var C=this;if(E.elemName&&E.elemName.indexOf(" ")>1){e.each(E.elemName.split(" "),function(F,G){C._liveClassBind(s(C._name,G,E.modName,E.modVal),B,D,A)});return C}return C._liveClassBind(s(C._name,E.elemName,E.modName,E.modVal),B,D,A)},liveUnbindFrom:function(B,A,D){var C=this;if(B.indexOf(" ")>1){e.each(B.split(" "),function(E,F){C._liveClassUnbind(s(C._name,F),A,D)});return C}return C._liveClassUnbind(s(C._name,B),A,D)},_liveInitOnBlockInit:function(B,D,C){var A=this._name;u[B].on("init",function(E){var F=E.block[C](A);D&&e.each(F,function(){D.call(this)})});return this},liveInitOnBlockInit:function(A,B){return this._liveInitOnBlockInit(A,B,"findBlocksOn")},liveInitOnBlockInsideInit:function(A,B){return this._liveInitOnBlockInit(A,B,"findBlocksOutside")},on:function(A,E,D,C,B){return A.jquery?this._liveCtxBind(A,E,D,C,B):this.__base(A,E,D,C)},un:function(A,D,C,B){return A.jquery?this._liveCtxUnbind(A,D,C,B):this.__base(A,D,C)},liveCtxBind:function(A,E,D,C,B){return this._liveCtxBind(A,E,D,C,B)},_liveCtxBind:function(A,F,E,D,C){if(e.isFunction(E)){C=D;D=E;E=h}var H=this;if(F.indexOf(" ")>-1){e.each(F.split(" "),function(I,J){H._liveCtxBind(A,J,E,D,C)})}else{var B=H._buildCtxEventName(F),G=f[B]||(f[B]={counter:0,ctxs:{}});A.each(function(){var J=e.identify(this),I=G.ctxs[J];if(!I){I=G.ctxs[J]={};++G.counter}I[e.identify(D)+(C?e.identify(C):"")]={fn:D,data:E,ctx:C}})}return H},liveCtxUnbind:function(A,D,C,B){return this._liveCtxBind(A,D,C,B)},_liveCtxUnbind:function(A,D,C,B){var F=this,E=f[D=F.buildEventName(D)];if(E){A.each(function(){var H=e.identify(this,true),G;if(H&&(G=E.ctxs[H])){C&&delete G[e.identify(C)+(B?e.identify(B):"")];if(!C||e.isEmptyObject(G)){E.counter--;delete E.ctxs[H]}}});E.counter||delete f[D]}return F},_extractElemNameFrom:function(A){var B=A[0].className.match(this._buildElemNameRE());return B?B[1]:h},extractParams:g,_buildModClassPrefix:function(B,A){return s(this._name)+(A?j+(typeof A==="string"?A:this._extractElemNameFrom(A)):"")+o+B+o},_buildModValRE:function(B,A,C){return new RegExp("(\\s?)"+this._buildModClassPrefix(B,A)+"("+k+")(\\s|$)",C)},_buildElemNameRE:function(){return new RegExp(this._name+j+"("+k+")(?:\\s|$)")},buildSelector:function(B,C,A){return"."+s(this._name,B,C,A)},getBlockByUniqId:function(A){return v[A]},getWindowSize:function(){var A=d[0];if(typeof A.innerWidth!="undefined"){return{width:A.innerWidth,height:A.innerHeight}}var B=n();return{width:B.clientWidth,height:B.clientHeight}}})})(BEM,jQuery);$(function(){BEM.DOM.init()});(function(b,a){a.block["b-search__input"]=function(e){var f=b(this);var c=b.extend({focus:false,shortcut:false},e);if(c.focus||f.data("lego:focused")){if(!f.data("lego:focused")){var d=document.activeElement;(d&&"input textarea".indexOf(d.tagName.toLowerCase())>-1)||setTimeout(function(){f.focus();if(f[0].createTextRange){var h=f[0].createTextRange(),g=f.val().length;h.collapse();h.moveStart("character",g);h.moveEnd("character",g);h.select()}f.data("lego:focused",true)},0)}if(!!window.history.length&&!b.trim(f.val())){f.bind("keydown",function(g){if(g.keyCode==8){if(!b.trim(f.val())){return window.history.back()}}f.unbind("keydown",arguments.callee)})}f.blur(function(){f.data("lego:focused",false)}).focus(function(){f.data("lego:focused",true)})}if(c.shortcut){b(document).keydown(function(g){if(!g.ctrlKey||b(g.target).is("input, textarea")){return}if(g.keyCode==38){f.focus().select()}})}}})(jQuery,window.Lego);(function(){var f,a=0,c=false,e=0,d=BEM.channel("sys"),b=50;BEM.decl("i-system",{},{start:function(){$(document).bind("mousemove keydown",function(){e=0;if(c){c=false;d.trigger("wakeup")}});this._tick()},_tick:function(){var g=this;d.trigger("tick",{counter:a++});if(!c&&(e+=b)>3000){c=true;d.trigger("idle")}f=setTimeout(function(){g._tick()},b)}}).start()})();(function(){var b,a;function c(){var d,e=0;while(d=b[e++]){d.val(d.elem("input").val())}}BEM.DOM.decl("b-form-input",{onSetMod:{js:function(){var f=this,d=f.elem("input"),e=f.__self.doc[0].activeElement;f._val=d.val();f._focused=e===d[0];if(!a){b=[];a=f.channel("sys").on({tick:c,idle:function(){a.un("tick",c)},wakeup:function(){a.on("tick",c)}})}f._focused&&f.setMod("focused","yes");if(f.params.autoFocus&&!f._focused&&!(e&&"input textarea".indexOf(e.tagName.toLowerCase())>-1)){f.setMod("focused","yes")._focused=true}f._instanceIndex=b.push(f.bindTo(d,{focus:f._onFocus,blur:f._onBlur}))-1;f.params.shortcut&&f.bindToDoc("keydown",function(g){if(g.ctrlKey&&g.keyCode==38&&!$(g.target).is("input, textarea")){f.setMod("focused","yes")}})},disabled:function(e,d){this.elem("input").attr("disabled",d=="yes")},focused:function(e,d){if(this.hasMod("disabled","yes")){return false}var f=d=="yes";f?this._focused||this._focus():this._focused&&this._blur();this.afterCurrentEvent(function(){this.trigger(f?"focus":"blur")})}},onElemSetMod:{message:{visibility:function(g,h,d){var i=this,f=i.getMod(g,"type");if(f){var e=true;d||i.elem("message","type",f).each(function(){this!=g[0]&&i.hasMod($(this),"visibility","visible")&&(e=false)});e&&i.toggleMod("message-"+f,"yes","",d==="visible")}f=="error"&&g.attr("aria-hidden",d!=="visible")}}},val:function(f,e){if(typeof f=="undefined"){return this._val}if(this._val!=f){var d=this.elem("input");d.val()!=f&&d.val(f);this._val=f;this.trigger("change",e)}return this},name:function(d){return this.elem("input").attr("name")},_onFocus:function(){this._focused=true;return this.setMod("focused","yes")},_onBlur:function(){this._focused=false;return this.delMod("focused")},_focus:function(){var e=this.elem("input")[0];if(e.createTextRange&&!e.selectionStart){var d=e.createTextRange();d.move("character",e.value.length);d.select()}else{e.focus()}},_blur:function(){this.elem("input").blur()},destruct:function(){this.__base.apply(this,arguments);this.params.shortcut&&this.unbindFromDoc("keydown");b.splice(this._instanceIndex,1);var e=this._instanceIndex,d;while(d=b[e++]){--d._instanceIndex}}});BEM.HTML.decl("b-form-input",{onBlock:function(d){var e=d.param("id")||d.generateId();d.tag("span").tParam("id",e).tParam("has-clear",d.mod("has-clear")==="yes").afterContent({elem:"box",tag:"span",content:{elem:"input",tag:d.mod("type")||"input",attrs:{value:d.param("value"),name:d.param("name"),id:e}}}).js(true)},onElem:{label:function(d){d.tag("label").attr("for",d.tParam("id"))},box:function(d){if(d.tParam("has-clear")){d.afterContent({elem:"clear",tag:"span"})}}}})})();(function(e,a){var d=!((e.browser.safari||e.browser.webkit)&&navigator.userAgent.toLowerCase().indexOf("mobile")>-1),c=a.block["b-suggest"]=function(G){var A=e(this),L=e('<div class="b-suggest-popup"><i class="b-suggest__opera-gap"></i><div class="b-suggest-list">'+(d?('<iframe class="b-suggest__iframe" frameborder="0" src="javascript:\'<body style=\\\'background:none;overflow:hidden\\\'>\'"></iframe>'):'<div class="b-suggest__iframe"/>')+'<ul class="b-suggest-items"></ul><div class="b-suggest-nah"></div></div></div>').hide(),I=L.find(".b-suggest-items"),E=A.closest("form").find('input[name="'+(G["for"]||"text")+'"]'),F=E.closest("form"),r=G.url||(G.host||"")+(G.path||""),s=G.openInNewWindow=typeof G.openInNewWindow=="undefined"?true:G.openInNewWindow,m=!!G.permanent,x=(function(){var M={};M["*"+r]=["",[]];return M})(),p=G.timeout||700,J={suggestType:G.suggestType||((G.id=="serp")?"serp_ru":G.id),usageType:"not_shown",region:"",nah:"nah_not_shown",buttonByMouse:"",position:"p0",session:(new Date().getTime()+Math.round(Math.random()*10000)),queryTimes:[],ratio:{userValue:0,finalValue:0,userActions:0},text:"",user_input:"",pos:"",_keydownTriggered:false},l="",w=G.getData?c.getDataFns[G.getData]:(function(){var O={"1.4.2":"-1-4-2","1.4.4":"-1-4-4","1.5.2":"-1-5-2","1.6.2":"-1-6-2"},T=(r.match(/^[^\/]*\/\/[^\/]+\//)||[location.protocol+"//"+location.host])[0]+"jquery"+(O[e.fn.jquery]||"")+".crossframeajax.html",N=e('<iframe style="display:none" src="'+T+'"></iframe>').appendTo("body")[0],P=document.domain,R=document.domain.match(/([^.]+\.)?[^.]+$/)[0],M=10,U;try{document.domain!=R&&(document.domain=R)}catch(S){}(function Q(){if(M){try{U=N.contentWindow.$.crossframeAjax;if(U){w=U}else{throw true}}catch(V){M--;setTimeout(Q,42)}}else{try{document.domain!=P&&(document.domain=P)}catch(V){}}})();return e.ajax})(),u=function(M){var N=M.length&&M[0].onclick?M[0].onclick():{};return N.value||M.text()},y=function(Q){var O=0;if(typeof(Q.selectionEnd)=="number"){O=Q.selectionEnd}else{var P=document.selection.createRange();if(P&&P.parentElement()==Q){var N=Q.value.length,M=Q.createTextRange();M.moveToBookmark(P.getBookmark());var R=Q.createTextRange();R.collapse(false);O=M.compareEndPoints("EndToEnd",R)>-1?N:-M.moveEnd("character",-N)}}return O},H=(function(){function P(S){return e.isArray(S)&&c.buildItemHtmlFns[S[0]]?c.buildItemHtmlFns[S[0]](S,{stats:J,params:G}):'<li><span class="b-suggest-elem b-suggest-elem-link"><span class="content">'+b(S)+"</span></span></li>"}function O(T){J.region=T[T.length-1].r;J.exprt=T[T.length-1].exprt;var S=T[1];if(!(k=S?S.length:0)){return t()}if(J.usageType!="edit"){J.usageType="not_used"}var U=T[2]||[];I.html(e.map(S,function(W,V){return P(!!U[V]?["href",W,U[V]]:W)}).join("")).find(".b-suggest-elem").filter(":not(.b-suggest__elem_selectable_no)").bind("mouseenter mouseleave",function(V){e(this)[V.type=="mouseenter"?"addClass":"removeClass"]("b-suggest-elem_state_hover")});C=S.length-I.find(".b-suggest__elem_selectable_no").length;L.find(".b-suggest-close").hide();if(L.find(".b-suggest-nah").find(".b-suggest-nah__link").length==0){switch(T[T.length-1].n){case 1:L.find(".b-suggest-list").addClass("b-suggest-list-nah_enabled").end().find(".b-suggest-nah").addClass("b-suggest-nah_enabled").html(c.buildHtmlMessageFns.nahLink("b-suggest.hah:on",a.message("b-suggest.hah:on","Мои запросы ((включены))"),a.message("b-suggest.hah:linkHref","http://tune.yandex.ru/suggest/"))).show();break;case 2:L.find(".b-suggest-list").addClass("b-suggest-list-nah_disabled").end().find(".b-suggest-nah").addClass("b-suggest-nah_disabled").html(c.buildHtmlMessageFns.nahLink("b-suggest.hah:off",a.message("b-suggest.hah:off","Мои запросы ((отключены))"),a.message("b-suggest.hah:linkHref","http://tune.yandex.ru/suggest/"))).show();break;default:L.find(".b-suggest-close").show().end().find(".b-suggest-nah").hide();break}L.find(".b-suggest-nah__link").bind("mousedown click",function(){window.location=this.href})}L.show();if(D===false&&J._keydownTriggered===true){J.usageType="edit";J._keydownTriggered=false}D=false}var Q=0,R=A.hasClass("b-suggest_reaction_changing"),N,M;return function(V){if(i){return}if(R){typeof M=="string"||(M=V);M==V||(N=true);if(!N){return}N=false;M=V}B(0,V);var U=x[V+"*"+r];if(U){O(U)}else{var Y=setTimeout(t,p);Q+=1;var T=new Date();var X=document.getElementsByName("lr"),S;try{S=window.location.toString().match(/lr=(.*?)(&|$)/)}catch(W){S=""}if(X.length>0){l=X[0].value}else{if(S&&S.length>0){l=S[1]}else{l=""}}w({url:r,data:e.extend({part:E.val(),lr:l},a.params.yandexuid?{yu:a.params.yandexuid}:null),dataType:"json",type:"GET",timeout:p,success:(function(aa,Z){return function(ab){if(!ab){return}x[V+"*"+Z]=ab;clearTimeout(Y);if(aa==Q){O(ab)}J.queryTimes.push(new Date()-T)}})(Q,r)})}}})(),v=function(M){n();window.setTimeout(function(){e('<form style="display:none" action="'+M+'" method="get"'+(s?' target="_blank"':"")+"/>").appendTo(e("body")).submit().remove()},500)},i=false,D=true,g=false,t=(function(){if(D){return}L.hide();B(0,E.val());D=true}),k=0,C=0,B=(function(){var M=0,N=E.val();return function(Q,T){if(T!=undefined){N=T}M=Q?M+Q:0;if(M<0){M=C}if(M>C){M=0}if(M>0){J.position="p"+M}var S=I.find(".b-suggest-elem").filter(":not(.b-suggest__elem_selectable_no)").removeClass("b-suggest-elem_selected").eq(M?M-1:1000).addClass("b-suggest-elem_selected"),U=u(S),R=S.is(".b-suggest-elem_nav")?f:(U||N),P=S.attr("href"),O=U&&P?P:"";E.val()!=R&&E.val(R);E.data("href",O)}})();var o=E.data("lego:focused");if(o){E.blur()}E.attr("autocomplete","off");if(o){E.focus()}if(G.text){E.val(G.text)}A.append(L);var q=false;e(document).bind("popupsClose.lego",t).keydown(function(M){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey){g=true}}).keyup(function(M){g=false}).mouseup(function(){q=false});F.find(":submit").click(function(){J.buttonByMouse="button_by_mouse"});I.mousedown(function(P){q=true;var O=e(P.target);if(O.is("li *")){j=O.closest(".b-suggest-elem");if(j.hasClass("b-suggest-elem_nav")){n()}else{if(!j.hasClass("b-suggest__elem_selectable_no")){B(0,u(j));E.data("href",j.attr("href"));var N=O.parents("ul"),M=P.target.className;if(M&&M.split(" ").length>0){N.find("."+M.split(" ")[0]).each(function(Q){if(this==P.target){J.position="p"+(Q+1);O.hasClass("b-suggest-elem_nah")&&(J.nah="nah_used")}})}J.usageType="mouse";if(!m){i=true}if(j.get(0).tagName.toLowerCase()!="a"){setTimeout(function(){F.submit()},0)}else{z()}}}}return false}).click(function(){if(m){t()}else{e.browser.msie?t():E.focus()}});var f="",j,h=false;F.submit(function(N){if(G.preventSubmit){t();i=true;z();setTimeout(function(){i=false},100);return false}if(h){return h=false}var M=E.data("href")||J.followAfterSubmit;if(m){E.blur()}if(!J.submitted){N.preventDefault();if(M){J.followAfterSubmit=M}J.user_input=f;J.text=E.val();J.ratio.userValue=f.length;J.ratio.finalValue=J.text.length;z();window.setTimeout(function(){F.submit()},500)}else{if(M&&!m){N.preventDefault();location.href=M}else{if(M&&m){N.preventDefault();v(M)}}}});function K(){B(0);t();q=false}E.blur(function(M){if(M.originalEvent&&!M.originalEvent.preventDefault){setTimeout(function(){if(!q&&E[0]!=document.activeElement){t()}},84)}else{if(!q){t()}}}).click(function(){if(!D&&!E.val()){f="";t()}J.pos=y(E[0])}).keydown(function(M){switch(M.keyCode){case 38:case 40:M.preventDefault();J._keydownTriggered=true;if(D){i=false;H(E.val())}else{J.usageType="keyboard";B(M.keyCode-39)}break;case 13:break;case 27:q=true;break}setTimeout(function(){f!=E.val()&&J.ratio.userActions++},1)}).keypress(function(N){switch(N.keyCode){case 13:q=true;var M=I.find(".b-suggest-elem_selected");if(M.hasClass("b-suggest-elem_nav")){h=true;v(M.attr("href"));m&&t()}else{M.hasClass("b-suggest-elem_nah")&&(J.nah="nah_used");m||(i=true);F.submit();t()}return false;case 27:return false}}).keyup(function(M){J.pos=y(E[0]);switch(M.keyCode){case 38:case 40:break;case 27:K();break;default:if(f!=E.val()){f=E.val();clearInterval(N);var N=setTimeout(function(){H(E.val())},1)}break}});setTimeout(function(){E.focus(function(M){if(e(M.target).data("b-suggest")!==false){q=false;H(E.val())}})},42);if(m){setInterval(function(){x={"":[]}},30*60*1000)}A.bind("updateParams.lego",function(N,O){if(!O){return}var M=(r.match(/^[^\/]*\/\/[^\/]+\//)||[""])[0]+(O.path||"");if(M){r=M}if("closed" in O){i=O.closed}});function z(){if(a.params["show-counters"]){var M=[[J.suggestType,J.usageType,J.position,J.nah,J.buttonByMouse].join("."),"session="+J.session,"region="+J.region,"times="+J.queryTimes.join("."),"pos="+J.pos,"text="+J.text,"user_input="+J.user_input,"ratio="+J.ratio.userValue+"."+J.ratio.finalValue+"."+J.ratio.userActions];J.exprt&&M.push("exprt="+J.exprt);a.cp(0,2873,M.join("/"))}m||(J.submitted=true)}function n(){a.params["show-counters"]&&a.cp(0,70833,J.suggestType+"/session="+J.session)}};function b(f){return f[0]=="hl"?e.map(f.slice(1),function(g){return e.isArray(g)?'<span class="b-suggest__highlight">'+g[0]+"</span>":g}).join(""):f}c.getDataFns={};c.buildItemHtmlFns={href:function(g,f){if(g[3]&&g[3].nah&&g[3].nah==1){f.stats.nah=="nah_not_shown"&&(f.stats.nah="nah_not_used");return'<li><span class="b-suggest-elem b-suggest-elem_nah">'+b(g[1])+"</span></li>"}return'<li><a class="b-suggest-elem b-suggest-elem-link" href="'+g[2]+'"><span class="content">'+b(g[1])+"</span></a></li>"},nav:function(g,f){return'<li><a class="b-suggest-elem b-suggest-elem-link b-suggest-elem_nav"'+(f.params.openInNewWindow?' target="_blank"':"")+' href="http://'+g[2]+'"><span class="content"><span class="link">'+g[2]+'</span><span class="info">&nbsp;&mdash; '+g[1]+"</span></span></a></li>"},html:function(g,f){return'<li><span class="b-suggest-elem b-suggest-elem-link">'+g[1]+"</span></li>"}};c.buildHtmlMessageFns={nahLink:(function(){var g=/\(\(([^\)]+)\)\)/g,f={};return function(h,j,i){if(!f[h]){f[h]=j.replace(g,'<a class="b-suggest-nah__link" href="'+i+'">$1</a>')}return f[h]}})()}})(jQuery,window.Lego);BEM.DOM.decl("b-form-button",{onSetMod:{js:function(){(this._href=this.domElem.attr("href"))&&this.isDisabled()&&this.domElem.removeAttr("href")},focused:{yes:function(){if(this.isDisabled()){return false}this.bindTo("keydown",this._onKeyDown).elem("input").focus()},"":function(){this.unbindFrom("keydown").elem("input").blur()}},disabled:function(c,a){var b=a=="yes";this.elem("input").attr("disabled",b);this._href&&(b?this.domElem.removeAttr("href"):this.domElem.attr("href",this._href));b&&this.domElem.keyup()},pressed:function(b,a){this.isDisabled()||this.trigger(a=="yes"?"press":"release")},hovered:{"":function(){this.delMod("pressed")}},"*":function(a){if(this.isDisabled()&&"hovered pressed".indexOf(a)>-1){return false}}},isDisabled:function(){return this.hasMod("disabled","yes")},url:function(a){if(typeof a=="undefined"){return this._href}else{this._href=a;this.isDisabled()||this.domElem.attr("href",a);return this}},_onKeyDown:function(b){var a=b.keyCode;if((a==13||a==32)&&!this._keyDowned){this._keyDowned=true;this.setMod("pressed","yes").bindTo("keyup",function(){this.delMod("pressed").unbindFrom("keyup");delete this._keyDowned;if(a==32&&this.domElem.attr("href")){document.location=this.domElem.attr("href")}})}},_onClick:function(a){this.isDisabled()?a.preventDefault():this.afterCurrentEvent(function(){this.trigger("click")})}},{live:function(){var a={mouseover:{name:"hovered",val:"yes"},mouseout:{name:"hovered"},mousedown:{name:"pressed",val:"yes"},mouseup:{name:"pressed"},focusin:{name:"focused",val:"yes"},focusout:{name:"focused"}};this.liveBindTo("leftclick",function(b){this._onClick(b)}).liveBindTo("mouseover mouseout mouseup focusin focusout",function(c){var b=a[c.type];this.setMod(b.name,b.val||"")}).liveBindTo("mousedown",function(c){var b=a[c.type];c.which==1&&this.setMod(b.name,b.val||"")})}});BEM.HTML.decl("b-form-button",{onBlock:function(a){a.tag(a.param("url")?"a":"span").attrs({href:a.param("url"),target:a.param("target")}).mods({theme:a.mod("theme")||"grey-19",height:a.mod("height")||19}).content([{elem:"left",tag:"i"},{elem:"content",tag:"span",content:{elem:"text",content:a.content(),tag:"span"}},((a.param("type")=="button"||a.param("type")=="submit")&&{elem:"input",tag:"input",attrs:{type:a.param("type"),disabled:a.param("disabled"),value:""}}),a.param("url")&&{elem:"click",tag:"i"}],true).js(true)}});(function(c,b){var a=b.block["i-metrika"]=function(d){d.counter&&a.newCounter(d.counter)};a.counters=[];a.newCounter=function(d){a.counters.push(d)};a.callback=function(d){return function(){a.newCounter=function(g){var f=window["yaCounter"+g]=new Ya.Metrika({id:g,ut:"noindex"});f.clickmap();f.trackLinks({external:true})};var e;while(e=a.counters.shift()){a.newCounter(e)}d&&d()}};!(window.Ya&&Ya.Metrika)&&c(function(){var f=document,e=f.createElement("script");e.type="text/javascript";e.src="//mc.yandex.ru/metrika/watch.js";e.setAttribute("async","true");window.yandex_metrika_callback=a.callback(window.yandex_metrika_callback);f.documentElement.firstChild.appendChild(e)})})(jQuery,window.Lego);(function(a){a.ch=function(c,b){if(a.params["show-counters"]){a.cp(132,70422,c,b)}}})(window.Lego);
