(function(A){if(!A){A=window.Lego={}}A.oframebust=function(C){if(location==top.location){return }var D=(location.search.match(/[&?]oframebust=([^&;]+)/)||[])[1];if(!D){top.location=location}if(C.hasOwnProperty(D)){var B=document.createElement("iframe");B.style.position="absolute";B.style.left="-999px";B.style.width="1px";B.src="//"+D+"/oframebust.html?"+encodeURIComponent(location.href);(function(){if(document.body&&document.body.firstChild){document.body.insertBefore(B,document.body.firstChild)}else{setTimeout(arguments.callee,0)}})();return }top.location=location}})(window.Lego);Lego.oframebust({"webmaster.yandex.ru":""});(function(B,A){if(!A){A=window.Lego={}}A.messages=A.messages||{};A.message=function(D,C){return A.params.locale=="ru"?C:(A.messages[D]||C)}})(jQuery,window.Lego);(function(B,A){A.block["b-dropdown"]=function(){var F=B(this),H=B('<div class="b-dropdown-popup"><iframe frameborder="0" src="javascript:\'<body style=\\\'background:none;overflow:hidden\\\'>\'"></iframe></div>'),G=F.clone(true).removeClass("g-js").hide(),E=true,C=(function(){if(E){return }H.css("visibility","hidden").before(F).hide();G.hide();E=true}),D;F.before(H);H.after(G);B(document).keydown(function(I){if(I.keyCode==27&&!(I.metaKey||I.ctrlKey||I.altKey||I.shiftKey)){C()}}).click(function(I){if(!B(I.target).is(".b-dropdown *")){C()}}).bind("popupsClose.lego",C);H.mouseout(function(){D=setTimeout(C,1000)}).mouseover(function(){clearTimeout(D)});B(this).find(".or").click(function(I){I.preventDefault();if(E){B(document).trigger("popupsClose.lego");var J=B.Event("popupOpen.lego");F.trigger(J);if(!J.isDefaultPrevented()){G.css("display","");H.append(F).css("visibility","").css("display","");E=false}}else{C()}})}})(jQuery,window.Lego);(function(B,A){A.block["b-head-userinfo.user"]=function(){var C=B(this);if(A.params.login!=""){B.getJSON("//pass.yandex.ru/services?callback=?",{locale:A.params.locale,login:"yes"},function(F){if(!F||!F.services){return }var D=F.login||A.params.login;var E='<div class="g-js b-dropdown" onclick="return {name:\'b-dropdown\'}"><ul><li class="visible"><a href="http://i.yandex.ru" class="or"><span class="b-pseudo-link"><span><b class="b-user"><b>'+D.substring(0,1)+"</b>"+D.substring(1)+'</b></span></span><i class="arrow"><i class="b-icon"><i></i></i></i></a></li>';B.each(F.services,function(){E+="<li>";if(A.params.id==this.id){E+="<strong>"+this.title+"</strong>"}else{E+='<a href="'+this.url+'"onmousedown="Lego.ch(\''+A.params.id+".login.myservices."+this.id+"',this)\">"+this.title+"</a>"}E+="</li>"});E+='<li class="line"><a href="//passport.yandex.ru/">'+A.message("b-head-userinfo.user:passport","Паспорт")+"</a></li>";E+='<li><a href="//passport.yandex.ru/passport?mode=changepass&retpath=http://i.yandex.ru/">'+A.message("b-head-userinfo.user:change-password","Сменить пароль")+"</a></li>";E+="</ul></div>";C.find(".b-user").replaceWith(E);A.blockInit(C,".b-dropdown")})}}})(jQuery,window.Lego);var cached_elements={};function $id(A){return cached_elements[A]||(cached_elements[A]=(document.getElementById)?document.getElementById(A):document.all(A))}function yandex_direct_phonePrint(){}function BSC(){}function keyboard_navigation(D){D=D||window.event;var A=D.keyCode;if(D.ctrlKey){var B=$id("b-head-search");if(A==13){B.submit()}var E=(D.target||D.srcElement).tagName;if(E!="INPUT"&&E!="TEXTAREA"){var C;if(A==37){C=$id("previous_page")}if(A==39){C=$id("next_page")}if(C){location.href=C.href}if((A==38)&&B.text){B.text.focus();B.text.select()}}}}function AE(C,B,A){C[B]=function(D){return A(D||event)}}function suggestToggle(){suggest.toggle();return 0}function load_suggest(){var A=frames.tsuggest.Suggest;if(A){new A({input:$id("b-head-search").text,noStartFocus:true,noNavi:TT.usug});suggest.status(true)}else{setTimeout(load_suggest,100)}}var restore_query=true;window.onload=function(){init()};window.onpageshow=function(A){if(A.persisted){init()}};function init(){var A=document.forms.web.text;if(!TT.zen&&restore_query){A.value=TT.query}document.onkeydown=keyboard_navigation;if(TT.lsug){load_suggest()}}function r(B,A){var D=new Date().getTime();var C=(B&&B.href)?B.href:"http://yandex.ru/";document.createElement("IMG").src="http://clck.yandex.ru/click/dtype="+A+"/u="+D+"/reqid="+TT.reqid+"/*"+C}function w(A,B,C){r(A,"iweb/path="+B+(C?"/vars="+C:"")+(TT.cltr?"/cltr="+TT.cltr:"")+"/reg="+TT.reg+(TT.btt?"/btt="+TT.btt:""))}function rc(A,B){var C=A.href;A.href=B;setTimeout(function(){A.href=C},500)}(function(){var E=window,X=document,T,I,G=[],H=false,D="CSS1Compat",P="resize",K="scroll",J="clientWidth",L="clientHeight",W="scrollLeft",V="scrollTop",O,F;function S(b,Z,c,Y,a){if(E[b]){c[b](Y,a,false)}else{c[Z]("on"+Y,a)}}function C(a,Y,Z){S("addEventListener","attachEvent",a,Y,Z)}function Q(a,Y,Z){S("removeEventListener","detachEvent",a,Y,Z)}function N(){return[X.compatMode==D&&T[J]||I[J]||0,X.compatMode==D&&T[L]||I[L]||0,]}function U(){return[E.pageXOffset||T[W]||I[W]||0,E.pageYOffset||T[V]||I[V]||0]}function A(a){var Y=0,Z=0;while(a){Y+=parseInt(a.offsetLeft);Z+=parseInt(a.offsetTop);a=a.offsetParent}return[Y,Z]}function M(Y){var Z=X.createElement("script");Z.type="text/javascript";Z.src=Y;return Z}function B(){if(H){return }var Z=N(),Y=U();if((G[0]+O.offsetWidth)>=Y[0]&&G[0]<(Y[0]+Z[0])&&(G[1]+O.offsetHeight)>=Y[1]&&G[1]<(Y[1]+Z[1])){Q(E,K,B);Q(E,P,R);O.parentNode.appendChild(M(F));H=true}}function R(){G=A(O);B()}E.direct_check_visibility=function(Z,Y){O=X.getElementById(Z);I=X.body;T=X.documentElement;F=Y;C(E,K,B);C(E,P,R);C(E,"load",R);R()}})();