(function(b,a){if(!a){a=window.Lego={}}a.messages=a.messages||{};a.message=function(e,d){return a.params.locale=="ru"?d:(a.messages[e]||d)}})(jQuery,window.Lego);(function(a){if(!a){a=window.Lego={}}a.oframebust=function(d){if(location==top.location){return}var e=(location.search.match(/[&?]oframebust=([^&;]+)/)||[])[1];if(!e){top.location=location}if(d.hasOwnProperty(e)){var b=document.createElement("iframe");b.style.position="absolute";b.style.left="-999px";b.style.width="1px";b.src="//"+e+"/oframebust.html?"+encodeURIComponent(location.href);(function(){if(document.body&&document.body.firstChild){document.body.insertBefore(b,document.body.firstChild)}else{setTimeout(arguments.callee,0)}})();return}top.location=location}})(window.Lego);(function(f){var b=(function(){_}).toString().indexOf("_")>-1,a=f.browser.msie,d=a?["toString","valueOf"]:null,g=function(){};function e(i,h,j){var l=false;if(a){var k=[];f.each(d,function(){j.hasOwnProperty(this)&&(l=true)&&k.push({name:this,val:j[this]})});if(l){f.each(j,function(m){k.push({name:m,val:this})});j=k}}f.each(j,function(n,o){if(l){n=o.name;o=o.val}if(f.isFunction(o)&&(!b||o.toString().indexOf(".__base")>-1)){var m=i[n]||function(){};h[n]=function(){var q=this.__base;this.__base=m;var p=o.apply(this,arguments);this.__base=q;return p}}else{h[n]=o}})}f.inherit=function(){var i=f.isFunction(arguments[0]),o=i?arguments[0]:g,k=arguments[i?1:0]||{},m=arguments[i?2:1],h=k.__constructor||(i&&o.prototype.__constructor)?function(){this.__constructor.apply(this,arguments)}:function(){};if(!i){h.prototype=k;h.prototype.__self=h.prototype.constructor=h;return f.extend(h,m)}f.extend(h,o);var l=function(){},j=l.prototype=o.prototype,n=h.prototype=new l();n.__self=n.constructor=h;e(j,n,k);m&&e(o,h,m);return h};f.inheritSelf=function(k,i,j){var h=k.prototype;e(h,h,i);j&&e(k,k,j);return k}})(jQuery);(function(a){a.isEmptyObject||(a.isEmptyObject=function(d){for(var b in d){return false}return true})})(jQuery);(function(d){var a=0,e="__"+(+new Date),b=function(){return"uniq"+ ++a};d.identify=function(h,g){if(!h){return b()}var f="uniqueID" in h?"uniqueID":e;return g||f in h?h[f]:h[f]=b()}})(jQuery);(function(e){var a="__"+ +new Date+"storage",d=function(g,f){return e.identify(g)+(f?e.identify(f):"")},b={buildEventName:function(f){return f},on:function(o,j,p,s,m){if(typeof o=="string"){if(e.isFunction(j)){s=p;p=j;j=undefined}var f=d(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||this,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;e.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=d(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;e.each(p,function(u,i){m.un(u,i,t)})}return this},trigger:function(j,i){typeof j==="string"?j=e.Event(this.buildEventName(j)):j.type=this.buildEventName(j.type);var k=this[a];if(k&&(k=k[j.type])){var h=k.list.first,f,g;while(h){j.data=h.data;f=h.fn.call(h.ctx,j,i);if(typeof f!=="undefined"){j.result=f;if(f===false){j.preventDefault();j.stopPropagation()}}g=h.next;h.special&&h.special.one&&this.un(j.type,h.fn,h.ctx);h=g}}return this}};e.observable=e.inherit(b,b)})(jQuery);BEM=(function(f,g){var e=[],b={};function d(j,i,h){return(j?"__elem_"+j:"")+"__mod"+(i?"_"+i:"")+(h?"_"+h:"")}function a(i,h,j){f.isFunction(i)?(h[d(j,"*","*")]=i):f.each(i,function(l,k){f.isFunction(k)?(h[d(j,l,"*")]=k):f.each(k,function(m,n){h[d(j,l,m)]=n})})}return f.inherit(f.observable,{__constructor:function(i,h){this._modCache={};this.params=f.extend(this.getDefaultParams(),i);this._uniqId=this.params.uniqId||f.identify(this);this.__self._uniqIdToBlock[this._uniqId]=this;h!==false?this._init():this.afterCurrentEvent(this._init)},_init:function(){this.setMod("js","inited").trigger("init")},changeThis:function(i,h){var j=this;return function(){return i.apply(h||j,arguments)}},afterCurrentEvent:function(i,h){this.__self.afterCurrentEvent(this.changeThis(i,h))},bind:function(j,k,i,h){return this.on(j,k,i,h)},bindOne:function(j,k,i,h){return this.onFirst(j,k,i,h)},unbind:function(i,h){return this.un(i,h)},trigger:function(i,h){this.__base(i=this.buildEvent(i),h).__self.trigger(i,h);return this},buildEvent:function(h){typeof h=="string"&&(h=f.Event(h));h.block=this;return h},hasMod:function(i,j,h){if(arguments.length==2){h=j;j=i;i=g}return this.getMod(i,j)===h},getMod:function(j,k){var h=typeof j;if(h==="string"||h==="undefined"){k=j||k;var i=this._modCache;return k in i?i[k]:i[k]=this._extractModVal(k)}return this._getElemMod(k,j)},_getElemMod:function(j,h,i){return this._extractModVal(j,h,i)},getMods:function(k){var i=k&&typeof k!="string",l=this,h=[].slice.call(arguments,i?1:0),j=l._extractMods(h,i?k:g);if(!i){h.length?f.each(h,function(n,m){l._modCache[m]=j[m]}):l._modCache=j}return j},setMod:function(k,m,h){if(typeof h=="undefined"){h=m;m=k;k=g}var o=this;if(!k||k[0]){var l,n=k?o._getElemMod(m,k,l=o.__self._extractElemNameFrom(k)):o.getMod(m);if(n===h){return o}var i=true,j=[m,h,n];k&&j.unshift(k);f.each([["*","*"],[m,"*"],[m,h]],function(){i=o._callModFn(l,this[0],this[1],j)!==false&&i});!k&&i&&(o._modCache[m]=h);i&&o._afterSetMod(m,h,k,l)}return o},_afterSetMod:function(j,h,i){},toggleMod:function(j,k,i,m,l){if(typeof j=="string"){l=m;m=i;i=k;k=j;j=g}if(typeof m=="undefined"){m=""}else{if(typeof m=="boolean"){l=m;m=""}}var h=this.getMod(j,k);(h==i||h==m)&&this.setMod(j,k,typeof l==="boolean"?(l?i:m):this.hasMod(j,k,i)?m:i);return this},delMod:function(h,i){if(!i){i=h;h=g}return this.setMod(h,i,"")},_callModFn:function(k,j,h,i){var l=d(k,j,h);return this[l]?this[l].apply(this,i):g},_extractModVal:function(i,h){return""},_extractMods:function(h,i){return{}},getDefaultParams:function(){return{}},del:function(i){var h=[].slice.call(arguments);typeof i=="string"&&h.unshift(this);this.__self.del.apply(this.__self,h);return this},destruct:function(){delete this.__self._uniqIdToBlock[this._uniqId]}},{blocks:{},_uniqIdToBlock:{},_liveEventStorage:{},MOD_DELIM:"_",BLOCK_ELEM_DELIM:"__",decl:function(h,i,k){typeof h=="string"&&(h={name:h});if(i.onSetMod){a(i.onSetMod,i);delete i.onSetMod}if(i.onElemSetMod){f.each(i.onElemSetMod,function(n,m){a(m,i,n)});delete i.onElemSetMod}var j=BEM.blocks[h.baseBlock||h.name]||this;if(h.modName){k=null;f.each(i,function(m,n){f.isFunction(n)&&(i[m]=function(){var p;if(this.hasMod(h.modName,h.modVal)){p=n}else{var o=j.prototype[m];o&&o!==i[m]&&(p=this.__base)}return p?p.apply(this,arguments):g})})}var l;h.name==j._name?(l=f.inheritSelf(j,i,k))._processLive(true):(l=BEM.blocks[h.name]=f.inherit(j,i,k))._name=h.name;return l},_processLive:function(h){return false},create:function(h,i){return new this.blocks[h](i)},getName:function(){return this._name},_extractElemNameFrom:function(h){},buildEventName:function(i){var h=i+":"+this._name;return h in b?b[h]:b[h]=i.replace(/ |^/g,"$&"+this._name+":")},afterCurrentEvent:function(i,h){e.push({fn:i,ctx:h});e.length==1&&setTimeout(function(){var j,k=e.splice(0,e.length);while(j=k.shift()){j.fn.call(j.ctx||this)}},0)},changeThis:function(i,h){return function(){return i.apply(h||this,arguments)}},del:function(l){var k=typeof l=="string",j=k?0:1,h=arguments.length;k&&(l=this);while(j<h){delete l[arguments[j++]]}return this}})})(jQuery);(function(a){if(typeof JSON!="undefined"){return a.stringify=JSON.stringify}var b=Object.prototype.toString;a.stringify=function(h){if(h===null){return"null"}switch(b.call(h)){case"[object String]":return'"'+h.replace(/"/g,'\\"')+'"';case"[object Number]":return""+h;case"[object Array]":var e="[",g=0,d=h.length,j;while(g<d){j=a.stringify(h[g]);e+=(g++>0?",":"")+(typeof j=="undefined"?"null":j)}return e+"]";case"[object Object]":var e="{",g=0,j;for(var f in h){if(h.hasOwnProperty(f)){j=a.stringify(h[f]);typeof j!="undefined"&&(e+=(g++>0?",":"")+'"'+f+'":'+j)}}return e+"}";default:return undefined}}})(jQuery);(function(a){var b=a.event.special.leftclick={setup:function(){a(this).bind("click",b.handler)},teardown:function(){a(this).unbind("click",b.handler)},handler:function(d){if(!d.button){d.type="leftclick";a.event.handle.apply(this,arguments);d.type="click"}}}})(jQuery);BEM.DOM=(function(j,f){var k=j(window),m=j(document),h={},d={},i={},g={},l="[a-zA-Z0-9-]+";function p(t,r){var s=t[0];j.each(o(s),function(u,w){a(w,s,u,r);var v=BEM._uniqIdToBlock[w.uniqId];v?v._addDomElem(t):e(u,t)})}function e(y,u,t,r,z){if(typeof t=="boolean"){z=r;r=t;t=f}var v=u[0];t=a(t||o(v)[y],v,y);var x=t.uniqId;if(BEM._uniqIdToBlock[x]){return BEM._uniqIdToBlock[x]}h[x]=h[x]?h[x].add(u):u;var w=BEM.blocks[y]||BEM.DOM.decl(y,{},{live:true});if(r||!(w._liveInitable=!!w._processLive())){var s=new w(h[x],t,!!r);delete h[x];z&&z.apply(s,Array.prototype.slice.call(arguments,4));return s}}function a(w,t,s,r){(w||(w={})).uniqId||(w.uniqId=(w.id?s+"-id-"+w.id:j.identify())+(r||j.identify()));var v=j.identify(t),u=d[v]||(d[v]={});u[s]||(u[s]=w);return w}function b(t,s,u){var r=t.find(s);return u?r:r.add(t.filter(s))}function o(r){var s=j.identify(r);return d[s]||(d[s]=q(r))}function q(t){var s=t.onclick;if(!s&&t.tagName.toLowerCase()=="body"){var r=j(t).attr("onclick");r&&(s=Function(r))}return s?s():{}}function n(r){delete d[j.identify(r)]}j.fn.bem=function(r,s){return e(r,this,s,true)};return BEM.decl("i-bem__dom",{__constructor:function(s,t,r){this.domElem=s;this._eventNameCache={};this._elemCache={};this.__base(t,r)},_addDomElem:function(r){this.domElem=this.domElem.add(r)},_removeDomElem:function(r){!(this.domElem=this.domElem.not(r))[0]&&this.destruct()},findBlocksInside:function(s,r){return this._doBlocksMethod(this._buildFindBlocksParams("find",s,r))},findBlockInside:function(s,r){return this._doBlocksMethod(this._buildFindBlocksParams("find",s,r,true))},findBlocksOutside:function(s,r){return this._doBlocksMethod(this._buildFindBlocksParams("parents",s,r))},findBlockOutside:function(s,r){return this._doBlocksMethod(this._buildFindBlocksParams("closest",s,r))[0]},findBlocksOn:function(s,r){return this._doBlocksMethod(this._buildFindBlocksParams("",s,r))},findBlockOn:function(s,r){return this._doBlocksMethod(this._buildFindBlocksParams("",s,r,true))},_buildFindBlocksParams:function(r,t,s,u){return{select:r,elem:s?t:f,blockName:s||t,onlyFirst:u}},doBlocksMethodInside:function(t,s,u,r){return this._doBlocksMethod(this._buildDoBlocksMethodParams("find",t,s,u,r))},doBlocksMethodOutside:function(t,s,u,r){return this._doBlocksMethod(this._buildDoBlocksMethodParams("closest",t,s,u,r))},doBlocksMethodOn:function(t,s,u,r){return this._doBlocksMethod(this._buildDoBlocksMethodParams("",t,s,u,r))},doBlocksMethod:function(s,t,r){return this._doBlocksMethod({blocks:s,method:t,args:r})},_buildDoBlocksMethodParams:function(r,v,u,w,t){var s=typeof w=="string";return{select:r,elem:s?v:f,blockName:s?u:v,method:s?w:u,args:s?t:w}},_doBlocksMethod:function(u){var v=this;if(u.blocks){return j.map(u.blocks,function(w){return v._doBlockMethod(w,u.method,u.args)})}var t=u.elem?(typeof u.elem=="string"?this.findElem(u.elem):u.elem):this.domElem,r="."+u.blockName+(u.onlyFirst?":first":""),s=t.filter(r);u.select&&(s=s.add(t[u.select](r)));return u.onlyFirst?this._doBlockMethod(e(u.blockName,s,true),u.method,u.args):j.map(s,function(w){return v._doBlockMethod(e(u.blockName,j(w),true),u.method,u.args)})},_doBlockMethod:function(s,t,r){return t?s[t].apply(s,r||[]):s},bindToDomElem:function(s,t,r){var u=this;r?s.bind(u._buildEventName(t),function(v){(v.data||(v.data={})).domElem=j(this);return r.apply(u,arguments)}):j.each(t,function(w,v){u.bindToDomElem(s,w,v)});return u},bindToDoc:function(s,r){return this.bindToDomElem(m,s,r)},bindToWin:function(s,r){return this.bindToDomElem(k,s,r)},bindToBlock:function(s,r){return this.bindToDomElem(this.domElem,s,r)},bindToElem:function(t,s,r){return this.bindToDomElem(typeof t=="string"?this.findElem(t):t,s,r)},bindTo:function(t,s,r){if(!s||j.isFunction(s)){r=s;s=t;t=this.domElem}else{if(typeof t=="string"){t=this.elem(t)}}return this.bindToDomElem(t,s,r)},unbindFromDomElem:function(r,s){r.unbind(this._buildEventName(s));return this},unbindFromDoc:function(r){return this.unbindFromDomElem(m,r)},unbindFromWin:function(r){return this.unbindFromDomElem(k,r)},unbindFromBlock:function(r){return this.unbindFromDomElem(this.domElem,r)},unbindFromElem:function(s,r){return this.unbindFromDomElem(typeof s=="string"?this.findElem(s):s,r)},unbindFrom:function(s,r){if(!r){r=s;s=this.domElem}else{if(typeof s=="string"){s=this.elem(s)}}return this.unbindFromDomElem(s,r)},buildClass:function(s,r){return this.__self.buildClass(s,r)},buildElemClass:function(t,s,r){return this.__self.buildElemClass(t,s,r)},buildSelector:function(t,s,r){return this.__self.buildSelector(t,s,r)},_buildEventName:function(t){var v=this,r=v._eventNameCache,u="."+v._uniqId,s=".bem_"+v.__self._name;return j.map(t.split(" "),function(w){if(w in r){return r[w]}if((w||"").indexOf(".")<0){return r[w]=w+u}return r[w]=j.map(w.split("."),function(y,x){return x==0?y+s:s+"_"+y}).join("")+u}).join(" ")},trigger:function(s,r){this.__base(s=this.buildEvent(s),r)._ctxTrigger(s,r);return this},_ctxTrigger:function(s,r){var u=this,t=i[s.type];t&&u.domElem.each(function(){var w=this,v=t.counter;while(w&&v){var y=j.identify(w,true);if(y){var x=t.ctxs[y];if(x){j.each(x,function(A,z){z.fn.call(z.ctx||u,s,r)});v--}}w=w.parentNode}})},setMod:function(s,t,r){if(s&&typeof r!="undefined"&&s.length>1){var u=this;s.each(function(){u.setMod(j(this),t,r)});return u}return this.__base(s,t,r)},_extractModVal:function(v,s,u){var r=(s||this.domElem)[0],t;r&&(t=r.className.match(this.__self._buildModValRE(v,u||s)));return t?t[1]:""},_extractMods:function(r,w){var v={},t=this.__self.MOD_DELIM,s=!r.length,u=0;j.each((w||this.domElem)[0].className.match(this.__self._buildModValRE("("+(s?l:r.join("|"))+")",w,"g"))||[],function(x,y){y=j.trim(y);var A=y.lastIndexOf(t),z=y.substr(0,A-1).lastIndexOf(t);v[y.substr(z+1,A-z-1)]=y.substr(A+1);++u});u<r.length&&j.each(r,function(x,y){y in v||(v[y]="")});return v},_afterSetMod:function(w,s,u,v){var r=this.__self._buildModClassPrefix(w,v),t=this.__self._buildModValRE(w,v),x=s==="";(u||this.domElem).each(function(){this.className.indexOf(r)>-1?this.className=this.className.replace(t,(x?"":r+s)+"$2"):x||j(this).addClass(r+s)});v&&this.dropElemCache(v,w,s)},findElem:function(u,w,v,t){if(arguments.length%2){t=v;v=w;w=u;u=this.domElem}else{if(typeof u=="string"){u=this.findElem(u)}}var s=this.__self,r="."+j.map(w.split(" "),function(x){return s._buildElemModClass({elemName:x,modName:v,modVal:t})}).join(",.");return b(u,r)},_elem:function(s,u,r){var t=s+this.__self._buildModPostfix(u,r);return this._elemCache[t]||(this._elemCache[t]=this.findElem(s,u,r))},elem:function(u,t,s){if(u.indexOf(" ")<0){return this._elem(u,t,s)}var r=j([]),v=this;j.each(u.split(" "),function(){r=r.add(v._elem(this,t,s))});return r},dropElemCache:function(u,t,r){if(u){var v=this,s=v.__self._buildModPostfix(t,r);u.indexOf(" ")<0?delete v._elemCache[u+s]:j.each(u.split(" "),function(x,w){delete v._elemCache[w+s]})}else{this._elemCache={}}return this},containsDomElem:function(r){return r.parents().andSelf().index(this.domElem)>-1},destruct:function(s){this.__base();var r=this.__self;this.dropElemCache().domElem.each(function(t,u){j.each(o(u),function(v,w){var x=r._uniqIdToBlock[w.uniqId];x&&x._removeDomElem(u)});n(u)});s||this.domElem.remove()}},{doc:m,win:k,_processLive:function(s){var u=this,t=u._liveInitable;if("live" in u){var r=typeof t=="undefined";if(r^s){if(j.isFunction(u.live)){t=u.live()!==false;u.live=function(){}}else{t=u.live}}}return t},init:function(s,u,t){if(!s||j.isFunction(s)){t=u;u=s;s=m}var r=j.identify();b(s,".i-bem").each(function(){p(j(this),r)});u&&this.afterCurrentEvent(u,t)},destruct:function(s,r,t){if(typeof s!="boolean"){t=r;r=s;s=f}var u=this;b(r,".i-bem",t).each(function(){j.each(o(this),function(v,w){if(w.uniqId){var x=u._uniqIdToBlock[w.uniqId];x&&x.destruct(true)}});n(this)});s||(t?r.empty():r.remove())},update:function(r,s,u,t){this.destruct(r,true);this.init(r.html(s),u,t)},_liveClassBind:function(t,u,y,r){var x=this;if(u.indexOf(" ")>-1){j.each(u.split(" "),function(z,A){x._liveClassBind(t,A,y,r)})}else{var s=x.buildEventName(u),w=g[s],v=j.identify(y);if(!w){w=g[s]={};m.bind(u,x.changeThis(x._liveClassTrigger,x))}w=w[t]||(w[t]={uniqIds:{},fns:[]});if(!(v in w.uniqIds)){w.fns.push({uniqId:v,fn:x._buildLiveEventFn(y,r)});w.uniqIds[v]=w.fns.length-1}}return this},_liveClassUnbind:function(u,v,y){var t=this.buildEventName(v),x=g[t];if(x){if(y){if(x=x[u]){var w=j.identify(y);if(w in x.uniqIds){var s=x.uniqIds[w],r=x.fns.length-1;x.fns.splice(s,1);while(s<r){x.uniqIds[x.fns[s++].uniqId]=s-1}delete x.uniqIds[w]}}}else{delete x[u]}}return this},_liveClassTrigger:function(x){var w=g[this.buildEventName(x.type)];if(w){var t=x.target,r=[];for(var y in w){w.hasOwnProperty(y)&&r.push(y)}do{var s=" "+t.className+" ",v=0;while(y=r[v++]){if(s.indexOf(" "+y+" ")>-1){var u=0,A=w[y].fns,z;while(z=A[u++]){z.fn.call(j(t),x)}r.splice(--v,1)}}}while(r.length&&(t=t.parentNode))}},_buildLiveEventFn:function(t,r){var s=this;return function(v){var u=[s._name,((v.data||(v.data={})).domElem=j(this)).closest(s.buildSelector()),true],w=e.apply(null,r?u.concat([t,v]):u);w&&(r||t.apply(w,arguments))}},liveInitOnEvent:function(s,r,t){return this.liveBindTo(s,r,t,true)},liveBindTo:function(t,s,u,r){if(!u){u=s;s=t;t=f}return this._liveClassBind(this.buildBaseClass(t),s,u,r)},liveUnbindFrom:function(s,r,t){return this._liveClassUnbind(this.buildBaseClass(s),r,t)},liveInitOnBlockInit:function(s,t){var r=this._name;BEM.blocks[s].on("init",function(u){var v=u.block.findBlocksOn(r);t&&j.each(v,function(){t.call(this)})})},liveInitOnBlockInsideInit:function(s,t){var r=this._name;BEM.blocks[s].on("init",function(u){var v=u.block.findBlocksOutside(r);t&&j.each(v,function(){t.call(this)})});return this},liveCtxBind:function(s,w,v,u,t){if(j.isFunction(v)){t=u;u=v;v=f}var y=this;if(w.indexOf(" ")>-1){j.each(w.split(" "),function(z,A){y.liveCtxBind(s,A,v,u,t)})}else{var r=y.buildEventName(w),x=i[r]||(i[r]={counter:0,ctxs:{}});s.each(function(){var A=j.identify(this),z=x.ctxs[A];if(!z){z=x.ctxs[A]={};++x.counter}z[j.identify(u)+(t?j.identify(t):"")]={fn:u,data:v,ctx:t}})}return y},liveCtxUnbind:function(s,v,u,t){var x=this,r=x.buildEventName(v),w=i[r];if(w){s.each(function(){var z=j.identify(this,true),y;if(z&&(y=w.ctxs[z])){u&&delete y[j.identify(u)+(t?j.identify(t):"")];if(!u||j.isEmptyObject(y)){w.counter--;delete w.ctxs[z]}}});w.counter||delete i[r]}return x},_extractElemNameFrom:function(r){var s=r[0].className.match(this._buildElemNameRE());return s?s[1]:f},extractParams:q,buildClass:function(u,r){var s=this._name;if(u){var t={},v=this;r?t[u]=r:t=u;s=[s];j.each(t,function(x,w){s.push(" ",v._name,v._buildModPostfix(x,w))});s=s.join("")}return s},buildBaseClass:function(r){return this.buildClass()+(r?this.BLOCK_ELEM_DELIM+r:"")},_buildModClass:function(s,r){return this.buildClass()+this._buildModPostfix(s,r)},buildElemClass:function(t,w,s){var x=this,u=x.buildBaseClass(t),r=[u],v={};arguments.length==2||typeof s=="undefined"?v=arguments[1]:v[w]=s;v&&j.each(v,function(z,y){y&&r.push(" ",x._buildElemModClass({elemClass:u,modName:z,modVal:y}))});return r.join("")},_buildElemModClass:function(r){return(r.elemClass||this.buildBaseClass(r.elemName))+this._buildModPostfix(r.modName,r.modVal)},_buildModPostfix:function(s,r){return s?this.MOD_DELIM+s+this.MOD_DELIM+r:""},_buildModClassPrefix:function(s,r){return this.buildClass()+(r?this.BLOCK_ELEM_DELIM+(typeof r==="string"?r:this._extractElemNameFrom(r)):"")+this.MOD_DELIM+s+this.MOD_DELIM},_buildModValRE:function(s,r,t){return new RegExp(this._buildModClassPrefix(s,r)+"("+l+")(\\s|$)",t)},_buildElemNameRE:function(){return new RegExp(this._name+this.BLOCK_ELEM_DELIM+"("+l+")(?:\\s|$)")},buildSelector:function(t,s,r){if(!(arguments.length&1)){r=s;s=t;t=f}return"."+(t?this._buildElemModClass({elemName:t,modName:s,modVal:r}):this._buildModClass(s,r))},buildHtml:function(v){v=v||{};var s=v.tag||"div",w=this,r=["<",s,' class="'],u={};j.each([{name:v.name,elem:v.elem,mods:v.mods,params:v.params}].concat(v.mix||[]),function(x,z){var y=z.name?BEM.blocks[z.name]:w;x&&r.push(" ");r.push(z.elem?y.buildElemClass(z.elem,z.mods):y.buildClass(z.mods));z.elem||(u[y.getName()]=z.params||{})});var t=!j.isEmptyObject(u);r.push(t?" i-bem":"",'"');t&&r.push(' onclick="return ',j.stringify(u).replace(/"/g,"'"),'"');r.push(">",this.buildHtmls(v.content),"</",s,">");return r.join("")},buildHtmls:function(r){if(!j.isArray(r)){return r||""}var s=this;return j.map(r,function(t){return s.buildHtml(t)}).join("")}})})(jQuery);$(function(){BEM.DOM.init()});(function(d,a){var b=a.block["b-head-tabs"]=function(t){var e=d(this),w=d(".b-head-search"),v=w.find(".b-search .b-input input:first"),n=a.params.id,j=p(document.location.search),i={www:505,search:521,images:526}[n]||527,f={market:{cvredirect:1,clid:i}},l={news:{rpt:"nnews",grhow:"clutop"},yaca:{rpt:"rs2"},market:{cvredirect:1,clid:i},blogs:{ft:"blog"}},u=(function(){var x={};d.each(["news","yaca","market","blogs","maps","adresa","video","fotki","slovari","auto","images","music","www"],function(){x[this]=["family"]});return x})(),q=(function(){var x={};d.each(["news","yaca","market","blogs","maps","adresa","video","fotki","slovari","auto","images","music","www"],function(){x[this]=["noreask","family"]});return x})(),r=e.find(':not(strong)>a.b-head-tabs__link:not([href$="/all"])').map(function(){var y=this.host.split(".")[0],z=p(this.search).clid,x=d.param(g(y,z),true);return{node:this,clid:z,toServiceId:y,path:b.getHostToUrlMap()[y],host:this.host,searchHost:b.getHostMap()[y],noSearchParamsUrl:x?"?"+x:"",searchParams:o(y,z)}}).filter(function(){return typeof this.path!=="undefined"}),m,s=w.find(".b-search__advanced")[0];if(s){var h=p(s.search),k=s.pathname.substring(1);h.text="";r.push({node:s,clid:h.clid,toServiceId:n,path:k,host:s.host,noSearchParamsUrl:k+"?"+d.param(h,true),searchParams:h})}(function(){var x=d.trim(v.val())||t["default"];if(m!=x){m=x;d.each(r,function(){x&&(this.searchParams[b.getSearchParamName(this.toServiceId)]=x);this.node.href=[this.node.protocol+"/",x&&this.searchHost?this.searchHost:this.host,x?this.path+"?"+d.param(this.searchParams,true):this.noSearchParamsUrl].join("/")})}setTimeout(arguments.callee,200)})();function g(x,y){var z=f[x]||{};!z.clid&&y&&(z.clid=y);d.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]||{};d.each(B,function(){j[this]&&(A[this]=j[this])});!A.clid&&z&&y!=="www"&&(A.clid=z);return A}function p(x){var y={};d.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];d.isArray(A)?A.push(B):y[z]=[A,B]}else{y[z]=B}}});return y}};d.extend(b,{getHostToUrlMap:function(){var e={www:"yandsearch",market:"search.xml",maps:"",music:"#/search",video:"#search"};e.blogs=e.adresa=e.fotki=e.slovari=e.auto=e.market;e.news=e.yaca=e.images=e.www;return e},getHostMap:function(){return{}},getSearchParamName:function(e){return"text"}})})(jQuery,window.Lego);(function(b,a){a.block["b-dropdown"]=function(f){var e=b(this),d,j,h,k,i=false,m=false,l=function(){d=e.find(".b-dropdown__list");j=b('<div class="b-dropdown__popup"/>');h=b('<iframe class="b-dropdown__iframe" frameborder="0" src="javascript:\'<body style=\\\'background:none;overflow:hidden\\\'>\'"/>');k=d.clone(true).addClass("b-dropdown__list_clone").hide();d.before(j);j.after(k);g();b(document).keydown(function(n){if(n.keyCode==27&&!(n.metaKey||n.ctrlKey||n.altKey||n.shiftKey)){g()}}).click(function(n){if(!b(n.target).is(".b-dropdown *")){g()}}).bind("popupsClose.lego",g);m=true},g=(function(){if(i){return}j.css("visibility","hidden").before(d).hide();k.hide();i=true});e.find(".b-dropdown__or").click(function(o){o.preventDefault();if(!m){l()}if(e.hasClass("b-dropdown_state_disabled")){e.trigger("popupDisabled.lego");return}if(i){b(document).trigger("popupsClose.lego",{source:e[0]});var p=b.Event("popupOpen.lego");e.trigger(p);if(!p.isDefaultPrevented()){k.css("display","");j.append(d).css("visibility","");if(f.direction=="up"||e.hasClass("b-dropdown_direction_up")){var n=j.height()-k.height();j.css("margin-top",-(n-(parseInt(d.css("padding-bottom"),10)+parseInt(b(this).closest(".b-dropdown__item").css("padding-bottom"),10))))}j.prepend(h).css("display","");i=false}}else{g()}})}})(jQuery,window.Lego);(function(d,a){var b=a.block["b-head-user"]=function(){var e=d(this);if(a.params.login!=""||a.params.displayName){d.getJSON(b.getApiUrl(),{locale:a.params.locale,login:"yes","current-login":a.params.login,yu:a.getCookie("yandexuid")},function(i){if(!i||!i.services){return}var j=i.displayName&&i.displayName.social,g=d("<div/>").text(b.getUserLogin(i)).html(),f=j?'<b class="b-user b-user_social_yes b-user_provider_'+j.provider+'"><span class="b-user__provider-ico"></span>'+g+"</b>":'<b class="b-user"><b class="b-user__first-letter">'+g.substring(0,1)+"</b>"+g.substring(1)+"</b>",h='<div class="g-js b-dropdown" onclick="return {name:\'b-dropdown\'}"><ul class="b-dropdown__list"><li class="b-dropdown__item b-dropdown__visible"><a href="'+(j?a.params["social-host"]:"http://i.yandex.ru")+'" class="b-dropdown__or"><span class="b-pseudo-link">'+f+"</span></a></li>";d.each(i.services,function(){h+='<li class="b-dropdown__item">';if(a.params.id==this.id&&a.params.index){h+="<strong>"+this.title+"</strong>"}else{h+='<a class="b-dropdown__link"href="'+this.url+'"onmousedown="Lego.ch(\''+a.params.id+".login.myservices."+this.id+"',this)\">"+this.title+"</a>"}h+="</li>"});h+=b.getUserItems(i,e);h+="</ul></div>";j&&e.addClass("b-head-user_social_yes");e.find(".b-user").replaceWith(h);a.blockInit(e,".b-dropdown")})}};b.getApiUrl=function(){return a.params["pass-host"]+"/services?callback=?"};b.getUserItems=function(g){var f=g.displayName&&g.displayName.social?[{name:a.message("b-head-userinfo.user:profile","Мои профили"),url:a.params["social-host"]}]:[{name:a.message("b-head-userinfo.user:passport","Паспорт"),url:a.params["passport-host"]},{name:a.message("b-head-userinfo.user:change-password","Сменить пароль"),url:a.params["passport-host"]+"/passport?mode=changepass&retpath="+encodeURIComponent(a.params.retpath)+"/"}];var e="";d.each(f,function(j,h){e+='<li class="b-dropdown__item'+(j==0?" b-dropdown__line":"")+'"><a class="b-dropdown__link" href="'+h.url+'">'+h.name+"</a></li>"});return e};b.getUserLogin=function(e){return a.params.displayName&&a.params.displayName.social&&a.params.displayName.name||e.displayName&&e.displayName.name||a.params.login||e.login}})(jQuery,window.Lego);(function(b,a){a.block["b-hint-input"]=function(){var j=b(this),f=b("#"+j.attr("for")),h=function(){j.hide()},e=function(){j.show()},d=function(){i||f.val()?h():e()},i=false;f.bind("focus blur",function(k){i=k.type=="focus";d()}).bind("change mouseover",d);j.click(function(){f.focus()});f.change();var g=f.val();(function(){if(f.val()!=g){b(f).trigger("change");g=f.val()}setTimeout(arguments.callee,200)})()}})(jQuery,window.Lego);(function(d,b){var e;function a(f){f[0]&&!!f.attr("href")&&(window.location.href=f.attr("href"))}b.block["b-pager"]=function(f){if(e){return f.override&&(e=d(this))}e=d(this);if(f.keydownReaction){d(document).keydown(function(g){if(!g.ctrlKey||d(g.target).is("input, textarea")){return}if(g.keyCode==37){a(e.find(".b-pager__prev"))}else{if(g.keyCode==39){a(e.find(".b-pager__next"))}}})}}})(jQuery,window.Lego);(function(e,a){var d=!((e.browser.safari||e.browser.webkit)&&navigator.userAgent.toLowerCase().indexOf("mobile")>-1),b=a.block["b-suggest"]=function(G){var A=e(this),L=e('<div class="b-suggest-popup"><i class="b-suggest__opera-gap"></i><div class="b-suggest-list">'+(d?('<iframe class="b-suggest__iframe" frameborder="0" src="javascript:\'<body style=\\\'background:none;overflow:hidden\\\'>\'"></iframe>'):'<div class="b-suggest__iframe"/>')+'<ul class="b-suggest-items"></ul>'+(G.close?'<div class="b-suggest-close"><a class="b-pseudo-link" href="javascript:void(0)">Закрыть</a></div>':"")+'<div class="b-suggest-nah">Включены <a class="b-suggest-nah__link" href="http://nahodki.yandex.ru/about_suggest.xml">мои запросы</a></div></div></div>').hide(),I=L.find(".b-suggest-items"),E=A.closest("form").find('input[name="'+(G["for"]||"text")+'"]'),F=E.closest("form"),r=G.url||(G.host||"")+(G.path||""),s=G.openInNewWindow=typeof G.openInNewWindow=="undefined"?true:G.openInNewWindow,m=!!G.permanent,x=(function(){var M={};M["*"+r]=["",[]];return M})(),p=G.timeout||700,J={suggestType:G.suggestType||((G.id=="serp")?"serp_ru":G.id),usageType:"not_shown",region:"",nah:"nah_not_shown",buttonByMouse:"",position:"p0",session:(new Date().getTime()+Math.round(Math.random()*10000)),queryTimes:[],ratio:{userValue:0,finalValue:0,userActions:0},pos:"",_keydownTriggered:false},l="",w=G.getData?b.getDataFns[G.getData]:(function(){var P=(r.match(/^[^\/]*\/\/[^\/]+\//)||[location.protocol+"//"+location.host])[0]+"jquery"+(e.fn.jquery=="1.4.2"?"-1-4-2":"")+".crossframeajax.html",S=e('<iframe style="display:none" src="'+P+'"></iframe>').appendTo("body")[0],O=document.domain,N=document.domain.match(/([^.]+\.)?[^.]+$/)[0],M=10,T;try{document.domain!=N&&(document.domain=N)}catch(R){}(function Q(){if(M){try{T=S.contentWindow.$.crossframeAjax;if(T){w=T}else{throw true}}catch(U){M--;setTimeout(Q,42)}}else{try{document.domain!=O&&(document.domain=O)}catch(U){}}})();return e.ajax})(),u=function(M){var N=M.length&&M[0].onclick?M[0].onclick():{};return N.value||M.text()},y=function(Q){var O=0;if(typeof(Q.selectionEnd)=="number"){O=Q.selectionEnd}else{var P=document.selection.createRange();if(P&&P.parentElement()==Q){var N=Q.value.length,M=Q.createTextRange();M.moveToBookmark(P.getBookmark());var R=Q.createTextRange();R.collapse(false);O=M.compareEndPoints("EndToEnd",R)>-1?N:-M.moveEnd("character",-N)}}return O},H=(function(){function N(P){return e.isArray(P)&&b.buildItemHtmlFns[P[0]]?b.buildItemHtmlFns[P[0]](P,{stats:J,params:G}):'<li><span class="b-suggest-elem b-suggest-elem-link"><span class="content">'+P+"</span></span></li>"}function M(Q){J.usageType="not_used";J.region=Q[Q.length-1]["r"];var P=Q[1];if(!(k=P?P.length:0)){return t()}var R=Q[2]||[];I.html(e.map(P,function(T,S){return N(!!R[S]?["href",T,R[S]]:T)}).join("")).find(".b-suggest-elem").filter(":not(.b-suggest__elem_selectable_no)").bind("mouseenter mouseleave",function(S){e(this)[S.type=="mouseenter"?"addClass":"removeClass"]("b-suggest-elem_state_hover")});C=P.length-I.find(".b-suggest__elem_selectable_no").length;Q[Q.length-1].n?L.find(".b-suggest-close").hide().end().find(".b-suggest-nah").show():L.find(".b-suggest-close").show().end().find(".b-suggest-nah").hide();L.show();if(D===false&&J._keydownTriggered===true){J.usageType="edit";J._keydownTriggered=false}D=false}var O=0;return function(S){if(i){return}B(0,S);var R=x[S+"*"+r];if(R){M(R)}else{var V=setTimeout(t,p);O+=1;var Q=new Date();var U=document.getElementsByName("lr"),P;try{P=window.location.toString().match(/lr=(.*?)(&|$)/)}catch(T){P=""}if(U.length>0){l=U[0].value}else{if(P&&P.length>0){l=P[1]}else{l=""}}w({url:r,data:e.extend({part:E.val(),lr:l},a.params.yandexuid?{yu:a.params.yandexuid}:null),dataType:"json",type:"GET",timeout:p,success:(function(X,W){return function(Y){if(!Y){return}x[S+"*"+W]=Y;clearTimeout(V);if(X==O){M(Y)}J.queryTimes.push(new Date()-Q)}})(O,r)})}}})(),v=function(M){n();window.setTimeout(function(){e('<form style="display:none" action="'+M+'" method="get"'+(s?' target="_blank"':"")+"/>").appendTo(e("body")).submit().remove()},500)},i=false,D=true,g=false,t=(function(){if(D){return}L.hide();B(0,E.val());D=true}),k=0,C=0,B=(function(){var M=0,N=E.val();return function(Q,T){if(T!=undefined){N=T}M=Q?M+Q:0;if(M<0){M=C}if(M>C){M=0}if(M>0){J.position="p"+M}var S=I.find(".b-suggest-elem").filter(":not(.b-suggest__elem_selectable_no)").removeClass("b-suggest-elem_selected").eq(M?M-1:1000).addClass("b-suggest-elem_selected"),U=u(S),R=S.is(".b-suggest-elem_nav")?f:(U||N),P=S.attr("href"),O=U&&P?P:"";E.val()!=R&&E.val(R);E.data("href",O)}})();var o=E.data("lego:focused");if(o){E.blur()}E.attr("autocomplete","off");if(o){E.focus()}if(G.text){E.val(G.text)}A.append(L);var q=false;L.find(".b-suggest-close").mousedown(function(){q=true}).mouseup(function(){q=false}).click(function(){B(0);t();i=true;E.focus()});L.find(".b-suggest-nah__link").mousedown(function(){window.location=this.href});e(document).bind("popupsClose.lego",t).keydown(function(M){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey){g=true}}).keyup(function(M){g=false}).mouseup(function(){q=false});F.find(":submit").click(function(){J.buttonByMouse="button_by_mouse"});I.mousedown(function(P){q=true;var O=e(P.target);if(O.is("li *")){j=O.closest(".b-suggest-elem");if(j.hasClass("b-suggest-elem_nav")){n()}else{if(!j.hasClass("b-suggest__elem_selectable_no")){B(0,u(j));E.data("href",j.attr("href"));var N=O.parents("ul"),M=P.target.className;if(M&&M.split(" ").length>0){N.find("."+M.split(" ")[0]).each(function(Q){if(this==P.target){J.position="p"+(Q+1);O.hasClass("b-suggest-elem_nah")&&(J.nah="nah_used")}})}J.usageType="mouse";if(!m){i=true}if(j.get(0).tagName.toLowerCase()!="a"){setTimeout(function(){F.submit()},0)}else{z()}}}}return false}).click(function(){if(m){t()}else{e.browser.msie?t():E.focus()}});var f="",j,h=false;F.submit(function(N){if(G.preventSubmit){t();i=true;z();setTimeout(function(){i=false},100);return false}if(h){return h=false}var M=E.data("href")||J.followAfterSubmit;if(m){E.blur()}if(!J.submitted){N.preventDefault();if(M){J.followAfterSubmit=M}J.ratio.userValue=f.length;J.ratio.finalValue=E.val().length;z();window.setTimeout(function(){F.submit()},500)}else{if(M&&!m){N.preventDefault();location.href=M}else{if(M&&m){N.preventDefault();v(M)}}}});function K(){B(0);t();q=false}E.blur(function(M){if(M.originalEvent&&!M.originalEvent.preventDefault){setTimeout(function(){if(!q&&E[0]!=document.activeElement){t()}},84)}else{if(!q){t()}}}).click(function(){if(!D&&!E.val()){f="";t()}J.pos=y(E[0])}).keydown(function(M){switch(M.keyCode){case 38:case 40:M.preventDefault();J._keydownTriggered=true;if(D){i=false;H(E.val())}else{J.usageType="keyboard";B(M.keyCode-39)}break;case 13:break;case 27:q=true;break}setTimeout(function(){f!=E.val()&&J.ratio.userActions++},1)}).keypress(function(N){switch(N.keyCode){case 13:q=true;var M=I.find(".b-suggest-elem_selected");if(M.hasClass("b-suggest-elem_nav")){h=true;v(M.attr("href"));m&&t()}else{M.hasClass("b-suggest-elem_nah")&&(J.nah="nah_used");m||(i=true);F.submit();t()}return false;case 27:return false}}).keyup(function(M){J.pos=y(E[0]);switch(M.keyCode){case 38:case 40:break;case 27:K();break;default:if(f!=E.val()){f=E.val();clearInterval(N);var N=setTimeout(function(){H(E.val())},1)}break}});setTimeout(function(){E.focus(function(M){if(e(M.target).data("b-suggest")!==false){q=false;H(E.val())}})},42);if(m){setInterval(function(){x={"":[]}},30*60*1000)}A.bind("updateParams.lego",function(N,O){if(!O){return}var M=(r.match(/^[^\/]*\/\/[^\/]+\//)||[""])[0]+(O.path||"");if(M){r=M}if("closed" in O){i=O.closed}});function z(){a.params["show-counters"]&&a.cp(0,2873,[[J.suggestType,J.usageType,J.position,J.nah,J.buttonByMouse].join("."),"session="+J.session,"region="+J.region,"times="+J.queryTimes.join("."),"pos="+J.pos,"ratio="+J.ratio.userValue+"."+J.ratio.finalValue+"."+J.ratio.userActions].join("/"));m||(J.submitted=true)}function n(){a.params["show-counters"]&&a.cp(0,70833,J.suggestType+"/session="+J.session)}};b.getDataFns={};b.buildItemHtmlFns={href:function(g,f){if(g[3]&&g[3].nah&&g[3].nah==1){f.stats.nah=="nah_not_shown"&&(f.stats.nah="nah_not_used");return'<li><span class="b-suggest-elem b-suggest-elem_nah">'+g[1]+"</span></li>"}return'<li><a class="b-suggest-elem b-suggest-elem-link" href="'+g[2]+'"><span class="content">'+g[1]+"</span></a></li>"},nav:function(g,f){return'<li><a class="b-suggest-elem b-suggest-elem-link b-suggest-elem_nav"'+(f.params.openInNewWindow?' target="_blank"':"")+' href="http://'+g[2]+'"><span class="content"><span class="link">'+g[2]+'</span><span class="info">&nbsp;&mdash; '+g[1]+"</span></span></a></li>"},muz:function(g,f){return'<li><a class="b-suggest-elem b-suggest-elem-link b-suggest-elem_muz" target="_blank" href="http://'+g[2]+'"><span class="content"><span class="link">'+g[1]+'</span><i class="icon"></i></span></a></li>'},html:function(g,f){return'<li><span class="b-suggest-elem b-suggest-elem-link">'+g[1]+"</span></li>"}}})(jQuery,window.Lego);(function(b,a){a.block["b-tabbed-pane__tabs"]=function(g){var e=b(this),d=g.bind||"def",f=e.find(".b-tabbed-pane__tab",e),h=[];b.each(f,function(){var i=b(this);var j=(this.onclick?this.onclick():{}).bind||"def";h.push(i.data("b-tabbed-pane.tabs",{index:j}));i.click(function(){var k=b(this).data("b-tabbed-pane.tabs").index;k=typeof k=="string"?[k]:k;b(document).trigger(d+".togglePanel.lego",{index:k});b.each(h,function(){var l=this.data("b-tabbed-pane.tabs").index;this.toggleClass("b-tabbed-pane__item_current",i==this)})})})}})(jQuery,window.Lego);(function(b,a){a.block["b-tabbed-pane__panels"]=function(g){var f=b(this),d=g.id||"def",e=f.find(".b-tabbed-pane__panel"),h={};b.each(e,function(j){var k=(this.onclick?this.onclick():{}).id||"def";h[k]=b(this).data("b-tabbed-pane.tabs",{index:k})});b(document).bind(d+".togglePanel.lego",function(j,i){b.each(h,function(k){this.toggleClass("g-hidden",b.inArray(k,i.index)==-1)})})}})(jQuery,window.Lego);BEM.DOM.decl("b-form-button",{onSetMod:{js:function(){(this._href=this.domElem.attr("href"))&&this.isDisabled()&&this.domElem.removeAttr("href")},focused:{yes:function(){if(this.isDisabled()){return false}this.bindTo("keydown",this._onKeyDown)},"":function(){this.unbindFrom("keydown")}},disabled:function(b,a){this.elem("input").attr("disabled",a=="yes");this._href&&(a=="yes"?this.domElem.removeAttr("href"):this.domElem.attr("href",this._href))},"*":function(b,a){if(this.isDisabled()&&"hovered pressed".indexOf(b)>-1){return false}"hovered focused".indexOf(b)>-1&&a==""&&this.delMod("pressed")}},isDisabled:function(){return this.hasMod("disabled","yes")},_onKeyDown:function(a){if(a.keyCode==13&&!this._keyDowned){this._keyDowned=true;this.setMod("pressed","yes").bindTo("keyup",function(){this.delMod("pressed").unbindFrom("keyup");delete this._keyDowned})}},_onClick:function(a){this.isDisabled()?a.preventDefault():this.trigger("click")}},{live:function(){var a={mouseover:{name:"hovered",val:"yes"},mouseout:{name:"hovered"},mousedown:{name:"pressed",val:"yes"},mouseup:{name:"pressed"},focusin:{name:"focused",val:"yes"},focusout:{name:"focused"}};this.liveBindTo("leftclick",function(b){this._onClick(b)}).liveBindTo("mouseover mouseout mousedown mouseup focusin focusout",function(d){var b=a[d.type];this.setMod(b.name,b.val||"")})}});BEM.DOM.decl("b-form-input",{onSetMod:{js:function(){var b=this.elem("input"),a=this.__self;this._val=b.val();this._focused=false;this.bindTo(b,{focus:this.onFocus,blur:this.onBlur});this.params.autoFocus&&this.focus();if(!a._instances){var d=a._instances=[];(function(){$.each(d,function(){this.val(this.elem("input").val())});setTimeout(arguments.callee,20)})()}a._instances.push(this)}},onChange:function(a){return this.trigger("change",a)},onFocus:function(){this._focused=true;return this.trigger("focus")},onBlur:function(){this._focused=false;return this.trigger("blur")},focus:function(){this.elem("input")[0].focus();return this},blur:function(){this.elem("input")[0].blur();return this},isFocused:function(){return this._focused},disable:function(){this.elem("input").attr("disabled",true);return this},enable:function(){this.elem("input").attr("disabled",false);return this},isEnabled:function(){return !this.elem("input").attr("disabled")},val:function(d,b){if(typeof d=="undefined"){return this._val}if(this._val!=d){var a=this.elem("input");a.val()!=d&&a.val(d);this._val=d;this.onChange(b)}return this}},{_instances:null});(function(f,h){var e=[],g={},a={};function d(k,j,i){return(k?"__elem_"+k:"")+"__mod"+(j?"_"+j:"")+(i?"_"+i:"")}function b(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})})}this.BEM=f.inherit(f.observable,{__constructor:function(j,i){var k=this;k._modCache={};k._processingMods={};k.params=f.extend(k.getDefaultParams(),j);k._uniqId=k.params.uniqId||f.identify(k);a[k._uniqId]=k;i!==false?k._init():k.afterCurrentEvent(k._init)},_init:function(){var i=this;if("_uniqId" in i&&!i.hasMod("js","inited")){i.setMod("js","inited").trigger("init")}return i},changeThis:function(j,i){var k=this;return function(){return j.apply(i||k,arguments)}},afterCurrentEvent:function(j,i){this.__self.afterCurrentEvent(this.changeThis(j,i))},bind:function(k,l,j,i){return this.on(k,l,j,i)},bindOne:function(k,l,j,i){return this.onFirst(k,l,j,i)},unbind:function(j,i){return this.un(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(j,k,i){if(arguments.length==2){i=k;k=j;j=h}return this.getMod(j,k)===i},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?f.each(i,function(o,n){m._modCache[n]=k[n]}):m._modCache=k}return k},setMod:function(l,p,q){if(typeof q=="undefined"){q=p;p=l;l=h}var m=this;if(!l||l[0]){var n=(l&&l[0]?f.identify(l[0]):"")+"_"+p;if(this._processingMods[n]){return m}var k,j=l?m._getElemMod(p,l,k=m.__self._extractElemNameFrom(l)):m.getMod(p);if(j===q){return m}this._processingMods[n]=true;var i=true,o=[p,q,j];l&&o.unshift(l);f.each([["*","*"],[p,"*"],[p,q]],function(){i=m._callModFn(k,this[0],this[1],o)!==false&&i});!l&&i&&(m._modCache[p]=q);i&&m._afterSetMod(p,q,l,k);delete this._processingMods[n]}return m},_afterSetMod:function(k,i,j){},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{}},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(){delete a[this.un()._uniqId];delete this._uniqId}},{_name:"i-bem",blocks:g,_uniqIdToBlock:a,getBlockByUniqId:function(i){return a[i]},decl:function(i,j,l){if(typeof i=="string"){i={block:i}}else{if(i.name){i.block=i.name}}if(j.onSetMod){b(j.onSetMod,j);delete j.onSetMod}if(j.onElemSetMod){f.each(j.onElemSetMod,function(o,n){b(n,j,o)});delete j.onElemSetMod}var k=g[i.baseBlock||i.block]||this;if(i.modName){f.each(j,function(n,o){f.isFunction(o)&&(j[n]=function(){var q;if(this.hasMod(i.modName,i.modVal)){q=o}else{var p=k.prototype[n];p&&p!==j[n]&&(q=this.__base)}return q?q.apply(this,arguments):h})})}var m;i.block==k._name?(m=f.inheritSelf(k,j,l))._processLive(true):(m=g[i.block]=f.inherit(k,j,l))._name=i.block;return m},_processLive:function(i){return false},create:function(i,j){return new g[i](j)},getName:function(){return this._name},_extractElemNameFrom:function(i){},afterCurrentEvent:function(j,i){e.push({fn:j,ctx:i})==1&&setTimeout(function(){var k,l=e.splice(0,e.length);while(k=l.shift()){k.fn.call(k.ctx||this)}},0)},changeThis:function(j,i){return function(){return j.apply(i||this,arguments)}},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}})})(jQuery);(function(j,b,a){var h="_",d="__",e="[a-zA-Z0-9-]+";function f(m,k,l){l.push(h,m,h,k)}function g(m,n,k,l){l.push(m);k&&f(n,k,l)}function i(o,m,n,k,l){g(o,a,a,l);l.push(d,m);k&&f(n,k,l)}j.INTERNAL={NAME_PATTERN:e,MOD_DELIM:h,ELEM_DELIM:d,buildModPostfix:function(n,k,l){var m=l||[];f(n,k,m);return l?m:m.join("")},buildClass:function(q,o,p,k,l){var n=typeof p;if(n=="string"){if(typeof k!="string"){l=k;k=p;p=o;o=a}}else{if(n!="undefined"){l=p;p=a}else{if(o&&typeof o!="string"){l=o;o=a}}}if(!(o||p||l)){return q}var m=l||[];o?i(q,o,p,k,m):g(q,p,k,m);return l?m:m.join("")},buildClasses:function(o,n,m,k){var l=k||[];n?i(o,n,a,a,l):g(o,a,a,l);m&&b.each(m,function(q,p){if(p){l.push(" ");n?i(o,n,q,p,l):g(o,q,p,l)}});return k?l:l.join("")}}})(BEM,jQuery);(function(l,e,d){var h=l.INTERNAL,g=h.ELEM_DELIM,i={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},j=h.buildClasses,k={};function f(m,n,o){(m[n]||(m[n]=[])).unshift(o)}function b(m,n){return n.modName?function(o){(o._currBlock.mods||{})[n.modName]===n.modVal&&m(o)}:m}function a(n,m){var p=e.isArray(m),o;e.isArray(n)?p?o=n.concat(m):(o=n).push(m):p?(o=m).unshift(n):o=[n,m];return o}l.HTML={decl:function(o,n){typeof o=="string"&&(o={name:o});var m=k[o.name]||(k[o.name]={});n.onBlock&&f(m,"_block",b(n.onBlock,o));if(n.onElem){e.isFunction(n.onElem)?f(m,"_elem",b(n.onElem,o)):e.each(n.onElem,function(q,p){f(m,"_elem"+(q==="*"?"":g+q),b(p,o))})}},build:function(n){var m=new this.Ctx(n);m._buildAll();return m._flush()},Ctx:e.inherit({__constructor:function(m){this._buffer=[];this._params=m;this._tParams=null;this._tParamsChanges=null;this._currBlock=d},pos:function(){return this._params._pos},isFirst:function(){return this._params._pos===1},isLast:function(){var m=this._params;return m._pos===m._siblingsCount},params:function(m){var n=this;if(typeof m=="undefined"){return n._params}n._params=m;return n},param:function(m,p,n,r){var q=this,o=q._params;if(typeof p=="undefined"){return o[m]}if(n||!(m in o)){o[m]=p}else{if(r){o[m]=e.extend(p,o[m])}}return q},attrs:function(n,m){return this.param("attrs",n,m,true)},attr:function(n,p,o){var q=this;if(typeof p=="undefined"){return(q._params.attrs||{})[n]}var m=q._params.attrs;m?(o||!(n in m))&&(m[n]=p):(q._params.attrs={})[n]=p;return q},tag:function(n,m){return this.param("tag",n,m)},cls:function(n,m){return this.param("cls",n,m)},mods:function(n,m){return this.param("mods",n,m,true)},mod:function(m,p,o){var q=this;if(typeof p=="undefined"){return(q._params.mods||{})[m]}var n=q._params.mods;n?(o||!(m in n))&&(n[m]=p):(q._params.mods={})[m]=p;return q},js:function(m){return this.param("js",m)},content:function(n,m){return this.param("content",n,m)},wrapContent:function(m){var o=this,n=o._params;m.content=n.content;n.content=m;return o},beforeContent:function(m){var o=this,n=o._params;n.content=a(m,n.content);return o},afterContent:function(m){var o=this,n=o._params;n.content=a(n.content,m);return o},wrap:function(m){var o=this,n=o._params;m.block||(m._currBlock=o._currBlock);m.content=n._wrapper?n._wrapper:n;n._wrapper=m;return o},tParam:function(m,p){var q=this,o=q._tParams||(q._tParams={});if(typeof p=="undefined"){return o[m]}var n=q._tParamsChanges||(q._tParamsChanges={});m in n||(n[m]=o[m]);o[m]=p;return q},_buildAll:function(){var t=this,n=t._buffer,s=t._params,q=typeof s;if(q=="string"||q=="number"){n.push(s)}else{if(e.isArray(s)){var p=0,m=s.length,o,r;while(p<m){t._params=o=s[p++];r=typeof o;if(r=="string"||r=="number"){n.push(o)}else{if(o){o._pos=p;o._siblingsCount=m;t._buildByDecl()}}}}else{if(s){t._params._pos=t._params._siblingsCount=1;t._buildByDecl()}}}},_build:function(){var r=this,n=r._buffer,q=r._params,m=q.tag||"div",p,o=q.block||q.elem;q.js&&((p={})[q.block]=q.js===true?{}:q.js);n.push("<",m);if(o||q.cls){n.push(' class="');if(o){j(q.block||r._currBlock.block,q.elem,q.mods,n);q.mix&&e.each(q.mix,function(s,t){n.push(" ");j(t.block,t.elem,t.mods,n);t.js&&((p||(p={}))[t.block]=t.js===true?{}:t.js)})}q.cls&&n.push(o?" ":"",q.cls);p&&n.push(" i-bem");n.push('"')}p&&n.push(' onclick="return ',e.stringify(p).replace(/'/g,"\\'").replace(/"/g,"'"),'"');q.attrs&&e.each(q.attrs,function(s,t){t!==false&&n.push(" ",s,'="',typeof t!="undefined"&&t!==null?t.toString().replace(/"/g,"&quot;"):"",'"')});if(i[m]){n.push("/>")}else{n.push(">");if(typeof q.content!="undefined"){r._params=q.content;r._buildAll()}n.push("</",m,">")}},_flush:function(){var m=this._buffer.join("");delete this._buffer;return m},_buildByDecl:function(){var p=this,s=p._currBlock,m=p._params;m._currBlock&&(p._currBlock=m._currBlock);m.block&&(p._currBlock=m);if(!m._wrapper){if(m.block||m.elem){var r=k[p._currBlock.block];if(r){var t;if(m.elem){t=r["_elem"+g+m.elem];r._elem&&(t=(t?t.concat(r._elem):r._elem))}else{t=r._block}if(t){var n=0,q;while(q=t[n++]){q(p)}}}}if(m._wrapper){m._currBlock=p._currBlock;p._params=m._wrapper;return p._buildAll()}}var u=p._tParamsChanges;p._tParamsChanges=null;p._build();p._currBlock=s;if(u){var o=p._tParams;e.each(u,function(v,w){typeof w=="undefined"?delete o[v]:o[v]=w})}}})}})(BEM,jQuery);(function(j,f,i){var e=f(window),y=f(document),n={},A={},g={},q={},v=j.blocks,w=j._uniqIdToBlock,b=j.INTERNAL,l=b.NAME_PATTERN,p=b.MOD_DELIM,k=b.ELEM_DELIM,z=b.buildModPostfix,t=b.buildClass;function r(D,B){var C=D[0];f.each(s(C),function(E,G){d(G,C,E,B);var F=w[G.uniqId];F?F._addDomElem(D):a(E,D,G)})}function a(I,E,D,B,J){if(typeof D=="boolean"){J=B;B=D;D=i}var F=E[0];D=d(D||s(F)[I],F,I);var H=D.uniqId;if(w[H]){return w[H]._init()}n[H]=n[H]?n[H].add(E):E;var G=v[I]||u.decl(I,{},{live:true});if(B||!(G._liveInitable=!!G._processLive())){var C=new G(n[H],D,!!B);delete n[H];J&&J.apply(C,Array.prototype.slice.call(arguments,4));return C}}function d(G,D,C,B){(G||(G={})).uniqId||(G.uniqId=(G.id?C+"-id-"+G.id:f.identify())+(B||f.identify()));var F=f.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=f.identify(B);return A[C]||(A[C]=h(B))}function h(D){var C=D.onclick;if(!C&&D.tagName.toLowerCase()=="body"){var B=f(D).attr("onclick");B&&(C=Function(B))}return C?C():{}}function m(B){delete A[f.identify(B)]}function o(){return y[0][f.support.boxModel?"documentElement":"body"]}f.fn.bem=function(B,C){return a(B,this,C,true)};var u=j.DOM=j.decl("i-bem__dom",{__constructor:function(C,D,B){this.domElem=C;this._eventNameCache={};this._elemCache={};this._needSpecialUnbind=false;this.__base(D,B)},_addDomElem:function(B){this.domElem=this.domElem.add(B)},_removeDomElem:function(B){!(this.domElem=this.domElem.not(B))[0]&&this.destruct()},findBlocksInside:function(B,C){return this._doBlocksMethod(this._buildFindBlocksParams("find",B,C))},findBlockInside:function(B,C){return this._doBlocksMethod(this._buildFindBlocksParams("find",B,C,true))},findBlocksOutside:function(B,C){return this._doBlocksMethod(this._buildFindBlocksParams("parents",B,C))},findBlockOutside:function(B,C){return this._doBlocksMethod(this._buildFindBlocksParams("closest",B,C))[0]},findBlocksOn:function(B,C){return this._doBlocksMethod(this._buildFindBlocksParams("",B,C))},findBlockOn:function(B,C){return this._doBlocksMethod(this._buildFindBlocksParams("",B,C,true))},_buildFindBlocksParams:function(B,C,E,D){return{select:B,elem:E?C:i,block:E||C,onlyFirst:D}},doBlocksMethodInside:function(C,D,E,B){return this._doBlocksMethod(this._buildDoBlocksMethodParams("find",C,D,E,B))},doBlocksMethodOutside:function(C,D,E,B){return this._doBlocksMethod(this._buildDoBlocksMethodParams("closest",C,D,E,B))},doBlocksMethodOn:function(C,D,E,B){return this._doBlocksMethod(this._buildDoBlocksMethodParams("",C,D,E,B))},doBlocksMethod:function(C,D,B){return this._doBlocksMethod({blocks:C,method:D,args:B})},_buildDoBlocksMethodParams:function(B,E,F,G,D){var C=typeof G=="string";return{select:B,elem:C?E:i,block:C?F:E,method:C?G:F,args:C?D:G}},_doBlocksMethod:function(C){var F=this;if(C.blocks){return f.map(C.blocks,function(K){return F._doBlockMethod(K,C.method,C.args)})}var E=C.elem?(typeof C.elem=="string"?this.findElem(C.elem):C.elem):this.domElem,D=typeof C.block=="string",J=D?C.block:C.block.blockName,B="."+(D?t(J):t(J,C.block.modName,C.block.modVal))+(C.onlyFirst?":first":""),G=E.filter(B);C.select&&(G=G.add(E[C.select](B)));if(C.onlyFirst){return G[0]?this._doBlockMethod(a(J,G.eq(0),true),C.method,C.args):null}if(C.method){return f.map(G,function(K){return F._doBlockMethod(a(J,f(K),true),C.method,C.args)})}var I=[],H={};f.each(G,function(K,L){var M=a(J,f(L),true);if(!H[M._uniqId]){H[M._uniqId]=true;I.push(M)}});return I},_doBlockMethod:function(C,D,B){return D?C[D].apply(C,B||[]):C},bindToDomElem:function(C,D,B){var E=this;B?C.bind(E._buildEventName(D),function(F){(F.data||(F.data={})).domElem=f(this);return B.apply(E,arguments)}):f.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(e,C,B)},bindToBlock:function(C,B){return this.bindToDomElem(this.domElem,C,B)},bindToElem:function(D,C,B){return this.bindToDomElem(typeof D=="string"?this.findElem(D):D,C,B)},bindTo:function(D,C,B){if(!C||f.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(e,B)},unbindFromBlock:function(B){return this.unbindFromDomElem(this.domElem,B)},unbindFromElem:function(C,B){return this.unbindFromDomElem(typeof C=="string"?this.findElem(C):C,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?f.map(B.split(" "),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]=f.map(D.split("."),function(H,G){return G==0?H+C:C+"_"+H}).join("")+E},trigger:function(C,B){this.__base(C=this.buildEvent(C),B)._ctxTrigger(C,B);return this},_ctxTrigger:function(C,B){var F=this,E=g[F.__self._buildCtxEventName(C.type)],D={};E&&F.domElem.each(function(){var H=this,G=E.counter;while(H&&G){var J=f.identify(H,true);if(J){if(D[J]){break}var I=E.ctxs[J];if(I){f.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(){E.setMod(f(this),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.each((F||this.domElem)[0].className.match(this.__self._buildModValRE("("+(C?l:B.join("|"))+")",F,"g"))||[],function(G,H){var J=(H=f.trim(H)).lastIndexOf(p),I=H.substr(0,J-1).lastIndexOf(p);E[H.substr(I+1,J-I-1)]=H.substr(J+1);++D});D<B.length&&f.each(B,function(G,H){H in E||(E[H]="")});return E},_afterSetMod:function(H,D,F,G){var C=this.__self,B=C._buildModClassPrefix(H,G),E=C._buildModValRE(H,G),I=D==="";(F||this.domElem).each(function(){var J=this.className;J.indexOf(B)>-1?this.className=J.replace(E,(I?"":"$1"+B+D)+"$3"):I||f(this).addClass(B+D)});G&&this.dropElemCache(G,H,D)},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="."+f.map(G.split(" "),function(H){return t(C._name,H,F,D)}).join(",.");return x(E,B)},_elem:function(C,E,B){var D=C+z(E,B);return this._elemCache[D]||(this._elemCache[D]=this.findElem(C,E,B))},elem:function(E,D,B){if(E.indexOf(" ")<0){return this._elem(E,D,B)}var C=f([]),F=this;f.each(E.split(" "),function(){C=C.add(F._elem(this,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]:f.each(E.split(" "),function(H,G){delete F._elemCache[G+C]})}else{this._elemCache={}}return this},containsDomElem:function(B){return B.parents().andSelf().index(this.domElem)>-1},buildSelector:function(C,D,B){return this.__self.buildSelector(C,D,B)},destruct:function(C){var D=this,B=D.__self;D._needSpecialUnbind&&B.doc.add(B.win).unbind("."+D._uniqId);D.__base();D.dropElemCache().domElem.each(function(E,F){f.each(s(F),function(G,H){var I=w[H.uniqId];I&&I._removeDomElem(F)});m(F)});C||D.domElem.remove();delete D.domElem;delete D._elemCache}},{doc:y,win:e,_processLive:function(C){var E=this,D=E._liveInitable;if("live" in E){var B=typeof D=="undefined";if(B^C){if(f.isFunction(E.live)){D=E.live()!==false;E.live=function(){}}else{D=E.live}}}return D},init:function(C,E,D){if(!C||f.isFunction(C)){D=E;E=C;C=y}var B=f.identify();x(C,".i-bem").each(function(){r(f(this),B)});E&&this.afterCurrentEvent(E,D)},destruct:function(C,B,D){if(typeof C!="boolean"){D=B;B=C;C=i}x(B,".i-bem",D).each(function(){f.each(s(this),function(E,F){if(F.uniqId){var G=w[F.uniqId];G&&G.destruct(true)}});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)},_buildCtxEventName:function(B){return this._name+":"+B},_liveClassBind:function(D,E,I,B){var H=this;if(E.indexOf(" ")>-1){f.each(E.split(" "),function(J,K){H._liveClassBind(D,K,I,B)})}else{var C=H._buildCtxEventName(E),G=q[C],F=f.identify(I);if(!G){G=q[C]={};y.bind(E,H.changeThis(H._liveClassTrigger,H))}G=G[D]||(G[D]={uniqIds:{},fns:[]});if(!(F in G.uniqIds)){G.fns.push({uniqId:F,fn:H._buildLiveEventFn(I,B)});G.uniqIds[F]=G.fns.length-1}}return this},_liveClassUnbind:function(E,F,I){var D=this._buildCtxEventName(F),H=q[D];if(H){if(I){if(H=H[E]){var G=f.identify(I);if(G in H.uniqIds){var C=H.uniqIds[G],B=H.fns.length-1;H.fns.splice(C,1);while(C<B){H.uniqIds[H.fns[C++].uniqId]=C-1}delete H.uniqIds[G]}}}else{delete H[E]}}return this},_liveClassTrigger:function(H){var G=q[this._buildCtxEventName(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;while(J=K[E++]){J.fn.call(f(D),H)}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=f(this)).closest(C.buildSelector()),true],G=a.apply(null,B?E.concat([D,F]):E);G&&(B||D.apply(G,arguments))}},liveInitOnEvent:function(C,B,D){return this.liveBindTo(C,B,D,true)},liveBindTo:function(F,C,E,B){if(!E){E=C;C=F;F=i}if(!F||typeof F=="string"){F={elemName:F}}var D=this;if(F.elemName&&F.elemName.indexOf(" ")>1){f.each(F.elemName.split(" "),function(G,H){D._liveClassBind(t(D._name,H,F.modName,F.modVal),C,E,B)});return D}return D._liveClassBind(t(D._name,F.elemName,F.modName,F.modVal),C,E,B)},liveUnbindFrom:function(C,B,E){var D=this;if(C.indexOf(" ")>1){f.each(C.split(" "),function(F,G){D._liveClassUnbind(t(D._name,G),B,E)});return D}return D._liveClassUnbind(t(D._name,C),B,E)},_liveInitOnBlockInit:function(C,E,D){var B=this._name;v[C].on("init",function(F){var G=F.block[D](B);E&&f.each(G,function(){E.call(this)})});return this},liveInitOnBlockInit:function(B,C){return this._liveInitOnBlockInit(B,C,"findBlocksOn")},liveInitOnBlockInsideInit:function(B,C){return this._liveInitOnBlockInit(B,C,"findBlocksOutside")},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){if(f.isFunction(F)){D=E;E=F;F=i}var I=this;if(G.indexOf(" ")>-1){f.each(G.split(" "),function(J,K){I._liveCtxBind(B,K,F,E,D)})}else{var C=I._buildCtxEventName(G),H=g[C]||(g[C]={counter:0,ctxs:{}});B.each(function(){var K=f.identify(this),J=H.ctxs[K];if(!J){J=H.ctxs[K]={};++H.counter}J[f.identify(E)+(D?f.identify(D):"")]={fn:E,data:F,ctx:D}})}return I},liveCtxUnbind:function(B,E,D,C){return this._liveCtxBind(B,E,D,C)},_liveCtxUnbind:function(B,E,D,C){var G=this,F=g[E=G.buildEventName(E)];if(F){B.each(function(){var I=f.identify(this,true),H;if(I&&(H=F.ctxs[I])){D&&delete H[f.identify(D)+(C?f.identify(C):"")];if(!D||f.isEmptyObject(H)){F.counter--;delete F.ctxs[I]}}});F.counter||delete g[E]}return G},_extractElemNameFrom:function(B){var C=B[0].className.match(this._buildElemNameRE());return C?C[1]:i},extractParams:h,_buildModClassPrefix:function(C,B){return t(this._name)+(B?k+(typeof B==="string"?B:this._extractElemNameFrom(B)):"")+p+C+p},_buildModValRE:function(C,B,D){return new RegExp("(\\s?)"+this._buildModClassPrefix(C,B)+"("+l+")(\\s|$)",D)},_buildElemNameRE:function(){return new RegExp(this._name+k+"("+l+")(?:\\s|$)")},buildSelector:function(C,D,B){return"."+t(this._name,C,D,B)},getWindowSize:function(){var B=e[0];if(typeof B.innerWidth!="undefined"){return{width:B.innerWidth,height:B.innerHeight}}var C=o();return{width:C.clientWidth,height:C.clientHeight}},buildClass:function(D,B){var C={};B?C[D]=B:C=D;return b.buildClasses(this._name,null,C)},buildElemClass:function(C,E,B){var D={};B?D[E]=B:D=E;return b.buildClasses(this._name,C,D)},buildHtml:function(F){F=F||{};var C=F.tag||"div",G=this,B=["<",C,' class="'],E={};f.each([{name:F.name,elem:F.elem,mods:F.mods,params:F.params}].concat(F.mix||[]),function(H,J){var I=J.name?j.blocks[J.name]:G;H&&B.push(" ");B.push(J.elem?I.buildElemClass(J.elem,J.mods):I.buildClass(J.mods));J.elem||(E[I.getName()]=J.params||{})});var D=!f.isEmptyObject(E);B.push(D?" i-bem":"",'"');D&&B.push(' onclick="return ',f.stringify(E).replace(/"/g,"'"),'"');B.push(">",this.buildHtmls(F.content),"</",C,">");return B.join("")},buildHtmls:function(B){if(!f.isArray(B)){return B||""}var C=this;return f.map(B,function(D){return C.buildHtml(D)}).join("")}})})(BEM,jQuery);$(function(){BEM.DOM.init()});(function(b,a){a.block["b-full-info"]=function(){b(this).find(".b-pseudo-link:first").click(function(){b(this).next().toggleClass("hidden")})}})(jQuery,window.Lego);(function(b){var g=b(document);g.keyup(function(d){var h="";if(window.event){h=d.keyCode}else{if(d.which){h=d.which}}if(h==27){b.fn.popupClose()}});g.bind("click",e);g.data("popup",{lastParent:0,modal:false,id:0});b.fn.popupOpen=function(h){var x=g.data("popup");var p=b(this).attr("id")||"p007";var i=h.type||"success";var l=h.cache||true;var w=(i=="success"||i=="inform"||i=="warning"||i=="action_modal");if(!x.lastParent||(x.lastParent&&!x.modal&&"popup"+b(this).attr("id")!==x.id)){b('div[class~="b-popup"]').remove();var u="";b("body").append('<div id="popup'+p+'" class="b-popup"></div>');var r=b("#popup"+p);window._pp=r;var u="";if(i=="tip"){u+='<div class="b-popup-content"><div class="b-popup-body"></div></div>'}else{u+='<i class="b-popup-tl"></i><i class="b-popup-tr"></i><i class="b-popup-t"></i><i class="b-popup-l"></i><div class="b-popup-content"><div class="b-popup-close" title="Закрыть (Esc)"><i></i></div><div class="b-popup-body"></div></div><i class="b-popup-r"></i><i class="b-popup-b"></i><i class="b-popup-bl"></i><i class="b-popup-br"></i>'}b(u).appendTo(r);u="";if("title" in h){r.find("div.b-popup-content").prepend('<div class="b-popup-title">'+h.title+"</div>")}else{if(i!="tip"){r.find("div.b-popup-body").css({"padding-top":"10px"})}}if(h.url){b.ajax({url:h.url,cache:l,beforeSend:function(){r.find("div.b-popup-body").html("<p>Загружается...</p>")},success:function(y){r.find("div.b-popup-body").html(y)}})}else{if(h.node){u=b(h.node).clone().wrap("<div></div>").parent()}else{if(h.html){u=h.html}}}r.find("div.b-popup-body").append(u);if(w){r.addClass("b-popup-modal");b("body").addClass("doNotFlicker")}r.addClass("b-popup-"+i);if(i=="note"||i=="tip"){r.find("div.b-popup-content").prepend('<div class="b-popup-tail"></div>');r.css({position:"absolute"})}var n=parseInt(r.outerWidth());var o=(h.height)?((parseInt(h.height)%2==1)?parseInt(h.height)+1:parseInt(h.height)):false;if(o){r.find("div.b-popup-body").css({height:o+"px"})}var q=(h.width)?((parseInt(h.width)%2==1)?parseInt(h.width)+1:parseInt(h.width)):false;if(q){if(w){r.find("div.b-popup-body").css({width:q+"px"})}r.css({width:(q+30)+"px"})}var t=a(b(this).get(0));var v={width:r.outerWidth(),height:r.outerHeight()};if(w){if(h.top){r.css({top:parseInt(h.top)+"px"})}else{r.css({"margin-top":Math.floor(v.height/2*(-1))+"px"})}if(h.left){r.css({left:parseInt(h.left)+"px"})}else{r.css({"margin-left":Math.floor(v.width/2*(-1))+"px"})}}else{if(i=="note"){r.css({top:t.top+b(this).innerHeight()+"px",left:t.left+"px"})}else{if(i=="tip"){r.css({top:t.top+"px",left:t.left+80+"px"})}else{var j=g.scrollTop();var d=g.scrollLeft();var m=Math.max(Math.floor((b(window).height()-v.height)/2+j),j);var k=Math.max(Math.floor((b(window).width()-v.width)/2+d),d);r.css({top:m+"px",left:k+"px"})}}}if(b(window).width()-t.left<v.width&&t.left>v.width&&!w){r.addClass("b-popup-note-right");var s=(-1)*(v.width-(n+parseInt(r.css("margin-left"))));r.css({"margin-left":s})}else{if(!w&&i=="note"){r.addClass("b-popup-note-left")}else{if(!w&&i=="tip"){r.addClass("b-popup-tip-left")}}}r.find("div.b-popup-close").bind("click",function(){b(this).popupClose(r)});g.data("popup").lastParent=this;g.data("popup").modal=w;g.data("popup").id="popup"+p;g.data("popup").onclose="onclose" in h?h.onclose:null;r.addClass("someFakeClassName");if(h.timeout){setTimeout(function(){b.fn.popupClose()},h.timeout)}return false}};function a(h){var i={left:h.offsetLeft,top:h.offsetTop};if(h.offsetParent){var d=a(h.offsetParent);i.left+=d.left;i.top+=d.top}return i}b.fn.popupClose=function(d){if(b.support.opacity){b('div[class~="b-popup"]').fadeOut("fast",f)}else{f()}return true};function f(){b('div[class~="b-popup"]').remove();b("body").removeClass("doNotFlicker");g.data("popup").lastParent=0;g.data("popup").modal=false;g.data("popup").id=0;if(typeof g.data("popup").onclose=="function"){g.data("popup").onclose()}}function e(h){var d=g.data("popup").modal;if(h.target==g.data("popup").lastParent||b(h.target).parents().is("div.b-popup")||b(h.target).is(".b-popup")||d){return true}else{if(!g.data("popup").modal&&g.data("popup").lastParent){b.fn.popupClose();return false}else{return true}}}Lego.block["b-popup"]=function(){var h=b(this),d=h.attr("href");h=h.attr("href","#").find("img");h.click(function(){try{h.popupOpen({type:"note",url:d})}catch(i){}return false})}})(window.jQuery,Lego);(function(b,a){var e=0;function d(){var h=document.createElement("DIV").style,g=["boxShadow","WebkitBoxShadow","MozBoxShadow","OBoxShadow","msBoxShadow","KhtmlBoxShadow"];for(var f in g){if(h[g[f]]!==undefined){return true}}return false}a.block["b-dropdown-menu"]=function(i){if(e===0){e=d()}var h=b(this),g,m,k,n,l=false,f=true,p=false,o=function(){g=h.find(".b-dropdown-menu__list");m=b('<div class="b-dropdown-menu__popup'+(e?" b-dropdown-menu__shadows":"")+'"/>');k=b('<iframe class="b-dropdown-menu__iframe" frameborder="0" src="javascript:\'<body style=\\\'background:none;overflow:hidden\\\'>\'"/>');n=g.clone(true).addClass("b-dropdown-menu__list_clone");g.before(m);m.prepend(k).after(n).hide();j();b(document).keydown(function(q){if(q.keyCode==27&&!(q.metaKey||q.ctrlKey||q.altKey||q.shiftKey)){j()}}).mouseout(function(q){if(!b(q.target).is(".b-dropdown-menu__item *")){j()}}).bind("popupsClose.lego",j);p=true},j=(function(){if(l){return}l=true;setTimeout(function(){if(l){f=true;m.css("visibility","hidden").before(g).hide();n.hide()}},100)});h.find(".b-dropdown-menu__item").mouseover(function(r){if(!p){o()}if(h.hasClass("b-dropdown-menu_disabled")){h.trigger("popupDisabled.lego");return}if(l){if(f){f=false;b(document).trigger("popupsClose.lego");var u=b.Event("popupOpen.lego");h.trigger(u);if(!u.isDefaultPrevented()){n.css("display","");m.append(g).css("visibility","");if(i.direction=="up"||h.hasClass("b-dropdown-menu_direction_up")){var q=m.height()-n.height();m.css("margin-top",-(q-(parseInt(g.css("padding-bottom"),10)+parseInt(b(this).closest(".b-dropdown-menu__item").css("padding-bottom"),10))))}m.css("display","");var t=g.find(".b-dropdown-menu__first"),s=g.find(".b-dropdown-menu__visible");if(Math.abs(t.attr("clientWidth")-s.attr("clientWidth"))<15){t.addClass("b-dropdown-menu__rectangle")}}}l=false}}).find(".b-dropdown-menu__or").click(function(){return false})}})(jQuery,window.Lego);BEM.DOM.decl("b-form-button",{onSetMod:{js:function(){(this._href=this.domElem.attr("href"))&&this.isDisabled()&&this.domElem.removeAttr("href")},focused:{yes:function(){if(this.isDisabled()){return false}this.bindTo("keydown",this._onKeyDown).elem("input").focus()},"":function(){this.unbindFrom("keydown").elem("input").blur()}},disabled:function(d,a){var b=a=="yes";this.domElem.attr("aria-disabled",b);this.elem("input").attr("disabled",b);this._href&&(b?this.domElem.removeAttr("href"):this.domElem.attr("href",this._href));b&&this.domElem.keyup()},pressed:function(b,a){this.isDisabled()||this.trigger(a=="yes"?"press":"release")},"*":function(b,a){if(this.isDisabled()&&"hovered pressed".indexOf(b)>-1){return false}"hovered focused".indexOf(b)>-1&&a==""&&this.delMod("pressed")}},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(a){if(a.keyCode==13&&!this._keyDowned){this._keyDowned=true;this.setMod("pressed","yes").bindTo("keyup",function(){this.delMod("pressed").unbindFrom("keyup");delete this._keyDowned})}},_onClick:function(a){this.isDisabled()?a.preventDefault():this.afterCurrentEvent(function(){this.trigger("click")})}},{live:function(){var a={mouseover:{name:"hovered",val:"yes"},mouseout:{name:"hovered"},mousedown:{name:"pressed",val:"yes"},mouseup:{name:"pressed"},focusin:{name:"focused",val:"yes"},focusout:{name:"focused"}};this.liveBindTo("leftclick",function(b){this._onClick(b)}).liveBindTo("mouseover mouseout mouseup focusin focusout",function(d){var b=a[d.type];this.setMod(b.name,b.val||"")}).liveBindTo("mousedown",function(d){var b=a[d.type];d.which==1&&this.setMod(b.name,b.val||"")})}});(function(){var a;BEM.DOM.decl("b-form-input",{onSetMod:{js:function(){var e=this,b=e.elem("input"),d=e.__self.doc[0].activeElement;e._val=b.val();e._focused=d===b[0];if(!a){a=[];(function(){var f,g=0;while(f=a[g++]){f.val(f.elem("input").val())}setTimeout(arguments.callee,50)})()}e._focused&&e.setMod("focused","yes");if(e.params.autoFocus&&!e._focused&&!(d&&"input textarea".indexOf(d.tagName.toLowerCase())>-1)){e.setMod("focused","yes")._focused=true}e._instanceIndex=a.push(e.bindTo(b,{focus:e._onFocus,blur:e._onBlur}))-1;e.params.shortcut&&this.bindToDoc("keydown",function(f){if(f.ctrlKey&&f.keyCode==38&&!$(f.target).is("input, textarea")){this.setMod("focused","yes")}})},disabled:function(d,b){this.elem("input").attr("disabled",b=="yes")},focused:function(d,b){if(this.hasMod("disabled","yes")){return false}var e=b=="yes";e?this._focused||this._focus():this._focused&&this._blur();this.afterCurrentEvent(function(){this.trigger(e?"focus":"blur")})}},onElemSetMod:{message:{visibility:function(f,g,b){var h=this,e=h.getMod(f,"type");if(e){var d=true;b||h.elem("message","type",e).each(function(){this!=f[0]&&h.hasMod($(this),"visibility","visible")&&(d=false)});d&&h.toggleMod("message-"+e,"yes","",b==="visible")}e=="error"&&f.attr("aria-hidden",b!=="visible")}}},val:function(e,d){if(typeof e=="undefined"){return this._val}if(this._val!=e){var b=this.elem("input");b.val()!=e&&b.val(e);this._val=e;this.trigger("change",d)}return this},_onFocus:function(){this._focused=true;return this.setMod("focused","yes")},_onBlur:function(){this._focused=false;return this.delMod("focused")},_focus:function(){var d=this.elem("input")[0];if(d.createTextRange&&!d.selectionStart){var b=d.createTextRange();b.move("character",d.value.length);b.select()}else{d.focus()}},_blur:function(){this.elem("input").blur()},destruct:function(){this.__base.apply(this,arguments);this.params.shortcut&&this.unbindFromDoc("keydown");a.splice(this._instanceIndex,1);var d=this._instanceIndex,b;while(b=a[d++]){--b._instanceIndex}}})})();BEM.DOM.decl("b-form-radio",{onSetMod:{js:function(){var b=this,a=b.__self.doc[0].activeElement;b._val=this.findElem(this.elem("button","checked","yes"),"radio").val()||"";b.elem("radio").each(function(){var e=[];a===this&&(e.push("focused"));this.checked&&(e.push("checked"));if(e[0]){var d=b.__self._getButtonByElem($(this));$.each(e,function(f,g){b.setMod(d,g,"yes")})}})}},onElemSetMod:{button:{focused:{yes:function(a){this.delMod(this.elem("button","focused","yes"),"focused").findElem(a,"radio").focus()}},checked:{yes:function(b){this.setMod(b.next(),"next-for-checked","yes");this._val=this.findElem(b,"radio").attr("checked",true).val();var a=this.elem("button","checked","yes");this.delMod(a,"checked");this.afterCurrentEvent(function(){this.trigger("change",{current:b,prev:a})})},"":function(a){this.delMod(a.next(),"next-for-checked")}},"next-for-checked":{yes:function(){this.delMod(this.elem("button","next-for-checked","yes"),"next-for-checked")}},disabled:function(b,d,a){b.find(this.buildSelector("radio")).attr("disabled",a=="yes")}}},val:function(a){if(typeof a=="undefined"){return this._val}else{var b=this;this.elem("radio").each(function(){if(this.value==a){b.setMod(b.__self._getButtonByElem($(this)),"checked","yes");return false}});return b}}},{live:function(){this.liveBindTo("radio","leftclick",function(b){if(!b.target.disabled){var a=this.__self._getButtonByElem(b.data.domElem);this.setMod(a,"focused","yes").setMod(a,"checked","yes")}}).liveBindTo("radio","focusin focusout",function(a){this.setMod(this.__self._getButtonByElem(a.data.domElem),"focused",a.type=="focusin"?"yes":"")});return false},_getButtonByElem:function(a){return a.closest(this.buildSelector("button"))}});$(function(){var a=($.browser.safari||$.browser.webkit)&&navigator.userAgent.toLowerCase().indexOf("mobile")>-1;if(a){$(".phone-number").each(function(){var b=$(this);b.before('<a href="tel:'+b.text().replace(" ","").replace("-","")+'">'+b.html()+"</a>");b.remove()})}});(function(b,a){a.block["trun-on-shop"]=function(e){var d=b(this);d.click(function(){d.attr("disabled",true);b.ajax({url:e.url,success:function(){d.closest(".error-message").addClass("hidden")}});return false})}})(jQuery,window.Lego);(function(b,a){a.block["be-toggle-link"]=function(e){e.hiddenClass=e.hiddenClass||"hidden";e.direction=e.direction||"forward";var d=false;b(this).click(function(i){i.preventDefault();if(e.container){var g=!d?"labelOff":"labelOn";var h=d?"addClass":"removeClass";if(e.parent){c=b(this).parents(e.parent+":first").find(e.container)}else{c=(e.direction=="forward"?b(this).nextAll(e.container+":first"):b(this).prevAll(e.container+":first"))}if(e[g]){b(this).html(e[g])}c.each(function(f,j){b(j)[h](e.hiddenClass)});d=!d}})}})(jQuery,window.Lego);
