(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-region-selector"]=function(k){var q=b(this),s=k.path,l=q.find(".b-region-selector-text-string"),m=b(".b-region-selector-geo-hidden"),e=b(".b-region-selector-geo-hidden-text"),g=q.find(".b-region-selector-clear-geo"),o=q.find(".b-region-selector-change-geo"),n=k.bid,f=k.myId;var d={};c();r();b(document).bind("change-geo",i);g.click(p);o.click(h);function c(){d.text=l.text();d.geo=m.val()}function r(){g.toggleClass("hidden",d.geo==m.val())}function i(u,v){var t=v.regions_id.match(/(.*),$/);t=t?t[1]:v.regions_id;m.val(t);e.val(v.regions_name);l.text(v.regions_name);r()}function p(t){t.preventDefault();m.val(d.geo);e.val(d.text);l.text(d.text);r()}function h(u){u.preventDefault();var t=s+"?cmd=showgeo&media=&geo="+encodeURIComponent(m.val())+"&bid="+n+"&my_id="+f;j(t,700,530,"geo");return false}function j(y,w,t,v,u){var x=window.open(y,v,"width="+w+",height="+t+",status=yes,menubar=no,resizable=yes,scrollbars=1");if(u){x.focus()}return false}}})(jQuery,window.Lego);
