.searchGenerator(c.element.href);var l="";if(document.location.href.indexOf("family")>-1||document.location.href.indexOf("school")>-1){l="&family=yes"}c.element.href=c.__makeUrl(n+"text="+encodeURIComponent(m)+l)}}};var h=this.searchInput.value;var b=function(){if(h!=this.value){f();h=this.value}};var e=function(){if(event.propertyName.toLowerCase()=="value"&&h!=this.value){f();h=this.value}};d(this.element,"keydown",f);if(window.navigator.appName!="Microsoft Internet Explorer"){if(window.navigator.appName.indexOf("Opera")==-1){d(this.searchInput,"input",f)}d(this.searchInput,"keydown",f);d(this.searchInput,"keyup",f)}else{d(this.searchInput,"propertychange",e)}if(this.mainContainer){d(this.mainContainer,"mousemove",f)}};var generators={};generators.images=function(){return"yandsearch?"};generators.news=function(){return"yandsearch?rpt=nnews&grhow=clutop&"};generators.yaca=function(){return"yandsearch?rpt=rs2&"};generators.market=function(a){if(a.length==0){return"?clid=505&cvredirect=1&"}else{return"search.xml?clid=505&cvredirect=1&"}};generators.blogs=function(){return"search.xml?ft=blog&"};generators.music=function(){return"#/search?"};generators.rabota=function(){return"search.xml?"};generators.maps=function(){return"?"};generators.adresa=generators.slovari=function(){return"search.xml?"};generators.video=function(){return"#search?"};generators.auto=function(){return"auto-search.xml?"};function tabs(a){var l=(a||document.getElementById("form")).getElementsByTagName("input")[0];if(!l){return}var c=document.getElementById("tabs");if(!c){return}var k=c.getElementsByTagName("a");if(!k){return}for(var d=0;d-1),b=a.block["b-suggest"]=function(F){var z=d(this),K=d('
'+(c?(''):'
')+'
    '+(F.close?'':"")+'
    ').hide(),H=K.find(".b-suggest-items"),D=z.closest("form").find('input[name="'+(F["for"]||"text")+'"]'),E=D.closest("form"),q=F.url||(F.host||"")+(F.path||""),r=F.openInNewWindow=typeof F.openInNewWindow=="undefined"?true:F.openInNewWindow,l=!!F.permanent,w=(function(){var L={};L["*"+q]=["",[]];return L})(),o=F.timeout||700,I={suggestType:F.suggestType||((F.id=="serp")?"serp_ru":F.id),usageType:"not_shown",region:"",nah:"nah_not_shown",buttonByMouse:"",position:"p0",session:(new Date().getTime()+Math.round(Math.random()*10000)),queryTimes:[],ratio:{userValue:0,finalValue:0,userActions:0},text:"",user_input:"",pos:"",_keydownTriggered:false},k="",v=F.getData?b.getDataFns[F.getData]:(function(){var O=(q.match(/^[^\/]*\/\/[^\/]+\//)||[location.protocol+"//"+location.host])[0]+"jquery"+(d.fn.jquery=="1.4.2"?"-1-4-2":"")+".crossframeajax.html",R=d('').appendTo("body")[0],N=document.domain,M=document.domain.match(/([^.]+\.)?[^.]+$/)[0],L=10,S;try{document.domain!=M&&(document.domain=M)}catch(Q){}(function P(){if(L){try{S=R.contentWindow.$.crossframeAjax;if(S){v=S}else{throw true}}catch(T){L--;setTimeout(P,42)}}else{try{document.domain!=N&&(document.domain=N)}catch(T){}}})();return d.ajax})(),t=function(L){var M=L.length&&L[0].onclick?L[0].onclick():{};return M.value||L.text()},x=function(P){var N=0;if(typeof(P.selectionEnd)=="number"){N=P.selectionEnd}else{var O=document.selection.createRange();if(O&&O.parentElement()==P){var M=P.value.length,L=P.createTextRange();L.moveToBookmark(O.getBookmark());var Q=P.createTextRange();Q.collapse(false);N=L.compareEndPoints("EndToEnd",Q)>-1?M:-L.moveEnd("character",-M)}}return N},G=(function(){function M(O){return d.isArray(O)&&b.buildItemHtmlFns[O[0]]?b.buildItemHtmlFns[O[0]](O,{stats:I,params:F}):'
  • '+O+"
  • "}function L(P){I.region=P[P.length-1]["r"];var O=P[1];if(!(j=O?O.length:0)){return s()}if(I.usageType!="edit"){I.usageType="not_used"}var Q=P[2]||[];H.html(d.map(O,function(S,R){return M(!!Q[R]?["href",S,Q[R]]:S)}).join("")).find(".b-suggest-elem").filter(":not(.b-suggest__elem_selectable_no)").bind("mouseenter mouseleave",function(R){d(this)[R.type=="mouseenter"?"addClass":"removeClass"]("b-suggest-elem_state_hover")});B=O.length-H.find(".b-suggest__elem_selectable_no").length;K.find(".b-suggest-close").hide();if(K.find(".b-suggest-nah").find(".b-suggest-nah__link").length==0){switch(P[P.length-1].n){case 1:K.find(".b-suggest-list").addClass("b-suggest-list-nah_enabled").end().find(".b-suggest-nah").addClass("b-suggest-nah_enabled").html('Мои запросы включены').show();break;case 2:K.find(".b-suggest-list").addClass("b-suggest-list-nah_disabled").end().find(".b-suggest-nah").addClass("b-suggest-nah_disabled").html('Мои запросы отключены').show();break;default:K.find(".b-suggest-close").show().end().find(".b-suggest-nah").hide();break}K.find(".b-suggest-nah__link").bind("mousedown click",function(){window.location=this.href})}K.show();if(C===false&&I._keydownTriggered===true){I.usageType="edit";I._keydownTriggered=false}C=false}var N=0;return function(R){if(h){return}A(0,R);var Q=w[R+"*"+q];if(Q){L(Q)}else{var U=setTimeout(s,o);N+=1;var P=new Date();var T=document.getElementsByName("lr"),O;try{O=window.location.toString().match(/lr=(.*?)(&|$)/)}catch(S){O=""}if(T.length>0){k=T[0].value}else{if(O&&O.length>0){k=O[1]}else{k=""}}v({url:q,data:d.extend({part:D.val(),lr:k},a.params.yandexuid?{yu:a.params.yandexuid}:null),dataType:"json",type:"GET",timeout:o,success:(function(W,V){return function(X){if(!X){return}w[R+"*"+V]=X;clearTimeout(U);if(W==N){L(X)}I.queryTimes.push(new Date()-P)}})(N,q)})}}})(),u=function(L){m();window.setTimeout(function(){d('
    ").appendTo(d("body")).submit().remove()},500)},h=false,C=true,f=false,s=(function(){if(C){return}K.hide();A(0,D.val());C=true}),j=0,B=0,A=(function(){var L=0,M=D.val();return function(P,S){if(S!=undefined){M=S}L=P?L+P:0;if(L<0){L=B}if(L>B){L=0}if(L>0){I.position="p"+L}var R=H.find(".b-suggest-elem").filter(":not(.b-suggest__elem_selectable_no)").removeClass("b-suggest-elem_selected").eq(L?L-1:1000).addClass("b-suggest-elem_selected"),T=t(R),Q=R.is(".b-suggest-elem_nav")?e:(T||M),O=R.attr("href"),N=T&&O?O:"";D.val()!=Q&&D.val(Q);D.data("href",N)}})();var n=D.data("lego:focused");if(n){D.blur()}D.attr("autocomplete","off");if(n){D.focus()}if(F.text){D.val(F.text)}z.append(K);var p=false;K.find(".b-suggest-close").mousedown(function(){p=true}).mouseup(function(){p=false}).click(function(){A(0);s();h=true;D.focus()});d(document).bind("popupsClose.lego",s).keydown(function(L){if(L.metaKey||L.ctrlKey||L.altKey||L.shiftKey){f=true}}).keyup(function(L){f=false}).mouseup(function(){p=false});E.find(":submit").click(function(){I.buttonByMouse="button_by_mouse"});H.mousedown(function(O){p=true;var N=d(O.target);if(N.is("li *")){i=N.closest(".b-suggest-elem");if(i.hasClass("b-suggest-elem_nav")){m()}else{if(!i.hasClass("b-suggest__elem_selectable_no")){A(0,t(i));D.data("href",i.attr("href"));var M=N.parents("ul"),L=O.target.className;if(L&&L.split(" ").length>0){M.find("."+L.split(" ")[0]).each(function(P){if(this==O.target){I.position="p"+(P+1);N.hasClass("b-suggest-elem_nah")&&(I.nah="nah_used")}})}I.usageType="mouse";if(!l){h=true}if(i.get(0).tagName.toLowerCase()!="a"){setTimeout(function(){E.submit()},0)}else{y()}}}}return false}).click(function(){if(l){s()}else{d.browser.msie?s():D.focus()}});var e="",i,g=false;E.submit(function(M){if(F.preventSubmit){s();h=true;y();setTimeout(function(){h=false},100);return false}if(g){return g=false}var L=D.data("href")||I.followAfterSubmit;if(l){D.blur()}if(!I.submitted){M.preventDefault();if(L){I.followAfterSubmit=L}I.user_input=e;I.text=D.val();I.ratio.userValue=e.length;I.ratio.finalValue=I.text.length;y();window.setTimeout(function(){E.submit()},500)}else{if(L&&!l){M.preventDefault();location.href=L}else{if(L&&l){M.preventDefault();u(L)}}}});function J(){A(0);s();p=false}D.blur(function(L){if(L.originalEvent&&!L.originalEvent.preventDefault){setTimeout(function(){if(!p&&D[0]!=document.activeElement){s()}},84)}else{if(!p){s()}}}).click(function(){if(!C&&!D.val()){e="";s()}I.pos=x(D[0])}).keydown(function(L){switch(L.keyCode){case 38:case 40:L.preventDefault();I._keydownTriggered=true;if(C){h=false;G(D.val())}else{I.usageType="keyboard";A(L.keyCode-39)}break;case 13:break;case 27:p=true;break}setTimeout(function(){e!=D.val()&&I.ratio.userActions++},1)}).keypress(function(M){switch(M.keyCode){case 13:p=true;var L=H.find(".b-suggest-elem_selected");if(L.hasClass("b-suggest-elem_nav")){g=true;u(L.attr("href"));l&&s()}else{L.hasClass("b-suggest-elem_nah")&&(I.nah="nah_used");l||(h=true);E.submit();s()}return false;case 27:return false}}).keyup(function(L){I.pos=x(D[0]);switch(L.keyCode){case 38:case 40:break;case 27:J();break;default:if(e!=D.val()){e=D.val();clearInterval(M);var M=setTimeout(function(){G(D.val())},1)}break}});setTimeout(function(){D.focus(function(L){if(d(L.target).data("b-suggest")!==false){p=false;G(D.val())}})},42);if(l){setInterval(function(){w={"":[]}},30*60*1000)}z.bind("updateParams.lego",function(M,N){if(!N){return}var L=(q.match(/^[^\/]*\/\/[^\/]+\//)||[""])[0]+(N.path||"");if(L){q=L}if("closed" in N){h=N.closed}});function y(){a.params["show-counters"]&&a.cp(0,2873,[[I.suggestType,I.usageType,I.position,I.nah,I.buttonByMouse].join("."),"session="+I.session,"region="+I.region,"times="+I.queryTimes.join("."),"pos="+I.pos,"text="+I.text,"user_input="+I.user_input,"ratio="+I.ratio.userValue+"."+I.ratio.finalValue+"."+I.ratio.userActions].join("/"));l||(I.submitted=true)}function m(){a.params["show-counters"]&&a.cp(0,70833,I.suggestType+"/session="+I.session)}};b.getDataFns={};b.buildItemHtmlFns={href:function(f,e){if(f[3]&&f[3].nah&&f[3].nah==1){e.stats.nah=="nah_not_shown"&&(e.stats.nah="nah_not_used");return'
  • '+f[1]+"
  • "}return'
  • '+f[1]+"
  • "},nav:function(f,e){return'
  • '+f[2]+' — '+f[1]+"
  • "},html:function(f,e){return'
  • '+f[1]+"
  • "}}})(jQuery,window.Lego);(function(b,a){a.block["b-dropdown"]=function(e){var d=b(this),c,i,g,j,h=false,l=false,k=function(){c=d.find(".b-dropdown__list");i=b('
    ');g=b('