(function(D,C){if(!C){C=window.Lego={}}C.messages=C.messages||{};C.message=function(A,B){return C.params.locale=="ru"?B:(C.messages[A]||B)}})(jQuery,window.Lego);(function(D,C){C.block["b-dropdown"]=function(){var I=D(this),A=D('
'),B=I.clone(true).removeClass("g-js").hide(),J=true,L=(function(){if(J){return }A.css("visibility","hidden").before(I).hide();B.hide();J=true}),K;I.before(A);A.after(B);D(document).bind("keydown click",function(E){if(((E.keyCode==27)&&!(E.ctrlKey||E.altKey))||!D(E.target).is(".b-dropdown *")){L()}}).bind("popupsClose.lego",L);A.mouseout(function(){K=setTimeout(L,1000)}).mouseover(function(){clearTimeout(K)});D(this).find(".or").click(function(F){F.preventDefault();if(J){D(document).trigger("popupsClose.lego");var E=D.Event("popupOpen.lego");I.trigger(E);if(!E.isDefaultPrevented()){B.css("display","");A.append(I).css("visibility","").css("display","");J=false}}else{L()}})}})(jQuery,window.Lego);(function(D,C){C.block["b-search.sample"]=function(A){var B=D(this),H=B.closest("form"),I=H.find("input[name='"+(A["for"]||"text")+"']"),J;B.find("a.b-pseudo-link").click(function(E){I.data("b-suggest",false).focus().attr("value",A.text||D(E.target).text());J=H.find("input[name='nl']");if(A.nl&&!J.length){J=D('').insertAfter(I)}D(document).trigger("popupsClose.lego");setTimeout(function(){I.removeData("b-suggest")},0)})}})(jQuery,window.Lego);(function(D,C){C.block["b-suggest"]=function(V){var c=D(this),A=D('').hide(),B=A.find(".b-suggest-items"),X=c.closest("form").find('input[name="'+(V["for"]||"text")+'"]'),W=X.closest("form"),h=V.url||(V.host||"")+(V.path||""),d={"":[]},e=(function(){var L=h.match(/^[^\/]*\/\/[^\/]+\//)[0]+"jquery.crossframeajax.html",H=D('').appendTo("body")[0],F=document.domain,G=document.domain.match(/[^.]+\.[^.]+$/)[0],I=10,E;try{document.domain=G}catch(J){}(function K(){if(I){try{E=H.contentWindow.$.crossframeAjax;if(E){e=E}else{throw true}}catch(M){I--;setTimeout(K,42)}}else{try{document.domain=F}catch(M){}}})();return D.ajax})(),U=(function(){function F(G){var I=G[1];j=I?I.length:0;if(!j){return f()}var H=G[2]||[];B.get(0).innerHTML="";B.html(D.map(I,function(J,K){var L=H[K]||"";return''+J+""}).join(""));A.show();Y=false}var E=0;return function(H){if(l){return }Z(0,H);var I=d[H+"*"+h];if(I){F(I)}else{var G=setTimeout(f,700);E+=1;e({url:h,data:{part:X.attr("value")},dataType:"json",type:"GET",timeout:700,success:(function(J,K){return function(L){if(!L){return }d[H+"*"+K]=L;clearTimeout(G);if(J==E){F(L)}}})(E,h)})}}})(),l=false,Y=true,f=(function(){if(Y){return }A.hide();Z(0,X.attr("value"));Y=true}),j=0,Z=(function(){var F=0,E=X.attr("value");return function(L,I){if(I!=undefined){E=I}F=L?F+L:0;if(F<0){F=j}if(F>j){F=0}var J=B.find(".b-suggest-elem").removeClass("b-suggest-elem_selected").eq(F-1).addClass("b-suggest-elem_selected"),H=J.text(),K=H||E,G=H?J.attr("href"):"";if(X.attr("value")!=K){X.attr("value",K)}X.data("href",G)}})();X.blur().attr("autocomplete","off");if(V.text){X.attr("value",V.text)}if(V.focus){X.focus()}c.append(A);var g=false;A.find(".b-suggest-close").mousedown(function(){g=true}).mouseup(function(){g=false}).click(function(){Z(0);f();l=true;X.focus()});X.blur(function(){if(g){return }else{f()}});D(document).bind("popupsClose.lego",f);B.click(function(E){E.preventDefault();var G=D(E.target);if(G.is("li *")){var F=G.closest(".b-suggest-elem");Z(0,F.text());X.data("href",F.attr("href"));setTimeout(function(){W.submit()},0)}}).mousedown(function(E){g=true});var m,k="";W.submit(function(E){var F=X.data("href");if(F){E.preventDefault();location.href=F}});X.keydown(function(E){switch(E.keyCode){case 38:case 40:E.preventDefault();if(Y){l=false;U(X.attr("value"))}else{Z(E.keyCode-39)}break;case 27:g=true;break;default:k=X.attr("value");break}}).keyup(function(F){switch(F.keyCode){case 38:case 40:break;case 13:W.submit();break;case 27:Z(0);f();l=true;g=false;X.focus();break;default:if(k!=X.attr("value")){clearInterval(E);var E=setTimeout(function(){U(X.attr("value"))},1)}break}});setTimeout(function(){X.focus(function(F,E){if(D(F.target).data("b-suggest")!==false){U(X.attr("value"))}})},42);c.bind("updateParams.lego",function(F,E){if(!E){return }var G=(h.match(/^[^\/]*\/\/[^\/]+\//)[0]||"")+(E.path||"");if(G){h=G}if("closed" in E){l=E.closed}})}})(jQuery,window.Lego);(function(D,C){C.block["b-head-userinfo.user"]=function(){var A=D(this);if(C.params.login!=""){D.getJSON("//pass.yandex.ru/services?callback=?",{locale:C.params.locale,login:"yes"},function(B){if(!B||!B.services){return }var H=B.login||C.params.login;var G='";A.find(".b-user").replaceWith(G);C.blockInit(A,".b-dropdown")})}}})(jQuery,window.Lego);(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(''),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-search.sample"]=function(G){var F=B(this),E=F.closest("form"),D=E.find("input[name='"+(G["for"]||"text")+"']"),C;F.find("a.b-pseudo-link").click(function(H){D.data("b-suggest",false).focus().attr("value",G.text||B(H.target).text());C=E.find("input[name='nl']");if(G.nl&&!C.length){C=B('').insertAfter(D)}B(document).trigger("popupsClose.lego");setTimeout(function(){D.removeData("b-suggest")},0)})}})(jQuery,window.Lego);(function(B,A){A.block["b-suggest"]=function(S){var M=B(this),V=B('').hide(),U=V.find(".b-suggest-items"),Q=M.closest("form").find('input[name="'+(S["for"]||"text")+'"]'),R=Q.closest("form"),H=S.url||(S.host||"")+(S.path||""),L={"":[]},K=(function(){var Z=H.match(/^[^\/]*\/\/[^\/]+\//)[0]+"jquery.crossframeajax.html",f=B('').appendTo("body")[0],Y=document.domain,X=document.domain.match(/[^.]+\.[^.]+$/)[0],W=10,g;try{document.domain=X}catch(d){}(function c(){if(W){try{g=f.contentWindow.$.crossframeAjax;if(g){K=g}else{throw true}}catch(h){W--;setTimeout(c,42)}}else{try{document.domain=Y}catch(h){}}})();return B.ajax})(),T=(function(){function X(Z){switch(Z[0]){case"num":return''+Z[1]+"";case"href":return''+Z[1]+"";case"nav":return''+Z[2]+' — '+Z[1]+"";default:return''+Z+""}}function W(c){var Z=c[1];O=B.grep(Z,function(e){return !e[0]||e[0]!="num"}).length;if(!(G=Z?Z.length:0)){return J()}var d=c[2]||[];U.get(0).innerHTML="";U.html(B.map(Z,function(f,e){return X(!!d[e]?["href",f,d[e]]:f)}).join(""));V.show();P=false}var Y=0;return function(d){if(E){return }N(0,d);var c=L[d+"*"+H];if(c){W(c)}else{var Z=setTimeout(J,700);Y+=1;K({url:H,data:{part:Q.attr("value")},dataType:"json",type:"GET",timeout:700,success:(function(f,e){return function(g){if(!g){return }L[d+"*"+e]=g;clearTimeout(Z);if(f==Y){W(g)}}})(Y,H)})}}})(),E=false,P=true,J=(function(){if(P){return }V.hide();N(0,Q.attr("value"));P=true}),G=0,O=0,N=(function(){var W=0,X=Q.attr("value");return function(Z,e){if(e!=undefined){X=e}W=Z?W+Z:0;if(W<0){W=O}if(W>O){W=0}var d=U.find(".b-suggest-elem:not(.b-suggest-elem__num)").removeClass("b-suggest-elem_selected").eq(W-1).addClass("b-suggest-elem_selected"),f=d.text(),c=d.is(".b-suggest-elem__nav")?C:(f||X),Y=f?d.attr("href"):"";if(Q.attr("value")!=c){Q.attr("value",c)}Q.data("href",Y)}})();Q.blur().attr("autocomplete","off");if(S.text){Q.attr("value",S.text)}if(S.focus){Q.focus()}M.append(V);var I=false;V.find(".b-suggest-close").mousedown(function(){I=true}).mouseup(function(){I=false}).click(function(){N(0);J();E=true;Q.focus()});Q.blur(function(){if(I){return }else{J()}});B(document).bind("popupsClose.lego",J);U.mousedown(function(X){I=true;var W=B(X.target);if(W.is("li *")){F=W.closest(".b-suggest-elem");if(!F.is(".b-suggest-elem__nav,.b-suggest-elem__num")){N(0,F.text());Q.data("href",F.attr("href"));setTimeout(function(){R.submit()},0)}}return false}).click(function(){Q.focus();return F.is(".b-suggest-elem__nav")});var C="",F,D=false;R.submit(function(X){if(D){return D=false}var W=Q.data("href");if(W){X.preventDefault();location.href=W}});Q.keydown(function(W){switch(W.keyCode){case 38:case 40:W.preventDefault();if(P){E=false;T(Q.attr("value"))}else{N(W.keyCode-39)}break;case 27:I=true;break}}).keypress(function(X){switch(X.keyCode){case 13:var W=U.find(".b-suggest-elem_selected");if(W.is(".b-suggest-elem__nav")){D=true;B('').appendTo(B("body")).submit()}break;case 27:N(0);J();E=true;I=false;Q.focus();return false}}).keyup(function(W){switch(W.keyCode){case 38:case 40:break;case 13:R.submit();break;default:if(C!=Q.attr("value")){C=Q.attr("value");clearInterval(X);var X=setTimeout(function(){T(Q.attr("value"))},1)}break}});setTimeout(function(){Q.focus(function(W){if(B(W.target).data("b-suggest")!==false){T(Q.attr("value"))}})},42);M.bind("updateParams.lego",function(X,Y){if(!Y){return }var W=(H.match(/^[^\/]*\/\/[^\/]+\//)[0]||"")+(Y.path||"");if(W){H=W}if("closed" in Y){E=Y.closed}})}})(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='";C.find(".b-user").replaceWith(E);A.blockInit(C,".b-dropdown")})}}})(jQuery,window.Lego);var g_form,g_searchInput,g_activeInput;document.documentElement.id="js";function addEvent(C,A,B){if(C.addEventListener){C.addEventListener(A,B,0)}else{if(C.attachEvent){C.attachEvent("on"+A,B)}}}function commonKeydown(C){if(!C){C=window.event}var A=C.keyCode;if(C.ctrlKey){if(!g_activeInput){if((A==13)&&(document.forms.length==1)){g_form.submit()}else{if(A==38){g_searchInput.focus()}else{if(A==37){var B=document.getElementById("previous_page");if(B){location.href=B.href}}else{if(A==39){var D=document.getElementById("next_page");if(D){location.href=D.href}}}}}}else{if((A==38)&&(document.forms[0]==g_activeInput.form)&&g_activeInput.select){g_activeInput.select()}}}else{if((A==27)&&(typeof (keydownEsc)=="function")){keydownEsc(C)}}}function commonInit(B){g_form=document.forms[0];addEvent(document,"keydown",commonKeydown);if(g_form){if(typeof (initTabs)=="function"){initTabs(g_form)}for(var D=0,A=document.forms.length;D0?A:1},resize:function(){var G=this.count();if(this.columns==G){return }this.columns=G;var B=document.createElement("table");var F=document.createElement("tbody");var K=this.cells[0].length/G;var A=100/G;for(var C=0;C1;var F=Math.max(G,D)/Math.min(G,D);if(F>(4/3)){C.scr_type="default"}else{if(F<=(4/3)){C.scr_type="4x3"}}if(!H){C.scr_type="vertical"}if(C.scr_type!="default"){E.container.addClass("b-filter-size_"+C.scr_type)}E.text_w.html(G);E.text_h.html(D);if(C.wall_res[I]){E.link.attr("href",E.link.attr("href").replace("&isize=wallpaper","&isize="+C.wall_res[I]))}}};B(".s-morda-hover-size a").bind("mouseenter",{type:"sizes",target:B("#i-size-icon"),parent:B(".s-morda-hover-size")},this.hover);B(".s-morda-hover-color a").bind("mouseenter",{type:"colors",target:B("#i-color-img"),parent:B(".s-morda-hover-color")},this.hover);this.get_resolution({container:B(".b-filter-size"),text_h:B("#i-scr-height"),text_w:B("#i-scr-width"),link:B(".s-wall-link")})}})(jQuery,window.images_ui);function sync(A,D,C){if(!document.getElementById){return }var E=document.getElementById(A);var B=document.getElementById(D);if(E&&B){E.onclick=function(){B.checked=this.checked;if(typeof (C)=="function"){C(B.checked)}};B.onclick=function(){E.checked=this.checked;if(typeof (C)=="function"){C(E.checked)}}}}function surl_manually(C){for(var A=0;A0){a=sliders[B][0]-portion;a=(a<0)?0:a;b=sliders[B][0]-1;do_load(B,a,b,0)}else{no_more[B][0]=1;return false}}else{if(A==1){if(sliders[B][1]sliders[B][2])?sliders[B][2]:b;do_load(B,a,b,1)}else{no_more[B][1]=1;return false}}}return true}else{return false}}function parent_table(A){while(A.tagName!="TABLE"){A=A.parentNode}return A}function shift_slider(D,C,B,A){var E=D.style[C];E=E.slice(0,E.length-2);D.style[C]=parseInt(E)-B+"px";A.style.display=""}function do_load(B,H,G,D){var A=document.getElementById("sld"+B);var F=B==0?parent_table(A):A;function J(V,S,W){if(B==0){if(window.page_type&&page_type=="morda"){var P=document.createElement("img");P.width=S.w/2;P.height=S.h/2;var T=document.createElement("a");S.request=S.request.replace(/(^\s*)|(\s*$)/g,"");S.href="/yandsearch?text="+encodeURIComponent(S.request)+"&rpt=image"+icq_clid_param_amp;T.href=S.href;if(window.slider_c){T.setAttribute("onmousedown",slider_c[0])}T.appendChild(P);var U=document.createElement("div");U.className="b-image";U.appendChild(T);var R=document.createElement("div");R.className="thumb g-line";R.appendChild(U);var Q=document.createElement("div");Q.className="info-wrap";R.appendChild(Q);var O=document.createElement("a");O.href=S.href;O.className="info-link";O.innerHTML=S.request;if(window.slider_c){O.setAttribute("onmousedown",slider_c[0])}Q.appendChild(O);var X=document.createElement("td");X.className="item";X.appendChild(R)}else{var P=document.createElement("img");P.width=S.w;P.height=S.h;var T=document.createElement("a");T.href=S.href;if(window.slider_c){T.setAttribute("onmousedown",slider_c[0])}T.appendChild(P);var U=document.createElement("div");if(S.multiple){U.className="b-image b-image-many";var M=document.createElement("i");M.appendChild(T);U.appendChild(M)}else{U.className="b-image";U.appendChild(T)}var R=document.createElement("div");R.className="thumb g-line";R.appendChild(U);var X=document.createElement("td");X.className="item";X.appendChild(R)}}else{var P=document.createElement("img");P.className="thumb";P.style.width=Math.round(S.w/2)+"px";P.style.height=Math.round(S.h/2)+"px";var T=document.createElement("a");T.href=S.href;if(window.slider_c){T.setAttribute("onmousedown",slider_c[1])}T.appendChild(P);var X=document.createElement("li");X.className="item";X.appendChild(T)}if(W==0){if(window.page_type&&page_type=="morda"){var L=(S.w/2)+21}else{var L=B==0?(S.w+32+S.multiple*2):(Math.round(S.h/2)+14)}var N=B==0?"left":"top";X.style.display="none";P.onload=function(){shift_slider(F,N,L,X)};P.src=S.url;A.insertBefore(X,V)}else{P.src=S.url;A.insertBefore(X,V.nextSibling)}return X}function K(L,M){for(i=M.length-1;i>=0;i--){L=J(L,M[i],0)}}function E(L,M){for(i=0;i0){for(var J=0;J"+L+"";var I=document.getElementById("i-main-pic-container");I.replaceChild(K,J.parentNode)}}function G(K,J,L){var I=new Image();I.src="http://clck.yandex.ru/click/dtype=stred/pid="+J+"/cid="+L+"/*"+K.src}var C=[]}})(jQuery,window.images_ui);var I18N_DOMAINS_CACHE=new Array();function I18N(language,domain){this.setDomain=function(domain){this.domain=new String(domain||"messages");this._setDomainObject()};this.get=function(msg){var r;if(this._domainObj!=undefined&&this._domainObj[msg]!=undefined){if(this._domainObj[msg] instanceof Array&&this._domainObj[msg][0]!=undefined){r=this._domainObj[msg][0]}else{r=this._domainObj[msg]}}else{r=msg}return r};this.nget=function(n,msgs){var r;var forms=[];for(var i=0;i0){forms=this._domainObj[msg].concat([])}else{forms=[this._domainObj[msg]]}}var idx=this._pluralFunc(num);r=new String(forms[idx]!=undefined?forms[idx]:forms[0]);r=r.replace(/\%d/,num)}return r};this.dget=function(domain,msg){var prev_dom=this.domain;this.setDomain(domain);var r=this.get(msg);this.setDomain(prev_dom);return r};this.ndget=function(domain,n,msgs){var a=[];for(var i=0;i=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2}}else{this._pluralFunc=function(n){return n!=1?1:0}}};this._setDomainObject=function(){if(I18N_DOMAINS_CACHE[this.language]!=undefined&&I18N_DOMAINS_CACHE[this.language][this.domain]!=undefined){this._domainObj=I18N_DOMAINS_CACHE[this.language][this.domain]}else{var objName="i18n_"+this.language.replace(/[^0-9A-Z]+/gi,"_")+"_"+this.domain.replace(/[^0-9A-Z]+/gi,"_");try{this._domainObj=eval(objName);if(I18N_DOMAINS_CACHE[this.language]==undefined){I18N_DOMAINS_CACHE[this.language]=new Array()}I18N_DOMAINS_CACHE[this.language][this.domain]=this._domainObj}catch(e){this._domainObj=undefined}}};this._setLanguage(language);this.setDomain(domain)}function ic(D){var E=wtable.columns?wtable.columns:5;var G=document.getElementById("ic"+D);var C=D%20;C=(C==0)?20:C;var F=(D-C)/20+1;var B=D%20;B=(B==0)?20:B;var H=B%E;H=(H==0)?E:H;var A=(B-H)/E+1;r(G,"stred/pid=40/cid=1104/path=P"+F+".L"+A+".C"+H)}if(typeof (y5)!="undefined"){var Images={};y5.registerNamespaceByData("Images",component_path,"utf-8")}function yandex_direct_phonePrint(){}function BSC(){};