text: (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 l=arguments,n=e.isFunction(l[0]),h=n?l[0]:f,m=l[n?1:0]||{},j=l[n?2:1],o=m.__constructor||(n&&h.prototype.__constructor)?function(){return this.__constructor.apply(this,arguments)}:function(){};if(!n){o.prototype=m;o.prototype.__self=o.prototype.constructor=o;return e.extend(o,j)}e.extend(o,h);var i=function(){},k=i.prototype=h.prototype,g=o.prototype=new i();g.__self=g.constructor=o;d(k,g,m);j&&d(h,o,j);return o};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(a){a.extend({debounce:function(c,d,e,b){if(arguments.length==3&&typeof e!="boolean"){b=e;e=false}var f;return function(){var g=arguments;b=b||this;e&&!f&&c.apply(b,g);clearTimeout(f);f=setTimeout(function(){e||c.apply(b,g);f=null},d)}},throttle:function(e,f,b){var g,d,c;return function(){d=arguments;c=true;b=b||this;g||(function(){if(c){e.apply(b,d);c=false;g=setTimeout(arguments.callee,f)}else{g=null}})()}}})})(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);j.target||(j.target=l);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(f,h){var e=[],g={},a={};function d(k,j,i){return(k?"__elem_"+k:"")+"__mod"+(j?"_"+j:"")+(i?"_"+i:"")}function c(j,i,k){f.isFunction(j)?(i[d(k,"*","*")]=j):f.each(j,function(m,l){f.isFunction(l)?(i[d(k,m,"*")]=l):f.each(l,function(n,o){i[d(k,m,n)]=o})})}function b(j,i){return i?Array.isArray(i)?function(m){var l=0,k=i.length;while(l<k){if(m.hasMod(j,i[l++])){return true}}return false}:function(k){return k.hasMod(j,i)}:function(k){return k.hasMod(j)}}this.BEM=f.inherit(f.observable,{__constructor:function(j,k,i){var l=this;l._modCache=j||{};l._processingMods={};l._params=k;l.params=null;i!==false?l._init():l.afterCurrentEvent(function(){l._init()})},_init:function(){if(!this._initing&&!this.hasMod("js","inited")){this._initing=true;if(!this.params){this.params=f.extend(this.getDefaultParams(),this._params);delete this._params}this.setMod("js","inited");delete this._initing;this.hasMod("js","inited")&&this.trigger("init")}return this},changeThis:function(j,i){return j.bind(i||this)},afterCurrentEvent:function(j,i){this.__self.afterCurrentEvent(this.changeThis(j,i))},trigger:function(j,i){this.__base(j=this.buildEvent(j),i).__self.trigger(j,i);return this},buildEvent:function(i){typeof i=="string"&&(i=f.Event(i));i.block=this;return i},hasMod:function(l,m,j){var i=arguments.length,n=false;if(i==1){j="";m=l;l=h;n=true}else{if(i==2){if(typeof l=="string"){j=m;m=l;l=h}else{j="";n=true}}}var k=this.getMod(l,m)===j;return n?!k:k},getMod:function(k,l){var i=typeof k;if(i==="string"||i==="undefined"){l=k||l;var j=this._modCache;return l in j?j[l]:j[l]=this._extractModVal(l)}return this._getElemMod(l,k)},_getElemMod:function(k,i,j){return this._extractModVal(k,i,j)},getMods:function(l){var j=l&&typeof l!="string",m=this,i=[].slice.call(arguments,j?1:0),k=m._extractMods(i,j?l:h);if(!j){i.length?i.forEach(function(n){m._modCache[n]=k[n]}):m._modCache=k}return k},setMod:function(k,p,q){if(typeof q=="undefined"){q=p;p=k;k=h}var l=this;if(!k||k[0]){var m=(k&&k[0]?f.identify(k[0]):"")+"_"+p;if(this._processingMods[m]){return l}var j,n=k?l._getElemMod(p,k,j=l.__self._extractElemNameFrom(k)):l.getMod(p);if(n===q){return l}this._processingMods[m]=true;var i=true,o=[p,q,n];k&&o.unshift(k);[["*","*"],[p,"*"],[p,q]].forEach(function(r){i=l._callModFn(j,r[0],r[1],o)!==false&&i});!k&&i&&(l._modCache[p]=q);i&&l._afterSetMod(p,q,n,k,j);delete this._processingMods[m]}return l},_afterSetMod:function(l,i,m,j,k){},toggleMod:function(k,l,j,n,m){if(typeof k=="string"){m=n;n=j;j=l;l=k;k=h}if(typeof n=="undefined"){n=""}else{if(typeof n=="boolean"){m=n;n=""}}var i=this.getMod(k,l);(i==j||i==n)&&this.setMod(k,l,typeof m==="boolean"?(m?j:n):this.hasMod(k,l,j)?n:j);return this},delMod:function(i,j){if(!j){j=i;i=h}return this.setMod(i,j,"")},_callModFn:function(l,k,i,j){var m=d(l,k,i);return this[m]?this[m].apply(this,j):h},_extractModVal:function(j,i){return""},_extractMods:function(i,j){return{}},channel:function(j,i){return this.__self.channel(j,i)},getDefaultParams:function(){return{}},del:function(j){var i=[].slice.call(arguments);typeof j=="string"&&i.unshift(this);this.__self.del.apply(this.__self,i);return this},destruct:function(){}},{_name:"i-bem",blocks:g,decl:function(j,k,n){if(typeof j=="string"){j={block:j}}else{if(j.name){j.block=j.name}}if(j.baseBlock&&!g[j.baseBlock]){throw ('baseBlock "'+j.baseBlock+'" for "'+j.block+'" is undefined')}k||(k={});if(k.onSetMod){c(k.onSetMod,k);delete k.onSetMod}if(k.onElemSetMod){f.each(k.onElemSetMod,function(q,p){c(p,k,q)});delete k.onElemSetMod}var m=g[j.baseBlock||j.block]||this;if(j.modName){var i=b(j.modName,j.modVal);f.each(k,function(p,q){f.isFunction(q)&&(k[p]=function(){var s;if(i(this)){s=q}else{var r=m.prototype[p];r&&r!==k[p]&&(s=this.__base)}return s?s.apply(this,arguments):h})})}if(n&&typeof n.live==="boolean"){var l=n.live;n.live=function(){return l}}var o;j.block==m._name?(o=f.inheritSelf(m,k,n))._processLive(true):(o=g[j.block]=f.inherit(m,k,n))._name=j.block;return o},_processLive:function(i){return false},create:function(j,i){typeof j=="string"&&(j={block:j});return new g[j.block](j.mods,i)},getName:function(){return this._name},_extractElemNameFrom:function(i){},afterCurrentEvent:function(j,i){e.push({fn:j,ctx:i})==1&&setTimeout(this._runAfterCurrentEventFns,0)},_runAfterCurrentEventFns:function(){var j=e.length;if(j){var i,k=e.splice(0,j);while(i=k.shift()){i.fn.call(i.ctx||this)}}},changeThis:function(j,i){return j.bind(i||this)},del:function(m){var l=typeof m=="string",k=l?0:1,j=arguments.length;l&&(m=this);while(k<j){delete m[arguments[k++]]}return this},channel:function(j,i){if(typeof j=="boolean"){i=j;j=h}j||(j="default");if(i){if(a[j]){a[j].un();delete a[j]}return}return a[j]||(a[j]=new f.observable())}})})(jQuery);(function(){Object.keys||(Object.keys=function(c){var b=[];for(var a in c){c.hasOwnProperty(a)&&b.push(a)}return b})})();(function(){var a=Array.prototype,d=Object.prototype.toString,b={indexOf:function(h,g){g=+(g||0);var f=this,e=f.length;if(e>0&&g<e){g=g<0?Math.ceil(g):Math.floor(g);g<-e&&(g=0);g<0&&(g=g+e);while(g<e){if(g in f&&f[g]===h){return g}++g}}return -1},forEach:function(j,f){var h=-1,g=this,e=g.length;while(++h<e){h in g&&(f?j.call(f,g[h],h,g):j(g[h],h,g))}},map:function(k,f){var j=-1,h=this,e=h.length,g=new Array(e);while(++j<e){j in h&&(g[j]=f?k.call(f,h[j],j,h):k(h[j],j,h))}return g},filter:function(k,f){var j=-1,h=this,e=h.length,g=[];while(++j<e){j in h&&(f?k.call(f,h[j],j,h):k(h[j],j,h))&&g.push(h[j])}return g},reduce:function(k,j){var h=-1,g=this,e=g.length,f;if(arguments.length<2){while(++h<e){if(h in g){f=g[h];break}}}else{f=j}while(++h<e){h in g&&(f=k(f,g[h],h,g))}return f},some:function(j,f){var h=-1,g=this,e=g.length;while(++h<e){if(h in g&&(f?j.call(f,g[h],h,g):j(g[h],h,g))){return true}}return false},every:function(j,f){var h=-1,g=this,e=g.length;while(++h<e){if(h in g&&!(f?j.call(f,g[h],h,g):j(g[h],h,g))){return false}}return true}};for(var c in b){a[c]||(a[c]=b[c])}Array.isArray||(Array.isArray=function(e){return d.call(e)==="[object Array]"})})();(function(){var a=Array.prototype.slice;Function.prototype.bind||(Function.prototype.bind=function(b){var d=this,c=a.call(arguments,1);return function(){return d.apply(b,c.concat(a.call(arguments)))}})})();(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){if(m&&typeof m!="string"){j=l;l=m;m=a}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);jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};(function(a){var d={"%D0":"%D0%A0","%C0":"%D0%90","%C1":"%D0%91","%C2":"%D0%92","%C3":"%D0%93","%C4":"%D0%94","%C5":"%D0%95","%A8":"%D0%81","%C6":"%D0%96","%C7":"%D0%97","%C8":"%D0%98","%C9":"%D0%99","%CA":"%D0%9A","%CB":"%D0%9B","%CC":"%D0%9C","%CD":"%D0%9D","%CE":"%D0%9E","%CF":"%D0%9F","%D1":"%D0%A1","%D2":"%D0%A2","%D3":"%D0%A3","%D4":"%D0%A4","%D5":"%D0%A5","%D6":"%D0%A6","%D7":"%D0%A7","%D8":"%D0%A8","%D9":"%D0%A9","%DA":"%D0%AA","%DB":"%D0%AB","%DC":"%D0%AC","%DD":"%D0%AD","%DE":"%D0%AE","%DF":"%D0%AF","%E0":"%D0%B0","%E1":"%D0%B1","%E2":"%D0%B2","%E3":"%D0%B3","%E4":"%D0%B4","%E5":"%D0%B5","%B8":"%D1%91","%E6":"%D0%B6","%E7":"%D0%B7","%E8":"%D0%B8","%E9":"%D0%B9","%EA":"%D0%BA","%EB":"%D0%BB","%EC":"%D0%BC","%ED":"%D0%BD","%EE":"%D0%BE","%EF":"%D0%BF","%F0":"%D1%80","%F1":"%D1%81","%F2":"%D1%82","%F3":"%D1%83","%F4":"%D1%84","%F5":"%D1%85","%F6":"%D1%86","%F7":"%D1%87","%F8":"%D1%88","%F9":"%D1%89","%FA":"%D1%8A","%FB":"%D1%8B","%FC":"%D1%8C","%FD":"%D1%8D","%FE":"%D1%8E","%FF":"%D1%8F"};function c(e){e=e.replace(/%.{2}/g,function(f){return d[f]});return e}function b(g,i){var f="";try{f=g(i)}catch(h){f=g(c(i))}return f}a.extend({decodeURI:function(e){return b(decodeURI,e)},decodeURIComponent:function(e){return b(decodeURIComponent,e)}})})(jQuery);(function(o,g,e){var k=o.INTERNAL,j=k.ELEM_DELIM,l={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},f=k.buildClass,m=k.buildClasses,n={};function i(p,q,r){(p[q]||(p[q]=[])).unshift(r)}function d(p,q){return q.modName?function(r){(r._curBlock.mods||{})[q.modName]===q.modVal&&p(r)}:p}function c(q,p){var s=g.isArray(p),r;g.isArray(q)?s?r=q.concat(p):(r=q).push(p):s?(r=p).unshift(q):r=[q,p];return r}var b={'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"},a=/["&<>]/g;function h(p){return p.replace(a,function(q){return b[q]})}o.HTML={decl:function(r,q){typeof r=="string"&&(r={block:r});r.name&&(r.block=r.name);var p=n[r.block]||(n[r.block]={});q.onBlock&&i(p,"_block",d(q.onBlock,r));if(q.onElem){g.isFunction(q.onElem)?i(p,"_elem",d(q.onElem,r)):g.each(q.onElem,function(t,s){i(p,"_elem"+(t==="*"?"":j+t),d(s,r))})}},build:function(q){var p=new this.Ctx(q);p._buildAll();return p._flush()},Ctx:g.inherit({__constructor:function(p){this._buffer=[];this._params=p;this._tParams=null;this._tParamsChanges=null;this._curBlock=e},pos:function(){return this._params._pos},isFirst:function(){return this._params._pos===1},isLast:function(){var p=this._params;return p._pos===p._siblingsCount},params:function(p){var q=this;if(typeof p=="undefined"){return q._params}q._params=p;return q},param:function(p,s,q,u){var t=this,r=t._params;if(typeof s=="undefined"){return r[p]}if(q||!(p in r)){r[p]=s}else{if(u){r[p]=g.extend(s,r[p])}}return t},attrs:function(q,p){return this.param("attrs",q,p,true)},attr:function(q,s,r){var t=this;if(typeof s=="undefined"){return(t._params.attrs||{})[q]}var p=t._params.attrs;p?(r||!(q in p))&&(p[q]=s):(t._params.attrs={})[q]=s;return t},tag:function(q,p){return this.param("tag",q,p)},cls:function(q,p){return this.param("cls",q,p)},mods:function(q,p){return this.param("mods",q,p,true)},mod:function(p,s,r){var t=this;if(typeof s=="undefined"){return(t._params.mods||{})[p]}var q=t._params.mods;q?(r||!(p in q))&&(q[p]=s):(t._params.mods={})[p]=s;return t},mix:function(r,p){var s=this,q=s._params;if(typeof r=="undefined"){return q.mix}if(p||!("mix" in q)){q.mix=r}else{q.mix=q.mix.concat(r)}return s},js:function(p){return this.param("js",p)},content:function(q,p){return this.param("content",q,p)},wrapContent:function(p){var r=this,q=r._params;p.content=q.content;q.content=p;return r},beforeContent:function(p){var r=this,q=r._params;q.content=c(p,q.content);return r},afterContent:function(p){var r=this,q=r._params;q.content=c(q.content,p);return r},wrap:function(p){var r=this,q=r._params;p.block||(p._curBlock=r._curBlock);p.content=q._wrapper?q._wrapper:q;q._wrapper=p;return r},tParam:function(p,s){var t=this,r=t._tParams||(t._tParams={});if(typeof s=="undefined"){return r[p]}var q=t._tParamsChanges||(t._tParamsChanges={});p in q||(q[p]=r[p]);r[p]=s;return t},generateId:function(){return g.identify()},stop:function(){this._params._isStopped=true},_buildAll:function(){var w=this,q=w._buffer,v=w._params,t=typeof v;if(t=="string"||t=="number"){q.push(v)}else{if(g.isArray(v)){var s=0,p=v.length,r,u;while(s<p){w._params=r=v[s++];u=typeof r;if(u=="string"||u=="number"){q.push(r)}else{if(r){r._pos=s;r._siblingsCount=p;w._buildByDecl()}}}}else{if(v){w._params._pos=w._params._siblingsCount=1;w._buildByDecl()}}}},_build:function(){var w=this,r=w._buffer,u=w._params,p=u.tag||"div",t,s=u.block||u.elem,v=s&&(u.block||w._curBlock.block),q=false;if(u.js){(t={})[f(v,u.elem)]=u.js===true?{}:u.js;q=!u.elem}r.push("<",p);if(s||u.cls){r.push(' class="');if(s){m(v,u.elem,u.mods,r);u.mix&&g.each(u.mix,function(x,y){if(y){r.push(" ");m(y.block,y.elem,y.mods,r);if(y.js){(t||(t={}))[f(y.block,y.elem)]=y.js===true?{}:y.js;q||(q=!y.elem)}}})}u.cls&&r.push(s?" ":"",u.cls);q&&r.push(" i-bem");r.push('"')}t&&r.push(' onclick="return ',h(JSON.stringify(t)),'"');u.attrs&&g.each(u.attrs,function(x,y){typeof y!="undefined"&&y!==null&&y!==false&&r.push(" ",x,'="',y.toString().replace(/"/g,"&quot;"),'"')});if(l[p]){r.push("/>")}else{r.push(">");if(typeof u.content!="undefined"){w._params=u.content;w._buildAll()}r.push("</",p,">")}},_flush:function(){var p=this._buffer.join("");delete this._buffer;return p},_buildByDecl:function(){var s=this,v=s._curBlock,p=s._params;p._curBlock&&(s._curBlock=p._curBlock);p.block&&(s._curBlock=p);if(!p._wrapper){if(p.block||p.elem){var u=n[s._curBlock.block];if(u){var w;if(p.elem){w=u["_elem"+j+p.elem];u._elem&&(w=(w?w.concat(u._elem):u._elem))}else{w=u._block}if(w){var q=0,t;while(t=w[q++]){t(s);if(p._isStopped){break}}}}}if(p._wrapper){p._curBlock=s._curBlock;s._params=p._wrapper;return s._buildAll()}}var x=s._tParamsChanges;s._tParamsChanges=null;s._build();s._curBlock=v;if(x){var r=s._tParams;g.each(x,function(y,z){typeof z=="undefined"?delete r[y]:r[y]=z})}}})}})(BEM,jQuery);(function(c){if(window.JSON){return}var b=Object.prototype.toString,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d;window.JSON={stringify:d=function(l){if(l===null){return"null"}if(typeof l==="undefined"){return c}switch(b.call(l)){case"[object String]":e.lastIndex=0;return'"'+(e.test(l)?l.replace(e,function(i){var m=a[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=d(l[j]);k+=(j++?",":"")+(typeof h==="undefined"?"null":h)}return k+"]";case"[object Object]":if(b.call(l.toJSON)==="[object Function]"){return d(l.toJSON())}var k="{",j=0,h;for(var g in l){if(l.hasOwnProperty(g)){h=d(l[g]);typeof h!=="undefined"&&(k+=(j++?",":"")+'"'+g+'":'+h)}}return k+"}";default:return c}}}})();(function(i,e,h){var d=e(window),y=e(document),n={},w={},A={},f={},q={},v=i.blocks,b=i.INTERNAL,k=b.NAME_PATTERN,p=b.MOD_DELIM,j=b.ELEM_DELIM,z=b.buildModPostfix,t=b.buildClass;function r(D,B){var C=D[0];e.each(s(C),function(E,G){c(G,C,E,B);var F=w[G.uniqId];if(F){if(F.domElem.index(C)<0){F.domElem=F.domElem.add(D);e.extend(F._params,G)}}else{a(E,D,G)}})}function a(J,F,E,C,K){if(typeof E=="boolean"){K=C;C=E;E=h}var G=F[0];E=c(E||s(G)[J],G,J);var I=E.uniqId;if(w[I]){return w[I]._init()}n[I]=n[I]?n[I].add(F):F;var B=G.parentNode;if(!B||B.nodeType===11){e.unique(n[I])}var H=v[J]||u.decl(J,{},{live:true});if(!(H._liveInitable=!!H._processLive())||C||E.live===false){var D=new H(n[I],E,!!C);delete n[I];K&&K.apply(D,Array.prototype.slice.call(arguments,4));return D}}function c(G,D,C,B){(G||(G={})).uniqId||(G.uniqId=(G.id?C+"-id-"+G.id:e.identify())+(B||e.identify()));var F=e.identify(D),E=A[F]||(A[F]={});E[C]||(E[C]=G);return G}function x(C,B,E){var D=C.find(B);return E?D:D.add(C.filter(B))}function s(B){var C=e.identify(B);return A[C]||(A[C]=g(B))}function g(D){var C=D.onclick||D.ondblclick;if(!C&&D.tagName.toLowerCase()=="body"){var E=e(D),B=E.attr("onclick")||E.attr("ondblclick");B&&(C=Function(B))}return C?C():{}}function m(B){delete A[e.identify(B)]}function l(C,B){C.domElem.length===1?C.destruct(true):C.domElem=C.domElem.not(B)}function o(){return y[0][e.support.boxModel?"documentElement":"body"]}e.fn.bem=function(B,C){return a(B,this,C,true)};var u=i.DOM=i.decl("i-bem__dom",{__constructor:function(C,D,B){var E=this;E.domElem=C;E._eventNameCache={};E._elemCache={};w[E._uniqId=D.uniqId||e.identify(E)]=E;E._needSpecialUnbind=false;E.__base(null,D,B)},findBlocksInside:function(B,C){return this._findBlocks("find",B,C)},findBlockInside:function(B,C){return this._findBlocks("find",B,C,true)},findBlocksOutside:function(B,C){return this._findBlocks("parents",B,C)},findBlockOutside:function(B,C){return this._findBlocks("closest",B,C)[0]||null},findBlocksOn:function(B,C){return this._findBlocks("",B,C)},findBlockOn:function(B,C){return this._findBlocks("",B,C,true)},_findBlocks:function(L,B,D,E){if(!D){D=B;B=h}var G=B?(typeof B=="string"?this.findElem(B):B):this.domElem,F=typeof D=="string",K=F?D:(D.block||D.blockName),C="."+(F?t(K):t(K,D.modName,D.modVal))+(E?":first":""),H=G.filter(C);L&&(H=H.add(G[L](C)));if(E){return H[0]?a(K,H.eq(0),true):null}var J=[],I={};e.each(H,function(M,N){var O=a(K,e(N),true);if(!I[O._uniqId]){I[O._uniqId]=true;J.push(O)}});return J},bindToDomElem:function(C,D,B){var E=this;B?C.bind(E._buildEventName(D),function(F){(F.data||(F.data={})).domElem=e(this);return B.apply(E,arguments)}):e.each(D,function(G,F){E.bindToDomElem(C,G,F)});return E},bindToDoc:function(C,B){this._needSpecialUnbind=true;return this.bindToDomElem(y,C,B)},bindToWin:function(C,B){this._needSpecialUnbind=true;return this.bindToDomElem(d,C,B)},bindTo:function(D,C,B){if(!C||e.isFunction(C)){B=C;C=D;D=this.domElem}else{if(typeof D=="string"){D=this.elem(D)}}return this.bindToDomElem(D,C,B)},unbindFromDomElem:function(B,C){B.unbind(this._buildEventName(C));return this},unbindFromDoc:function(B){return this.unbindFromDomElem(y,B)},unbindFromWin:function(B){return this.unbindFromDomElem(d,B)},unbindFrom:function(C,B){if(!B){B=C;C=this.domElem}else{if(typeof C=="string"){C=this.elem(C)}}return this.unbindFromDomElem(C,B)},_buildEventName:function(B){var C=this;return B.indexOf(" ")>1?B.split(" ").map(function(D){return C._buildOneEventName(D)}).join(" "):C._buildOneEventName(B)},_buildOneEventName:function(D){var F=this,B=F._eventNameCache;if(D in B){return B[D]}var E="."+F._uniqId;if(D.indexOf(".")<0){return B[D]=D+E}var C=".bem_"+F.__self._name;return B[D]=D.split(".").map(function(H,G){return G==0?H+C:C+"_"+H}).join("")+E},trigger:function(C,B){this.__base(C=this.buildEvent(C),B).domElem&&this._ctxTrigger(C,B);return this},_ctxTrigger:function(C,B){var F=this,E=f[F.__self._buildCtxEventName(C.type)],D={};E&&F.domElem.each(function(){var H=this,G=E.counter;while(H&&G){var J=e.identify(H,true);if(J){if(D[J]){break}var I=E.ctxs[J];if(I){e.each(I,function(L,K){K.fn.call(K.ctx||F,C,B)});G--}D[J]=true}H=H.parentNode}})},setMod:function(C,D,B){if(C&&typeof B!="undefined"&&C.length>1){var E=this;C.each(function(){var F=e(this);F.__bemElemName=C.__bemElemName;E.setMod(F,D,B)});return E}return this.__base(C,D,B)},_extractModVal:function(F,C,E){var B=(C||this.domElem)[0],D;B&&(D=B.className.match(this.__self._buildModValRE(F,E||C)));return D?D[2]:""},_extractMods:function(B,F){var E={},C=!B.length,D=0;((F||this.domElem)[0].className.match(this.__self._buildModValRE("("+(C?k:B.join("|"))+")",F,"g"))||[]).forEach(function(G){var I=(G=G.trim()).lastIndexOf(p),H=G.substr(0,I-1).lastIndexOf(p);E[G.substr(H+1,I-H-1)]=G.substr(I+1);++D});D<B.length&&B.forEach(function(G){G in E||(E[G]="")});return E},_afterSetMod:function(G,J,I,C,B){var E=this.__self,F=E._buildModClassPrefix(G,B),H=E._buildModValRE(G,B),D=J==="";(C||this.domElem).each(function(){var K=this.className;K.indexOf(F)>-1?this.className=K.replace(H,(D?"":"$1"+F+J)+"$3"):D||e(this).addClass(F+J)});B&&this.dropElemCache(B,G,I).dropElemCache(B,G,J)},findElem:function(E,G,F,D){if(arguments.length%2){D=F;F=G;G=E;E=this.domElem}else{if(typeof E=="string"){E=this.findElem(E)}}var C=this.__self,B="."+G.split(" ").map(function(H){return t(C._name,H,F,D)}).join(",.");return x(E,B)},_elem:function(C,F,B){var E=C+z(F,B),D;if(!(D=this._elemCache[E])){D=this._elemCache[E]=this.findElem(C,F,B);D.__bemElemName=C}return D},elem:function(E,D,B){if(D&&typeof D!="string"){D.__bemElemName=E;return D}if(E.indexOf(" ")<0){return this._elem(E,D,B)}var C=e([]),F=this;E.split(" ").forEach(function(G){C=C.add(F._elem(G,D,B))});return C},dropElemCache:function(E,D,B){if(E){var F=this,C=z(D,B);E.indexOf(" ")<0?delete F._elemCache[E+C]:E.split(" ").forEach(function(G){delete F._elemCache[G+C]})}else{this._elemCache={}}return this},elemParams:function(B){var C;if(typeof B=="string"){C=B;B=this.elem(B)}else{C=this.__self._extractElemNameFrom(B)}return g(B[0])[t(this.__self.getName(),C)]||{}},containsDomElem:function(C){var B=false;this.domElem.each(function(){return !(B=C.parents().andSelf().index(this)>-1)});return B},buildSelector:function(C,D,B){return this.__self.buildSelector(C,D,B)},destruct:function(C){var D=this,B=D.__self;D._isDestructing=true;D._needSpecialUnbind&&B.doc.add(B.win).unbind("."+D._uniqId);D.dropElemCache().domElem.each(function(E,F){var G=s(F);e.each(G,function(H,I){var J=w[I.uniqId];if(J){if(!J._isDestructing){l(J,F);delete G[H]}}else{delete n[I.uniqId]}});e.isEmptyObject(G)&&m(F)});C||D.domElem.remove();delete w[D.un()._uniqId];delete D.domElem;delete D._elemCache;D.__base()}},{doc:y,win:d,_processLive:function(C){var E=this,D=E._liveInitable;if("live" in E){var B=typeof D=="undefined";if(B^C){D=E.live()!==false;E.live=function(){}}}return D},init:function(C,E,D){if(!C||e.isFunction(C)){D=E;E=C;C=this.doc}var B=e.identify();x(C,".i-bem").each(function(){r(e(this),B)});E&&this.afterCurrentEvent(function(){E.call(D||this,C)});this._runAfterCurrentEventFns();return C},destruct:function(C,B,D){if(typeof C!="boolean"){D=B;B=C;C=h}x(B,".i-bem",D).each(function(E,F){var G=s(this);e.each(G,function(H,I){if(I.uniqId){var J=w[I.uniqId];if(J){l(J,F);delete G[H]}else{delete n[I.uniqId]}}});e.isEmptyObject(G)&&m(this)});C||(D?B.empty():B.remove())},update:function(B,C,E,D){this.destruct(B,true);this.init(B.html(C),E,D)},append:function(B,C){this.init(e(C).appendTo(B))},prepend:function(B,C){this.init(e(C).prependTo(B))},before:function(B,C){this.init(e(C).insertBefore(B))},after:function(B,C){this.init(e(C).insertAfter(B))},_buildCtxEventName:function(B){return this._name+":"+B},_liveClassBind:function(C,D,H,B){var G=this;if(D.indexOf(" ")>-1){D.split(" ").forEach(function(I){G._liveClassBind(C,I,H,B)})}else{var F=q[D],E=e.identify(H);if(!F){F=q[D]={};G.doc.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,B)});F.uniqIds[E]=F.fns.length-1}}return this},_liveClassUnbind:function(D,E,H){var G=q[E];if(G){if(H){if(G=G[D]){var F=e.identify(H);if(F in G.uniqIds){var C=G.uniqIds[F],B=G.fns.length-1;G.fns.splice(C,1);while(C<B){G.uniqIds[G.fns[C++].uniqId]=C-1}delete G.uniqIds[F]}}}else{delete G[D]}}return this},_liveClassTrigger:function(H){var G=q[H.type];if(G){var D=H.target,B=[];for(var I in G){G.hasOwnProperty(I)&&B.push(I)}do{var C=" "+D.className+" ",F=0;while(I=B[F++]){if(C.indexOf(" "+I+" ")>-1){var E=0,K=G[I].fns,J,L=false;while(J=K[E++]){if(J.fn.call(e(D),H)===false){L=true}}L&&H.preventDefault();if(L||H.isPropagationStopped()){return}B.splice(--F,1)}}}while(B.length&&(D=D.parentNode))}},_buildLiveEventFn:function(D,B){var C=this;return function(F){var E=[C._name,((F.data||(F.data={})).domElem=e(this)).closest(C.buildSelector()),true],G=a.apply(null,B?E.concat([D,F]):E);if(G&&!B&&D){return D.apply(G,arguments)}}},liveInitOnEvent:function(C,B,D){return this.liveBindTo(C,B,D,true)},liveBindTo:function(F,C,E,B){if(!C||e.isFunction(C)){E=C;C=F;F=h}if(!F||typeof F=="string"){F={elem:F}}F.elemName&&(F.elem=F.elemName);var D=this;if(F.elem&&F.elem.indexOf(" ")>1){F.elem.split(" ").forEach(function(G){D._liveClassBind(t(D._name,G,F.modName,F.modVal),C,E,B)});return D}return D._liveClassBind(t(D._name,F.elem,F.modName,F.modVal),C,E,B)},liveUnbindFrom:function(C,B,E){var D=this;if(C.indexOf(" ")>1){C.split(" ").forEach(function(F){D._liveClassUnbind(t(D._name,F),B,E)});return D}return D._liveClassUnbind(t(D._name,C),B,E)},_liveInitOnBlockEvent:function(D,C,F,E){var B=this._name;v[C].on(D,function(H){var G=arguments,I=H.block[E](B);F&&I.forEach(function(J){F.apply(J,G)})});return this},liveInitOnBlockEvent:function(C,B,D){return this._liveInitOnBlockEvent(C,B,D,"findBlocksOn")},liveInitOnBlockInsideEvent:function(C,B,D){return this._liveInitOnBlockEvent(C,B,D,"findBlocksOutside")},liveInitOnBlockInit:function(B,C){return this.liveInitOnBlockEvent("init",B,C)},liveInitOnBlockInsideInit:function(B,C){return this.liveInitOnBlockInsideEvent("init",B,C)},on:function(B,F,E,D,C){return B.jquery?this._liveCtxBind(B,F,E,D,C):this.__base(B,F,E,D)},un:function(B,E,D,C){return B.jquery?this._liveCtxUnbind(B,E,D,C):this.__base(B,E,D)},liveCtxBind:function(B,F,E,D,C){return this._liveCtxBind(B,F,E,D,C)},_liveCtxBind:function(B,G,F,E,D){var I=this;if(typeof G=="string"){if(e.isFunction(F)){D=E;E=F;F=h}if(G.indexOf(" ")>-1){G.split(" ").forEach(function(J){I._liveCtxBind(B,J,F,E,D)})}else{var C=I._buildCtxEventName(G),H=f[C]||(f[C]={counter:0,ctxs:{}});B.each(function(){var K=e.identify(this),J=H.ctxs[K];if(!J){J=H.ctxs[K]={};++H.counter}J[e.identify(E)+(D?e.identify(D):"")]={fn:E,data:F,ctx:D}})}}else{e.each(G,function(K,J){I._liveCtxBind(B,K,J,F)})}return I},liveCtxUnbind:function(B,E,D,C){return this._liveCtxUnbind(B,E,D,C)},_liveCtxUnbind:function(B,E,D,C){var G=this,F=f[E=G._buildCtxEventName(E)];if(F){B.each(function(){var I=e.identify(this,true),H;if(I&&(H=F.ctxs[I])){D&&delete H[e.identify(D)+(C?e.identify(C):"")];if(!D||e.isEmptyObject(H)){F.counter--;delete F.ctxs[I]}}});F.counter||delete f[E]}return G},_extractElemNameFrom:function(B){if(B.__bemElemName){return B.__bemElemName}var C=B[0].className.match(this._buildElemNameRE());return C?C[1]:h},extractParams:g,_buildModClassPrefix:function(C,B){return t(this._name)+(B?j+(typeof B==="string"?B:this._extractElemNameFrom(B)):"")+p+C+p},_buildModValRE:function(C,B,D){return new RegExp("(\\s?)"+this._buildModClassPrefix(C,B)+"("+k+")(\\s|$)",D)},_buildElemNameRE:function(){return new RegExp(this._name+j+"("+k+")(?:\\s|$)")},buildSelector:function(C,D,B){return"."+t(this._name,C,D,B)},getBlockByUniqId:function(B){return w[B]},getWindowSize:function(){return{width:d.width(),height:d.height()}}})})(BEM,jQuery);(function(){String.prototype.trim||(String.prototype.trim=function(){var c=this.replace(/^\s\s*/,""),a=/\s/,b=c.length;while(a.test(c.charAt(--b))){}return c.slice(0,b+1)})})();(function(a){if(!a){a=window.Lego={}}a.isSessionValid=function(){return !!a.getCookie("yandex_login")}})(window.Lego);BEM.DOM.decl("i-global",{onSetMod:{js:function(){this.del(this.__self._params=$.extend({},this.params),"uniqId","name");var a=this.__self._params;a["passport-msg"]||(a["passport-msg"]=a.id);if(a["show-counters"]===undefined){a["show-counters"]=Math.round(Math.random()*100)<=a["show-counters-percent"]}a.locale=a.lang;$(function(){a.oframebust&&Lego.oframebust(a.oframebust)})}},getDefaultParams:function(){return{id:"",login:Lego.isSessionValid()?$.cookie("yandex_login")||"":"",yandexuid:$.cookie("yandexuid"),lang:"ru",retpath:encodeURI($.decodeURI(location.href)),"passport-host":"https://passport.yandex.ru","pass-host":"//pass.yandex.ru","social-host":"//social.yandex.ru","lego-path":"/lego","show-counters-percent":100}}},{param:function(a){return(this._params||{})[a]}});BEM.DOM.decl("i-global",{_params:Lego.params});(function(b){if(!b){b=window.Lego={}}!b.params&&(b.params={});function a(c){return c.replace(/^(?:https?:)?\/\//,"")}b.c=function(d,c,j){var i=a((j&&j.host)||BEM.blocks["i-global"].param("click-host")||"clck.yandex.ru"),e=function(l,n,m,k){n=n.replace("'","%27");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-link_pseudo_yes/)||(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){BEM.blocks["i-global"].param("show-counters")&&a.cp(0,2219,c,b)}})(window.Lego);function cp(g,c,d){var b="clck/lid="+g;if(typeof Lego.params.msid!="undefined"){b+="/sid="+Lego.params.msid}try{Lego.c(b,c,d)}catch(f){}}function cpt(c,b){c+=(document.getElementById("form").text.value?".full":".empty")+"/u="+new Date().getTime();cp(c,b)}function c0(a){try{Lego.c(a)}catch(b){}}function csh(d,b){try{cp(d,b)}catch(c){}}function csh_ifmsid(c,b){if(typeof Lego.params.msid!="undefined"){csh(c,b)}}function cpa(a){return a&&typeof Lego.params.msid!="undefined"?"onmousedown=\"Lego.cp('132','71946','"+a+"',this)\"":""}csh_ifgsid=csh_ifmsid;(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(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"];BEM.blocks["i-global"]._params||b.extend(BEM.blocks["i-global"]._params={},c);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(f,b,g,a){b=f.documentElement;g="className";a="replace";b[g]=b[g][a]("i-ua_js_no","i-ua_js_yes");if(f.compatMode!="CSS1Compat"){b[g]=b[g][a]("i-ua_css_standart","i-ua_css_quirks")}})(document);(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(a){if(!a.ya){a.ya={}}})(this);(function(a,b){if(!a.Collection){a.Collection=function(c){this.storage=[];this.idAttr=c||"id"};a.Collection.prototype={add:function(c){this.storage.push(c);$(this).trigger("append."+c[this.idAttr],[c])},get:function(d){var c=this;return this.storage.filter(function(e){return(e[c.idAttr]===d)})}}}})(ya,this);(function(b,c){var a=/\[%\s([^%]+)\s%\]/g;b.template=function(d,g){g=g||{};try{var f=d.replace(/'/g,"\\'").replace(a,function(i,e){if(g.hasOwnProperty(e)){return"'+(hash.hasOwnProperty(\""+e+'")?hash["'+e+'"]:"'+g[e]+"\")+'"}else{return"'+(hash.hasOwnProperty(\""+e+'")&&typeof(hash["'+e+"\"])!='undefined'?hash[\""+e+"\"]:'')+'"}});return new Function("hash","return '"+f+"'")}catch(h){debug("template make failed:",d,f)}};b.getClasses=function(g,f,e){var d,h=g;e&&(h+=" "+e);if(f){for(d in f){if(f.hasOwnProperty(d)&&f[d]){h+=" "+g+"_"+d+"_"+f[d]}}}return h};b.getAttrs=function(e){if(!e){return""}var d,f="";for(d in e){if(e.hasOwnProperty(d)){f+=" "+d+'="'+e[d]+'"'}}return f};b.getJsParams=function(d){return JSON.stringify(d||{}).replace(/"/g,"'")}})(ya,this);ya.pages={};ya.templates={common:{},pages:{}};ya.generators={common:{},pages:{}};ya.hash={common:{},pages:{}};(function(a,b){a.make=function(c,d){if(!c.hasOwnProperty(d)){c[d]={}}return c[d]};a.getScripts=function(c,d){return c.map(function(e){return a.templates.common.script({src:e(d)})}).join("")};a.uid=function(){return String(Math.random()).substr(2,12)};a.htmlFilter=function(c){return c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};a.urlFilter=function(c){return c.replace(/./g,function(d){if(d.match(/[&@\/;:=+?$]/)){return d}else{return encodeURIComponent(d)}})};a.capitalize=function(c){c=c||"";return c[0].toUpperCase()+c.substring(1)};a.Collection=function(c){this.storage=[];this.idAttr=c||"id"};a.Collection.prototype={add:function(c){this.storage.push(c);$(this).trigger("append."+c[this.idAttr],[c])},get:function(d){var c=this;return this.storage.filter(function(e){return(e[c.idAttr]===d)})}};a.log=function(){if(env.debug){if(b.console){b.console.log.apply(this,arguments)}else{if(b.debug){b.debug.apply(this,arguments)}else{if(b.document&&b.document.body){var d="debugWindow",c=document.getElementById(d);if(c){c.innerHTML+="<hr/>msg"}else{document.body.innerHTML+='<div style="width:50%;height: 50px; margin-bottom: 200px; overflow: auto;position: absolute;bottom: 0; z-index: 9999; border:1px solid #ccc;background: #fff; color: #000; padding: 1em 2em;margin:2px;" id="'+d+'">Debug:<hr/>'+arguments[0]+"</div>"}}}}}};a.zCookie=function(){return{insert:function(e,d){var j=d.split(":"),n,k,f=[],m=false,c;if(j.length==3){c=j[0];k=e.split("|");for(var h=0,g=k.length;h<g;h++){if(k[h]){n=k[h].split(":");if(n[0]==c){f.push(d);m=true}else{f.push(k[h])}}}if(!m){f.push(d)}return f.join("|")}return false},get:function(g,d){var f=g.split("|"),h;for(var e=0,c=f.length;e<c;e++){h=f[e].split(":");if(h.length==3&&h[0]=="m-"+d){return{version:h[1],cache:h[2]}}}return false}}};a.getStaticURL=function(d){var c=b&&b.staticVersion||b&&b.ya&&b.ya.page&&b.ya.page.staticVersion||"1.274";return(env.devInstance?"/v12":"//yandex.st/www/"+c+"/v12")+d}})(ya,this);var env={};(function(a,b){a.devInstance=false;a.useTests=false;a.useCache=true;a.lsExternalStyles=0;a.lsExternalScripts=0;a.lsClientScrips=0;a.serverSide=1;a.configs={adaptiveRules:{w1:function(c){return{styles:[c.getStaticURL("/static/css/_desktop.w1.css")]}},w2:function(c){return{styles:[c.getStaticURL("/static/css/_desktop.w2.css")],stylesIE:[c.getStaticURL("/static/css/_desktop.w2.ie.css")]}},w3:function(c){return{styles:[c.getStaticURL("/static/css/_desktop.w3.css")],stylesIE:[c.getStaticURL("/static/css/_desktop.w3.ie.css")]}},h1:function(c){return{styles:[c.getStaticURL("/static/css/_desktop.h1.css")]}}}}})(env,this);$(function(){var a=Detector&&Detector();if($.browser.msie&&parseInt($.browser.version,10)<8&&a&&a.isInlineBlockSupported&&a.isInlineBlockSupported()){$("link[relates=ieOLD]").remove();$("style[relates=ieOLD]").remove()}});ya.passRequest=function(a){if(!a){return}var b=$("<iframe />");b.css({position:"absolute",height:"0",width:"0",left:"0",top:"0",visibility:"hidden"});b.attr("src",a);b.appendTo(document.body)};$(function(){if($.browser.msie&&parseInt($.browser.version,10)>6&&!detector.isMQuerySupported("(min-width: 100px)")){$.ajaxSetup({cache:true});$.getScript(ya.getStaticURL("/static/respond/respond.min.js"));$.ajaxSetup({cache:false})}});BEM.decl("i-statface",{onSetMod:{js:function(){this._data={};this._needSend=false;this.hasMod("send","manual")||$(window).unload(this.changeThis(this.send))}},set:function(a,c){this._needSend=true;var b=this._data;if(typeof a=="object"){$.each(a,function(d,e){b[d]=e})}else{b[a]=c}return this},reset:function(){var a=this;arguments[0]?$.each(arguments,function(c,b){delete a._data[b]}):this._data={};$.isEmptyObject(this._data)&&(this._needSend=false);return this},serialize:function(){var a=this;return $.map(a.params.keys,function(b){return a._data[b]}).join(".")+(a.params.customKeys?$.map(a.params.customKeys,function(b){var c=a._data[b];return"/"+b+"="+(c==undefined?"":c)}).join(""):"")},send:function(b){if(this._needSend){var c=this.params,a=["//",c.host,"/",c.path,"/dtype=stred","/pid=",c.pid,"/cid=",c.cid,"/path=",this.serialize(),"/*data=",encodeURIComponent("url="+encodeURIComponent(location.href))].join("");c.path=="click"?document.createElement("IMG").src=a:$.ajax({type:"GET",url:a,data:null,complete:b||$.noop,dataType:"script",timeout:500});this._needSend=false}return this},getDefaultParams:function(){return{host:"clck.yandex.ru",path:"jclck"}}});(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){a=a||{};a.oframebust=function(c){if(window.top.location!=window.location){var b=document.referrer.match(/^https?:\/\/([^:\/\s]+)\/?.*/);if(!b){return}!a.oframebustMatchDomain(c,b[1])&&(window.top.location=window.location)}}})(window.Lego);(function(){var b;var a={isAuthenticated:false,isFeedbackReceived:false,isRequestSent:false};var c=function(){};BEM.decl("i-mda-auth",{},{authenticate:function(e){b=Lego.params["mda-auth-url"]||"";if(b===""){return false}var d=Lego.params["mda-auth-delay"]||10;c=e||function(){};setTimeout(function(){var f=document.createElement("iframe");f.style.visibility="hidden";f.style.position="absolute";f.setAttribute("src",b);f.style.top=f.style.left=f.style.width=f.style.height=0;document.getElementsByTagName("body")[0].appendChild(f);a.isRequestSent=true},d)},isRequestSent:function(){return a.isRequestSent},isFeedbackReceived:function(){return a.isFeedbackReceived},isAuthenticated:function(){return a.isAuthenticated},getUrl:function(){return b},registerFeedback:function(d){var e=(d==="success");a.isFeedbackReceived=true;a.isAuthenticated=e;c(e)}})})();(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(){var c,b,d=function(){var e,f=0;while(e=c[f++]){e.val(e.elem("input").val())}},a=function(g){try{return g.activeElement}catch(f){}};BEM.DOM.decl("b-form-input",{onSetMod:{js:function(){var h=this,f=h.elem("input"),g=a(h.__self.doc[0]),e=h.params.autoFocus&&!(g&&$(g).is("input, textarea"));h._val=f.val();if(g===f[0]||e){h.setMod("focused","yes")._focused=true}if(!b){c=[];b=h.channel("sys").on({tick:d,idle:function(){b.un("tick",d)},wakeup:function(){b.on("tick",d)}})}h._instanceIndex=c.push(h.bindTo(f,{focus:h._onFocus,blur:h._onBlur}))-1;h.params.shortcut&&h.bindToDoc("keydown",function(i){if(i.ctrlKey&&i.keyCode==38&&!$(i.target).is("input, textarea")){h.setMod("focused","yes")}})},disabled:function(f,e){this.elem("input").attr("disabled",e=="yes")},focused:function(f,e){if(this.hasMod("disabled","yes")){return false}var g=e=="yes";g?this._focused||this._focus():this._focused&&this._blur();this.afterCurrentEvent(function(){this.trigger(g?"focus":"blur")})}},onElemSetMod:{message:{visibility:function(h,i,e){var j=this,g=j.getMod(h,"type");if(g){var f=true;e||j.elem("message","type",g).each(function(){this!=h[0]&&j.hasMod($(this),"visibility","visible")&&(f=false)});f&&j.toggleMod("message-"+g,"yes","",e==="visible")}}}},val:function(g,f){if(typeof g=="undefined"){return this._val}if(this._val!=g){var e=this.elem("input");e.val()!=g&&e.val(g);this._val=g;this.trigger("change",f)}return this},getSelectionEnd:function(){var i=this.elem("input")[0],g=0;if(typeof(i.selectionEnd)=="number"){g=i.selectionEnd}else{var h=document.selection.createRange();if(h&&h.parentElement()==i){var f=i.value.length,e=i.createTextRange();e.moveToBookmark(h.getBookmark());var j=i.createTextRange();j.collapse(false);g=e.compareEndPoints("EndToEnd",j)>-1?f:-e.moveEnd("character",-f)}}return g},name:function(e){return this.elem("input").attr("name")},_onFocus:function(){this._focused=true;return this.setMod("focused","yes")},_onBlur:function(g){var f=this;if(f._preventBlur){setTimeout(function(){f._focus()},0);return f}f._focused=false;return f.delMod("focused")},_focus:function(){var f=this.elem("input")[0];if(f.createTextRange&&!f.selectionStart){var e=f.createTextRange();e.move("character",f.value.length);e.select()}else{f.focus()}},_blur:function(){this.elem("input").blur()},destruct:function(){this.__base.apply(this,arguments);this.params.shortcut&&this.unbindFromDoc("keydown");c.splice(this._instanceIndex,1);var f=this._instanceIndex,e;while(e=c[f++]){--e._instanceIndex}}});BEM.HTML.decl("b-form-input",{onBlock:function(e){var f=e.param("id")||e.generateId();e.tag("span").tParam("id",f).tParam("has-clear",e.mod("has-clear")==="yes").tParam("type",e.mod("type")||"input").afterContent({elem:"box",tag:"span",content:{elem:"input",attrs:{value:e.param("value"),name:e.param("name"),id:f}}}).js(true)},onElem:{input:function(e){e.tag(e.tParam("type"))},label:function(e){e.tag("label").attr("for",e.tParam("id"))},box:function(e){if(e.tParam("has-clear")){e.afterContent({elem:"clear",tag:"span"})}},hint:function(e){e.tag("label").attr("for",e.tParam("id"))}}})})();BEM.DOM.decl("b-form-input",{_onBlur:function(){var a=this;if(a._preventBlur){setTimeout(function(){a._focus()},0);return a}a._focused=false;return a.delMod("focused")}});(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()})();BEM.DOM.decl("b-form-input",{onSetMod:{js:function(){this.__base.apply(this,arguments);(this._hasHint=!!this.elem("hint")[0])&&this.on("change",this._updateHint)._updateHint()},focused:function(){this.__base.apply(this,arguments);this._hasHint&&this._updateHint()}},_updateHint:function(){this.toggleMod(this.elem("hint-wrap"),"visibility","visible",!(this._focused||this.val()))}});(function(d){var c,g=[],a=d.browser;function f(){return g.length?g.shift():c?c.clone():c=b()}function e(h){g.push(h)}function b(){return d((a.safari||a.webkit)&&navigator.userAgent.toLowerCase().indexOf("mobile")>-1?"<div/>":"<iframe"+(a.msie&&a.version<9?' frameborder="0"':"")+"/>")}BEM.DOM.decl("i-popup",{onSetMod:{js:function(){var h=d.browser;if(h.msie&&parseInt(h.version)>=9){this.domElem[0].onresize=function(){this.className+=""}}},visibility:{visible:function(){var h=this._getUnder(),i=h.parent();this.hasMod(h,"type","paranja")?i.is("body")||h.appendTo("body"):(i[0]!==this.domElem[0])&&h.prependTo(this.domElem);this._inBody||(this._inBody=!!this.domElem.appendTo("body"));this.trigger("show")},"":function(){var h=this._getUnder();this.hasMod(h,"type","paranja")&&h.remove();this._putUnder();this.trigger("hide")}}},_getUnder:function(){return this._under||(this._under=f().attr("class",this._underClass||(this._underClass=this.findElem("under").remove().attr("class"))))},_putUnder:function(){e(this._under);delete this._under},show:function(h){h&&this.domElem.css(h);return this.setMod("visibility","visible")},hide:function(){return this.delMod("animate").delMod("visibility")}},{live:true})})(jQuery);BEM.HTML.decl("i-popup",{onBlock:function(a){a.mod("autoclosable","yes").js(true).wrapContent({elem:"content"}).afterContent({elem:"under",mods:a.param("underMods"),mix:a.param("underMix")}).param("zIndex")&&a.attr("style","z-index:"+(32700+a.param("zIndex")))}});(function(a){var b=(a.browser.opera&&a.browser.version<12.1)?"keypress":"keydown";BEM.DOM.decl({name:"i-popup",modName:"autoclosable",modVal:"yes"},{onSetMod:{visibility:{visible:function(){this.afterCurrentEvent(function(){if(this.hasMod("visibility","visible")){var c=this._under;this.bindToDoc("leftclick",function(d){this.containsDomElem(a(d.target))||this._onOutClick(d)}).bindToDoc(b,function(d){d.keyCode==27&&this.hide()});if(c&&c.is("iframe")&&this.hasMod(c,"type","paranja")){this.bindToDomElem(a([c[0].contentWindow,c[0].contentWindow.document]),"leftclick",this.hide)}}});this.__base.apply(this,arguments)},"":function(){return this.unbindFromDoc("leftclick "+b).__base.apply(this,arguments)}}},_onOutClick:function(c){var d=a.Event("outside-click");this.trigger(d,{domEvent:c});d.isDefaultPrevented()||this.hide()}})})(jQuery);BEM.DOM.decl({name:"b-form-input",modName:"type",modVal:"autofocus"},{onSetMod:{js:function(){this._preventRequest=true;this.delMod("focused");this.setMod("focused","yes")._focused=true;this.__base.apply(this,arguments);this._preventRequest=false;var a=this;$(window).bind("keyboardOpened.lego",function(){a.setMod("focused","yes")._focused=true});this.bindTo("click",function(){this._preventRequest||this._focused&&!this._isPopupShown&&this._doRequest()})}}});(function(){var a={};BEM.decl("i-request",{onSetMod:{js:function(){this._preventCache=false}},get:function(c,e,b,d){if(!$.isFunction(b)){d=b;b=this.params.onError}this._get(c,e,b,$.extend({},this.params,d))},_get:function(e,g,d,f){var c=this._buildCacheKey(e,f),b=a[f.cacheGroup];f.cache&&b&&c in b.data?this.afterCurrentEvent(function(){g.call(this.params.callbackCtx,b.data[c])},this):this._do(e,g,d,f)},_do:function(c,e,b,d){},_onSuccess:function(c,b,d,e){e.cache&&!this._preventCache&&this.putToCache(e,c,d);this._preventCache=false},_buildCacheKey:function(b,c){return typeof b=="string"?b:$.param(b)},putToCache:function(f,d,e){var b=a[f.cacheGroup]||(a[f.cacheGroup]={keys:[],data:{}});if(b.keys.length>=f.cacheSize){delete b.data[b.keys.shift()]}var c=this._buildCacheKey(d,f);b.data[c]=e;b.keys.push(c)},dropCache:function(){delete a[this.params.cacheGroup]},getDefaultParams:function(){return{cache:false,cacheGroup:"default",cacheSize:100,callbackCtx:this}}})})();BEM.decl({block:"i-request_type_ajax",baseBlock:"i-request"},{onSetMod:{js:function(){this.__base();this._requestNumber=this._number=this._preventNumber=this._retryCount=0}},_get:function(b,d,a,c){this._number++;this._requestNumber++;this._retryCount=c.retryCount;this.__base.apply(this,arguments)},_do:function(d,h,f,c){var g=this;if(g._number>g._preventNumber){var i=arguments,b={data:c.data?$.extend({},c.data,d):d},e=g._wrapCallback(function(l,j,k){g._onSuccess(g._buildCacheKey(d,c),d,l[0],c);g._allowCallback(j,k)&&h.apply(c.callbackCtx,l)}),a=g._wrapCallback(function(l,j,k){g._allowCallback(j,k)&&(g._retryCount-->0?setTimeout(function(){g._do.apply(g,i)},c.retryInterval):f&&f.apply(c.callbackCtx,l))});$.each(["url","dataType","timeout","type","jsonp","jsonpCallback"].concat(c.paramsToSettings||[]),function(k,j){b[j]=c[j]});$.ajax(b).done(e).fail(a)}},_wrapCallback:function(c){var a=this._requestNumber,b=this._number;return function(d){d!==null&&c(arguments,a,b)}},_allowCallback:function(a,b){return b>this._preventNumber&&this._requestNumber==a},_buildCacheKey:function(a,b){return typeof a=="string"?a:this.__base(a)+b.url},abort:function(){this._preventNumber=++this._number},preventCallbacks:function(){this.abort()},getDefaultParams:function(){return $.extend(this.__base(),{cache:true,type:"GET",dataType:"jsonp",timeout:20000,retryCount:0,retryInterval:2000})}});(function(b){var d=BEM.HTML,a=BEM.DOM,c;b(function(){b(window).bind("focus",function(){c=document.activeElement})});a.decl({name:"b-form-input",modName:"autocomplete",modVal:"yes"},{onSetMod:{js:function(){var f=this;f.params.foot&&(f.foot=f.params.foot);f._preventRequest=true;f._preventPopupShow=false;f._isPopupShown=false;f.__base.apply(f,arguments);f._userVal=f.val();var e=f._focused;e&&f.delMod("focused");f.elem("input").attr("autocomplete","off");f._preventRequest=false;e&&f.setMod("focused","yes");f._items=[];f._curItemIndex=-1;f._doRequest=b.debounce(f._doRequest,f.params.debounceDelay)},focused:{yes:function(){this.__base();var e=this.params.showListOnFocus?this._onChange():this._onChange;this.on("change",e)},"":function(){this.__base();this.un("change",this._onChange)._preventHide||this._getPopup().hide()}}},onElemSetMod:{popup:{fixed:{yes:function(){this._isPopupShown&&this.afterCurrentEvent(function(){this._updatePopupPos()})},"":function(){this._isPopupShown&&this.afterCurrentEvent(function(){this._updatePopupPos()})}}}},getDataprovider:function(){var e=this.params.dataprovider.url;return this._dataprovider||(this._dataprovider=BEM.create(this.params.dataprovider.name||this.__self.getName()+"__dataprovider",b.extend(this.params.dataprovider,{url:e,callbackCtx:this})))},_onChange:function(){c===this.elem("input")[0]?c=null:this._preventRequest||this._doRequest();return this._onChange},_onKeyDown:function(m){var g=this,n=m.keyCode==38||m.keyCode==40;if(n&&!m.shiftKey){m.preventDefault();if(!g._isPopupShown){g._getHiddenPopup()}else{var f=g._items.length,j=false;if(f){var l=m.keyCode-39,h=g._curItemIndex,k=0;do{j=((h==0&&l==-1)||(h+l>=f))&&g._onLeaveItem(g._items[h],true);h+=l;h=h<0?f-1:h>=f?0:h}while(!j&&g._onEnterItem(g._items[h],true)===false&&++k<f)}}}},_onKeyPress:function(f){if(f.keyCode==13){if(this._curItemIndex>-1&&this._isCurItemEnteredByKeyboard){f.preventDefault();this._onSelectItem(this._items[this._curItemIndex],true)}this._getPopup().hide()}},_getHiddenPopup:function(){this._preventRequest||this._focused&&!this._isPopupShown&&this._doRequest()},_getPopup:function(){var h=this;if(!h._popup){var e=(b.browser.opera&&b.browser.version<12.1)?"keypress":"keydown",g=h.__self.getName(),f=[{elem:"items",tag:"ul",mix:[{block:g,elem:"popup-items"}]},{block:"b-form-input",elem:"shadow",tag:"i"}];h._hasPopupFade()&&f.push({block:g,elem:"fade"});h._popup=b(d.build({block:"i-popup",mix:[{block:g,elem:"popup",mods:h.params.popupMods,js:{uniqId:h._uniqId}}],content:f})).bem("i-popup").on({show:function(){h.trigger("popup-shown").bindTo("keypress",h._onKeyPress).bindToWin("resize",h._updatePopupPos).unbindFrom("input","click")._isPopupShown=true},"outside-click":function(j,i){h.containsDomElem(b(i.domEvent.target))&&j.preventDefault()},hide:function(){h.trigger("popup-hidden").unbindFrom("keypress").unbindFromWin("resize").bindTo("input","click",h._getHiddenPopup)._curItemIndex=-1;h._isPopupShown=false}});h.bindTo(e,h._onKeyDown);b.each({mouseover:h._onEnterItem,mouseout:h._onLeaveItem,mousedown:h._onSelectItem,mouseup:h._onItemMouseUp},function(j,i){BEM.blocks["b-autocomplete-item"].on(h._popup.domElem,j,function(k){i.call(h,k.block)})});a.init(h._popup.domElem)}return h._popup},getPopup:function(){return this._getPopup()},_hasPopupFade:function(){return(this.params.popupMods||{}).fade=="yes"},_updatePopupPos:function(){var f=this.elem("box"),e=f.offset();e.top+=f.outerHeight();this.hasMod(this.elem("popup"),"fixed")&&(e.top-=a.win.scrollTop());this._hasPopupFade()&&(e.width=f.outerWidth());this._preventPopupShow||this._getPopup().show(e)},_onEnterItem:function(g,h){if(g.hasMod("enterable","no")){return false}var e=this._items,f=this._curItemIndex;f>-1&&e[f].delMod("hovered");f=this._getItemIndex(g);f>-1&&e[f].setMod("hovered","yes");this._curItemIndex=f;this._isCurItemEnteredByKeyboard=!!h;if(h&&this.params.updateOnEnter){this._preventRequest=true;this.val(g.enter()!==false?g.val():this._userVal,{source:"autocomplete",itemIndex:this._curItemIndex}).del("_preventRequest")}},_onLeaveItem:function(f,g){var e=this._curItemIndex;if(e>-1&&e==this._getItemIndex(f)){this._items[e].delMod("hovered");this._curItemIndex=-1}g&&this.val(this._userVal);return true},_onSelectItem:function(f,h){var e=f.select(h||false),i=(typeof e=="object")?e.needUpdate:e!==false,g=(typeof e=="object")&&e.needEvent;this._preventRequest=true;this._preventBlur=!h;i&&this.val(this._userVal=f.val(),{source:"autocomplete",itemIndex:this._curItemIndex});if(h){this.del("_preventRequest")}else{i||(this._preventHide=true);this.afterCurrentEvent(function(){this.setMod("focused","yes").del("_preventRequest","_preventHide")})}(i||g)&&this.trigger("select",{item:f,byKeyboard:h})},_onItemMouseUp:function(){this.del("_preventBlur")._getPopup().hide()},_getItemIndex:function(e){return b.inArray(e,this._items)},_doRequest:function(){var e=this;e.enablePopup();e._userVal=e.val();e.trigger("data-requested").getDataprovider().get(e.val(),function(h){e.trigger("data-received",h);var f=e._getPopup(),g=h.items||h;e.foot&&g.length&&(b.inArray(e.foot,g)==-1)&&g.push(e.foot);if(g.length){e._curItemIndex=-1;a.update(f.elem("items"),e._buildItemsHtml(g),function(){e._updatePopupPos();e._items=f.findBlocksInside("b-autocomplete-item");e.trigger("update-items")})}else{f.hide()}})},_buildItemsHtml:function(e){var f=this;return d.build(b.map(e,function(j,h){var k={block:"b-autocomplete-item",data:j,mods:{type:b.isArray(j)?j[0]:"text"},suggestVersion:f.params.dataprovider.version},g;(b.isArray(j))&&b.isPlainObject(g=j.concat().pop())&&b.extend(k,g);return k}))},setFoot:function(e){return this.foot=e},getDefaultParams:function(){return b.extend(this.__base(),{updateOnEnter:true,debounceDelay:50,showListOnFocus:true})},enablePopup:function(){this._preventPopupShow=false},disablePopup:function(){this._preventPopupShow=true}})})(jQuery);BEM.DOM.decl({name:"b-form-input",modName:"autocomplete",modVal:"yes"},{_updatePopupPos:function(){var b=this.elem("box"),a=b.offset();a.top+=b.outerHeight();this.hasMod(this.elem("popup"),"fixed")&&(a.top-=BEM.DOM.win.scrollTop());this._preventPopupShow||this._getPopup().show(a)},_getPopup:function(){var d=this;if(!d._popup){var a=($.browser.opera&&$.browser.version<12.1)?"keypress":"keydown",c=d.__self.getName(),b=[{elem:"items",tag:"ul",mix:[{block:c,elem:"popup-items"}]},{block:"b-form-input",elem:"shadow",tag:"i"}];d._hasPopupFade()&&b.push({block:c,elem:"fade"});d._popup=$(BEM.HTML.build({block:"i-popup",mix:[{block:c,elem:"popup",mods:d.params.popupMods,js:{uniqId:d._uniqId}}],content:b})).bem("i-popup").on({show:function(){d.trigger("popup-shown").bindTo("keypress",d._onKeyPress).bindTo(a,d._onKeyDown).bindToWin("resize",d._updatePopupPos).unbindFrom("input","click")._isPopupShown=true},"outside-click":function(g,f){d.containsDomElem($(f.domEvent.target))&&g.preventDefault()},hide:function(){d.trigger("popup-hidden").unbindFrom("keypress "+a).unbindFromWin("resize").bindTo("input","click",d._getHiddenPopup)._curItemIndex=-1;d._isPopupShown=false}});$.each({mouseover:d._onEnterItem,mouseout:d._onLeaveItem,mousedown:d._onSelectItem,mouseup:d._onItemMouseUp},function(g,f){BEM.blocks["b-autocomplete-item"].on(d._popup.domElem,g,function(h){f.call(d,h.block)})});BEM.DOM.init(d._popup.domElem)}return d._popup},_onSelectItem:function(b,d){var a=b.select(d||false),e=(typeof a=="object")?a.needUpdate:a!==false,c=(typeof a=="object")&&a.needEvent;this._preventRequest=true;this._preventBlur=!d;e&&this.val(this._userVal=b.val(),{source:"autocomplete",itemIndex:this._curItemIndex});if(d){this.del("_preventRequest","_preventBlur")}else{e||(this._preventHide=true);this.afterCurrentEvent(function(){this.setMod("focused","yes").del("_preventRequest","_preventHide","_preventBlur")})}(e||c)&&this.trigger("select",{item:b,byKeyboard:d})}});BEM.decl({name:"b-form-input__dataprovider",baseBlock:"i-request_type_ajax"},{get:function(a,b){return this.__base({part:a},function(c){b.call(this,{items:c[1],metainfo:c[2]})})}});BEM.decl({name:"b-form-input__dataprovider",baseBlock:"i-request_type_ajax"},{get:function(b,e){var a=this.params.url,d={part:b,pos:this.params.callbackCtx.getSelectionEnd(),yu:Lego.params.yandexuid||"",srv:this.params.callbackCtx.params.suggestType||Lego.params.id||""},c=this._getLR();(c&&!a.match(/lr=(.*?)(?:&|$)/))&&(d.lr=c);return this.__base(d,function(f){e.call(this,{items:f[1],metainfo:f[2]})})},_onSuccess:function(b,a,c,d){(c[2]&&c[2].nocache)&&(this._preventCache=true);this.__base.apply(this,arguments)},_getLR:function(){if(this.hasOwnProperty("_lr")){return this._lr}var b=document.getElementsByName("lr");if(b.length){return this._lr=b[0].value}try{lrParam=window.location.toString().match(/lr=(.*?)(?:&|$)/);if(lrParam){return this._lr=lrParam[1]}}catch(a){}return this._lr=""}});BEM.decl("i-common__string",{},{cleverSubstring:(function(){var a="…";return function(d,b,c){return(d.length>b+c)?d.substring(0,b-1)+a:d}})(),escapeHTML:(function(){var b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},a=function(c){return b[c]||c};return function(c){return String(c).replace(/&(?!\w+;)|[<>"']/g,function(d){return b[d]||d})}})(),escapeRegExp:function(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},highlight:function(e,a){if(!$.isArray(a)){return e}var f=[],d=0,b,c=a.sort(function(h,g){return h[0]-g[0]});c.forEach(function(g){b=(d>g[0])?d:g[0];f.push({tag:"span",elem:"span",content:this.escapeHTML(e.slice(d,b))});f.push({tag:"em",elem:"em",content:this.escapeHTML(e.slice(b,d=g[1]))})},this);f.push({tag:"span",elem:"span",content:this.escapeHTML(e.slice(d))});return f}});BEM.DOM.decl("b-autocomplete-item",{val:function(){return this.params.val||this.elem("text").text()||this.domElem.text()},enter:function(){},select:function(a){}},{live:function(){this.liveBindTo("mouseover mouseout mousedown mouseup",function(a){this.trigger(a.type)})}});BEM.HTML.decl("b-autocomplete-item",{onBlock:function(a){var b=a.param("data"),c=BEM.blocks["i-common__string"].escapeHTML($.isArray(b)?b[1]:b);$.isArray(a.param("search_cgi"))&&a.js({cgi:a.param("search_cgi")});a.tag("li").mod("pers",a.param("pers")?"yes":false).content(BEM.blocks["i-common__string"].highlight(c,a.param("hl"))).js(true)}});BEM.HTML.decl({block:"b-autocomplete-item",modName:"type",modVal:"hl"},{onBlock:function(a){a.content($.map(a.param("data").slice(1),function(b){return $.isArray(b)?{tag:"span",elem:"highlight",content:b[0]}:b}))}});BEM.HTML.decl({block:"b-autocomplete-item",modName:"type",modVal:"fact"},{onBlock:function(a){var b=a.param("data").slice(1);a.content([{tag:"span",elem:"text",content:BEM.blocks["i-common__string"].highlight(b[0],a.param("hl"))},{tag:"span",elem:"fact",content:[" — ",BEM.blocks["i-common__string"].escapeHTML(b[1])]}])}});BEM.DOM.decl({block:"b-autocomplete-item",modName:"type",modVal:"nav"},{enter:function(){return false},select:function(a){a&&$('<form style="display:none" action="'+this.val()+'" target="_blank"/>').appendTo("body").submit().remove();return{needEvent:true}}});BEM.HTML.decl({block:"b-autocomplete-item",modName:"type",modVal:"nav"},{onBlock:function(b){var e=b.param("data"),d=b.param("suggestVersion")==4,a=e[4]||e[3],c=(a.match(/^\w[\w-]*:\/\//g)?"":"http://")+a;b.js({val:c}).content({elem:"link",url:c,title:BEM.blocks["i-common__string"].escapeHTML(d?e[3]:e[2]),description:BEM.blocks["i-common__string"].highlight(d?e[2]:e[1],b.param("hl"))})},onElem:{link:function(a){a.tag("a").attrs({href:a.param("url"),target:"_blank"}).content([{elem:"link-url",tag:"span",content:a.param("title")},{elem:"link-info",tag:"span",content:["&nbsp;&mdash; "].concat(a.param("description"))}])}}});BEM.HTML.decl({block:"b-autocomplete-item",modName:"type",modVal:"nah"},{onBlock:function(a){a.content(a.param("data")[1])}});BEM.DOM.decl({block:"b-autocomplete-item",modName:"type",modVal:"href"},{url:function(){return this.findBlockInside("b-link").domElem.attr("href")},enter:function(){return false},select:function(a){a&&(location.href=this.url());return false}});BEM.HTML.decl({block:"b-autocomplete-item",modName:"type",modVal:"href"},{onBlock:function(a){var b=a.param("data").slice(1);a.content({block:"b-link",content:b[0],url:b[1]})}});BEM.HTML.decl("b-link",{onBlock:function(a){a.tag("a").attr("href",a.param("url"));var b=["title","target"],c;while(c=b.pop()){a.param(c)&&(a.attr(c,a.param(c)))}}});BEM.HTML.decl({block:"b-autocomplete-item",modName:"type",modVal:"weather"},{onBlock:function(a){var b=a.param("data").slice(1),c=BEM.blocks["i-common__string"].escapeHTML;a.content([{tag:"span",elem:"text",content:c(b[0])},{tag:"i",elem:"icon",mods:{weather:b[2].replace("-","minus-").replace("+","plus-").replace(/_/g,"-")}},{tag:"span",elem:"value",content:c(b[1].replace("-","&ndash;"))}])}});BEM.HTML.decl({block:"b-autocomplete-item",modName:"type",modVal:"traffic"},{onBlock:function(a){var b=a.param("data").slice(1),c=BEM.blocks["i-common__string"].escapeHTML;a.content([{tag:"span",elem:"text",content:c(b[0])},{tag:"i",elem:"icon",mods:{traffic:b[2]}},{tag:"span",elem:"value",content:c(b[1])}])}});BEM.DOM.decl({block:"b-autocomplete-item",modName:"type",modVal:"foot"},{select:function(){return false}});BEM.HTML.decl({block:"b-autocomplete-item",modName:"type",modVal:"foot"},{onBlock:function(a){a.mod("enterable","no").content($.map(a.param("data").slice(1),function(b){return $.isArray(b)?{tag:"span",elem:"foot",content:b[0]}:b}))}});BEM.DOM.decl({name:"b-form-input",modName:"tap-ahead",modVal:"yes"},{onSetMod:{js:function(){this.__base();this.buildAhead();this._input=this.elem("input")[0];this._intent=false;this._text=this.val();this._preventAhead=false;this._lastBackspace=0;this.on({"data-received":this._onDataReceive,change:this._onTextChange,"popup-hidden":this._onPopupHide}).bindTo("mousedown",function(c){if(this._preventAhead){return}var d=c.pageX-this.domElem.offset().left-parseInt(this._ahead.css("padding-left")),a=this.elem("ahead-filler").width(),b=a+this.elem("ahead-hintholder").width();if(d>a&&d<b){this.trigger("ahead-click");var f=this;setTimeout(function(){f._fill({usage:"mouse"})},0)}})}},_onKeyDown:function(a){this.__base.apply(this,arguments);(new Date()-this._lastBackspace>this.params.backspaceDelay)&&(this._preventAhead=false);switch(a.keyCode){case 8:if(!this.params.hideOnBackspace){break}this._preventAhead=true;this._lastBackspace=new Date();this._intent=this.clearAhead();break;case 9:a.preventDefault();this._fill({usage:"tab"});break;case 39:(this.val().length==this.getSelectionEnd())&&this._fill({usage:"arrow"});break;case 38:case 40:this.clearAhead();break}},_onDataReceive:function(f,d){if(this._preventAhead||(d.metainfo&&d.metainfo.off_client_tpah)){return false}var b=d.items&&d.items[0],h=this._text,c=(typeof b==="object")?b[1]:b,a=(typeof c==="string")&&c.match("^"+BEM.blocks["i-common__string"].escapeRegExp(h.toLowerCase())+"(.*)$"),g;if(a&&(h.length>=this.params.showOverChars)){g=this.params.showFullPhrase?a[1]:a[1].split(" ")[0];this.elem("ahead-hintholder").text(g);this._intent=this.showAhead(h,h+g)}else{this._intent=this.clearAhead()}},_onTextChange:function(b){var a=this._text.length-(this._text=this.val()).length;(a>0)&&this.shiftAhead(a);this._intent&&!this._intent.match("^"+BEM.blocks["i-common__string"].escapeRegExp(this.val()))&&this.clearAhead()},_onPopupHide:function(){this.clearAhead()},_fill:function(c){var a=$.extend(c,{chars:this._intent.length-this._text.length});if(typeof this._intent==="string"){try{var f=document.createEvent("TextEvent");f.initTextEvent("textInput",true,true,null,this._intent.slice(this.val().length),9);this._input.selectionEnd=this._input.selectionStart=this._text.length;this._input.dispatchEvent(f)}catch(d){this.val(this._intent);if(this._input.createTextRange){var b=this._input.createTextRange();b.moveEnd("character",this._text.length);b.collapse(false);b.select()}}this.trigger("ahead-fill",a)}},getDefaultParams:function(){return $.extend(this.__base(),{showOverChars:3,backspaceDelay:100,hideOnBackspace:true,showFullPhrase:false})}});BEM.DOM.decl("b-form-input",{onSetMod:{js:function(){this.__base();this._filler="";this._hint=""}},buildAhead:function(){this._ahead=$(BEM.HTML.build({block:"b-form-input",elem:"ahead"}));BEM.DOM.init(this._ahead.insertBefore(this.elem("input")));return this},_setAhead:function(a,b){this.elem("ahead-filler").text((this._filler=a)||"");this.elem("ahead-hint").val(!this._preventAhead&&(this._hint=b)||"");return b},showAhead:function(a,b){if(typeof a==="undefined"){this.clearAhead()}return this._setAhead(a,b)},clearAhead:function(){this._setAhead("","");return false},shiftAhead:function(a){this.elem("ahead-filler").text((this._filler=this._filler.slice(0,-a))||"")}});BEM.HTML.decl("b-form-input",{onElem:{ahead:function(a){a.mix([{block:"b-form-input",elem:"input"}]).content([{elem:"ahead-filler"},{elem:"ahead-hint"},{elem:"ahead-hintholder"}])},"ahead-filler":function(a){a.tag("span")},"ahead-hint":function(a){a.mix([{block:"b-form-input",elem:"input"}]).tag("input").attrs({disabled:true})},"ahead-hintholder":function(a){a.tag("span")}}});BEM.DOM.decl({name:"b-form-input",modName:"suggest",modVal:"yes"},{onSetMod:{js:function(){this.__base();$.extend(true,this.params,{popupMods:{suggest:"yes"}})}}});BEM.DOM.decl({name:"b-form-input",modName:"suggest",modVal:"yes"},{onSetMod:{js:function(){this.__base.apply(this,arguments);this.on("data-received",function(c,b){var a=b.metainfo,d=a.pers_options||a.n;if(d){this._toggleNahFoot(d===1)}})}},_toggleNahFoot:function(b){var a=/\(\(([^\)]+)\)\)/g,d=Lego.params.tuneURL||"http://tune.yandex.ru",c=Lego.message("b-suggest.hah:linkHref",d+"/suggest/?retpath="+encodeURIComponent(location.protocol+"//"+location.host));this._suggestFoot||(this._suggestFoot=this.setFoot(["foot",(b?BEM.I18N("b-head-search","my-searches-on"):BEM.I18N("b-head-search","my-searches-off")).replace(a,'<a class="b-link" href="'+c+'">$1</a>')]))}});(function(d,e){var c,b={},a=BEM.decl("i-loader",{},{load:function(p,g,l,i,h){if(typeof g!="string"){h=i;i=l;l=g;g=p}if(h===undefined&&i!==undefined&&typeof i!="function"){h=i;i=undefined}var q=b[p],j=this;if(q){if(q.successFns){q.successFns.push(l);i&&q.errorFns.push(i)}else{this.afterCurrentEvent(function(){l()})}return}var n=document,m=n.createElement("script"),k=function(){a._error(p)},f=g.split("."),o=f.splice(-2);if(h){o.unshift(typeof h=="string"?h:BEM.blocks["i-global"].param("lang"))}if(e.browser.msie&&e.browser.version<=8){o.splice(-1,0,"ie")}m.type="text/javascript";m.charset="utf-8";m.src=f.concat(o).join(".");m.onerror=k;this.afterCurrentEvent(function(){(c||(c=e("head")[0])).insertBefore(m,c.firstChild)});b[p]={successFns:[l],errorFns:i?[i]:[],timer:setTimeout(k,20000)}},loaded:function(q){var i=b[q.id];clearTimeout(i.timer);q.js&&q.js();q.css&&a._appendCss(q.css);if(q.hcss){var o=[],f=d._ycssjs;q.hcss.forEach(function(r){if(f){if(r[0] in f){return}f(r[0])}o.push(r[1])});o.length&&a._appendCss(o.join(""))}if(q.hcss2){var p=q.hcss2,l=document,n=l.createElement("div"),g=l.body,j="ycssjs_",o=[],h;n.style.position="absolute";g.insertBefore(n,g.lastChild.nextSibling);h=window.getComputedStyle(n);Object.keys(p).forEach(function(r){n.className=j+r;h.getPropertyValue("top").charAt(0)==="1"||o.push(p[r])});h=null;g.removeChild(n);o.length&&a._appendCss(o.join(""))}var m=i.successFns,k;while(k=m.shift()){k()}delete i.successFns},_error:function(g){var i=b[g],f=i.errorFns,h;clearTimeout(i.timer);while(h=f.shift()){h()}delete b[g]},_appendCss:function(f){var g=document.createElement("style");g.type="text/css";c.insertBefore(g,c.firstChild);g.styleSheet?g.styleSheet.cssText=f:g.appendChild(document.createTextNode(f))}})})(this,jQuery);(function(a,c,b){a.DOM.decl("b-head-stripe",{onSetMod:{js:function(){var d=this.params.theme;this.hasMod("theme")?this._show():this._loadTheme(d,this._show)}},_install:function(f){f.preventDefault();var d=this.params.download_url;d&&(window.location=d)},_close:function(f){f.preventDefault();f.stopPropagation();var d=this.params.close_url;d&&((new Image()).src=d);this.domElem.animate({"margin-top":"-20px"},500);this.setMod("state","closed")},_loadTheme:function(f,h){if(!f){return}var g=this,e="b-head-stripe_theme_"+f,d=c.param("lego-static-host")+"/blocks-desktop/b-head-stripe/_theme/b-head-stripe_theme_"+f+".bembundle.js";a.blocks["i-loader"].load(e,d,h)},_show:function(){this._generateCounter().delMod("state")},_generateCounter:function(){var d=this.params.counter;d&&((new Image()).src=d);return this}},{live:function(){this.liveBindTo("close","leftclick",function(d){this._close(d)});this.liveBindTo("leftclick",function(d){this._install(d)});return false}})})(BEM,BEM.blocks["i-global"],jQuery);BEM.DOM.decl("b-head-stripe",{onSetMod:{js:function(){this.__base.apply(this,arguments)}},_install:function(c){var b,a;c.preventDefault();this._close(c);if(c.target.href){b=this.params.set_cntr;a=c.target.href}else{b=this.params.stripe_cntr;a=this.params.stripe_url}if(b){cp(b)}setTimeout(function(){if(a){window.location=a}else{this.__base.apply(this,arguments)}},200)},_close:function(a){this.__base.apply(this,arguments);$(window).trigger("popupredraw.lego");a.preventDefault();a.stopPropagation()},_changeTheme:function(){}});BEM.HTML.decl("b-icon",{onBlock:function(c){var b={src:"//yandex.st/lego/_/La6qi18Z8LwgnZdsAr1qy1GwCwo.gif",alt:""},f=c.params(),d=["alt","width","height"],e;f.url&&(b.src=f.url);while(e=d.shift()){f[e]&&(b[e]=f[e])}c.tag("img").attrs(b)}});BEM.DOM.decl({block:"b-head-stripe",modName:"type",modVal:"wide"},{onSetMod:{js:function(){this.__base.apply(this,arguments);this.domElem.animate({"margin-top":0},1000);var a=this;var b=setTimeout(function(){a._doCloseAnimation()},5000);this.bindTo("mouseover",function(){clearTimeout(b)});this.bindTo("mouseout",function(){b=setTimeout(function(){a._doCloseAnimation()},1500)})}},_doCloseAnimation:function(){var a=this;this.domElem.animate({"margin-top":"-4em"},1000,function(){a.setMod("state","closed")})}});BEM.DOM.decl({name:"b-link",modName:"pseudo",modVal:"yes"},{_onClick:function(a){a.preventDefault();this.hasMod("disabled","yes")||this.afterCurrentEvent(function(){this.trigger("click")})}},{live:function(){this.__base.apply(this,arguments);this.liveBindTo({modName:"pseudo",modVal:"yes"},"leftclick",function(a){this._onClick(a)})}});BEM.HTML.decl({name:"b-link",modName:"pseudo",modVal:"yes"},{onBlock:function(a){a.tag(a.param("url")?"a":"span");a.wrapContent({elem:"inner"});a.js(true)},onElem:{inner:function(a){a.tag("span")}}});(function(){var c=false,a=false,b=[];BEM.decl("i-https",{},{isHTTPSSupported:function(){return a},enableHTTPS:function(){a=true;var d;while(d=b.shift()){d()}},getHTTPSHost:function(){var d=BEM.blocks["i-global"].param("lego-static-host");if(d){if(d.indexOf("https:")==0){return d}if(d.indexOf("http:")==0){return"https"+d.substr(4)}if(d.indexOf("//")==0){return"https:"+d}else{return"https://"+location.host+d}}else{return"https://"+location.host}},checkForHTTPS:function(d){if(a){return d()}b.push(d);if(c){return}c=true;BEM.create("i-request_type_ajax",{url:this.getHTTPSHost()+"/blocks-desktop/i-https/check-https.js",dataType:"script",cache:true,paramsToSettings:["cache"]}).get({},function(){},false,this)}})})();(function(d,a,b){var e=b.blocks["i-https"],c=b.blocks["i-global"];a.block["b-domik"]=function(v){var g=this,s=g.find(".b-domik__social"),u=s.length&&b.DOM.extractParams(s[0])["b-domik__social"].size,l=arguments.callee,n=d('<input type="hidden" name="timestamp"/>'),t=this.attr("class").match(/\bb-domik_type_(\w+)\b/)[1],f=g.find(".b-domik__button .b-form-button:first").bem("b-form-button"),j={host:c.param("social-host"),providers:c.param("social-providers"),sprites:c.param("social-sprites")};if(s.length&&j.host){if(j.providers&&j.sprites){w(j.providers,j.sprites[u])}else{d.getJSON(j.host+"/providers2.jsonp?callback=?",function(y){w(y.providers,y.icon_sprites[u])})}var x=new a.block["i-social"];d(".b-domik__social-link").live("click",function(y){k();d(".b-domik__social-popup").each(function(){d(this).bem("b-popupa").hide()});x.start(function(){var z=c.param("retpath");(!z||top.location.href==z)?top.location.reload():(top.location.href=z)},function(){s.removeClass("b-domik__social_loading_yes").css("height","").find(".b-spin").bem("b-spin").delMod("progress")},{provider:b.DOM.extractParams(this)["b-domik__social-link"].provider});y.preventDefault()})}function w(A,z){if(!A.length){s.remove();return}s.html(m(A,z));var B=s.find(".b-dropdowna");if(!B.length){return}b.DOM.init(B);b.DOM.init(s.find(".b-spin"));var C=B.bem("b-dropdowna").getPopup();function y(){C.pos()}C.on("show",function(){d(window).scroll(y)}).on("hide",function(){d(window).unbind("scroll",y)})}function m(B,A){var C=[{block:"b-domik",elem:"social-title",content:b.I18N("b-domik","enter-with")}];B=d.grep(B,function(D){return D.enabled});var z=d.grep(B,function(D){return D.primary});z=d.map(z,function(D){return{block:"b-domik",tag:"a",elem:"social-link",content:{tag:"i",elem:"social-icon",attrs:{style:'background-image:url("'+A+'");background-position: 0px -'+(D.id-1)*32+"px;"}},js:{provider:D.code},attrs:{tabIndex:103}}});[].push.apply(C,z);function y(G){var F=d.map(G,function(I){return{block:"b-domik",tag:"a",elem:"social-link",mods:{},attrs:{tabIndex:103},js:{provider:I.code},content:[{tag:"i",elem:"social-icon",attrs:{style:'background-image:url("'+A+'");background-position: 0px -'+(I.id-1)*32+"px;"}},I.display_name]}});F.length%2&&(F[F.length]="");var E=[],H;for(var D=0;D<F.length;D++){D%2||E.push(H={tag:"tr",content:[]});H.content.push({tag:"td",elem:"provider",content:F[D]})}return E}if(z.length<B.length){C.push({tag:"div",block:"b-dropdowna",js:true,content:[{elem:"switcher",tag:"span",content:{tag:"a",block:"b-link",mods:{pseudo:"yes","is-bem":"yes"},js:true,attrs:{href:b.I18N("b-domik","passport-link"),tabIndex:103}}},{block:"b-popupa",js:{zIndex:"1"},tag:"div",mix:[{block:"b-dropdowna",elem:"popup"},{block:"b-domik",elem:"social-popup",mods:{type:t}}],content:[{elem:"tail",tag:"i"},{elem:"content",content:[{elem:"providers",tag:"table",content:y(B)}]}]}]})}C.push({block:"b-spin",js:true,mods:{size:t=="bigform"?"45":"27",theme:t=="bigform"?"white-45":"white-27","is-bem":"yes"},content:{block:"b-icon",tag:"img",attrs:{src:"//yandex.st/lego/_/La6qi18Z8LwgnZdsAr1qy1GwCwo.gif"}}});return b.HTML.build(C)}function k(){s.css("height",s.height()).addClass("b-domik__social_loading_yes").find(".b-spin").bem("b-spin").setMod("progress","yes")}l.isHTTPSSupported=false;g.append(n).submit(function(){var y=g.attr("action");f.setMod("disabled","yes");n.val(+new Date);if(y){a.block["b-domik"].isHTTPSSupported?/^http:/.test(y)&&g.attr("action",y.replace(/^http:/,"https:")):/^https:/.test(y)&&g.attr("action",y.replace(/^https:/,"http:"))}});var q=g.find("input[name=login]"),p=g.find("input[name=passwd]"),r=g.find("input[type=submit]");q.change(function(){var y=q.val();y.indexOf("@")==-1&&!(/^[a-z0-9A-Z!@#\$%\^&\*\(\)_\-\+:;\,\.]*$/i.test(y))?h(v&&v.err_msg||b.I18N("b-domik","wrong-keyboard-layout")):o()});q.change();p.change(function(){var y=p.val();y.length&&!(/^[0-9a-zA-Z`!@#\$%\^&\*\(\)_=\-\+\[\]\{\}:;"\,\.<>\\|\/\?]*$/i.test(y))?h(b.I18N("b-domik","wrong-keyboard-layout")):o()});p.change();var i;function h(y){!i&&(i=d('<div class="b-domik__error"/>').insertAfter(g.find(".b-domik__password")));i.text(y).show()}function o(){i&&i.hide()}l.enableHTTPS=function(){l.isHTTPSSupported=true};l.checkForHTTPS=e.checkForHTTPS;e.checkForHTTPS(function(){l.enableHTTPS()})}})(jQuery,window.Lego,BEM);(function(a){BEM.DOM.decl("b-domik",{onSetMod:{js:function(){this.bindTo("input","keyup",this._onChange)}},_onChange:function(b){a(b.target).trigger("change")}})}(jQuery));(function(a){BEM.DOM.decl("b-dropdowna",{onSetMod:{js:function(){this._getSwitcher().on("click",this._toggle,this)},disabled:function(c,b){this._getSwitcher().setMod(c,b);b=="yes"&&this.getPopup().hide()}},_getSwitcher:function(){return this._switcher||(this._switcher=this.findBlockInside("b-"+(this.getMod(this.elem("switcher"),"type")||"link")))},_toggle:function(){this.getPopup().toggle(this.elem("switcher"))},getPopup:function(){return this._popup||(this._popup=this.findBlockInside("b-popupa")).on("outside-click",function(c,b){this._getSwitcher().containsDomElem(a(b.domEvent.target))&&c.preventDefault()},this)},destruct:function(){var b=this._popup;b&&b.destruct();this.__base.apply(this,arguments)}},{live:function(){this.liveInitOnEvent("switcher","leftclick",function(){})}})})(jQuery);BEM.HTML.decl("b-dropdowna",{onBlock:function(a){a.js(true)}});(function(b){var a=["down-right","down","down-left","up","up-right","up-left","right-down","right","right-up","left-down","left","left-up"];BEM.DOM.decl("b-popupa",{onSetMod:{js:function(){this._owner=null;this._isShowed=false;this._direction=this.getMod("direction")||"down";this._lastDirection=null;this._hasTail=!!this.elem("tail").length;if(!this._hasTail){Object.keys(this.params).forEach(function(c){(c.indexOf("tail")===0)&&(this.params[c]=0)},this)}}},show:function(c){if(!this._isShowed||this._owner!==c){this._owner=c;this._getUnder().show({left:-10000,top:-10000});this.pos();this._getUnder().setMod("animate","yes")}return this},hide:function(){this._isShowed&&this._getUnder().hide();return this},toggle:function(c){return this.isShowed()?this.hide():this.show(c)},_pos:function(){var c=this._calcParams(this._owner);this._hasTail&&this.elem("tail").css(c.tailOffsets);this.setMod("direction",c.direction)._getUnder().show(c.offsets);return this},pos:function(){if(!this._isShowed){return this}return this._pos()},isShowed:function(){return this._isShowed},setDirection:function(c){if(this._direction!=c){this._direction=c;this.isShowed()&&this.pos()}},setContent:function(c,e,d){BEM.DOM.update(this.elem("content"),c,e,d);return this.isShowed()?this.pos():this},_isOwnerNode:function(){return !!(this._owner&&this._owner.jquery)},_calcDimensions:function(){var i=this._getUnder().domElem,m=this._getUnder()._getUnder(),k=this.__self.win,f=this._owner,n=this._isOwnerNode(),l=n?f.offset():f,d=n?f.outerWidth():0,e=n?f.outerHeight():0,h=k.scrollLeft(),g=k.scrollTop(),j=this.__self.getWindowSize(),c=parseInt(this.elem("content").css("border-top-width"),10);return{ownerWidth:d,ownerHeight:e,ownerLeft:l.left,ownerTop:l.top,ownerRight:l.left+d,ownerBottom:l.top+e,ownerHorizMiddle:l.left+d/2,ownerVertMiddle:l.top+e/2,posWidth:i.outerWidth(),posHeight:i.outerHeight(),underWidth:m.outerWidth(),underHeight:m.outerHeight(),borderWidth:isNaN(c)?0:c,windowLeft:h,windowRight:h+j.width,windowTop:g,windowBottom:g+j.height}},_calcParams:function(){var i=this._calcDimensions();if(this.hasMod("adjustable","no")){return this.calcDirectionParams(this._direction,i)}var c={},f=this.params.directions,j=b.inArray(this._direction,f);j>-1||(j=0);var e=j,h,g;do{h=f[j];g=c[h]=this.calcDirectionParams(h,i);if(!g.factor){this._lastDirection=h;return g}++j==f.length&&(j=0)}while(j!==e);return c[this._lastDirection||f[0]]},calcDirectionParams:function(l,j){var k,g=this.params,f={top:0,left:0},i={marginLeft:0,marginTop:0},c=l.split("-")[0],e=(this._hasTail&&j.ownerWidth<g.tailWidthVertical)?(g.tailWidthVertical-j.ownerWidth)/2:0,h=(this._hasTail&&j.ownerHeight<g.tailHeightHorizontal)?(g.tailHeightHorizontal-j.ownerHeight)/2:0;switch(l){case"up":case"down":f.left=j.ownerHorizMiddle-j.posWidth/2;f.top=l=="down"?j.ownerBottom+g.tailHeightVertical:j.ownerTop-j.posHeight-g.tailHeightVertical;i.marginLeft=j.posWidth/2-g.tailWidthVertical/2;i.marginTop=l=="down"?0-g.tailHeightVertical:0;break;case"up-left":case"up-right":case"down-left":case"down-right":f.left=l=="down-right"||l=="up-right"?j.ownerLeft-e:j.ownerRight-j.posWidth+e;f.top=c=="down"?j.ownerBottom+g.tailHeightVertical:j.ownerTop-j.posHeight-g.tailHeightVertical;i.marginLeft=j.ownerWidth>j.posWidth?j.posWidth/2-g.tailWidthVertical/2:j.ownerHorizMiddle-f.left-g.tailWidthVertical/2;i.marginTop=c=="down"?j.borderWidth-g.tailHeightVertical:0-j.borderWidth;break;case"left-down":case"right-down":f.left=l=="left-down"?j.ownerLeft-j.posWidth-g.tailWidthHorizontal:j.ownerRight+g.tailWidthHorizontal;f.top=j.ownerTop-h;i.marginLeft=l=="left-down"?0-j.borderWidth:j.borderWidth-g.tailWidthHorizontal;i.marginTop=j.ownerHeight<j.posHeight?j.ownerVertMiddle-f.top-g.tailHeightHorizontal/2:j.posHeight/2-g.tailHeightHorizontal/2;break;case"left":case"right":f.left=l=="left"?j.ownerLeft-j.posWidth-g.tailWidthHorizontal:j.ownerRight+g.tailWidthHorizontal;f.top=j.ownerVertMiddle-j.posHeight/2;i.marginLeft=l=="left"?0-j.borderWidth:j.borderWidth-g.tailWidthHorizontal;i.marginTop=j.posHeight/2-g.tailHeightHorizontal/2;break;case"left-up":case"right-up":f.left=l=="left-up"?j.ownerLeft-j.posWidth-g.tailWidthHorizontal:j.ownerRight+g.tailWidthHorizontal;f.top=j.ownerBottom-j.posHeight+h;i.marginLeft=c=="left"?0-j.borderWidth:j.borderWidth-g.tailWidthHorizontal;i.marginTop=j.ownerHeight>j.posHeight?j.posHeight/2-g.tailHeightHorizontal/2:j.ownerVertMiddle-f.top-g.tailHeightHorizontal/2}k=this.calcInWindowFactor(f,j);return{direction:c,factor:k,offsets:f,tailOffsets:i}},calcInWindowFactor:function(f,e){var c=0;e.windowTop>f.top&&(c+=e.windowTop-f.top);f.top+e.underHeight>e.windowBottom&&(c+=f.top+e.underHeight-e.windowBottom);e.windowLeft>f.left&&(c+=e.windowLeft-f.left);f.left+e.underWidth>e.windowRight&&(c+=f.left+e.underWidth-e.windowRight);return c},getDefaultParams:function(){return{tailOffset:19,tailWidthHorizontal:9,tailWidthVertical:19,tailHeightHorizontal:19,tailHeightVertical:10,shadowSize:7,directions:a}},destruct:function(){var c=this._under;if(!c){this.__base.apply(this,arguments)}else{if(!this._destructing){this._destructing=true;this.hide();BEM.DOM.destruct(false,c.domElem);this.__base(true)}}},_getUnder:function(){if(!this._under){var c=b(BEM.HTML.build({block:"i-popup",zIndex:this.params.zIndex,mods:{autoclosable:this.getMod("autoclosable")||"yes",fixed:this.hasMod("direction","fixed")&&"yes"},underMods:this.params.underMods,underMix:[{block:"b-popupa",elem:"under"}]}));(this._under=this.findBlockOn(c,"i-popup")).on({show:this._onUnderShowed,hide:this._onUnderHidden,"outside-click":this._onUnderOutsideClicked},this).elem("content").append(this.domElem)}return this._under},_onUnderShowed:function(){this._isShowed=true;this.bindToWin("resize",this.pos)._isOwnerNode()&&this.bindToDomElem(this._owner.parents().add(this.__self.win),"scroll",this.pos);this.trigger("show")},_onUnderHidden:function(){this._isShowed=false;this.unbindFromWin("resize")._isOwnerNode()&&this.unbindFromDomElem(this._owner.parents().add(this.__self.win),"scroll");this.trigger("hide")},_onUnderOutsideClicked:function(){this.trigger.apply(this,arguments)}},{live:function(){this.liveBindTo("close","leftclick",function(){this.hide()})}});BEM.HTML.decl("b-popupa",{onBlock:function(c){var d=false;b.each(c.param("content"),function(e,f){return !(d=f.elem=="close")});c.mods({theme:"ffffff",direction:"down","has-close":d&&"yes"}).js(true).afterContent({elem:"shadow"})},onElem:{content:function(c){c.wrap({elem:"wrap-cell",tag:"td"}).wrap({tag:"tr"}).wrap({elem:"wrap",tag:"table"})},close:function(c){c.tag("i")},shadow:function(c){c.tag("i")},tail:function(c){c.tag("i").wrapContent({elem:"tail-i",tag:"i"})}}})})(jQuery);BEM.DOM.decl("b-popupa",{immediateHide:function(){if(this._isShowed){this._getUnder().delMod("animate").delMod("visibility")}return this},onSetMod:{overlapping:{yes:function(){this.afterCurrentEvent(function(){this._bindOnShowHide()})}}},_pos:function(){var a=this._calcParams(this._owner);if(this.elem("tail")){this.elem("tail").css(a.tailOffsets)}this.setMod("direction",a.direction)._getUnder().show(a.offsets);return this}});BEM.HTML.decl("b-dropdowna",{onElem:{switcher:function(a){a.tag("span")}}});(function(b,a){window.Lego||(window.Lego={block:{}});Lego.block["i-social"]=function(e){function g(l){var k=this,i={};this.url=l.startUrl+"?";delete l.startUrl;this.popupName=l.popupName;this.yaWindow=null;this.wTimer=null;this.paramsDefault=l;function n(){var o;if(!k.yaWindow){return true}try{o=k.yaWindow.closed}catch(p){o=true}return o}function m(){if(n()){k.wTimer=clearInterval(k.wTimer);k.onFailure({status:"error"})}}function h(x){var A=k.popupName,s=500,B=280,u=Math.round(((window.opera?window.innerWidth:screen.availWidth)-s)/2),y=Math.round(((window.opera?window.innerHeight:screen.availHeight)-B)/2),q="scrollbars=yes, resizable=1, menubar=0, toolbar=0, status=0, location=0, directories=0, left="+u+", top="+y+", width="+s+", height="+B;var t={};for(var w in k.paramsDefault){t[w]=k.paramsDefault[w]}for(var w in x){t[w]=x[w]}if(t.display&&t.display!="popup"){t.retpath=t.retnopopup||window.location.href}else{var z="ddom="+(t.ddom||(location.hostname==document.domain?"":document.domain));if("retnopopup" in t){delete t.retnopopup}t.retpath+=(t.retpath.match("#")?"&":"#")+z}var o=k.url;var r=[];for(var v in t){r.push(encodeURIComponent(v)+"="+encodeURIComponent(t[v]))}o+=r.join("&");if(t.display&&t.display!="popup"){window.location.href=o;return}k.yaWindow=window.open(o,A,q);k.yaWindow.focus();if(k.yaWindow){k.wTimer=setInterval(m,500)}}function j(){this.handlers={onSuccess:null,onFailure:null};k.wTimer=clearInterval(k.wTimer);n()||k.yaWindow.close();k.yaWindow=false}this.start=function(p,o,q){j();k.handlers={onSuccess:p,onFailure:o};h(q)};this.onSuccess=function(p){j();var o=k.handlers.onSuccess;o&&o.call(k,p)};this.onFailure=function(p){j();var o=k.handlers.onFailure;o&&o.call(k,p)}}arguments.callee.Broker=g;var f=a.param("id"),d=arguments.callee.defaultParams={startUrl:a.param("social-startUrl")||a.param("social-host")+"/broker/start",retpath:a.param("social-retpath")||location.protocol+"//"+location.host+a.param("lego-path")+"/blocks-common/i-social/closer/i-social__closer.html",retnopopup:a.param("social-retnopopup")||false,consumer:f||"morda",popupName:"social_"+(f||"morda"),application:"",action_if_anonymous:"authorize",result_location:"fragment"},c=arguments.callee.broker=new g(b.extend(d,e));return c}})(jQuery,BEM.blocks["i-global"]);BEM.DOM.decl("b-form-button",{onSetMod:{js:function(){var a=this.isDisabled();(this._href=this.domElem.attr("href"))&&a&&this.domElem.removeAttr("href");this.elem("input").attr("disabled",a)},focused:{yes:function(){var a=this;if(a.isDisabled()){return false}a.bindTo("keydown",this._onKeyDown).elem("input").is(":focus")||a.elem("input").focus();a._unloadInited||(a._unloadInited=$(window).bind("unload",function(){a.delMod("focused")}))},"":function(){this.unbindFrom("keydown").elem("input").blur()}},disabled:function(c,a){var b=a=="yes";this._href&&(b?this.domElem.removeAttr("href"):this.domElem.attr("href",this._href));b&&this.domElem.keyup();this.afterCurrentEvent(function(){this.domElem&&this.elem("input").attr("disabled",b)})},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")})},destruct:function(){this.delMod("focused");this.__base.apply(this,arguments)}},{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({size:a.mod("size"),theme:a.mod("theme")}).content([{elem:"left",tag:"i"},{elem:"content",tag:"span",content:{elem:"text",tag:"span",content:a.content()}}],true).afterContent(a.param("type")?{elem:"input",attrs:{value:a.param("value")||"",type:a.param("type"),name:a.param("name"),disabled:a.mod("disabled")&&"disabled"}}:{elem:"click"}).js(true)},onElem:{input:function(a){a.tag("input")},click:function(a){a.tag("i")}}});BEM.DOM.decl("b-fade",{onSetMod:{js:function(){var a=this,b=this.params.target?this.findBlockOutside(this.params.target):this;b.domElem.bind("mouseenter",function(){a.setMod("hovered","yes");clearTimeout(a.countdown)}).bind("mouseleave",function(){a.hide()});this._bindEventsOnPopups()}},hide:function(){var a=this;a.countdown=setTimeout(function(){a._hide()},200)},_bindEventsOnPopups:function(){var e=this._getDropdownas(),c,a=e.length,b=this,d=function(){clearTimeout(b.countdown)},f=function(){b.hide()};for(c=0;c<a;c++){e[c].getPopup().domElem.unbind("mouseenter.b-fade",d).unbind("mouseleave.b-fade",f).bind("mouseenter.b-fade",d).bind("mouseleave.b-fade",f)}},_getDropdownas:function(){if(!this.dropdownas||!this.dropdownas.length){this.dropdownas=this.findBlocksInside("b-dropdowna")||[]}return this.dropdownas},_hide:function(){var d=this._getDropdownas(),c,b,a=d.length;this.setMod("hovered","");for(var b=0;b<a;b++){d[b].getPopup().hide()}}});BEM.DOM.decl({name:"b-domik",modName:"type",modVal:"simple"},{onSetMod:{js:function(){this.__base.apply(this,arguments);Lego.block["b-domik"].call(this.domElem,this.params);this.domElem.submit(function(){var a=1;$(".b-domik .b-form-input__input").each(function(){if(this.value.replace(/\s/g,"")!==""){a=0}});if(a){window.location=Lego.params.mailHost;return false}})}}});BEM.DOM.decl("b-topbar",{onSetMod:{js:function(){this.urls=BEM.DOM.extractParams(this.domElem[0])["b-topbar"];this._bindToggle();this.popup=this._createPopup();this._bindAutoclose();if(this.getMod("expanded")==="yes"){this.state=1;this._show()}},expanded:{"":function(){this._switchCounters(this.domElem,".big.",".small.");this._switchCounters($(".b-popupa_overlapping_yes"),".big.",".small.");this._switchCounters($(".b-topbar__area"),".big",".small")},yes:function(){this._switchCounters(this.domElem,".small.",".big.");this._switchCounters($(".b-popupa_overlapping_yes"),".small.",".big.");this._switchCounters($(".b-topbar__area"),".small",".big")}}},_switchCounters:function(a,c,b){a.find(".b-link").each(function(){var d=$(this).attr("onmousedown");if(d){$(this).attr("onmousedown",d.replace(c,b))}})},_createPopup:function(){var a=$(BEM.HTML.build({block:"b-popupa",mods:{theme:"gradient",autoclosable:"no",behavior:"snap",adjustable:"no",calm:"yes",direction:"down-right"},mix:[{block:"b-topbar",elem:"popup"}],js:{zIndex:-31700},content:[{elem:"tail"},{elem:"content",mods:{padded:"no"}}]}));a=this.findBlockOn(a,"b-popupa");a.elem("content").append($(".b-topbar__popup .b-popupa__content > *"));a.on({"outside-click":function(c,b){c.preventDefault()}},this);return a},_bindAutoclose:function(){var a=this,b;$(window).bind("popupopen.lego",function(){clearTimeout(b);a.popup.hide()}).bind("popupclose.lego",function(){clearTimeout(b);b=setTimeout(function(){a.state&&a.popup.show(a._getSwitcher())},50)}).bind("popupredraw.lego keyboardOpened.lego keyboardClosed",function(){if(a.state){a.popup.pos()}})},_bindToggle:function(){var b=this.findBlocksInside($(".b-topbar__toggler"),"b-link");for(var a=0;a<b.length;a++){b[a].on("click",this._toggle,this)}},_show:function(){this.setMod("expanded","yes");this._save(1);var a=this._getSwitcher();this.popup.show(a)},_hide:function(){this.delMod("expanded");this._save(0);this.popup.hide()},_getSwitcher:function(){if(!this.switcher){this.switcher=$(".b-topbar__switcher")}return this.switcher},_toggle:function(){if(this.popup.isShowed()){this._hide()}else{this._show()}},_save:function(b){if(this.state===b){return}this.state=b;var a=$(".b-topbar__frame");if(!a.length){a=$('<iframe class="b-topbar__frame" style="display:none"></iframe>');$(document.body).append(a)}a.attr("src",this.urls[(b?"open":"close")])}});BEM.DOM.decl({block:"b-popupa",modName:"overlapping",modVal:"yes"},{onSetMod:{js:function(){this._bindOnShowHide()}},_bindOnShowHide:function(){this.on({show:function(){this._dispatch("open")},hide:function(){this._dispatch("close")}})},_dispatch:function(a){$(window).trigger("popup"+a+".lego")}});BEM.DOM.decl({block:"b-popupa",modName:"calm",modVal:"yes"},{_pos:function(){var a=this._calcDimensions();if(!this._ownerPos||Math.abs(a.ownerHorizMiddle-this._ownerPos.ownerHorizMiddle)>5||Math.abs(a.ownerVertMiddle-this._ownerPos.ownerVertMiddle)>5){this._ownerPos=a;this.__base.apply(this,arguments);this._underOffset=this._getUnder().domElem.offset();return this}this._getUnder().show(this._underOffset);return this}});BEM.decl("i-user-services",{},{get:function(a){this._data?a(this._data):this._get(a)},getApiUrl:function(){return BEM.blocks["i-global"].param("pass-host")+"/services?callback=?"},_callbacks:[],_get:function(a){var b=this;b._callbacks.push(a);b._callbacks.length==1&&$.getJSON(b.getApiUrl(),{locale:BEM.blocks["i-global"].param("lang"),login:"yes","current-login":BEM.blocks["i-global"].param("login"),yu:$.cookie("yandexuid")},function(c){b._data=c;$.each(b._callbacks,function(){this(c)});b._callbacks.length=0})}});(function(d,a,b,c){b.DOM.decl("b-head-user",{onSetMod:{js:function(){var e=this;this._maxLength=parseInt(this.params.maxlength,10);this._maxLengthRel=parseInt(this.params["maxlength-relative"],10);if(c.param("login")!==""||c.param("displayName")){b.blocks["i-user-services"].get(function(f){e.buildHtml(f)})}}},getDefaultParams:function(){return{maxlength:20,"maxlength-relative":3}},getUserItems:function(g){var f=g.displayName&&g.displayName.social?[{name:b.I18N("b-head-user","profiles"),url:c.param("social-host")}]:[{name:b.I18N("b-head-user","passport"),url:c.param("passport-host")+"/passport?mode=passport"},{name:b.I18N("b-head-user","change-password"),url:c.param("passport-host")+"/passport?mode=changepass&retpath="+encodeURIComponent(c.param("retpath"))+"/"}];var e="";d.each(f,function(j,h){e+='<li class="b-menu__layout-vert-cell'+(j==f.length-1?" b-menu__layout-vert-cell_position_last":"")+'"><div class="b-menu__item"><a class="b-link b-head-user__link" href="'+h.url+'">'+h.name+"</a></div></li>"});return e},buildHtml:function(i){if(!i||!i.services){return}var k=this,f=i.displayName&&i.displayName.social,m=b.blocks["i-common__string"].cleverSubstring(d("<div/>").text(k.getUserLogin(i)).html(),k._maxLength,k._maxLengthRel),h=this.findBlocksOn("i-ctr")&&c.param("show-counters"),g,l,e="",j;g=f?'<b class="b-user b-user_social_yes"><span class="b-user__provider-ico" style="background:url(//static.yandex.st/social/current/icons/16/'+f.provider+'.png)"></span>'+m+"</b>":'<b class="b-user"><b class="b-user__first-letter">'+m.substring(0,1)+"</b>"+m.substring(1)+"</b>";if(k.params.href){e=k.params.href}else{if(f){e=c.param("social-host")}else{if(/\.com(.tr)?$/.test(location.hostname)){e=c.param("passport-host")}else{e=c.param("i-host")||"https://i.yandex.ru"}}}l='<a class="b-link b-link_pseudo_yes '+(h?"i-ctr i-ctr_click_b-link ":"")+"i-bem\" onclick=\"return {'b-link':{}"+(h?",'i-ctr':{stat:'head-login'}":"")+'}"'+(!f&&k.hasMod("type","com")?"":' href="'+e+'"')+'><span class="b-link__inner">'+g+"</span></a>";j='<div class="b-dropdowna b-dropdowna i-bem" onclick="return {\'b-dropdowna\':{}}"><span class="b-dropdowna__switcher">'+l+'</span><div class="i-popup i-popup_autoclosable_yes i-popup i-bem" onclick="return {\'i-popup\':{}}"><div class="i-popup__content"><div class="i-popup__under b-popupa__under"></div><div class="b-popupa b-popupa_theme_ffffff b-popupa_direction_down i-bem b-dropdowna__popup" onclick="return {\'b-popupa\':{}}"><i class="b-popupa__shadow"></i><i class="b-popupa__tail"><i class="b-popupa__tail-i"></i></i><table cellpadding="0" cellspasing="0" class="b-popupa__wrap"><tr><td class="b-popupa__wrap-cell"><div class="b-popupa__content"><div class="b-menu b-menu_layout_vert b-dropdowna__menu"><ul class="b-menu__layout-vert">';f&&k.setMod("social","yes");d.each(i.services,function(n){j+='<li class="b-menu__layout-vert-cell'+(n===0?" b-menu__layout-vert-cell_position_first":"")+'"><div class="b-menu__item">';if(c.param("id")==this.id&&c.param("index")){j+="<strong>"+this.title+"</strong>"}else{j+='<a class="b-link b-head-user__link" href="'+this.url+'" onmousedown="Lego.ch(\''+c.param("id")+".login.myservices."+this.id+"',this)\">"+this.title+"</a>"}j+="</div></li>"});if(i.services.length){j+='<li class="b-menu__layout-vert-separator"><i class="b-menu__separator"></i></li>'}j+=k.getUserItems(i);j+="</ul></div></div></td></tr></table></div></div></div></div>";b.DOM.update(k.findBlockInside("b-user").domElem,j)},getUserLogin:function(f){var e=c.param("displayName");return e&&e.social&&e.name||f.displayName&&f.displayName.name||c.param("login")||f.login}})})(jQuery,window.Lego,BEM,BEM.blocks["i-global"]);(function(){var a=[];function b(){Lego.c("lego-ctr/p=show("+d(f())+")");a=[]}function e(h){var g=h.split("-");return g.join("(")+new Array(g.length).join(")")}function f(){var g=[];for(var m=0,n=a.length;m<n;m++){var p=a[m].split("-"),l=g;for(var k=0,o=p.length-1;k<o;k++){var h=p[k];if(!l[h]){l[h]=[];l.push(h)}l=l[h]}l.push(p[p.length-1])}return g}function d(h){var g="",m=[],j=[];for(var l=0;l<h.length;l++){var k=h[l];h[k]?m.push(k+"("+d(h[k])+")"):j.push(k)}m.length&&j.push(m.join(""));return j.join(",")}function c(g){var h="-"+BEM.blocks["i-global"].param("id");return g.indexOf(h,g.length-h.length)===-1?g+=h:g}BEM.DOM.decl("i-ctr",{onSetMod:{js:function(){this.setupShow();this.setupClick()}},setupShow:function(){var g=c(this.params.stat);a.push(g);a.length==1&&this.afterCurrentEvent(function(){b()})},setupClick:function(){var g=this.getMod("click");g?this.findBlockOn(g).on("click",function(){this.sendClick()},this):this.bindTo("mousedown",this.sendClick)},sendClick:function(g){Lego.c("lego-ctr/p=click("+e(c(this.params.stat))+")",g&&g.target&&g.target.tagName.toUpperCase()==="A"&&g.target)}})})();BEM.DOM.decl({block:"b-head-user",modName:"overlapping",modVal:"yes"},{onSetMod:{js:function(){var b=this.buildHtml||null,a=this;if(b){this.buildHtml=function(d){b.apply(this,arguments);var c=a.findBlockInside("b-popupa");c.setMod("overlapping","yes");BEM.DOM.init(c.domElem)};this.__base.apply(this,arguments)}}}});(function(){var a=function(){this.serverDate=null;this.prevDay=null;this.loadDate=null;this.parent=null;this.placeHolders={date:null,day:null,month:null,wday:null,time:null,h:null,m:null};this.flicker={timePH:null,init:function(b){this.timePH=b},blink:function(){$(this.timePH).toggleClass("hT")}};this.timeTemplate=null};a.prototype._norm=function(b){return(b>9)?(""+b):("0"+b)};a.prototype.iterate=function(){var c=new Date(),b=new Date(this.serverDate.getTime()+(c.getTime()-this.loadDate.getTime())),d=b.getDay();if((b.getHours()===0)&&(b.getMinutes()===0)){if(this.prevDay!=d){if(this.placeHolders.date.length>0){this.placeHolders.date.replaceWith(this.timeTemplate({title:"",day:b.getDate(),month:this.locale.month[b.getMonth()],wday:this.locale.week[d]}));this.placeHolders.date=$(".b-datetime__date",this.parent)}this.prevDay=d;$(window).trigger({type:"morda.nextDay",date:b.getDate(),month:this.locale.month[b.getMonth()],wday:this.locale.week[d],monthServer:b.getMonth(),day:d})}}this.placeHolders.h.html(this._norm(b.getHours()));this.placeHolders.m.html(this._norm(b.getMinutes()))};a.prototype.init=function(d,c){if(c){this.parent=c;if($(this.parent).hasClass("b-datetime__inited")){return}else{$(this.parent).addClass("b-datetime__inited")}this.serverDate=new Date(d);this.loadDate=new Date();this.timeTemplate=ya.template(this.infoDate);if(this.serverDate&&this.serverDate!="Invalid Date"&&!isNaN(this.serverDate)){this.placeHolders.date=$(".b-datetime__date",c);this.placeHolders.day=$(".b-datetime__day",c);this.placeHolders.month=$(".b-datetime__month",c);this.placeHolders.wday=$(".b-datetime__wday",c);this.placeHolders.time=$(".b-datetime__time",c);this.placeHolders.h=$("span:first",this.placeHolders.time);this.placeHolders.m=$("span:last",this.placeHolders.time);this.flicker.init(this.placeHolders.time);this.iterate();var b=this;setInterval(function(){b.iterate();b.flicker.blink()},1000)}else{this.timePH.style.display="none"}}};window.MordaClock=a})();(function(){var a=true;if($.browser.msie){$(document).bind("focusin",function(){a=true});$(document).bind("focusout",function(){a=false})}else{$(window).focus(function(){a=true});$(window).blur(function(){a=false})}$(document).ready(function(){if(!window.teaserId){return}var f=$("#"+window.teaserId);if(!f.length){return}f=f[0];var e=f.src,b=0,d=60*1000,c=setTimeout(function(){if(b<600){if(a){f.src=e+"?rnd="+ya.uid();b++;setTimeout(arguments.callee,d)}else{if($.browser.msie){$(document).one("focusin",arguments.callee)}else{$(window).one("focus",arguments.callee)}}}else{clearTimeout(c)}},d)})})();function tabs(b,i,l,g){var e="b-tabs",h="b-tabs__selected",j="b-tabs__notselected",f="b-tabs__names",d="b-tabs__items",a="i-hidden";if($(i).parent().is("."+h)){csh_ifmsid(l+".link",i);return true}var k=$(i).closest("."+e);$("ul."+f+" > li",k).removeClass(h).addClass(j);$(i).closest("li").removeClass(j).addClass(h);$("div."+d+" > div",k).addClass(a);$("#"+b).removeClass(a);csh_ifmsid(l+".select");i.blur();if(g){var c=$(".b-tabs__frame");if(!c.length){c=$('<iframe class="b-tabs__frame" style="display:none"></iframe>');$(document.body).append(c)}c.attr("src",g)}return false}var XivaData={};var ws=null;WEB_SOCKET_DEBUG=false;var withReconnect=true;var xivaDialer=function(){var a=0,b=false;return{next:function(){a++;if(b){b=false}if(a<=5){setTimeout(initxiva,3000)}else{if(a<=15){setTimeout(initxiva,10000)}else{setTimeout(initxiva,60000)}}},stop:function(){b=true;setTimeout(function(){if(b){a=0}},5000)}}}();function XivaAdd(d,c){var b=Widget.Framework.get(d);if(b&&b.params.rebind==""){return}if(!XivaData[d]){XivaData[d]=[];XivaData[d].push(c)}else{var a=XivaData[d];if(a.join(",").indexOf(c)==-1){XivaData[d].push(c)}}if(window.ws&&"close" in window.ws){ws.close()}}function XivaRemove(a){delete XivaData[a];window.ws&&"close" in window.ws&&ws.close()}function XivaChannels(){var a="";for(var b in XivaData){if(a.length){a=a+","}a=a+XivaData[b].join(",")}return a}function XivaUpdate(c){var a=c.ch+"_"+c.key+":";for(var j in XivaData){var g=XivaData[j];if(g){if(g.join(",").indexOf(a)>-1){var f=g.length;var h=[];for(var d=0;d<f;d++){var b=g[d].split(":")[1];if(b>=c.ts){h[h.length]=g[d]}}XivaData[j]=h;var e=Widget.Framework.get(j);e&&e.iReload(function(){ws.close()});break}}}}function closeXivaConnection(a){withReconnect=a;window.ws&&"close" in window.ws&&ws.close()}function initxiva(){if("WebSocket" in window){WEB_SOCKET_SWF_LOCATION="WebSocketMain.swf";WebSocket.__swfLocation="WebSocketMain.swf";withReconnect=true;var channels=XivaChannels();for(var wid in XivaData){var widget=Widget.Framework.get(wid);widget&&widget.stopAutoReload()}if(channels){var wsurl="ws://"+XivaUrl+"/?id=www&channels="+encodeURIComponent(channels);ws=new WebSocket(wsurl);ws.onopen=function(){ws.send("ping");xivaDialer.stop()};ws.onmessage=function(e){var message=$.trim(e.data);if(message!="ping"){try{eval(message)}catch(e){}}};ws.onclose=function(){withReconnect&&xivaDialer.next()}}}}var posRegionHint,initRegionHint;(function(c){var b,d=false;function a(f){var e;d=true;e=f.bem("b-popupa");e.show(b)}window.initRegionHint=function(f,h){var k=c(".b-region__hint"),g=c(h),e=c(f),j=k.find(".b-region__hint__header")[0],i=j?j.onclick():{};if(k.length>0){setTimeout(function(){var l;if(i.ispopup=="1"){b=e;if(b.length===0){return false}a(k)}else{b=g;if(b.length===0){return false}}l=function(m){a(k)};b.click(l);c(document).keydown(function(m){if(m.keyCode=="27"){k.bem("b-popupa").hide()}});k.bem("b-popupa").on("hide",function(){d=false});if(i.ispopup=="1"){k.bem("b-popupa").on("hide",function(){b.unbind("click",l)})}c(window).resize(function(){setTimeout(function(){if(d){k.bem("b-popupa")._isShowed=false;k.bem("b-popupa").show(b);d=true;try{document.body.focus()}catch(m){}}},142)});c(".b-region__ajax-action").click(function(){c(document.body).append('<iframe style="display:none" src="'+this.href+'"></iframe>');k.bem("b-popupa").hide();return false})},1000)}}})(jQuery);BEM.DOM.decl("b-morda-search",{onSetMod:{js:function(){var a=this;this.input=this.findBlockInside("b-form-input");this.form=this.domElem.find("form");this._bindHeatDNS();this._bindEmptyInputClickCounter();this._initSearchSample();this._initSearchSampleBro();if(!this.input.hasMod("suggest","yes")){return}this._initNahStat();this.input.on("select",function(c,b){b.item.params.cgi&&b.item.params.cgi.forEach(function(d){(d instanceof Array&&d.length>1)&&BEM.DOM.append(a.form,BEM.HTML.build({block:"b-search",elem:"hidden",tag:"input",attrs:{type:"hidden",name:d[0],value:d[1]}}))});if(!b.item.hasMod("type","nav")){a.form.submit()}})}},_bindHeatDNS:function(){},_bindEmptyInputClickCounter:function(){var a=this.input;function b(c){if(!a.val()&&c&&(c.clientX||c.clientY)){Lego.cp(132,71618)}}a.bindTo("click",b)},_initSearchSample:function(){var c=this.findBlockInside("sample","b-link"),b=this.input,a=this;if(c){c.bindTo("click",function(f){b._preventRequest=true;b.val(a.params.text||$(f.target).text()).setMod("focused","yes");b._preventRequest=false;var d=a.domElem.find("input[name='nl']");if(a.params.nl&&!d.length){d=$('<input type="hidden" name="nl" value="1"/>').insertAfter(b.domElem)}return false})}},_initSearchSampleBro:function(){var f=this.findBlockInside("b-morda-search__sample-browser"),c=this.input,b=this,d=["yeni Yandex Browser","hızlı Yandex Browser","güvenli Yandex Browser","Yandex Browser indir","site çevirisi Yandex Browser'da"],a=["новый Яндекс Браузер","быстрый Яндекс Браузер","безопасный Яндекс Браузер","скачать Яндекс Браузер","переводчик сайтов в Яндекс Браузере"],e;if(f){f.bindTo("click",function(h){e=Math.floor(Math.random()*5);c._preventRequest=true;c.val(d[e]||"новый Яндекс Браузер").setMod("focused","yes");c._preventRequest=false;var g=b.domElem.find("input[name='nl']");if(b.params.nl&&!g.length){g=$('<input type="hidden" name="nl" value="1"/>').insertAfter(c.domElem)}return false})}},_initNahStat:function(){var d=this._resetSuggestStats(),c=new Date(),f="",e=0,h,g,b=this;this.input.on({select:function(j,i){d.usageType=i.byKeyboard?"keyboard":"mouse";(i.item.hasMod("type","nah")||i.item.hasMod("type","href"))&&(d.nah="nah_used");if(i.item.hasMod("type","nav")){b._submitStats()}},"data-requested":function(){c=new Date()},"data-received":function(l,k){var j=k.metainfo;if(j){d.region=j.r;d.exprt=j.exprt;j.personal=j.pers_options||j.n}if(c){d.times.push(new Date()-c)}var i=(j.personal==1);i||$.each(k.items,function(){return !(i=this[0]=="nah")});i&&d.nah!="nah_used"&&(d.nah="nah_not_used")},"update-items":function(){d.usageType!="edit"&&(d.usageType="not_used")},change:function(j,i){d._submited=false;d.ratio.userActions++;if(i&&i.source=="autocomplete"){d.usageType="suggest";d.position=i.itemIndex+1}else{d.usageType=="suggest"&&(d.usageType="edit");i&&i.source||(d.user_input=encodeURIComponent(j.block.val()))}}}).bindTo("keyup click",function(i){switch(i.keyCode){case 38:case 40:case 27:break;default:h=this.val();g=b.input.getSelectionEnd();if(f!=h||e!=g){([37,39].indexOf(i.keyCode)!=-1||i.type=="click")&&this.trigger("change");d.endTime=new Date().getTime();d.startTime||(d.startTime=d.endTime);d.pos=g;f=h;e=g}break}});this.findBlockInside("button","b-form-button").domElem.bind("click",function(i){d.buttonByMouse="button_by_mouse"});var a=function(i){if(!b._suggestStats._submited){i.preventDefault()||b._submitStats(function(){b.form.unbind("submit",a).submit().bind("submit",a)});return false}else{b.form.unbind("submit",a)}};b.form.bind("submit",a);this.input.hasMod("tap-ahead","yes")&&this.input.on("ahead-fill",function(j,i){d.aheadKey=i.usage;d.chars=i.chars})},_resetSuggestStats:function(){this._suggestStats=this._suggestStats||{};$.extend(this._suggestStats,{suggestType:this.input.params.suggestType||Lego.params.id,usageType:"not_shown",region:"",nah:"nah_not_shown",buttonByMouse:"",position:0,pos:0,startTime:0,endTime:0,session:(new Date().getTime()+Math.round(Math.random()*10000)),times:[],user_input:"",_submited:true,ratio:{userValue:0,finalValue:0,userActions:0}});return this._suggestStats},_submitStats:function(d){var b=this._suggestStats;b.text=encodeURIComponent(this.input.val());b.ratio.userValue=b.user_input.length;b.ratio.finalValue=b.text.length;var e=["session","region","times","pos","text","user_input","ratio","chars"];b.exprt&&e.push("exprt");var c=BEM.create("i-statface",{pid:0,cid:2873,url:"http://ya.ru",keys:["suggestType","usageType","position","nah","buttonByMouse","aheadKey"],customKeys:e});var f={};$.each(b,function(g,i){if(i==undefined){return}if(typeof i=="object"){if(!$.isArray(i)){var h=[];$.each(i,function(j,k){h.push(k)});i=h}f[g]=i.join(".")}else{f[g]=i}});f.position="p"+f.position;var a=new Date().getTime();b.startTime&&(e.push("since_first_change"),f.since_first_change=(a-b.startTime));b.endTime&&(e.push("since_last_change"),f.since_last_change=(a-b.endTime));c.set(f).send(d);this._resetSuggestStats();return this}});(function(){function a(c){var b=$(".b-etrains__track",c),d=$(".b-etrains__direction",c);if(d.length>1){d.unbind("click").click(function(){b.toggleClass("i-hidden");var e=this.parentNode.onclick();if(e&&e.stat){csh_ifmsid(e.stat)}})}$(".b-etrains__track_time",c).unbind("mouseover").mouseover(function(){var e=this.onclick().id;$("#"+e).removeClass("i-hidden")}).unbind("mouseout").mouseout(function(){var e=this.onclick().id;$("#"+e).addClass("i-hidden")})}window.initEtrains=a})();(function(){var a;$(function(){a=$(".b-disaster-popup");a.find(".b-disaster-content").each(function(){var c=this.onclick()||{};c=c.content||"";$(this).replaceWith(c)})});function b(c){$(".b-pseudo-link",c).click(function(d){if(a){a.bem("b-popupa").show($(this))}return false})}window.initDisasterPopup=b})();BEM.DOM.decl({name:"i-flashcookie",modName:"type",modVal:"inline"},{onSetMod:{js:function(){Lego.block["i-flashcookie"].call(this.domElem,this.params)}}});(function(){var a=Lego.block["i-flashcookie"],b=function(c){c||(c={});var d=c.host||"kiks.yandex";function j(R,S){return'<param name="'+R+'" value="'+S+'" />'}function J(R,S){return" "+R+'="'+S+'"'}var I=window,h=document,o=navigator,H=o.userAgent,w=o.mimeTypes,P=9,z=H&&(/gecko/i).test(H),A=H&&(/MSIE/).test(H)&&(/Win/).test(H),l=z?"embed":"object",r="//"+d.split(".").slice(0,-1).join(".")+".%s/system/fc%d.html",M="//"+d+".ru/system/%s%d.swf",N="http://"+d+".ru/fu",q="//"+d+".ru/fu",m="application/x-shockwave-flash",O="style",k="position:absolute;margin-left:-999em;top:0;",u=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"',v="allowScriptAccess",K="always",x="height",D="wmode",p="window",e="width",t="bgcolor",Q="#FFFFFF",s="ya_fc",G=J(O,k)+J(e,1)+J(x,1)+J("id",s),B=false;var y,i,n,f;I.ya_fc_external=function(U,aa,S,T){y=U;i=aa;n=S;f=T||"fc";var W=(w&&w[m])?w[m].enabledPlugin:0,Z=B,Y=0,R=E()?M.replace("%d",i).replace("%s",f):N.replace("%s",L()),V;if(W){Y=W.description.split("Shockwave Flash ")[1];Z=(parseInt(Y,10)>=P)}else{if(A){Z=B;try{Z=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+P)}catch(X){}}}if(Z){if(z){V='<div style="'+k+'"><'+l+G+J("src",R)+J(D,p)+J(t,Q)+J(v,K)+J("type",m)+"/></div>"}else{V=(A?"<"+l+u+G+">"+j("movie",R):"<"+l+G+J("type",m)+J("data",R)+">")+j(D,p)+j(t,Q)+j(v,K)+"</"+l+">"}}else{V='<img src="'+q.replace("%s",L())+'" style="'+k+'" />'}return V};I.ya_fc_requestData=function(){var R=h.getElementById("ya_fc");try{R.setLocation(L(),E())}catch(S){}};I.ya_fc_setCookie=function(S){var R=new Date();R.setTime(R.getTime()+315360000000);h.cookie="fuid"+n+"="+S+";expires="+R.toGMTString()+";path=/;domain="+L()};I.ya_fc_getIFrame=function(U){var V=r.replace("%s",U).replace("%d",y),T=h.createElement("iframe"),R=h.getElementsByTagName("body")[0],S="40px;";T.src=V;T.style.cssText=e+S+x+S+"border:0;"+k;T.frameBorder=0;R&&R.insertBefore(T,R.firstChild)};function C(T,S,U){var R=T.match(S);return R&&R[U+1?U:1]||""}function E(){return C(h.cookie,new RegExp("fuid"+n+"=([^;]+)"))}function L(){var R=h.domain;return R&&C(R,/[^.]+\.[^.]{2,3}(\.tr)?$/,0)}var g=this,F=arguments.callee.load=function(T){var R,S;if(T.mode){R="00";S="kfc"}else{R="07"}location.protocol.indexOf("https")<0&&g.replaceWith(I.ya_fc_external("07_2",R,"01",S))};g.hasClass("i-flashcookie_autoload_no")||F(c)};Lego.block["i-flashcookie"]=function(d){var c=this.hasClass("i-flashcookie_type_inline")?b:a;c&&c.call(this,d)}})();BEM.DOM.decl("b-keyboard-loader",{onSetMod:{js:function(){Lego.block["b-keyboard-loader"].call(this.domElem,this.params)}}});
  /*!jeanny-ignore*/
  (function(b,a){a.block["b-keyboard-loader"]=function(g){var i=b(document.body),e=b(window),j=this,l;j.click(function(t){t.preventDefault();var s=b(this),q=(this.className.match(/b-keyboard-loader_lang_(\w+)/)||["",""])[1];if(!i.find(".b-keyboard")[0]){var r=BEM.blocks["i-global"].param("lego-static-host"),u=r+(r.charAt(r.length-1)==="/"?"":"/")+"blocks-desktop/",p=[u+"b-keyboard/_keyboard.js"],o=b.browser.msie&&((!document.documentMode)||(document.documentMode<9))?".ie":"",n=[u+"b-keyboard/_keyboard"+o+".css"];s.append('<i class="b-keyboard-loader__progress"/>');b.xLazyLoader({name:"b-keyboard",js:p,css:n,success:function(){a.block["b-keyboard-popup"]({lang:q,"for":g["for"]});i.append("<div class=\"b-keyboard i-bem\" onclick=\"return {'b-keyboard': { lang:'"+q+"'}};\"></div>");BEM.DOM.init(b(".b-keyboard"));s.find(".b-keyboard-loader__progress").remove();e.trigger("keyboardOpened.lego",{afterLoad:true})}})}else{h()}});function h(o){var q=o?"addClass":"toggleClass",p=i.find(".b-keyboard-popup"),n=a.block["b-keyboard"]._lastFocusedIn;if(p.length){i.find(".b-keyboard-popup__gap")[q]("i-hidden");if(i.find(".b-keyboard-popup")[q]("i-hidden").hasClass("i-hidden")){e.trigger("keyboardClosed");b(document).trigger("popupsClose.lego");if(n){n.focus()}}else{e.trigger("keyboardOpened.lego")}p.data("isHidden",false)}}e.bind("keyboardOpen.lego",function(){j.click()}).bind("keyboardClose.lego",h);g["for"]&&e.bind("keyboardOpened.lego",function(o,n){!(n&&n.afterLoad&&g.autoLoad)&&b(g["for"]).focus()});e.bind("keyboardLangChanged.lego keyboardSetLang.lego",function(o,p){var n=j.find(".b-keyboard-loader__flag");if(n[0]){if(p==="tt"){p="ru"}n.attr("src",n.attr("src").replace(/[a-z]+\.png$/,p+".png"))}});g.storeState=g.storeState!==false;if(g.storeState){e.bind("keyboardOpened.lego",function(){k("keyboard_state","open");var n=c("keyboard_lang");if(n){b(window).trigger("keyboardSetLang.lego",n)}}).bind("keyboardClosed.lego",function(){k("keyboard_state","close")}).bind("keyboardLangChanged.lego",function(n,o){k("keyboard_lang",o)})}(g.autoLoad=g.autoLoad||(g.storeState&&c("keyboard_state")=="open"))&&j.click();var m;function f(){if(m){return}a.cp(0,70873,BEM.blocks["i-global"].param("id")+"."+(g.autoLoad?"auto":"manual"));m=true}e.bind("keyboardOpened.lego",function(){f();b("input:focus").focus()});function c(n){return d()[n]}function d(){var n={};b.each(window.name.split("&"),function(){if(this.toString()){var o=this.split("=");n[o[0]]=o[1]}});return n}function k(n,p){var o=d(),q=[];o[n]=p;b.each(o,function(r,s){q.push(r+"="+s)});window.name=q.join("&")}}})(jQuery,window.Lego);(function(b){b.xLazyLoader=function(e,d){if(typeof e=="object"){d=e;e="init"}new c()[e](d)};b.xLazyLoader.defaults={js:[],css:[],img:[],name:null,timeout:20000,success:function(){},error:function(){},complete:function(){},each:function(){}};var a=document.getElementsByTagName("head")[0];function c(){var m=this,o,i=[],k=[],j,d,f,e=[];this.init=function(p){if(!p){return}o=b.extend({},b.xLazyLoader.defaults,p);f={js:o.js,css:o.css,img:o.img};b.each(f,function(q,r){if(typeof r=="string"){r=r.split(",")}e=e.concat(r)});if(!e.length){h("error");return}if(o.timeout){j=setTimeout(function(){var q=i.concat(k);b.each(e,function(s,r){b.inArray(r,q)==-1&&k.push(r)});h("error")},o.timeout)}b.each(f,function(q,r){if(b.isArray(r)){b.each(r,function(t,s){l(q,s)})}else{if(typeof r=="string"){l(q,r)}}})};this.js=function(u,v,q){var t=b('script[src*="'+u+'"]');if(t.length){t.attr("pending")?t.bind("scriptload",v):v();return}var r=document.createElement("script");r.setAttribute("type","text/javascript");r.setAttribute("charset","utf-8");r.setAttribute("src",u);r.setAttribute("pending",1);r.onerror=n;b(r).bind("scriptload",function(){b(this).removeAttr("pending");v();setTimeout(function(){b(r).unbind("scriptload")},10)});var p=false;r.onload=r.onreadystatechange=function(){if(!p&&(!this.readyState||/loaded|complete/.test(this.readyState))){p=true;r.onload=r.onreadystatechange=null;b(r).trigger("scriptload")}};a.appendChild(r)};this.css=function(p,s,q){if(b('link[href*="'+p+'"]').length){s();return}var r=document.createElement("link");r.setAttribute("type","text/css");r.setAttribute("rel","stylesheet");r.setAttribute("href",p);if(b.browser.msie){r.onreadystatechange=function(){/loaded|complete/.test(r.readyState)&&s()}}else{if(b.browser.opera){r.onload=s}else{(function(){if(r&&r.sheet){s()}else{d=setTimeout(arguments.callee,20)}})()}}a.appendChild(r)};this.img=function(q,r){var p=new Image();p.onload=r;p.onerror=n;p.src=q};this.disable=function(p){b("#lazy-loaded-"+p,a).attr("disabled","disabled")};this.enable=function(p){b("#lazy-loaded-"+p,a).removeAttr("disabled")};this.destroy=function(p){b("#lazy-loaded-"+p,a).remove()};function l(q,p){m[q](p,function(r){r=="error"?k.push(p):i.push(p)&&o.each(p);g()},"lazy-loaded-"+(o.name?o.name:new Date().getTime()))}function h(p){o.complete(p,i,k);o[p](p=="error"?k:i);clearTimeout(j);clearTimeout(d)}function g(){if(i.length==e.length){h("success")}else{if(i.length+k.length==e.length){h("error")}}}function n(){k.push(this.src);g()}}})(jQuery);
  /*!jeanny-ignore*/
  BEM.DOM.decl("b-keyboard-loader",{onSetMod:{js:function(){Lego.block["b-keyboard-loader"].call(this.domElem,this.params)}}});
  /*!jeanny-ignore*/
  (function(b,a){a.block["b-keyboard-loader"]=function(g){var i=b(document.body),e=b(window),j=this,l;j.click(function(t){t.preventDefault();var s=b(this),q=(this.className.match(/b-keyboard-loader_lang_(\w+)/)||["",""])[1];if(!i.find(".b-keyboard")[0]){var r=BEM.blocks["i-global"].param("lego-static-host"),u=r+(r.charAt(r.length-1)==="/"?"":"/")+"blocks-desktop/",p=[u+"b-keyboard/_keyboard.js"],o=b.browser.msie&&((!document.documentMode)||(document.documentMode<9))?".ie":"",n=[u+"b-keyboard/_keyboard"+o+".css"];s.append('<i class="b-keyboard-loader__progress"/>');b.xLazyLoader({name:"b-keyboard",js:p,css:n,success:function(){a.block["b-keyboard-popup"]({lang:q,"for":g["for"]});i.append("<div class=\"b-keyboard i-bem\" onclick=\"return {'b-keyboard': { lang:'"+q+"'}};\"></div>");BEM.DOM.init(b(".b-keyboard"));s.find(".b-keyboard-loader__progress").remove();e.trigger("keyboardOpened.lego",{afterLoad:true})}})}else{h()}});function h(o){b("body").removeClass("b-page_keyboard");var q=o?"addClass":"toggleClass",p=i.find(".b-keyboard-popup");if(p.length){i.find(".b-keyboard-popup__gap")[q]("i-hidden");if(i.find(".b-keyboard-popup")[q]("i-hidden").hasClass("i-hidden")){e.trigger("keyboardClosed");b(document).trigger("popupsClose.lego");var n=a.block["b-keyboard"]._lastFocusedIn;if(n!==undefined){n.focus()}}else{e.trigger("keyboardOpened.lego")}p.data("isHidden",false)}}e.bind("keyboardOpen.lego",function(){j.click()}).bind("keyboardClose.lego",h);g["for"]&&e.bind("keyboardOpened.lego",function(o,n){!(n&&n.afterLoad&&g.autoLoad)&&b(g["for"]).focus()});e.bind("keyboardLangChanged.lego keyboardSetLang.lego",function(o,p){var n=j.find(".b-keyboard-loader__flag");if(n[0]){if(p==="tt"){p="ru"}n.attr("src",n.attr("src").replace(/[a-z]+\.png$/,p+".png"))}});g.storeState=g.storeState!==false;if(g.storeState){e.bind("keyboardOpened.lego",function(){k("keyboard_state","open");var n=c("keyboard_lang");if(n){b(window).trigger("keyboardSetLang.lego",n)}}).bind("keyboardClosed.lego",function(){b("body").removeClass("b-page_keyboard");k("keyboard_state","close")}).bind("keyboardLangChanged.lego",function(n,o){k("keyboard_lang",o)})}(g.autoLoad=g.autoLoad||(g.storeState&&c("keyboard_state")=="open"))&&j.click();var m;function f(){if(m){return}a.cp(0,70873,BEM.blocks["i-global"].param("id")+"."+(g.autoLoad?"auto":"manual"));m=true}e.bind("keyboardOpened.lego",function(){f();b("input:focus").focus();b("body").addClass("b-page_keyboard")});function c(n){return d()[n]}function d(){var n={};b.each(window.name.split("&"),function(){if(this.toString()){var o=this.split("=");n[o[0]]=o[1]}});return n}function k(n,p){var o=d(),q=[];o[n]=p;b.each(o,function(r,s){q.push(r+"="+s)});window.name=q.join("&")}}})(jQuery,window.Lego);
  /*!jeanny-ignore*/
  BEM.DOM.decl("b-menu",{onElemSetMod:{trigger:{state:function(b,c,a){this.toggleMod(this.findElem(b.closest(this.buildSelector("layout-vert-cell")),"item-content").eq(0),"visibility","visible",a=="opened").trigger("trigger",{domElem:b,state:a})}},item:{state:{current:function(c){var d=this,a=d.__self.getName(),b=d.elem("item","state","current").filter(function(){return $(this).closest(d.buildSelector()).bem(a)===d});d.findElem(c.parents(d.buildSelector("item-content")).prev(d.buildSelector("item")),"trigger").each(function(){d.setMod($(this),"state","opened")});d.delMod(b,"state").trigger("current",{prev:b,current:c})}}}},onTriggerClick:function(a){a.preventDefault();this.toggleMod(a.data.domElem,"state","opened")},onItemSelectorClick:function(b){var a=this._getItemByEvent(b);this.hasMod(a,"state","disabled")||this.setMod(a,"state","current")},_getItemByEvent:function(a){return a.data.domElem.closest(this.buildSelector("item"))}},{live:function(){this.liveBindTo("trigger","leftclick",function(a){this.onTriggerClick(a)}).liveBindTo("item-selector","leftclick",function(a){this.onItemSelectorClick(a)})}});BEM.DOM.decl("b-keyboard-popup",{onSetMod:{js:function(){Lego.block["b-keyboard-popup"].call(this.domElem,this.params)}}});(function(b,a){a.block["b-keyboard-popup"]=function(h){var g=b('<div class="b-keyboard-popup__gap"/><div class="b-keyboard-popup"><div class="b-keyboard-popup__bar"><span class="b-keyboard-popup__bar-link b-keyboard-popup__close"><img class="b-icon" src="//yandex.st/lego/_/La6qi18Z8LwgnZdsAr1qy1GwCwo.gif">'+BEM.I18N("b-keyboard-popup","close")+"</span></div><div class=\"b-keyboard i-bem\" onclick=\"return {name: 'b-keyboard',fake: false,lang: '"+h.lang+"'"+(h["for"]?",'for': '"+h["for"]+"'":"")+'};"/></div>').appendTo("body"),e=g.filter(".b-keyboard-popup"),c=g.filter(".b-keyboard-popup__gap"),f=function(i){if(typeof i!=="undefined"){e.data("isHidden",i)}else{return e.data("isHidden")}},d=function(){if(f()){return}g.addClass("i-hidden");b(window).trigger("keyboardClosed.lego");f(true)};b(document).bind("popupsClose.lego",function(i,j){(f()||(j&&j.source&&b.contains(e[0],j.source)))||d()});g.find(".b-keyboard-popup__close").click(function(){d();var i=a.block["b-keyboard"]._lastFocusedIn;if(i){i.focus()}})}})(jQuery,window.Lego);(function(c){BEM.DOM.decl({block:"b-popupa",modName:"behavior",modVal:"snap"},{_calcParams:function(){var o=this._calcDimensions(),l=this.params.directions,n=a(o),q=c.inArray(this._direction,l);if(this.hasMod("adjustable","no")){return e(this._direction,o,n[this._direction]||0)}q>-1||(q=0);var k=q,m,p;do{m=l[q];p=n[m];if(p){return e(m,o,p)}++q==l.length&&(q=0)}while(q!==k);return e(l[0],o,0)}});var d=19,b=7,i=15,f=15,g=7,j=7,h=["down-right","down","up","right","left"];function a(r){var t=c(window).width(),o=c(window).height(),q=r.ownerTop-r.windowTop-r.underHeight,u=r.windowBottom-r.ownerBottom-r.underHeight,m=r.ownerLeft-r.windowLeft-r.underWidth,v=r.windowRight-r.ownerRight-r.underWidth,x=r.ownerRight-r.windowLeft-r.underWidth,l=r.windowRight-r.ownerLeft-r.underWidth,w,n,p=r.underWidth/2,k=r.underHeight/2,s={};q=q<0?-q:0;u=u<0?-u:0;m=m<0?-m:0;v=v<0?-v:0;x=x<0?-x:0;l=l<0?-l:0;w=(p>m?0:m-p)-(p>v?0:v-p);n=(k>q?0:q-k)-(k>u?0:u-k);if(Math.abs(w)<p){w-=p;if(!q){s.up=w}if(!u){s.down=w;if(!x){s["down-left"]=w}if(!l){s["down-right"]=w}}}if(Math.abs(n)<k){n-=k;if(!m){s.left=n}if(!v){s.right=n}}return s}function e(p,q,r){var m,n={},l={},o,k={};switch(p){case"down":case"up":case"down-right":case"down-left":case"up-left":case"up-right":if(q.windowRight>q.ownerRight&&q.windowRight-q.ownerRight+i<q.underWidth-2*j){k.left=Math.min(q.windowRight-q.underWidth+j-3,q.ownerHorizMiddle-j)}else{if(q.windowLeft<q.ownerLeft&&q.ownerLeft-q.windowLeft+j<q.underWidth-2*j){k.left=Math.max(q.windowLeft-j+3,q.ownerHorizMiddle+j-q.underWidth)}}break;case"left":case"right":if(q.ownerHorizMiddle>q.windowTop&&q.ownerVertMiddle-q.windowTop+f<q.underHeight-j){k.top=q.windowTop}else{if(q.windowBottom>q.ownerVertMiddle&&q.windowBottom-q.ownerVertMiddle-f<q.underHeight-j){k.top=q.windowbottom-q.unserWidth}}}switch(p){case"down":case"up":n={left:r+q.ownerHorizMiddle-i,top:p=="down"?q.ownerBottom+g:q.ownerTop-q.underHeight-g};o=p;break;case"left":case"right":n={top:q.ownerVertMiddle+r-f,left:p=="left"?q.ownerLeft-q.underWidth-b:q.ownerRight+b};break;case"down-right":case"down-left":case"up-right":case"up-left":o=p=="down-right"||p=="down-left"?"down":"up";n={left:(p=="down-right"||p=="up-right"?q.ownerLeft:q.ownerRight-q.underWidth+j),top:o=="down"?q.ownerBottom+g:q.ownerTop-q.underHeight+j*2-g};break}n.top=k.top!==undefined?k.top:n.top;n.left=k.left!==undefined?k.left:n.left;switch(p){case"left":case"right":l={marginLeft:p=="left"?-q.borderWidth:-b+q.borderWidth,marginTop:q.ownerVertMiddle-n.top-f/2};if(l.marginTop<0){l.marginTop=0}else{if(l.marginTop>q.underHeight){l.marginTop=q.underHeight}}break;default:l={marginLeft:q.ownerHorizMiddle-n.left-i/2,marginTop:(o=="down"?-g+q.borderWidth:-q.borderWidth)};if(l.marginLeft<0){l.marginLeft=0}else{if(l.marginLeft>q.underWidth){l.marginLeft=q.underWidth}}}return{direction:p,factor:m,offsets:n,tailOffsets:l}}})(jQuery);(function(){var a=10;BEM.DOM.decl({name:"b-popupa",modName:"direction",modVal:"fixed"},{_pos:function(){var c=this._getUnder(),e=-c.domElem.outerWidth()/2,d=-c.domElem.outerHeight()/2,b=this.__self.getWindowSize();c.show({left:"50%",top:"50%",marginLeft:b.width/2-a+e<0?-b.width/2+a:e,marginTop:b.height/2-a+d<0?-b.height/2+a:d});return this}})})();BEM.DOM.decl({block:"b-popupa",modName:"hacks",modVal:"yes"},{onSetMod:{js:function(){this.on({show:function(){$(document).ready(function(){$("#text").blur()})},hide:function(){$("#text").focus();$(document).ready(function(){if("initRegionHint" in window){initRegionHint(".b-region_city span",".b-region_city span")}})}})}}});$(document).ready(function(){var e=$("i.b-hand"),b=10,a=1000,i=1000,d=10000,f=600,c=0,h=e.css("opacity")==1;$("a.b-link_sethome").click(function(l){try{e.stop().hide();var k=this;delete window.setHomeHandCloseUrl;if(!!window.setHomeHandCloseUrl){l.preventDefault();var j=new Image();j.src=window.setHomeHandCloseUrl;j.onload=function(){if($(k).hasClass("b-sethome_redirectable_yes")){window.location=k.href}}}}catch(l){}return true});if(!h){e.show()}var g=function(){c+=1;if(c<7){var j=(c%2==0)?("-="+b):("+="+b);e.animate({top:j},f,g)}else{setTimeout(function(){if(h){e.hide()}else{e.animate({opacity:"0"},i,function(){e.hide()})}},d)}};setTimeout(function(){if(window.setHomeHandUrl&&e){var j=new Image();j.src=window.setHomeHandUrl}if(h){e.show();g()}else{e.animate({opacity:"1"},i,g)}},a)});BEM.DOM.decl("b-form-checkbox",{onSetMod:{js:function(){var d=this,a=d.elem("checkbox");try{var c=d.__self.doc[0].activeElement}catch(b){}d.setMod("checked",a.attr("checked")?"yes":"");c===a[0]&&d.setMod("focused","yes")},focused:{yes:function(){if(this.isDisabled()){return false}this.elem("checkbox").focus()},"":function(){this.elem("checkbox").blur()}},checked:function(b,a){this.elem("checkbox").attr("checked",a=="yes");this.elem("tick").attr("alt",((a=="yes")?" v":""));this.afterCurrentEvent(function(){this.trigger("change")})},disabled:function(b,a){this.elem("checkbox").attr("disabled",a=="yes")}},isDisabled:function(){return this.hasMod("disabled","yes")},isChecked:function(){return this.hasMod("checked","yes")},toggle:function(){this.toggleMod("checked","yes","")},val:function(b){var a=this.elem("checkbox");return b==undefined?a.val():a.val(b)},_onClick:function(a){if(a.button){return}this.isDisabled()||this.setMod("focused","yes")},_onChange:function(a){a.target.checked?this.setMod("checked","yes"):this.delMod("checked")}},{live:function(){this.liveBindTo("checkbox","click",function(a){this._onClick(a)}).liveBindTo("checkbox","change",function(a){this._onChange(a)}).liveBindTo("checkbox","focusin focusout",function(a){this.setMod("focused",a.type=="focusin"?"yes":"")});return false}});BEM.HTML.decl("b-form-checkbox",{onBlock:function(b){var a=b.param("checkboxAttrs")||{};b.js(true).mix(!b.mod("size")?[{block:"b-form-checkbox",mods:{size:"m"}}]:"").tag("span").tParam("checkboxAttrs",$.extend(a||{},{id:b.param("id")||a.id||$.identify(),checked:b.mod("checked")?"checked":undefined,disabled:b.mod("disabled")?"disabled":undefined})).beforeContent({elem:"inner",content:[{elem:"checkbox",attrs:b.tParam("checkboxAttrs")},{elem:"bg"}]})},onElem:{label:function(a){a.tag("label").attr("for",a.tParam("checkboxAttrs").id)},checkbox:function(a){a.tag("input").attrs($.extend(a.attrs(),{type:"checkbox"}))},bg:function(a){a.tag("i").content({elem:"tick"})},tick:function(a){a.tag("i")},inner:function(a){a.tag("span")}}});(function(c,a){BEM.DOM.decl("b-head-tabs",{onSetMod:{js:function(){a.block["b-head-tabs"].call(this,this.params)}}});var b=a.block["b-head-tabs"]=function(t){var w=this.findBlockOutside("b-page").findBlockInside("b-head-search"),h=w&&w.findBlockInside("b-search"),v=h&&h.findBlockInside("b-form-input"),n=BEM.blocks["i-global"].param("id"),j=(function(){var y=p(window.location.search),x=/^#.*(\?.+)$/.exec(window.location.hash);x&&c.extend(y,p(x[1]));return y}()),i={www:505,search:521,images:526}[n]||527,e={market:{cvredirect:2,clid:i}},l={news:{rpt:"nnews2",grhow:"clutop"},haber:{rpt:"nnews2",grhow:"clutop"},yaca:{rpt:"rs2"},market:{cvredirect:2,clid:i},blogs:{ft:"blog"},people:{filter:"people"},appsearch:{filter:"mobile_apps"}},u=(function(){var x={};c.each(["news","yaca","market","blogs","maps","adresa","video","fotki","slovari","auto","images","music","www","aile","yandex","haber","gorsel"],function(){x[this]=["family"]});return x})(),q=(function(){var x={};c.each(["news","yaca","market","blogs","maps","adresa","video","fotki","slovari","auto","images","music","www","aile","yandex","haber","gorsel"],function(){x[this]=["noreask","family"]});return x})(),r=this.domElem.find(':not(strong)>a.b-head-tabs__link:not([href$="/all"])').map(function(){var y=this.host.split(".")[0],z=p(this.search),B=z.clid,x=decodeURIComponent(c.param(c.extend(z,f(y,B)),true)),C=this.pathname.replace(/^\/?(.*)/,"/$1"),A=b.getHostToUrlMap()[y];A&&C.indexOf((A.charAt(0)==="/"?"":"/")+A)>-1&&(A="");C=C.slice(1);if(C.length){C=C.replace(/\/*$/,"/")}return{node:this,clid:B,toServiceId:y,path:A,pathname:C,host:this.host,searchHost:b.getHostMap()[y],noSearchParamsUrl:x?"?"+x:"",searchParams:c.extend(z,o(y,B))}}).filter(function(){return typeof this.path!=="undefined"}),m,s=h&&h.elem("advanced")[0];if(s&&s.pathname){var g=p(s.search),k=s.pathname.replace(/^\/?(.*)/,"$1");g.text="";r.push({node:s,clid:g.clid,toServiceId:n,path:"",pathname:k,host:s.host,noSearchParamsUrl:"?"+c.param(g,true),searchParams:g})}(function(){var x=v&&c.trim(v.val())||t["default"];if(m!=x){m=x;c.each(r,function(){x&&(this.searchParams[b.getSearchParamName(this.toServiceId)]=x);this.node.href=[this.node.protocol+"/",x&&this.searchHost?this.searchHost:this.host,this.pathname+(x?this.path+"?"+c.param(this.searchParams,true):this.noSearchParamsUrl)].join("/")})}setTimeout(arguments.callee,200)})();function f(x,y){var z=e[x]||{};!z.clid&&y&&(z.clid=y);c.each(u[x]||[],function(){j[this]&&(z[this]=j[this])});return z}function o(y,z){var B=[].concat(q[y]),x=y+n;(x=="imageswww"||x=="wwwimages")&&B.push("site");var A=l[y]||{};c.each(B,function(){j[this]&&(A[this]=j[this])});!A.clid&&z&&y!=="www"&&(A.clid=z);return A}function p(x){var y={};if(!x){return y}c.each(x.substr(1).split("&"),function(C){var D=this.split("="),z=D[0],B=D[1];if(z){if(y.hasOwnProperty(z)){var A=y[z];c.isArray(A)?A.push(B):y[z]=[A,B]}else{y[z]=B}}});return c.decodeURIComponent!==undefined?d(y):y}function d(y){var x=["site"];c.each(y,function(z,A){if(c.inArray(z,x)>-1){y[z]=c.isArray(A)?A.map(function(B){return c.decodeURIComponent(B)}):c.decodeURIComponent(A)}});return y}};c.extend(b,{getHostToUrlMap:function(){var d={www:"yandsearch",market:"search.xml",maps:"",music:"#!/search",video:"search"};d.translate=d.ceviri=d.harita=d.maps;d.blogs=d.adresa=d.fotki=d.slovari=d.auto=d.rabota=d.market;d.appsearch=d.people=d.news=d.yaca=d.images=d.gorsel=d.haber=d.yandex=d.www;d.afisha=d.pogoda=d.hava=d.video;return d},getHostMap:function(){return{}},getSearchParamName:function(d){switch(d){case"pogoda":case"hava":return"request";default:return"text"}}})})(jQuery,window.Lego);$(document).ready(function(){if(!window.tabParams){return}var a=$("#text"),d=$("a.b-head-tabs__tab-link:not(.b-link_pseudo_yes)");if(!a.length){a=tabParams.elemSearch}if(!d.length&&tabParams.elemTabs){d=tabParams.elemTabs}if(!a.length||!d.length){return}var c="";function f(g,h){return g+(h.length?(g.indexOf("?")!==-1?"&":"?")+h:"")}function e(g){if(tabParams.searchParamName&&tabParams.searchParamName[g]){return tabParams.searchParamName[g]}return""}function b(){var g=encodeURIComponent($.trim(a.val()));if(g===c){return}c=g;d.map(function(){var k=this.host,p=$(this).attr("id").split("-")[1],j,o,q,n,i={},h="",r="",m="";if(tabParams.url[p]){j=tabParams.url[p]}if(tabParams.searchUrl[p]){n=tabParams.searchUrl[p]}if((!g||!n)&&tabParams.noSearchDefParamsMap&&tabParams.noSearchDefParamsMap[p]){h=$.param(tabParams.noSearchDefParamsMap[p])}else{if(g&&tabParams.searchDefParamsMap&&tabParams.searchDefParamsMap[p]){h=$.param(tabParams.searchDefParamsMap[p])}}r=$.param(tabParams.commonParams);resultParamString=[r,h].filter(function(s){return s.length}).join("&");if(!n||!g){o=f(j,resultParamString)}if(n&&g){var l=e(p);o=f(n,resultParamString);o=f(o,l+"="+g)}$(this).attr("href",o)})}setInterval(b,200)});BEM.DOM.decl("b-head-tabs",{onSetMod:{js:function(){var a=this.findBlockInside("b-popupa");if(!a){return}a.on("show",function(){this.afterCurrentEvent(function(){$(window).trigger("balance.b-twocolumns")})});a.on("hide",function(){$(window).trigger("unbalance.b-twocolumns")})}}});(function(g){var c=g("<div></div>")[0],a=["MozColumnCount","columnCount","WebkitColumnCount"].some(function(i){return(i) in c.style});if(a){return}var f=g(".b-twocolumn").children(),h=g('<div class="b-twocolumn__left"></div>'),b=g('<div class="b-twocolumn__right"></div>'),e=Math.ceil(f.length/2);f.each(function(j){(j<e?h:b).append(this)});g(".b-twocolumn").append(h).append(b);function d(){g(window).unbind("resize.b-twocolumns").bind("resize.b-twocolumns",d);var k=h.children(":visible").length-b.children(":visible").length;if(k<-1){for(var j=0;j<-k;j+=2){h.append(b.children().first())}}else{if(k>1){for(var j=0;j<k;j+=2){b.prepend(h.children().last())}}}}g(window).bind("balance.b-twocolumns",d);g(window).bind("unbalance.b-twocolumns",function(){g(window).unbind("resize.b-twocolumns")})})(jQuery);BEM.HTML.decl({name:"b-form-button",modName:"type",modVal:"simple"},{onBlock:function(a){a.tag(a.param("url")?"a":"span").attrs({href:a.param("url"),target:a.param("target")}).mods({size:a.mod("size")||"s",theme:a.mod("theme")||(a.mod("type")+"-grey")}).content({tag:"span",elem:"simple",content:a.content()},true).afterContent(a.param("type")?{elem:"input",attrs:{value:a.param("value")||"",type:a.param("type"),name:a.param("name"),disabled:a.mod("disabled")&&"disabled"}}:{elem:"click"}).js(true).stop()}});var quiteLogger=function(b,c){c=c||500;if(b.length){var a=new Image();a.src=b}if(c){window.setTimeout(function(){a.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAICTAEAOw=="},c)}};BEM.DOM.decl("b-themes-list",{onSetMod:{js:function(){var a=this;$(".b-themes-list__tab-item").live("click",function(g){var d=$(this);var f=d.data("tabid");if(d.data("stat")&&!!d.data("stat")){cp(d.data("stat"))}a.showTab(f)});$(".b-themes-list__theme-link").click(function(d){d.preventDefault();a.addHashAndGo($(this).attr("href"),$(this).data("skinid"),$(this).data("stat"))});$(".b-themes-list__arrow-prev").click(function(){a.scrolling(5,1)});$(".b-themes-list__arrow-next").click(function(){a.scrolling(-5,1)});if(window.addEventListener){window.addEventListener("DOMMouseScroll",function(d){a.wheel(d)},false)}window.onmousewheel=document.onmousewheel=function(d){a.wheel(d)};var b=a.hashQuery();if(!(b.tab&&window.themesTabs&&themesTabs[b.tab])){b.tab="all"}if(b.pos){b.pos=parseInt(b.pos)}else{var c=a.getThemeOffsetFromLeft($(".b-themes-list__theme_selected").prev("td"));c=a.check(c);b.pos=-c}a.showTab(b.tab,b.pos,true);if($.browser.msie){document.title=document.title.split("#")[0]}}},hashQuery:function(){var e=location.hash.substr(1),d={},b;if(e){e=e.split("&");for(var c=0,a=e.length;c<a;c++){b=e[c].split("=");if(b.length==2){d[b[0]]=b[1]}}}return d},getThemeOffsetFromLeft:function(d){var b=this.elem("theme").not(".b-themes-list__theme-hidden");var a=b.index(d);var c=b.index($(".b-themes-list__theme_selected"));if(c!=-1&&c<a){return -68*a-28}else{return -68*a}},updateHash:function(a,e){var c=this.hashQuery();if(a==="all"||!a){delete c.tab}else{c.tab=a}if(e){c.pos=e}else{delete c.pos}var b="";for(var d in c){b+=d+"="+c[d]+"&"}if(b.length){b=b.substr(0,b.length-1)}location.hash=b;if($.browser.msie){document.title=document.title.split("#")[0]}},showTabThemes:function(b){var c=this.elem("theme"),a=c.eq(0).parent();if(themesTabs[b]){c.addClass("b-themes-list__theme-hidden");$.each(themesTabs[b],function(d,f){var e=".b-themes-list__theme_"+f;a.append($(e));$(".b-themes-list__theme_"+f).removeClass("b-themes-list__theme-hidden")})}else{a.append(c.removeClass("b-themes-list__theme-hidden"))}},showTab:function(c,b,e){var d;this.showTabThemes(c);if(b){d=-b}else{d=0}d=this.check(d);var a=$(".b-themes-list__list table");if(e){a.css("left",d).show();setTimeout(function(){a.show()},0)}else{a.animate({left:d});setTimeout(function(){a.show()},0)}$(".b-themes-list__tab_selected").removeClass("b-themes-list__tab_selected");$(".b-themes-list__tab_"+c).addClass("b-themes-list__tab_selected");e||this.updateHash(c)},showTheme:function(b,e,a){var d=this.elem("theme"),c=d.eq(0).parent();d.addClass("b-themes-list__theme-hidden");$.each(themesTabs[b],function(f,h){var g=".b-themes-list__theme_"+h;c.append($(g));$(".b-themes-list__theme_"+h).removeClass("b-themes-list__theme-hidden")});this.showTab(b,e||0,a)},scrolling:function(d,b){var a=$(".b-themes-list__list table");var c=this.check(parseInt(a.css("left"))+68*d);if(b){a.stop().animate({left:c})}else{a.css({left:c})}},check:function(a){var b=this.widths(),c=b.windowWidth-b.themesTableWidth-36;if(a>0||c>0){return 0}if(a<c){return c}return a},widths:function(){var a=$(window).width();var b=parseFloat($(".b-themes-list__list table").width());b=(b==a-36)?this.elem("theme").length*68+28:b;return{themesTableWidth:b,windowWidth:a}},scrollThemes:function(a){if(a<-1){a=-1}if(a>1){a=1}this.scrolling(parseInt(a),0)},getCurrentTab:function(){return $(".b-themes-list__tab_selected > .b-themes-list__tab-item").data("tabid")||"all"},addHashAndGo:function(b,a,c){b+="#tab="+this.getCurrentTab()+"&pos="+Math.abs(parseInt($(".b-themes-list__list table").css("left")));if(c&&Lego.params.msid){location.href=location.protocol+"//clck.yandex.ru/redir/dtype=clck/lid="+c+"/sid="+Lego.params.msid+"/rnd="+((new Date()).getTime()+Math.round(Math.random()*100))+"/*data="+encodeURIComponent("url="+encodeURIComponent((b.match(/^http/)?b:location.protocol+"//"+location.host+(b.match("^/")?b:"/"+b))))}else{location.href=b}return false},wheel:function(b){var c=0,a;if(b){a=b.target}else{b=window.event;a=b.srcElement}if($(a).parents(".b-themes-list").length){if(b.wheelDelta){c=b.wheelDelta/120}else{if(b.detail){c=-b.detail/3}}if(c){this.scrollThemes(c);b.preventDefault&&b.preventDefault();b.returnValue=false}}else{b.returnValue=true}}});(function(){function a(){return $(".b-mobile-balloon")[0].onclick()}$(".b-mobile-balloon__button_yes").click(function(){var c=a().url,b=a().statYes;if(Lego.params.msid){cp(b);setTimeout(function(){document.location.href=c},500)}else{document.location.href=c}});$(".b-mobile-balloon__button_no").click(function(){var b=a().closeurl,c=a().statNo;new Image().src=b;if(Lego.params.msid){cp(c)}$(".b-mobile-balloon").hide()})})();(function(){function a(){$(".b-wdgt-promo").toggleClass("i-hidden");wg.hidePromo=wg.hidePromo=="1"?"0":"1";wg.changed=true}$(function(){$(".b-wdgt-promo .b-widget__control__close, .b-wdgt-promo .b-link_pseudo_yes").click(a);$(".b-wdgt-promo__add").click(function(){var b=this.onclick();if("wg" in window){wg.addWidget(b.id,1,b.type);return false}else{return true}})})})();(function(){if(window.wg){return}var g,e,h,b,f;$(function(){g=$(".b-wdgt-control");e=$("#b-wdgt-setup_button").attr("href");if(!g.length){return}g.css({right:0,top:0});$("#b-wdgt-send_button").addClass("i-hidden");$("#b-wdgt-del_button").addClass("i-hidden");$(".b-wdgt-control").css({width:18,height:18});$(".b-wdgt-control").mouseenter(function(){f=1;clearTimeout(b)});$(".b-wdgt-control").mouseleave(function(){b=setTimeout(function(){f=0;c()},1000)})});function a(j,i){j.append(g);g.fadeIn(500);f=0;$("#b-wdgt-setup_button").attr("href",e+"#open=_"+i);clearTimeout(b);b=setTimeout(function(){c()},4000)}function c(i){if(!f){g.fadeOut(500)}}function d(j,i){if($(".b-newpromo").length){return}j.mouseenter(function(){if(f){return}clearTimeout(b);h=setTimeout(function(){a(j,i)},1000)}).mouseleave(function(){clearTimeout(h);clearTimeout(b);b=setTimeout(function(){f=0;c()},1000)})}window.wdgtControl=d})();(function(A){var u=document.domain.match(/([^.]+(?:\.com?)?\.)?[^.]+$/)[0];try{document.domain!=u&&(document.domain=u)}catch(s){}A.mordaAuth={};var x=null,o=null,q=null,h=null,y=null,a=null,r=null,m=null,g=null;A.mordaAuth.setFields=function(G,C,E,D,F,B,H,e){if(A.mordaAuthParams){A.mordaAuth.params=A.mordaAuthParams}g=$(G);r=$(C);m=$(E);y=$(D);h=$(H);a=$(F);q=$(B);x=$(e);o=$('<input type="hidden" name="idkey"/>');g.find('[name="idkey"]').remove();g.append(o)};var k=10000,t=null,i="",l,d,n=null;A.mordaAuth.checkLogin=function(E){n=E;if(A.mordaAuth.params.login){n(A.mordaAuth.params.login);return}var e=r.val().split("@")[0];window.clearTimeout(t);t=window.setTimeout(z,k);r.val(e);b();y.addClass("i-hidden");g.trigger("captcha",{show:false});var B=A.mordaAuth.params.statusUrl;var C=g.clone();C.action=A.mordaAuth.params.passportUrl;var D="auth-iframe-"+ya.uid();d=$(C).attr("target",D).append('<input type="hidden" name="retpath" value="'+B+'"/>').addClass("i-hidden").appendTo("body");l=$('<iframe class="i-hidden" name="'+D+'" src="javascript:false"></iframe>').appendTo("body");window.setTimeout(function(){C.submit()},1);return false};function z(){p();j({status:"internal-exception"})}var w,v=null;function f(e){w=e;x.html(A.mordaAuth.params.texts[e]).removeClass("i-hidden");if(v){clearTimeout(v)}v=setTimeout(function(){x.html("").addClass("i-hidden")},3000)}function b(e){if(!e||w==e){x.addClass("i-hidden");w=null}}function p(){if(l){l.empty().remove()}if(d){d.empty().remove()}l=d=null}A.mordaAuth.onResponse=function(C){if(!C){j(null);return}var E=C.split("?")[1].split("&");var e={};for(var D=0,B=E.length;D<B;D++){var F=E[D].split("=");e[F.shift()]=decodeURIComponent(F.join("="))}delete e.ncrnd;j(e)};function j(e){if(!e){e={status:"internal-exception"}}window.clearTimeout(t);q.val("").prop("disabled",true);switch(e.status){case"ok":var B=r.val().split("@");A.mordaAuth.params.login=B[0];n(A.mordaAuth.params.login);return;case"login-empty":case"password-empty":case"account-not-found":case"password-invalid":case"account-disabled":f(e.status);break;case"captcha-invalid":f("captcha-invalid");break;case"captcha-required":break;case"internal-exception":f("internal-exception");c();return;default:if(e.url){window.location=e.url}else{c()}return}i=e.captcha_url;if(i){a.attr("src",i);q.prop("disabled",false);y.removeClass("i-hidden");g.trigger("captcha",{show:true});h.unbind("click").click(function(){a.attr("src",i+"&cantread=1&ncrnd="+Math.floor(Math.random()*100000));return false})}o.prop("disabled",false).val(e.idkey?e.idkey:"");if(!(e.status==="captcha-required"&&i)){m.val("")}p();n(false)}function c(){window.location.href=A.mordaAuth.params.passportHost+"?mode=auth&from=morda&retpath="+encodeURIComponent(window.location.href)}})(this);BEM.DOM.decl("b-spin",{onSetMod:{js:function(){this._size=this.getMod("size")||/[\d]+/.exec(this.getMod("theme"))[0];this._bgProp="background-position";this._posPrefix="0 -";if(this.elem("icon").css("background-position-y")){this._bgProp="background-position-y";this._posPrefix="-"}this._curFrame=0;this.hasMod("progress")&&this.channel("sys").on("tick",this._onTick,this)},progress:{yes:function(){this.channel("sys").on("tick",this._onTick,this)},"":function(){this.channel("sys").un("tick",this._onTick,this)}}},_onTick:function(){var a=++this._curFrame*this._size;(a>=this._size*36)&&(this._curFrame=a=0);this.elem("icon").css(this._bgProp,this._posPrefix+a+"px")},destruct:function(){this.channel("sys").un("tick",this._onTick,this);this.__base.apply(this,arguments)}});var freezeURLs={"b-domik_hover_chelly":"//yandex.st/www/_/N1hgtNIFSWeiP_5G4qXSiMPpL_o.jpg","b-domik_hover_bear-1440":"//yandex.st/www/_/XNBOOTTvwPGaRmBP7sE2u2olqYM.jpg","b-domik_hover_primorie":"//yandex.st/www/_/sLGpCCvf5ACrSqd-IbjiYCkC_LM.jpg","b-domik_hover_novosibirsk":"//yandex.st/www/_/TFvp0jLDVVXz9TRVuvjlLcy_Nrw.jpg","b-domik_hover_bear-1024":"//yandex.st/www/_/Q2zkcRb6pdlWGrsyK5rkC4y_cMA.jpg","b-domik_hover_bashkir":"//yandex.st/www/_/8ZONM2_ph_r_sTnw_zhGIeB7rSM.jpg","b-domik_hover_samara":"//yandex.st/www/_/PA-THrMlA4B7sV8RUbqupAuEXG4.jpg","b-domik_hover_ekb":"//yandex.st/www/_/cqiYp0AYJl16Rt7HligFkB2PUVI.jpg","b-domik_hover_bear-1280":"//yandex.st/www/_/EvVryUGULJfUELN41beEAtoQPXg.jpg","b-domik_hover_bear-1680":"//yandex.st/www/_/Rw81pprdjyza6OMLXUt6gprG168.jpg","b-domik_hover_bear-1920":"//yandex.st/www/_/Xi1OS5Gj8CYSffrFOIsX37QnEWk.jpg","b-domik_hover_perm":"//yandex.st/www/_/O6H3nHLXBGwlcxvCrjT5tzJKVjs.jpg","b-domik_hover_krasnoyarsk":"//yandex.st/www/_/HgxNYwF5QXlx3UkWiTE8Y6hFIr0.jpg"};Lego.block["i-freeze-url"]=freezeURLs;(function(L){var u=false,P=$(".b-hockey > .b-hockey__game > .b-hockey__game__teams"),c=$(".b-hockey > .b-hockey__game > .b-hockey__game__period");function M(){f();$("body").bind("click",b);u=true}function G(){$(".b-hockey__game__table").addClass("i-hidden");$("body").unbind("click",b);u=false}var a=null,o=null;function F(R){var S=$(".b-hockey__frame");if(!S.length){S=$('<iframe class="b-hockey__frame" style="display:none"></iframe>');$(document.body).append(S)}S.attr("src",hockey2013.setLink+R)}function k(R){var S=R.attr("eventId");if(S!=a){C.html($(".b-hockey__game__teams",R).html());var T=o?o[S]:null;if(T){n(T)}F(S);I(R);a=S}G()}function v(S){var R=$(".b-hockey__game__events .b-hockey-table__item[eventid='"+S+"']");if(R.length){P.html($(".b-hockey__game__teams",R).html());I(R)}}var h=null;function s(S,T){var R="";if(h){R="onmousedown=\"cp('"+h+"',this)\""}return"<a onclick=\"return{'b-link':{}}\" "+R+' class="b-link i-bem" href="'+S+'">'+T+"</a>"}function n(R){c.html(e(R,h))}function I(R){var S=$(".b-hockey__game__events .b-hockey-table__item:first",R.closest(".b-hockey__game__events"));if(R[0]!=S[0]){S.before(R)}}function b(R){if($(R.target).closest(".b-hockey__game__teams").length){return}if(u&&!$(R.target).closest(".b-hockey__game__table").length){G()}}var B=null,E=null,C=null;function H(){$(".b-hockey__game > .b-hockey__game__teams").unbind("click").click(function(){C=$(this);M();csh_ifgsid(B)});$(".b-hockey__game__table .b-hockey-table__item").unbind("click").click(function(){k($(this));csh_ifgsid(E)})}var w=L.template('<div class="b-hockey-table__item" eventId="[% eventId %]"><span class="b-hockey__game__teams b-inline">[% teams %]</span><div class="b-hockey__game__period">[% period %]</div></div>'),K=L.template('<img class="b-hockey__flag" src="http://yandex.st/lego/2.6-53/blocks/b-country-flag/_size-16/b-country-flag_size-16_[% country_1_iso %].png">&nbsp;<span class="b-link__inner">[% country_1 %]&nbsp;[% score %]&nbsp;[% country_2 %]</span>&nbsp;<img class="b-hockey__flag" src="http://yandex.st/lego/2.6-53/blocks/b-country-flag/_size-16/b-country-flag_size-16_[% country_2_iso %].png">'),z=L.template('<div class="b-hockey b-inline"><span class="b-hockey__title">[% title %]</span><span class="b-hockey__game"><span class="b-hockey__game__teams b-inline b-link b-link_pseudo_yes">[% teams %]</span><span class="b-hockey__game__period b-inline">[% period %]</span></span></div>',{text:""}),i=L.template('<div class="b-hockey__game__table i-hidden"><iframe class="i-popup__under"></iframe><i class="b-popupa__shadow"></i><div class="b-popupa__content"><div class="b-hockey__game__events">[% table %]</div><div class="b-hockey__game__table__add">[% widget %]</div></div></div>'),D=L.template('<span class="b-hockey__game__score[% mod %]">[% score_1 %]&nbsp;:&nbsp;[% score_2 %][% descr %]</span>',{descr:""}),m=L.template('<span class="b-hockey__game__period__playing">[% time %]</span>'),J=L.template('<span class="b-hockey__game__winner">[% name %]</span>'),q=L.template("window.hockey2013=[% data %];");function Q(S){if(S.m_status!="not_started"){var T="",R="";if(S.m_status=="finished"){if(S.m_finished=="4"){T="&nbsp;"+(typeof hockey2013!="undefined"&&hockey2013.statuses?hockey2013.statuses.finishOT:Lang("hockey.finishOT"))}else{if(S.m_finished=="5"){T="&nbsp;"+(typeof hockey2013!="undefined"&&hockey2013.statuses?hockey2013.statuses.finishB:Lang("hockey.finishB"))}}R=" b-hockey__game__score_finished"}return D({score_1:S.teams&&S.teams[0]?S.teams[0].result:"0",score_2:S.teams&&S.teams[1]?S.teams[1].result:"0",descr:T,mod:R})}else{return"&mdash;"}}function e(R,S){if(R.m_status=="finished"){if(typeof hockey2013!="undefined"&&hockey2013.statuses){return typeof S!="undefined"&&R.url?s(R.url,hockey2013.statuses.finished):hockey2013.statuses.finished}else{return typeof S!="undefined"&&R.url?generators["b-link"]({text:Lang("hockey.finished"),url:R.url,counter:S}):Lang("hockey.finished")}}else{if(R.m_status!="not_started"){if(typeof hockey2013!="undefined"&&hockey2013.statuses){return typeof S!="undefined"&&R.url?m({time:s(R.url,hockey2013.statuses[R.m_status])}):m({time:hockey2013.statuses[R.m_status]})}else{return m({time:typeof S!="undefined"&&R.url?generators["b-link"]({text:Lang("hockey."+R.m_status),url:R.url,counter:S}):Lang("hockey."+R.m_status)})}}else{return R.time}}}function r(T){if(T.m_status=="finished"){var S=Number(T.teams[0].result),R=Number(T.teams[1].result);if(S>R){return 1}if(R>S){return 2}}return 0}function x(S,R){if(R){return J({name:S})}else{return S}}function g(X,Y){var S="",R,Z,W,V;if(X.length){for(var U=0,T=X.length;U<T;U++){R=X[U];S+=N(R,Y)}}return S}function N(U,S){var R=U.teams[0].country,W=U.teams[1].country,T=r(U),V=K({country_1:x(typeof hockey2013!="undefined"&&hockey2013.countryNames?hockey2013.countryNames[R.id]:LangGeo(R.id),T==1),country_1_iso:R.iso,country_2:x(typeof hockey2013!="undefined"&&hockey2013.countryNames?hockey2013.countryNames[W.id]:LangGeo(W.id),T==2),country_2_iso:W.iso,score:Q(U)});return w({teams:S||U.m_status=="not_started"||!U.url?V:generators["b-link"]({text:V,url:U.url,counter:StatLogIdOnly("wdgthockey.link"),mix:"b-link_black_novisit"}),period:e(U),period_mod:"",eventId:U.id})}var p=true;if($.browser.msie){$(document).bind("focusout",function(){p=false});$(document).bind("focusin",function(){p=true})}else{$(window).focus(function(){p=true});$(window).blur(function(){p=false})}function t(){if(p){O()}else{var R=function(){if($.browser.msie){$(document).unbind("focusin",R)}else{$(window).unbind("focus",R)}var S=Math.round(Math.random()*4000);setTimeout(function(){O()},S)};if($.browser.msie){$(document).bind("focusin",R)}else{$(window).bind("focus",R)}}}var A=null;function y(S){var R=Number(S);A=setTimeout(function(){t()},R*1000)}var d=$(".b-hockey__game__events"),j={};$(".b-hockey-table__item",d).each(function(){j[$(this).attr("eventId")]=true});function O(){$.ajax({method:"GET",url:hockey2013.updateLink,dataType:"json",cache:true,ifModified:true,success:function(Y){if(Y){var W=Y.events,X,T,S=null,U=[];if(W.length){for(var V=0,R=W.length;V<R;V++){X=W[V];if(j[X.id]){T=$(".b-hockey__game__events .b-hockey-table__item[eventid='"+X.id+"']");T.replaceWith(N(X,true))}if(a==X.id){S=X}o[X.id]={url:X.url,m_status:X.m_status,time:X.time}}H();if(S){v(a);n(S)}}}y(60)}})}$(document).keydown(function(R){if(R.keyCode=="27"){G()}});window.hockey2013Init=function(){$(function(){if(typeof hockey2013=="undefined"){return}if(!a){a=hockey2013.selectedEvent}if(B===null){B=hockey2013.counters.popup}if(E===null){E=hockey2013.counters.popupLink}if(h===null){h=hockey2013.counters.link}if(o===null){o=hockey2013.statusesLinks}P=$(".b-hockey > .b-hockey__game > .b-hockey__game__teams");c=$(".b-hockey > .b-hockey__game > .b-hockey__game__period");H();if(!A){y(hockey2013.rebind)}})};window.hockey2013Init();function f(){l();$(".b-hockey__game__table").removeClass("i-hidden")}function l(){if(!C||!C.length){return}var S=$(".b-widget-data .b-hockey__game__table"),R=$("body > .b-hockey__game__table");if(S.length){R.remove();$("body").append(S);R=$("body > .b-hockey__game__table")}if(!R.length){return}var T=C.offset();R.css({left:T.left,top:T.top})}$(window).resize(function(){l()})})(ya);$(function(){if(typeof diskUploaderParams=="undefined"){return}function a(d){this.callback=d;this.items=0;this.results={}}a.prototype.add=function(f,e){var d=this;this.items++;return function(){var g=e.apply(e,arguments);d.check(f,g)}};a.prototype.check=function(e,d){this.results[e]=d;this.items--;if(this.items===0){this.callback.call(this,this.results)}};var c=function(){this.sk=diskUploaderParams.sk;this.files=[];this.statusesTimers={};this.areaShown=false;this.wrapTimer=null;this.uploadQueue=[];this.maxSize=300*1024*1024;this.forceDialogItemTemplate=ya.template('<div class="b-disk-uploader__force_item"><label class="b-disk-uploader__force_label" for="[% id %]"><input type="checkbox" id="[% id %]" class="b-disk-uploader__force_box">[% text %]</label></div>')};c.prototype.push=function(d){this.files.push({file:d,status:0})};c.prototype.store=function(){var h=new a(function(k){var i=[],n,o,m=0;for(o in k){n=k[o];if(n.status==2){i.push(n)}m+=n.file.size}if(i.length){e.showForceDialog(i)}else{var j=ya.uid(),l=0;e.uploadQueue.push(j);for(o in k){k[o].queueId=j;l++}e.uploadFiles()}}),e=this,g;for(var f=0,d=this.files.length;f<d;f++){g=this.files[f];if(g.status===0||g.status===3){if(!g.id){g.id=ya.uid()}this.storeFile(g,h.add(g.id,this.storeFileHandler))}}e.hideArea()};c.prototype.storeFile=function(e,f){if(e.status==3){f(e);return}var d=this;$.ajax({url:"http://mail.yandex.ru/api/disk_handler?handle=store&upload_from_main=1&sk="+this.sk+"&path=/disk/"+e.file.name+(e.force?"&force=1":""),method:"GET",xhrFields:{withCredentials:true},dataType:"json",success:function(g){if(g.oid&&g.upload_url){e.status=3;e.oid=g.oid;e.upload_url=g.upload_url}else{if(g.code==47){e.status=2}}f(e)},failure:function(g){e.status=-1;f(e)}});e.status=1};c.prototype.initUser=function(d){$.ajax({url:"http://mail.yandex.ru/api/disk_handler?handle=user_init&upload_from_main=1&sk="+this.sk,method:"GET",xhrFields:{withCredentials:true},dataType:"json",success:function(e){d(fileInfo)},failure:function(e){d(fileInfo)}})};c.prototype.storeFileHandler=function(d){return d};c.prototype.uploadFiles=function(){var g,e=0;for(var f=0,d=this.files.length;f<d;f++){g=this.files[f];if(g.status==3){this.uploadFile(g);this.checkTimer(g,1000,false);e++}}if(e==1){csh_ifmsid(diskUploaderParams.statUploadOne)}else{if(e>1){csh_ifmsid(diskUploaderParams.statUploadMany)}}this.updateStatuses()};c.prototype.uploadFile=function(e){var f=new FormData(),d=this;f.append("file",e.file);e.xhr=$.ajax({url:e.upload_url,data:f,cache:false,contentType:false,processData:false,type:"POST",error:function(g){e.status=-1;d.updateStatuses()}});e.status=4};c.prototype.showForceDialog=function(h){var g,f="";for(var e=0,d=h.length;e<d;e++){g=h[e];f+=this.forceDialogItemTemplate({id:g.id,text:g.file.name})}$(document).trigger("popupsClose.lego");this.forcePopupContent.html(f);this.forcePopup.show();if(d==1){$(".b-disk-uploader__force_box").attr("checked","checked").hide();$(".b-disk-uploader__force_label").css("margin-left",0)}this.fixParanja()};c.prototype.collectForceFiles=function(){var d=this;$(".b-disk-uploader__force_box",this.forcePopupContent).each(function(){var e=d.gitFileInfo(this.id);if(e&&e.status==2){if(this.checked){e.status=0;e.force=true}else{e.status=-2}}});this.store();this.forcePopup.hide()};c.prototype.gitFileInfo=function(f){for(var e=0,d=this.files.length;e<d;e++){if(this.files[e].id==f){return this.files[e]}}return null};c.prototype.checkTimer=function(f,g,d){var e=this;this.statusesTimers[f.id]=setTimeout(function(){if(d){e.checkFocus(f)}else{e.checkStatus(f)}},g)};c.prototype.focusEvents=function(){this.windowFocused=true;var d=this;if($.browser.msie){$(document).bind("focusout",function(){d.windowFocused=false});$(document).bind("focusin",function(){d.windowFocused=true})}else{$(window).focus(function(){d.windowFocused=true});$(window).blur(function(){d.windowFocused=false})}};c.prototype.checkFocus=function(e){var d=this;if(this.windowFocused){this.checkStatus(e)}else{var f=function(){if($.browser.msie){$(document).unbind("focusin",f)}else{$(window).unbind("focus",f)}var g=Math.round(Math.random()*4000);setTimeout(function(){d.checkStatus(e)},g)};if($.browser.msie){$(document).bind("focusin",f)}else{$(window).bind("focus",f)}}};c.prototype.checkStatus=function(e){var d=this;$.ajax({url:"http://mail.yandex.ru/api/disk_handler?handle=status&sk="+this.sk+"&oid="+e.oid,method:"GET",xhrFields:{withCredentials:true},dataType:"json",success:function(f){e.mpfs=f;if(e.mpfs.status=="WAITING"||e.mpfs.status=="EXECUTING"){d.checkTimer(e,2000,true)}else{if(e.mpfs.status=="DONE"){e.status=5;e.mpfs.progress=100}else{e.status=-1}}d.updateStatuses()},failure:function(f){e.status=-1;d.updateStatuses()}})};c.prototype.updateStatuses=function(){var p=0,r=0,q=[],d,e,k=0,v=0,u=0,s="";for(var n=0,f=this.uploadQueue.length;n<f;n++){e=this.getFilesByQueue(this.uploadQueue[n]);p+=e.length;for(var o=0,h=e.length;o<h;o++){fileInfo=e[o];if(fileInfo.status==4){d=fileInfo.mpfs&&fileInfo.mpfs.progress?fileInfo.mpfs.progress:0;r+=d;q.push(fileInfo);k++}else{if(fileInfo.status==5){r+=100;v++}else{if(fileInfo.status==-1){s=fileInfo.file.name;u++}}}}}if(k>0){this.showStatusesWrap();this.showBg();this.showCancel();this.progress.css("width",Math.floor(r/p)+"%");this.title.removeClass("b-disk-uploader__statuses_title_error");if(k==1){this.title.html(ya.htmlFilter(q[0].file.name))}else{this.title.html(diskUploaderParams.uploadingFiles.replace("%1",v).replace("%2",p))}}else{var t,g=false;if(u==1){t=diskUploaderParams.errorFile.replace("%1",ya.htmlFilter(s));g=true}else{if(u>1){t=diskUploaderParams.errorFiles;g=true}else{t=diskUploaderParams.loaded}}this.finishUpload(t,g)}};c.prototype.finishUpload=function(e,d){this.uploadQueue=[];this.hideStatusesWrap();this.hideBg();this.hideCancel();this.title.html(e);if(typeof d!="undefined"&&d){this.title.addClass("b-disk-uploader__statuses_title_error")}};c.prototype.getFilesByQueue=function(g){var f=[];for(var e=0,d=this.files.length;e<d;e++){if(this.files[e].queueId===g){f.push(this.files[e])}}return f};c.prototype.addCancelEvent=function(){var d=this,e;$(".b-disk-uploader__button_cancel").click(function(){for(var g=0,f=d.files.length;g<f;g++){e=d.files[g];if(e.xhr&&e.status!=5){e.xhr.abort();clearTimeout(d.statusesTimers[e.id]);e.status=-3}}d.finishUpload(diskUploaderParams.cancel);return false})};c.prototype.addCancelDialogEvent=function(){var d=this;this.forcePopup.on("hide",function(){d.clearUploadQueue();d.unfixParanja();d.forcePopup.hide()});$("#diskUploadCancel").click(function(){d.clearUploadQueue();d.unfixParanja();d.forcePopup.hide()})};c.prototype.clearUploadQueue=function(){var f;for(var e=0,d=this.files.length;e<d;e++){f=this.files[e];if(f.status==2||f.status==3){f.status==-3}}};c.prototype.fixParanja=function(){$(".i-popup__under_type_paranja").addClass("b-disk-force-popup__under");$(".b-disk-force").closest(".i-popup").addClass("b-disk-force-popup")};c.prototype.unfixParanja=function(){$(".i-popup__under_type_paranja").removeClass("b-disk-force-popup__under");$(".b-disk-force").closest(".i-popup").removeClass("b-disk-force-popup")};c.prototype.checkFileTypes=function(g){if(!g.types){return false}var h=false,e=false;if(g.types.length){for(var f=0,d=g.types.length;f<d;f++){if(g.types[f]=="Files"){if(g.items&&g.items[f]&&g.items[f].type===""){e=true}h=true}}}return h&&!e};c.prototype.checkFiles=function(h){if(!h.files){return}var g=new a(function(i){for(var j in i){if(i[j].status!==false){e.push(i[j].file)}}e.store()}),e=this;for(var f=0,d=h.files.length;f<d;f++){this.isRegularFile(h.files[f],g.add("file"+f,this.checkFileHandler))}};c.prototype.isRegularFile=function(f,h){if(f.type===""){setTimeout(function(){h(false,f)},0);return}if(f.size>4096){setTimeout(function(){h(true,f)},0);return}if(!window.FileReader||(window.opera&&navigator.platform.toLowerCase().indexOf("mac")>-1&&window.opera.version()==="12.00")){setTimeout(function(){h(null,f)},0)}else{try{var d=new FileReader();d.onerror=function(){d.onloadend=d.onprogress=d.onerror=null;h(false,f)};d.onloadend=d.onprogress=function(i){d.onloadend=d.onprogress=d.onerror=null;if(i.type!="loadend"){d.abort()}h(true,f)};d.readAsDataURL(f)}catch(g){setTimeout(function(){h(false,f)},0)}}};c.prototype.checkFileHandler=function(e,d){return{file:d,status:e}};c.prototype.init=function(){if(window.File&&window.FileList&&window.FileReader&&$(".b-disk-uploader").length){this.uploaderArea=$(".b-disk-uploader");this.innerArea=$(".b-disk-uploader__inner");this.forcePopup=$(".b-disk-force").bem("b-popupa");this.forcePopupContent=$(".b-disk-uploader__force_content");this.statusesWrap=$(".b-disk-uploader__statuses_wrap");this.progress=$(".b-disk-uploader__statuses_progress");this.bg=$(".b-disk-uploader__statuses_bg");this.title=$(".b-disk-uploader__statuses_title");this.cancel=$(".b-disk-uploader__button_cancel");var d=this;$(window).bind({dragenter:function(e){if(!d.checkFileTypes(e.originalEvent.dataTransfer)){return}if(!d.areaShown){d.showArea()}return false},dragover:function(){return false},dragleave:function(e){return false},drop:function(e){d.checkFiles(e.originalEvent.dataTransfer);return false}});this.uploaderArea.click(function(){d.hideArea();return false});$(document).mouseout(function(e){var f=e.relatedTarget||e.toElement;if(!f||f.nodeName=="HTML"){d.hideArea()}});$(document).mouseover(function(e){if(d.areaShown){d.hideArea()}});$("#diskUploadOk").click(function(){d.collectForceFiles();return false});this.focusEvents();this.addCancelEvent();this.addCancelDialogEvent()}};c.prototype.showArea=function(){this.uploaderArea.addClass("b-disk-uploader__highlighted");this.areaShown=true};c.prototype.hideArea=function(){this.uploaderArea.removeClass("b-disk-uploader__highlighted");this.areaShown=false};c.prototype.showStatusesWrap=function(){if(this.wrapTimer){clearTimeout(this.wrapTimer)}if(this.statusesWrap.hasClass("i-hidden")){this.statusesWrap.css({bottom:-44}).removeClass("i-hidden").animate({bottom:0},500)}};c.prototype.hideStatusesWrap=function(){var d=this;if(!this.statusesWrap.hasClass("i-hidden")){this.wrapTimer=setTimeout(function(){d.statusesWrap.animate({bottom:-44},500,function(){d.statusesWrap.css({bottom:0}).addClass("i-hidden")})},5000)}};c.prototype.showBg=function(){this.bg.removeClass("i-hidden")};c.prototype.hideBg=function(){this.bg.addClass("i-hidden")};c.prototype.showCancel=function(){this.cancel.removeClass("i-hidden")};c.prototype.hideCancel=function(){this.cancel.addClass("i-hidden")};var b=new c();b.init();window.uploader=b});var i18n=i18n||{};(function(e,f,d){if(typeof f.I18N==="function"&&f.I18N._proto){return f.I18N}var a={},k=[],l="_",h="__",g="ru";function m(n){typeof n==="string"&&(n={block:n});return n.block+(n.elem?(h+n.elem):"")+(n.modName?l+n.modName+l+n.modVal:"")}function i(o){var n={};o.split(h).forEach(function(r,p){var q=[p?"elem":"block","mod","val"];r.split(l).forEach(function(t,s){n[q[s]]=t})});return n}function c(n){if(!n){return false}return k.push(n)}function b(){return k.length&&k.pop()}function j(){this._lang="";this._prj="lego";this._keyset="";this._key=""}j.prototype={lang:function(n){this._lang=n;return this},project:function(n){this._prj=n;return this},keyset:function(n,o){o&&c(this._keyset);this._keyset=m(n);return this},key:function(n){this._key=n;return this},decl:function(q){var o=i(this._keyset),r=o.block==="i-tanker"?"tanker":this._prj,t=o.elem||this._keyset,s=this._key;r=i18n[r]||(i18n[r]={});t=r[t]||(r[t]={});t[s]=typeof q==="function"?q:(function(u){return(q)});var n=a[this._lang]||(a[this._lang]={}),p=n[this._keyset]||(n[this._keyset]={});p[s]=q},val:function(q,n){var o=a[this._lang]&&a[this._lang][this._keyset];if(!o){console&&console.log&&console.log("[Error] keyset: "+this._keyset+" key: "+this._key+" (lang: "+this._lang+")");return""}o=o[this._key];if(!o){return""}try{return typeof o==="string"?o:n?o.call(n,q):o.call(this,q)}catch(p){throw"[Error] keyset: "+this._keyset+" key: "+this._key+" (lang: "+this._lang+")"}},_c:function(){return a}};f.I18N=(function(o){var n=function(q,p,r){return n.keyset(q).key(p,r)};n._proto=o;n.project=function(p){this._proto.project(p);return this};n.keyset=function(p){this._proto.keyset(p,true);return this};n.key=function(q,t){var r=this._proto,p,s;r.lang(this._lang).key(q);p=r.val.call(r,t,n);s=b();s&&r.keyset(s,false);return p};n.decl=function(p,t,r){var s=this._proto,q;r||(r={});r.lang&&s.lang(r.lang);s.keyset(p);for(q in t){t.hasOwnProperty(q)&&s.key(q).decl(t[q])}return this};n.lang=function(p){typeof p!=="undefined"&&(this._lang=p);return this._lang};n.lang(g);return n}(new j()));BEM=f})(this,typeof BEM==="undefined"?{}:BEM);BEM.I18N.decl("b-domik",{"bigform-logo-alt":"Яндекс","bigform-logo-link":"http://www.yandex.ru","bigform-logo-url":"/blocks-desktop/b-domik/_type/b-domik_type_bigform__logo.png",cancel:"Отмена","enter-with":"Войти при помощи",help:"что это","help-link":"http://help.yandex.ru/passport/?id=922493",login:"логин",logon:"Войти","passport-link":"https://passport.yandex.ru/",password:"пароль",permanent:"запомнить меня",register:"Зарегистрироваться",remember:"Напомнить пароль",title:"Вход","wrong-keyboard-layout":"смените раскладку"},{lang:"ru"});BEM.I18N.decl("b-form-input",{search:"Поиск","search-label":"поиск",vid:"Видео"},{lang:"ru"});BEM.I18N.decl("b-head-search",{"my-searches-off":"Мои запросы ((выключены))","my-searches-on":"Мои запросы ((включены))"},{lang:"ru"});BEM.I18N.decl("b-head-tabs",{more:"ещё",or:"или"},{lang:"ru"});BEM.I18N.decl("b-head-user",{"change-password":"Сменить пароль",passport:"Паспорт",profiles:"Мои профили"},{lang:"ru"});BEM.I18N.decl("b-keyboard-loader",{keyboard:"Клавиатура"},{lang:"ru"});BEM.I18N.decl("b-keyboard-popup",{close:"закрыть"},{lang:"ru"});BEM.I18N.decl("i-services",{"404":"404",adresa:"Адреса",advertising:"Реклама",afisha:"Афиша",all:"Все сервисы",api:"API",appsearch:"Поиск приложений",auto:"Авто",aziada:"Азиада",ba:"Баян",backapv:"Партнер Я.Карт",balance:"Баланс",bar:"Бар","bar-ie":"Бар для ИЕ","bar-ie9":"Бар для ИЕ9",bayan:"Баннеры Яндекса",blogs:"Блоги",books:"Книги",browser:"Браузер",calendar:"Календарь",captcha:"ой...",catalogwdgt:"Каталог виджетов",chrome:"Хром с поиском Яндекса",city:"Города",cityday:"День города",collection:"Коллекция",company:"Компания",contest:"Contest",desktop:"Персональный поиск",direct:"Директ","direct.market":"Маркет",disk:"Диск",ege:"ЕГЭ",expert:"Эксперт",feedback:"Обратная связь",ff:"ФФ с поиском Яндекса",fotki:"Фотки",games:"Игрушки",geocontext:"Геоконтекст",goroda:"Города",help:"Помощь",i:"Мои сервисы",ie:"ИЕ с поиском Яндекса",images:"Картинки","images-com":"Картинки",interests:"Интересы",internet:"Интернет",keyboard:"Клавиатура",kraski:"Краски",kuda:"Куда все идут",large:"Яндекс для слабовидящих",legal:"Правовые документы",lenta:"Лента",libra:"Библиотека",literacy:"Неделя борьбы за грамотность",local:"Локальная сеть",lost:"Незабудки",love:"День взаимного тяготения — 13 августа",mail:"Почта",maps:"Карты","maps-wiki":"Народная карта",market:"Маркет","market.advertising":"Маркет",metrika:"Метрика",metro:"Метро",mobile:"Мобильный",moikrug:"Мой Круг",money:"Деньги",museums:"Дни исторического и культурного наследия",music:"Музыка","music-partner":"Музыка: статистика",nahodki:"Мои находки",nano:"Нано",newhire:"Наниматор",news:"Новости",oauth:"Авторизация",online:"Онлайн",openid:"OpenID",opera:"Opera Software",opinion:"Цитаты",partners:"Рекламная сеть",partnersearch:"Поиск для партнеров",passport:"Паспорт",pdd:"Почта для домена",peoplesearch:"Поиск людей",perevod:"Перевод",probki:"Пробки",pulse:"блоги: пульс",punto:"Punto switcher",pvo:"Ответы",rabota:"Работа",ramazan:function(a){return},rasp:"Расписания",realty:"Недвижимость",referats:"Рефераты",rk:"Есть вопросы?",root:"Яндекс.Олимпиада для Unix администраторов",school:"Школа",search:"Поиск",server:"Сервер",site:"Поиск для сайта",slovari:"Словари",so:"Самооборона",social:"Социализм",soft:"Программы",sport:"Спорт",sprav:"Справочник",start:"Стартовая страница",stat:"Статистика",subs:"Подписки",taxi:"Такси",terms:"Разговорник",tests:"Тесты и опросы",time:"Яндекс.Время",toster:"Тосты",translate:"Перевод",tune:"Настройки",tv:"Телепрограмма",uslugi:"Услуги",video:"Видео","video-com":"Видео",wdgt:"Виджеты",weather:"Погода",webmaster:"Вебмастер",widgets:"Виджеты",wordstat:"Статистика",wow:"Я.ру",www:"Поиск",xmlsearch:"XML",yaca:"Каталог",yamb:"Медийные баннеры",zakladki:"Закладки"},{lang:"ru"});BEM.I18N.lang("ru");