Files

43 lines
248 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*!
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var CJS=CJS||{};CJS.start=function(){CJS.init();CJS.findScripts();CJS.downloadScripts();if(CJS.defer){if("undefined"!=typeof(document.readyState)&&"complete"===document.readyState){CJS.processScripts()}else{CJS.addHandler(window,"load",CJS.processScripts)}}else{alert("Immediate processing is not currently supported.");CJS.processScripts()}};CJS.findScripts=function(){var d=document.getElementsByTagName("script");var a=d.length;for(var c=0;c<a;c++){var b=d[c];if("text/cjs"===CJS.getAttribute(b,"type")&&"undefined"===typeof(b.cjsfound)){CJS.aScripts[CJS.aScripts.length]=b;b.cjsfound=true}}};CJS.downloadScripts=function(){var a=CJS.aScripts.length;for(var c=0;c<a;c++){var b=CJS.aScripts[c];var d=CJS.getAttribute(b,"data-cjssrc")||CJS.getAttribute(b,"cjssrc");if(d){CJS.downloadScript(d)}}};CJS.downloadScript=function(a){CJS.dprint("downloading "+a);if(CJS.bIE||CJS.bOpera){CJS.downloadScriptImage(a)}else{CJS.downloadScriptObject(a)}};CJS.downloadScriptImage=function(b){var a=new Image();a.onload=function(){CJS.onloadCallback(b)};a.onerror=function(){CJS.onloadCallback(b)};a.src=b};CJS.downloadScriptObject=function(a){if("undefined"===typeof(document.body)||!document.body){setTimeout("CJS.downloadScriptObject('"+a+"')",50);return}var b=document.createElement("object");b.data=a;b.width=0;b.height=0;b.onload=function(){CJS.onloadCallback(a)};b.onerror=function(){CJS.onloadCallback(a)};document.body.appendChild(b)};CJS.onloadCallback=function(a){CJS.hLoaded[a]=true};CJS.execCallback=function(a){CJS.dprint("execCallback: "+a);if(0===CJS.aExecs.length){CJS.dprint("ERROR: We finished executing a script but the exec queue is empty: "+a);return}if(a==CJS.aExecs[0][0]){CJS.aExecs.splice(0,1)}else{CJS.dprint("ERROR: We finished executing a script that wasn't on the queue: "+a)}if(CJS.aExecs.length){CJS.execScript(CJS.aExecs[0][0],CJS.aExecs[0][1])}};CJS.processScripts=function(){CJS.processNextScript()};CJS.processNextScript=function(){if(CJS.aScripts.length){var a=CJS.aScripts[0];CJS.curScript=a;var c=CJS.getAttribute(a,"data-cjssrc")||CJS.getAttribute(a,"cjssrc");var b=CJS.getAttribute(a,"data-cjsexec")||CJS.getAttribute(a,"cjsexec");if(c){if("false"===b){CJS.aScripts.splice(0,1);setTimeout(CJS.processNextScript,0)}else{if(CJS.hLoaded[c]){CJS.processExternalScript(a,CJS.processNextScript);CJS.aScripts.splice(0,1)}else{CJS.dprint("processNextScript: waiting for script "+c);if("undefined"===typeof(a.startwait)){a.startwait=Number(new Date())}var d=Number(new Date())-a.startwait;if(d<CJS.maxWait){setTimeout(CJS.processNextScript,CJS.waitival)}else{alert("There was an error loading script: "+c)}}}}else{CJS.processInlineScript(a);CJS.aScripts.splice(0,1);setTimeout(CJS.processNextScript,0)}return}CJS.findScripts();if(CJS.aScripts.length){CJS.downloadScripts();setTimeout(CJS.processNextScript,0);return}document.write=CJS.docwriteOrig;CJS.dprint("DONE processing scripts")};CJS.processInlineScript=function(script){CJS.curScript=script;var code=script.text;CJS.dprint("processInlineScript: processing script code: "+code.substring(0,64));CJS.eval(code)};CJS.processExternalScript=function(a,c){var b=CJS.getAttribute(a,"data-cjssrc")||CJS.getAttribute(a,"cjssrc");CJS.dprint("processExternalScript: processing script "+b);CJS.execScript(b,c)};CJS.execScript=function(e,d){CJS.dprint("execScript: "+e);if(0===CJS.aExecs.length){CJS.aExecs[CJS.aExecs.length]=[e,d]}else{if(e!=CJS.aExecs[0][0]){CJS.dprint("execScript: queueing for later: "+e);CJS.aExecs[CJS.aExecs.length]=[e,d];return}}var f=(function(g){switch(typeof(g)){case"string":g=new Function(g);break;case"function":break;default:g=new Function()}return g})(d);var b=function(){if(this.readyState&&this.readyState!="complete"&&this.readyState!="loaded"){return}CJS.execCallback(e);this.onload=this.onreadystatechange=null;f()};var c=document.createElement("script");c.onload=c.onreadystatechange=b;c.src=e;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(c,a)};CJS.eval=function(code){if(window.execScript){window.execScript(code)}else{var fn=function(){window.eval.call(window,code)};fn()}};CJS.init=function(){CJS.bInited=true;CJS.defer=("undefined"===typeof(CJS.defer)?true:CJS.defer);CJS.aScripts=[];CJS.hLoaded={};CJS.aExecs=[];CJS.bIE=(-1!=navigator.userAgent.indexOf("MSIE"));CJS.bChrome=(-1!=navigator.userAgent.indexOf("Chrome/"));CJS.bOpera=(-1!=navigator.userAgent.indexOf("Opera"));CJS.curScript=null;CJS.maxWait=5000;CJS.waitival=200;CJS.docwriteOrig=document.write;document.write=CJS.docwrite};CJS.getAttribute=function(f,d){var c=f.attributes;var b=c.length;for(var e=0;e<b;e++){var a=c[e];if(d===a.nodeName){return a.nodeValue}}return undefined};CJS.addHandler=function(c,d,b,a){a=(a)?true:false;if(c.addEventListener){c.addEventListener(d,b,a)}else{if(c.attachEvent){c.attachEvent("on"+d,b)}else{if(c["on"+d]){}else{c["on"+d]=b}}}};if("undefined"!=typeof(console)&&"undefined"!=typeof(console.log)){CJS.dprint=function(a){console.log("CJS "+Number(new Date())+": "+a)}}else{CJS.dprint=function(a){}}CJS.docwrite=function(f){if(CJS.curScript){if(!CJS.curScript.docwriteTarget){CJS.curScript.docwriteTarget=document.createElement("span");CJS.curScript.parentNode.insertBefore(CJS.curScript.docwriteTarget,CJS.curScript)}var e=f.indexOf("<script");if(-1===e){CJS.dprint("docwrite: "+f.substring(0,64));CJS.curScript.docwriteTarget.innerHTML+=f}else{var d=f.indexOf("<\/script>",e)+9;if(-1!=d){var c=f.substring(0,e);var a=f.substring(e,d);var b=f.substring(d+1);if(c){CJS.dprint("docwrite: "+c.substring(0,64));CJS.curScript.docwriteTarget.innerHTML+=c+b}CJS.docwriteScript(a)}}}else{CJS.dprint("ERROR: There's a problem with the async override of document.write.")}};CJS.docwriteScript=function(b){var a=b.match(/src='([^']*)/i)||b.match(/src="([^"]*)/i)||b.match(/src=([^ >]*)/i);if(a){var c=a[1];CJS.dprint("docwriteScript url = "+c);var d=document.createElement("script");d.src=c;document.body.appendChild(d)}else{}};CJS.start();
/*!
* See https://github.com/douglascrockford/JSON-js
*/
var JSON;if(!JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());jQuery.extend(jQuery.expr[":"],{focus:function(a){return a==document.activeElement}});function Sources(){this.sources={}}Sources.prototype={getSource:function(b,d,g,f,j){var a=this.sources[b];if((a&&!j)||(a&&j&&a.info)){d(a,f)}else{var c=new Source({id:b});this.sources[b]=c;var h=this;var e=function(k,l){c.setByJSON(k);d(c,l)};var i=function(k){g(k)};(function(k){jQuery.ajax({url:friendsURL("ajax/source"),data:{requestid:b},dataType:"json",success:function(l){e(l,k)},error:function(l){i(l,k)}})})(f)}},addSource:function(a){if(this.sources[a.id]){return this.sources[a.id].setByJSON(a)}this.sources[a.id]=new Source(a);return this.sources[a.id]}};var g_controls=new Object();var g_controlsInst={};var g_source=null;var g_sources=new Sources();function init(e,b){var g=e;if(!g){g=document;commonInit()}if(b){g_source=new Source(b);g_sources.addSource(g_source)}wrapUsernames(g);if(typeof(ProfileEdit)=="function"){var d=["code","div"];var a=[];for(var h=0;h<d.length;h++){var l=y5.Dom.getDescendants(document,d[h],new RegExp("\\bc-[\\w-]+",""));a=a.concat(l)}for(var h in g_controls){var m=g_controls[h].prototype.TAGNAME;var c=g_controls[h].prototype.CLASSNAME;g_controlsInst[h]=[];for(var f=0;f<a.length;f++){var k=a[f];if(k.tagName.toLowerCase()==m&&isClass(k,c)){g_controlsInst[h][f]=new g_controls[h](k);delClass(k,c)}}}}initAutoareas(g)}function initAutoareas(d){var a=getByTagName("textarea",d);for(var c=0,b=a.length;c<b;c++){new Autoarea(a[c*2]);a=getByTagName("textarea",d)}}function destruct(){for(var b in g_controlsInst){for(var a=0,d=g_controlsInst[b].length;a<d;a++){var c=g_controlsInst[b][a];if(c){if(typeof(c.destruct)==="function"){c.destruct()}g_controlsInst[b][a]=null}}}}y5.require(["Dom","Events"],function(){new y5.AEventListener("unload",destruct,window,true);y5.Events.observe("dom:loaded",setCounter,y5,true)});function setCounter(){var d=y5.Dom.getDescendant(document,"table","b-head");if(d){var c=y5.Dom.getDescendant(d,"span","b-yauser");if(c){new y5.AEventListener("click",function(){r(this,"stred/pid=116/cid=1249")},c,true,this)}}var b=y5.$("actions_mine");if(b){var a=y5.Dom.getDescendant(b,"a","*");new y5.AEventListener("click",function(){r(this,"stred/pid=116/cid=1282")},a,true,this)}}function wrapUsernames(b){var e=y5.Dom.getDescendants(b,"span","b-yauser");for(var c=0,a=e.length;c<a;c++){var d=e[c];if(d&&y5.Dom.textContent(d).length>10){new WrappingText(d)}}}function getParams(_element){var f=_element.onclick;if(f){return f()}var params=String(_element.getAttribute("onclick"));var pos=params.indexOf("[");if(pos!=-1){return eval(params.substring(pos,params.indexOf("]")+1))}return null}function yauser(a,c){var e=c||false;var d=new RegExp("^(\\W*?)(\\w|[\u00a0-\uffff]|S(?!.*\\w))(.*)$");var b=a.title&&/\S+/.test(a.title)?a.title.match(d):a.login.match(d);if(b){return ya.templates.user.Ya({url:friendsFullURL(a.login),userWithUpperLetter:ya.templates.user.userWithUpperLetter({firstPart:b[2],secondPart:b[3]}),qu:(e&&a.qu)?ya.templates.user.Qu({qu:a.qu}):""})}return null}function yausercardBase(a){var d=new RegExp("^(\\W*?)(\\w|[\u00a0-\uffff]|S(?!.*\\w))(.*)$"),c=a.name?a.name:a.title?a.title:a.login?a.login:"",b=c.match(d),e=a.picture_url?a.picture_url+"small":g_source.getDefaultUserpicName(a.sex,"small");if(b){return'<a class="b-userpic b-userpic_type_small" href="'+a.url+'"><img src="'+e+'"class="b-userpic__img"/><i class="b-userpic__i"></i></a><b class="b-user"><a href="'+a.url+'" class="b-user__link">'+ya.xmlEscape(b[1])+'<b class="b-user__first-letter">'+ya.xmlEscape(b[2])+"</b>"+ya.xmlEscape(b[3])+"</a></b>"}else{return""}}function yausercard(a,b){var c=yausercardBase(a);b=b||"b-usercard";if(c){return'<span class="'+b+'"><span class="'+b+'-i">'+c+"</span></span>"}else{return""}}function yausercardWithButton(a,c,b){var d=yausercardBase(a);b=b||"b-usercard";if(d){return'<span class="'+b+'b-usercard_type_add"><span class="'+b+'-i">'+d+'</span><a href="/" class="b-pseudo-link"><img alt="'+c+'" src="//yandex.st/lego/_/La6qi18Z8LwgnZdsAr1qy1GwCwo.gif" class="b-ico"></a></span>'}else{return""}}function yausercardWithLink(b,d,c,e,a){var f=yausercardBase(b);e=e||"b-usercard";if(f){return'<span class="'+e+' b-usercard_type_celebrate"><span class="'+e+'__i">'+f+'<span class="b-usercard__celebrate'+(a?" b-usercard__celebrate_bday_today":"")+'"><a href="'+c+'" class="b-link">'+d+"</a></span></span></span>"}else{return""}}function errImg(a,b){a.onerror=null;a.src=g_globals.img_base+"empty_userpic-"+b+".png"}function viewText(b){var a=document.getElementById(b);var c=document.getElementById(b+"-d");if(c.style.display=="block"){c.style.display="none";a.src=g_globals.img_base+"txt9-plus.gif"}else{c.style.display="block";a.src=g_globals.img_base+"txt9-minus.gif"}return false}function saveStateForm(a){var b=document.forms.post;if(!b){return true}b.action=a;b.submit();return false}function checkChangeForm(){window.onbeforeunload=function(a){return"Вы не сохранили изменения. Действительно хотите уйти отсюда?"}}function WrappingText(a,c,b){this.wrapping_length=c||10;this.wrapping_length_min=b||3;this.wrapping_regexp=new RegExp("\\S{"+(this.wrapping_length+1)+"}");this.wrapTextNodes(this._searchTextNodes(a))}WrappingText.prototype={_searchTextNodes:function(b){var c=[];for(var a=0;a<b.childNodes.length;a++){var d=b.childNodes[a];if(d.nodeType==3){if(this.searchLongWord(d.nodeValue,this.wrapping_length)!=-1){c[c.length]=d}}else{c=c.concat(this._searchTextNodes(d))}}return c},searchLongWord:function(a){return a.search(this.wrapping_regexp)},splitLongWord:function(a){var b=this.searchLongWord(a);if(b!=-1){if(a.length-(b+this.wrapping_length)<this.wrapping_length_min){return null}return{word:a.substring(0,b+this.wrapping_length),last:a.substring(b+this.wrapping_length,a.length)}}return null},wrapTextNodes:function(a){for(var b=0;b<a.length;b++){var c=a[b];c.parentNode.replaceChild(this.createWrappedText(c.nodeValue,this.wrapping_length),c)}},createWrappedText:function(b){var a,c;if(document.createDocumentFragment){c=document.createDocumentFragment()}else{c=document.createElement("span")}while((a=this.splitLongWord(b))){c.appendChild(document.createTextNode(a.word));c.appendChild(document.createElement("wbr"));b=a.last}c.appendChild(document.createTextNode(b));return c}};function open_cut(c,a){a.blur();y5.Dom.removeNode(document.getElementById("oc"+c));var b=document.getElementById("cut"+c);if(b){onclickToSrc(b);$(b).yshow()}return false}function onclickToSrc(d){var e=d.getElementsByTagName("img");for(var c=0,a=e.length;c<a;c++){var b=e[c];if(b.onclick){b.src=b.onclick()}}}function cleanLogin(){y5.$("t").checked=0;var a=y5.$("l");var b=y5.$("s");setInterval(function(){if(a.value){clean(a)}if(b.value){clean(b)}},100)}function ChFormElementValue(c,b,e){var d=document.forms[c];var a=d.elements[b];a.value+=e;d.submit();return false}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;d<a;d++){var g=document.forms[d];for(var c=0,h=g.length;c<h;c++){var e=g.elements[c];if((e.tagName.toLowerCase()=="textarea")||(e.type&&e.type=="text")){if(!g_searchInput){g_searchInput=e}addEvent(e,"focus",function(){g_activeInput=this});addEvent(e,"blur",function(){g_activeInput=null})}}}if(b&&g_searchInput){g_searchInput.focus()}}if(typeof(addEmptyTitleAndBorderToAllImages)=="function"){addEmptyTitleAndBorderToAllImages(document)}if(typeof(applyDecoration)=="function"){applyDecoration(document)}}function getCookie(g){var f=document.cookie;if(f.length<1){return false}var a=f.indexOf(g+"=");if(a==-1){return false}a+=(g.length+1);var d=f.indexOf(";",a);return unescape((d==-1)?f.substring(a):f.substring(a,d))}function r(c,b){new Image().src=location.protocol+"//clck.yandex.ru/click/dtype="+b+"/rnd="+((new Date()).getTime()+Math.round(Math.random()*100))+"/*"+(c?(c.href||location.href):"")}function clean(b){var c=b.previousSibling;if(c){b.onblur=function(){if(!b.value){c.style.top=""}};c.style.top="-9999px"}}function cleanIfNotEmpty(b){var d=[];for(var a=0;a<b.length;a++){d[a]=document.getElementById(b[a])}var c=function(){for(var e=0;e<d.length;e++){if(d[e].value){clean(d[e])}}};setInterval(c,100)}function getById(a){if(document.getElementById){return document.getElementById(a)}else{if(document.all){return document.all[a]}}return null}var _cacheByTagName=[];function getByTagName(a,c){if(!c){c=document}var b=c.getElementsByTagName(a);return b}function associateEventWithObject(c,a,b){return function(d){return c[a](this,b,d||window.event)}}function isClass(d,e){if(d&&d.className){var c=(typeof(e)=="string")?new Array(e):e;for(var b=0,a=c.length;b<a;b++){if(new RegExp("(^|\\s+)"+c[b]+"(\\s+|$)","").test(d.className)){return c[b]}}}return null}function addClass(a,b){if(!a.length&&isClass(a,b)){return}modifyClass(a,b,function(c,d){if(c.className&&!/^\s*$/.test(c.className)){if(!isClass(c,d)){c.className=c.className+" "+d}}else{c.className=d}})}function delClass(a,b){if(!a.length&&!isClass(a,b)){return}try{modifyClass(a,b,function(d,e){d.className=d.className.replace(new RegExp("\\b"+e+"\\b","g"),"").replace(/^\s|\s$/,"")})}catch(c){alert([a.id,b])}}function replaceClass(c,b,a){delClass(c,b);addClass(c,a)}function switchClass(b,d,c,a){if(isClass(b,d)){replaceClass(b,d,c)}else{if(isClass(b,c)){replaceClass(b,c,d)}else{if(a){addClass(b,a)}}}}function modifyClass(d,e,c){if(d.length){for(var b=0,a=d.length;b<a;b++){c(d[b],e)}}else{c(d,e)}}function getParentOrSelfByClass(a,b){var c=a;while(c.tagName){if(isClass(c,b)){return c}c=c.parentNode}return null}function getParentOrSelfByTagName(b,a){var c=b;while(c.tagName){if(c.tagName.toLowerCase()==a){return c}c=c.parentNode}return null}function getElementsByTagNameAndClass(g,b,f){var e;if(b=="*"){e=g.all?g.all:g.getElementsByTagName("*")}else{e=g.getElementsByTagName(b)}var c=[];for(var d=0,a=e.length;d<a;d++){if(isClass(e[d],f)){c[c.length]=e[d]}}return c}function getChildrenByTagName(d,a){var c=d.firstChild;var b=new Array();while(c!=null){if(c.tagName&&((a=="*")||(new String(c.tagName).toLowerCase()==a))){b[b.length]=c}c=c.nextSibling}return b}function getChildrenByTagNameAndClass(f,a,e){var d=getChildrenByTagName(f,a);var b=new Array();for(var c=0;c<d.length;c++){if(isClass(d[c],e)){b[b.length]=d[c]}}return b}function getPrevElement(d,a){var e=d.previousSibling;var f=(typeof(a)=="string")?new Array(a):a;while(e!=null){if(e.tagName){var b=new String(e.tagName).toLowerCase();for(var c=0;c<f.length;c++){if((b==f[c])||(f[c]=="*")){return e}}}e=e.previousSibling}return null}function getNextElement(d,a){var e=d.nextSibling;var f=(typeof(a)=="string")?new Array(a):a;while(e!=null){if(e.tagName){var b=new String(e.tagName).toLowerCase();for(var c=0;c<f.length;c++){if((b==f[c])||(f[c]=="*")){return e}}}e=e.nextSibling}return e}function getOffsetLeft(a){var c=a;var b=c.offsetLeft;while((c=c.offsetParent)!=null){b+=c.offsetLeft}return b}function getOffsetTop(a){var c=a;var b=c.offsetTop;while((c=c.offsetParent)!=null){b+=c.offsetTop}return b}function insertAfter(a,b){if(b.nextSibling){b.parentNode.insertBefore(a,b.nextSibling)}else{b.parentNode.appendChild(a)}}function appendInputField(b,c){var a;try{a='<input type="'+c.type+'" name="'+c.name+'"';if(c.id){a+='id="'+c.id+'"'}if(c.value){a+='value="'+c.value+'"'}a+=">";a=document.createElement(a)}catch(d){a=document.createElement("input");a.type=c.type;a.name=c.name;if(c.id){a.id=c.id}if(c.value){a.value=c.value}}return b.appendChild(a)}function Source(a){this.id=null;this.login=null;this.type=null;this.title=null;this.title_inflections=null;this.qu=null;this.sex="man";this.userpics=[];this.info=null;this.mood="";this.status="normal";this.setByJSON(a);this.currentUserpicId=0}Source.prototype={setByJSON:function(b){for(var a in b){this[a]=b[a]}return this},hasUserpics:function(){return this.userpics&&(this.userpics.length>0)},getUserpicsCount:function(){return this.userpics.length},getUserpicId:function(b){var a=b||0;if(this.userpics[a]){return this.userpics[a][0]}return null},getUserpicName:function(c,b){var a=c||0;if(this.userpics[a]){return this.userpics[a][1]}return this.getDefaultUserpicNameShort(null,b)},getDefaultUserpicNameShort:function(b,a){return this.getDefaultUserpicName(b,a).replace(/^\w+:\/\/[^\/]+/i,"")},getDefaultUserpicName:function(d,b){b=b||"normal";if(this.type=="community"){return this.userpic.replace("normal(.png)?$",b)}var c=this.sex||d||"man";var a=(typeof this.default_userpic=="object"?this.default_userpic[c]:this.default_userpic)+b;return a},getUserpic:function(a){var c=a.id||0;var b=a.size||"normal";if(this.userpics[c]&&this.userpics[c][1]!=""){return g_globals.userpic_base+this.id+"/"+this.getUserpicName(c)+"-"+b}return this.getDefaultUserpicName(0,a.size)},getUserpicContent:function(a){var c=a.size||"normal";var f=a.simple||false;var e=a.src||this.getUserpic(a);var b=a.loaded!==false;var d;if(b){d="<img"+(a.id?" id='"+a.id+"'":"")+(a.className?" class='"+a.className+"'":"")+" src='"+e+"'' alt='userpic'/>"}else{d="<code class='Friends-later-ImageLoadable' onclick='return {src:\""+e+"\"}'>"}if(!f){d="<i class='b-userpic "+c+"'><b><i><a class='b-userpic no-link'>"+d+"</a></i></b></i>"}return d},yauser:function(b){var c=b||false;var a=this.title&&/\S+/.test(this.title)?this.title:this.login;a=y5.Strings.normalize(a);var a='<span class="b-yauser"><a href="'+friendsFullURL(this)+'"><b>'+a.substr(0,1)+"</b>"+a.substring(1)+"</a>";if(c&&this.qu){a+="<sup>"+this.qu+"</sup>"}a+="</span>";return a}};window.JZ=(function(b){(function(c){c.proxy||(c.proxy=function(f,e,d){if(arguments.length===2){if(typeof e==="string"){d=f;f=d[e];e=undefined}else{if(e&&!jQuery.isFunction(e)){d=e;e=undefined}}}if(!e&&f){e=function(){return f.apply(d||this,arguments)}}if(f){e.guid=f.guid=f.guid||e.guid||jQuery.guid++}return e})})(jQuery);(function(g){var d=(function(){_}).toString().indexOf("_")>-1,c=g.browser.msie,e=c?["toString","valueOf"]:null,h=function(){};function f(j,i,k){var m=false;if(c){var l=[];g.each(e,function(){k.hasOwnProperty(this)&&(m=true)&&l.push({name:this,val:k[this]})});if(m){g.each(k,function(n){l.push({name:n,val:this})});k=l}}g.each(k,function(o,p){if(m){o=p.name;p=p.val}if(g.isFunction(j[o])&&g.isFunction(p)&&(!d||p.toString().indexOf(".__base")>-1)){var n=j[o];i[o]=function(){var s=this.__base;this.__base=n;var q=p.apply(this,arguments);this.__base=s;return q}}else{i[o]=p}})}g.inherit=function(){var j=g.isFunction(arguments[0]),p=j?arguments[0]:h,l=arguments[j?1:0]||{},n=arguments[j?2:1],i=l.__constructor||(j&&p.prototype.__constructor)?function(){this.__constructor.apply(this,arguments)}:function(){};if(!j){i.prototype=l;i.prototype.__self=i.prototype.constructor=i;return g.extend(i,n)}g.extend(i,p);var m=function(){},k=p.prototype;m.prototype=p.prototype;i.prototype=new m();var o=i.prototype;o.__self=o.constructor=i;f(k,o,l);n&&f(p,i,n);return i}})(jQuery);(function(c){c.extend({debounce:function(e,f,g,d){if(arguments.length==3&&typeof g!="boolean"){d=g;g=false}var h;return function(){var i=arguments;d=d||this;if(g&&!h){e.apply(d,i)}clearTimeout(h);h=setTimeout(function(){if(!g){e.apply(d,i)}h=null},f)}},throttle:function(g,h,f){var i,e,d;return function(){e=arguments;d=true;if(!i){(function(){if(d){g.apply(f,e);d=false;i=setTimeout(arguments.callee,h)}else{i=null}})()}}}})})(jQuery);(function(d){var c=1;d.identify=function(e){return e.__id||(e.__id=c++)}})(jQuery);(function(d){var c=function(h,f,g){var e=[d.identify(h),d.identify(f)];d.each(g,function(){e.push(typeof this,this)});return e.join("\x0B")};d.memoize=function(e){return function(){!e.__memoize&&(e.__memoize={});var f=c(e,this,arguments);return e.__memoize[f]||(e.__memoize[f]=e.apply(this,arguments))}}})(jQuery);(function(){var c={getSelection:function(){var d=this.jquery?this[0]:this;return(("selectionStart" in d&&function(){var e=d.selectionEnd-d.selectionStart;return{start:d.selectionStart,end:d.selectionEnd,length:e,text:d.value.substr(d.selectionStart,e)}})||(document.selection&&function(){d.focus();var f=document.selection.createRange();if(f==null){return{start:0,end:d.value.length,length:0}}var e=d.createTextRange();var g=e.duplicate();e.moveToBookmark(f.getBookmark());g.setEndPoint("EndToStart",e);return{start:g.text.length,end:g.text.length+f.text.length,length:f.text.length,text:f.text}})||function(){return{start:0,end:d.value.length,length:0}})()},replaceSelection:function(){var d=this.jquery?this[0]:this;var f=arguments[0]||"";return(("selectionStart" in d&&function(){d.value=d.value.substr(0,d.selectionStart)+f+d.value.substr(d.selectionEnd,d.value.length);return this})||(document.selection&&function(){d.focus();document.selection.createRange().text=f;return this})||function(){d.value+=f;return this})()}};jQuery.each(c,function(d){jQuery.fn[d]=this})})();var a={CSS_CLASS_WIDGET:"jz",onInit:function(d,c){d.bind("init.jz",c).each(function(){b(this).data("jz")&&c.call(window,b.Event("init.jz"),b(this).data("jz"))})},registerWidget:function(c,f,d,e){this.Builder.registerWidget(c,f,d,e);return this},_throwException:function(c){throw"JZException: "+c},_identifyNode:function(c){return c.id||("__id-"+b.identify(c))}};b.fn.jz=function(d){var c;this.each(function(g){var j=b(this),e=j.data("jz");if(d===false){e&&e.remove(true)}else{if(!e){var h=j.closest("form");if(h[0]){var f=h.data("jz-builder");(f||new a.Builder()).build(f?j:h)}}}g==0&&(c=j.data("jz"))});return c};a.Observable=b.inherit({bind:function(j,k,h,e){this._observers||(this._observers={});if(b.isFunction(k)){e=h;h=k}var g=0,f=j.split(" "),c,d;while(c=f[g++]){d=c.indexOf(".")>-1;c=d?c.split("."):c;j=d?c.shift():c;(this._observers[j]||(this._observers[j]=[])).push({ns:d?c.sort().join("."):null,fn:h,data:k,ctx:e})}return this},unbind:function(l,n){if(this._observers){if(l){var d=0,c,g=l.split(" "),f,h,k,e,m;while(k=g[d++]){e=k.indexOf(".")>-1;k=e?k.split("."):k;l=e?k.shift():k;m=e?new RegExp("(^|\\.)"+k.sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;if(l){f=this._observers[l];if(f){c=0;while(h=f[c++]){if((!n||n===h.fn)&&(!e||(e&&h.ns&&m.test(h.ns)))){f.splice(--c,1)}}}}else{for(l in this._observers){f=this._observers[l];c=0;while(h=f[c++]){if((!n||n===h.fn)&&h.ns&&m.test(h.ns)){f.splice(--c,1)}}}}}}else{delete this._observers}}return this},trigger:function(k,j){if(this._observers){typeof k==="string"&&(k=b.Event(k));var c=k.type.indexOf(".")>-1,h=c?k.type.split("."):null;if(c){k.type=h.shift();h=new RegExp("(^|\\.)"+h.sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}var l=this._observers[k.type];if(l){var g=0,d,f;while(d=l[g++]){if(!c||(d.ns&&h.test(d.ns))){k.data=d.data;f=d.fn.call(d.ctx||window,k,j);if(typeof f!=="undefined"){k.result=f;if(f===false){k.preventDefault();k.stopPropagation()}}}}}}return this}});a.Widget=b.inherit(a.Observable,{__constructor:function(c,d,e){this._elem=c.data("jz",this);this._classElem=d||c;this._params=b.extend(this._getDefaultParams(e),e);this._parent=this._form=null;this._isInited=this._isRequired=false;this._isValid=true;this._isEnabled=!this._elem.attr("disabled");this._val=this._initialVal=null;this._dependencies={};this._dependFromIds={}},getElement:function(){return this._elem},getId:b.memoize(function(){return a._identifyNode(this._elem[0])}),getName:b.memoize(function(){return this._extractName()}),focus:function(){this._elem[0].focus();return this},hasCSSClass:function(c){return this._classElem.hasClass(c)},addCSSClass:function(c){this._classElem.addClass(c);return this},removeCSSClass:function(c){this._classElem.removeClass(c);return this},replaceCSSClass:function(c,d){this.hasCSSClass(c)&&this.removeCSSClass(c);return this.addCSSClass(d)},init:function(){return this._isInited?this._reinit():this._init()},isRequired:function(){return this._isRequired},isValid:function(){return this._isValid},isReady:function(){return !this.isEnabled()||(!this.isRequired()&&this.isValid())},isEnabled:function(){return this._isEnabled},show:function(){return this.removeCSSClass(this.__self.CSS_CLASS_INVISIBLE)},hide:function(){return this.addCSSClass(this.__self.CSS_CLASS_INVISIBLE)},enable:function(c){if(this.isEnabled()||!this._parent.isEnabled()){return this}if(c&&this._dependencies.enabled){return this._checkDependencies("enabled")}this._enableElems();var d=this.removeCSSClass(this.__self.CSS_CLASS_DISABLED).isReady();this._isEnabled=true;d!=this.isReady()&&this.trigger("ready-change",this);this.isChanged()&&this.trigger("initial-value-change",true);return this.trigger("enable",this)},disable:function(){if(this.isEnabled()){this._disableElems();var c=this.addCSSClass(this.__self.CSS_CLASS_DISABLED).isReady();this._isEnabled=false;c!=this.isReady()&&this.trigger("ready-change",this);this.isChanged()&&this.trigger("initial-value-change",false);this.trigger("disable",this)}return this},val:function(c){return typeof c=="undefined"?this._val.get():this._setVal(this._processVal(this._createVal(c)))},getValue:function(){return this.val()},setValue:function(c){return this.val(c)},addDependence:function(d,c){this._dependencies[d]=c;var e=this;b.each(c.getFrom(),function(){e._dependFromIds[this.getId()]||(e._bindTo(this,{"value-change enable disable":this._onChangeDependFromWidget,remove:this._onRemoveDependFromWidget})._dependFromIds[this.getId()]=true)})},remove:function(c){this._triggerRemove()._parent&&this._parent._removeChild(this);var d=this._classElem;this._destruct();c&&d.remove()},reset:function(){if(this._hasVal()){this._setNoReady(false);this._setVal(this._initialVal)}return this},addChild:function(){},_bindTo:function(f,d,e,c){if(b.isFunction(e)){c=e;e=null}var g=this;typeof d=="string"?f.bind(d,e,b.proxy(c,g)):b.each(d,function(h){g._bindTo(f,h,e,this)});return g},_bindToElem:function(d,e,c){return this._bindTo(this._elem,d,e,c)},_init:function(){this._bindEvents()._hasVal()&&this._initVal();this._isInited=true;this._params.focusOnInit&&this.focus();return this},_reinit:function(){if(this._hasVal()){this._setNoReady(false);this.isChanged()&&this.removeCSSClass(this.__self.CSS_CLASS_CHANGED);this._initialVal=this._val}return this},_extractName:function(){return this._elem.attr("name")},_createVal:function(c){return new a.Value(c)},_processVal:function(c){return c},_getVal:function(){return this._val},_setVal:function(e,c){if(!this._val.isEqual(e)){var d=this.isChanged();this._val=e;c||this._setValToElem(e);d==this.trigger("value-change",this).isChanged()||this[(d?"remove":"add")+"CSSClass"](this.__self.CSS_CLASS_CHANGED).trigger("initial-value-change",!d)}return this},_setForm:function(c){(this._form=c)._addWidget(this);return this},_getDefaultParams:function(c){return{focusOnInit:false}},_delete:function(){var c=this;b.each(arguments,function(d,e){delete c[e]})},_destruct:function(){this._unbindAll();this._elem.removeData("jz");this._delete("_elem","_classElem","_params","_parent","_val","_initialVal","_dependencies","_dependFromIds")},_unbindAll:function(){this._elem.unbind();this._classElem.unbind();this.unbind()},_hasVal:function(){return false},_initVal:function(){this._initialVal=(this._val=this._createVal(this._extractValFromElem())).clone()},isChanged:function(){return this._hasVal()&&!this._initialVal.isEqual(this._val)},_updateValue:function(){this._setVal(this._createVal(this._extractValFromElem()),true)},_checkDependencies:(function(){var c=["enabled","valid","required"];return function(g,k,l){var f=0,j,m,e=!!g?[g]:c,d=e.length,h=this.isReady();while(f<d){m=this._dependencies[j=e[f++]];if(m||l){this[this.__self._dependenceTypeToFn(j)](m?m.check():{result:true,params:{}})}}h!=this.isReady()&&this.trigger("ready-change",this);return this}})(),_checkRequired:function(c){return this._getVal().match(c.pattern)},_processEnabledDependenceCheck:function(c){if(c.result){var d=this.isEnabled();this.enable().show();c.params.focusOnEnable&&!d&&this.focus()}else{this.disable();c.params.hideOnDisable&&this.hide()}},_processRequiredDependenceCheck:function(c){this._updateRequired(!c.result)},_processValidDependenceCheck:function(c){this._updateValid(c.result);var e=this,d=c.params.invalidCSSClasses;d&&b.each(d,function(){e[(this.add?"add":"remove")+"CSSClass"](this.name)})},_updateRequired:function(d){var c=this.__self;(d?this.replaceCSSClass(c.CSS_CLASS_REQUIRED_OK,c.CSS_CLASS_REQUIRED):this.replaceCSSClass(c.CSS_CLASS_REQUIRED,c.CSS_CLASS_REQUIRED_OK).removeCSSClass(c.CSS_CLASS_NOREADY_REQUIRED))._isRequired=d},_updateValid:function(d){var c=this.__self;(d?(this._getVal().isEmpty()?this.removeCSSClass(c.CSS_CLASS_INVALID+" "+c.CSS_CLASS_INVALID_OK):this.replaceCSSClass(c.CSS_CLASS_INVALID,c.CSS_CLASS_INVALID_OK)).removeCSSClass(c.CSS_CLASS_NOREADY_INVALID):this.replaceCSSClass(c.CSS_CLASS_INVALID_OK,c.CSS_CLASS_INVALID))._isValid=d},_setNoReady:function(d){var c=(d?"add":"remove")+"CSSClass";this.isRequired()&&this[c](this.__self.CSS_CLASS_NOREADY_REQUIRED);this.isValid()||this[c](this.__self.CSS_CLASS_NOREADY_INVALID)},_processFirstUnreadyWidget:function(){if(!this.isReady()){return this}},_extractValFromElem:function(){return this._elem.val()},_setValToElem:function(c){this._elem.val(c.toString())},_triggerRemove:function(){return this.trigger("remove",this)},_onChangeDependFromWidget:function(){this._checkDependencies()},_onRemoveDependFromWidget:function(c,d){var e=this;b.each(this._dependencies,function(g){var f=this.removeFrom(d);f?e._dependencies[g]=f:delete e._dependencies[g];e._checkDependencies(g,false,true)});delete this._dependFromIds[d.getId()]},_bindEvents:function(){return this},_enableElems:function(){},_disableElems:function(){},_beforeSubmit:function(){}},{CSS_CLASS_HIDDEN:a.CSS_CLASS_WIDGET+"-hidden",CSS_CLASS_INVISIBLE:a.CSS_CLASS_WIDGET+"-invisible",CSS_CLASS_INITED:a.CSS_CLASS_WIDGET+"-inited",CSS_CLASS_CHANGED:a.CSS_CLASS_WIDGET+"-changed",CSS_CLASS_FOCUSED:a.CSS_CLASS_WIDGET+"-focused",CSS_CLASS_SELECTED:a.CSS_CLASS_WIDGET+"-selected",CSS_CLASS_DISABLED:a.CSS_CLASS_WIDGET+"-disabled",CSS_CLASS_REQUIRED:a.CSS_CLASS_WIDGET+"-required",CSS_CLASS_REQUIRED_OK:a.CSS_CLASS_WIDGET+"-required-ok",CSS_CLASS_INVALID:a.CSS_CLASS_WIDGET+"-invalid",CSS_CLASS_INVALID_OK:a.CSS_CLASS_WIDGET+"-invalid-ok",CSS_CLASS_NOREADY_REQUIRED:a.CSS_CLASS_WIDGET+"-noready-required",CSS_CLASS_NOREADY_INVALID:a.CSS_CLASS_WIDGET+"-noready-invalid",_dependenceTypeToFn:b.memoize(function(c){return"_process"+c.charAt(0).toUpperCase()+c.substr(1).toLowerCase()+"DependenceCheck"})});a.Widget.Input=b.inherit(a.Widget,{__constructor:function(){this.__base.apply(this,arguments);this._isFocused=false},_bindEvents:function(){return this._bindToElem({focus:this._onFocus,blur:this._onBlur})},_onFocus:function(){this.addCSSClass(this.__self.CSS_CLASS_FOCUSED)._isFocused=true;this.trigger("focus")},_onBlur:function(){this.removeCSSClass(this.__self.CSS_CLASS_FOCUSED)._isFocused=false;this.trigger("blur")},_hasVal:function(){return true},_enableElems:function(){this._elem.attr("disabled",false)},_disableElems:function(){this._elem.attr("disabled",true)}});a.Widget.Input.Text=b.inherit(a.Widget.Input,{__constructor:function(){this.__base.apply(this,arguments);this._hintShowed=false},_init:function(){this.__base()._isFocused||this._updatePlaceholder();return this},_bindEvents:function(){return this.__base()._bindToElem("input change keyup blur",this._onChange)},_onFocus:function(){this.__base();this._updatePlaceholder()},_onBlur:function(){this.__base();this._updatePlaceholder()},_onChange:function(){this._updateValue()},_updatePlaceholder:function(){if(this._params.placeholder){var d=this._hintShowed,c=this._getVal().isEmpty();this._hintShowed?(this._isFocused||!c)&&(d=false):(!this._isFocused&&c)&&(d=true);d!=this._hintShowed&&this._getPlaceholder()[((this._hintShowed=d)?"remove":"add")+"Class"](this.__self.CSS_CLASS_HIDDEN)}},_setValToElem:function(){this._updatePlaceholder();this.__base.apply(this,arguments)},_getPlaceholder:b.memoize(function(){return b('<label for="'+this.getId()+'" class="'+this.__self.CSS_CLASS_PLACEHOLDER+'">'+this._params.placeholder+"</label>").insertBefore(this._elem.attr("id",this.getId()))}),_destruct:function(){this._params.placeholder&&this._getPlaceholder().remove();this.__base()}},{CSS_CLASS_PLACEHOLDER:a.CSS_CLASS_WIDGET+"-placeholder"});a.Widget.Input.Text.Combo=b.inherit(a.Widget.Input.Text,{__constructor:function(){this.__base.apply(this,arguments);this._isListShowed=this._preventOnBlur=this._preventOnFocus=this._preventUpdate=this._focusOnBlur=false;this._hilightedIndex=-1;this._itemsCount=0;this._lastSearchVal=this._keyDownValue=this._updateList=this._reposTimer=this._lastOffset=null},_init:function(){this.__base()._elem.attr("autocomplete","off");this._params.arrow&&this._params.arrow.attr("tabIndex",-1);this._updateList=b.debounce(function(d){if(this._elem){if(!this._params.showListOnEmpty&&this._elem.val()===""){return this._hideList()}var c=typeof d=="undefined"?this._elem.val():d;if(this._lastSearchVal===this._elem.val()&&typeof d=="undefined"){return this._showList()}this._getStorage().filter(this._lastSearchVal=c,b.proxy(this._onStorageFilter,this))}},this._params.debounceInterval);return this},_onStorageFilter:function(d,e){if(this._lastSearchVal==d){this._itemsCount=e.length;this._hilightedIndex=-1;if(!e.length){return this._hideList()}var c=this._elem.val(),f=this;this._getList().html(b.map(e,function(h,g){c==h&&(f._hilightedIndex=g);return f._params.listItemRenderFn(h,c,d)}).join(""));this._showList()}},_bindEvents:function(){var c=b.browser.opera?"keypress":"keydown",d={keyup:this._onKeyUp};d[c]=this._onKeyDown;this.__base()._bindToElem(d);var e=this._params.arrow;e&&this._bindTo(e,{mousedown:this._onArrowMouseDown,mouseup:this._onArrowMouseUp,click:this._onArrowClick});return this},_onFocus:function(){if(!this._preventOnFocus){this.__base();if(!this._preventUpdate){if(this._params.showAllOnFocus){this._updateList("");this._lastSearchVal=this._elem.val()}else{this._updateList()}}else{this._preventUpdate=false}}else{this._preventOnFocus=false}},_onBlur:function(){if(!this._preventOnBlur){this.__base();this._hideList()}else{this._preventOnBlur=false}if(this._focusOnBlur){this._focusOnBlur=false;setTimeout(b.proxy(function(){this.focus()._refocus()},this),0)}},_onArrowMouseDown:function(){if(this.isEnabled()){this._preventOnBlur=true;this._params.arrow.addClass(this.__self.CSS_CLASS_ARROW_PRESSED)}},_onArrowMouseUp:function(){this.isEnabled()&&this._params.arrow.removeClass(this.__self.CSS_CLASS_ARROW_PRESSED)},_onArrowClick:function(){if(!this.isEnabled()){return}if(this._isListShowed){this._hideList();this._preventOnFocus=true;this.focus()}else{this._preventUpdate=true;this.focus()._refocus()._updateList("");this._preventOnBlur=false}return false},_onKeyDown:function(c){if(this._keyDownValue!==null){return}this._keyDownValue=this._elem.val();if(c.metaKey||c.ctrlKey||c.shiftKey||c.altKey){return}switch(c.keyCode){case 13:if(this._isListShowed){this._itemsCount=0;this._hilightedIndex=-1;this.val(this._lastSearchVal=this._keyDownValue)._hideList();return false}break;case 38:this._prev();return false;case 40:this._next();return false}},_onKeyUp:function(c){if(!this._isFocused||c.metaKey||c.ctrlKey||c.shiftKey||c.altKey){return}c.keyCode!=9&&this._keyDownValue!=this._elem.val()&&this._updateList();this._keyDownValue=null},_prev:function(){this._isListShowed&&this._hilightItemByIndex((this._hilightedIndex>0?this._hilightedIndex:this._itemsCount)-1)},_next:function(){this._isListShowed&&this._hilightItemByIndex(this._hilightedIndex<this._itemsCount-1?this._hilightedIndex+1:0)},_hilightItemByIndex:function(c){this._getList().find("li").eq(this._hilightedIndex).removeClass(this.__self.CSS_CLASS_SELECTED).end().eq(c).addClass(this.__self.CSS_CLASS_SELECTED);this._selectItemByIndex(this._hilightedIndex=c)._keyDownValue=this.val()},_selectItemByIndex:function(d){if(this._isListShowed){var e=this.val(this._lastSearchVal=this._getList().find("li").eq(d).text())._elem[0];if(e.createTextRange&&!e.selectionStart){var c=e.createTextRange();c.move("character",this._elem.val().length);c.select()}}return this},_showList:function(){if(this._isListShowed||!this._isFocused||!this._itemsCount||(this._itemsCount==1&&this._hilightedIndex==0)){return}this._getListContainer().removeClass(this.__self.CSS_CLASS_INVISIBLE);this._reposList();this._isListShowed=true},_hideList:function(){if(this._isListShowed){this._reposTimer&&clearTimeout(this._reposTimer);this._getListContainer().addClass(this.__self.CSS_CLASS_INVISIBLE);this._isListShowed=false}},_reposList:function(){var e=this._elem.offset(),d=e.left,c=e.top+this._elem.outerHeight();if(!(this._lastOffset&&this._lastOffset.left==d&&this._lastOffset.top==c)){this._lastOffset={left:d,top:c};this._getListContainer().css({width:this._elem.outerWidth()+"px",left:d+"px",top:c+"px"})}this._params.reposList&&(this._reposTimer=setTimeout(b.proxy(arguments.callee,this),50))},_getListContainer:b.memoize(function(){var c=b('<div class="'+this.__self.CSS_CLASS_LIST+" "+this.__self.CSS_CLASS_INVISIBLE+'"><iframe frameborder="0" tabindex="-1"/><ul/></div>');this._bindTo(c,"mousedown",function(d){this._preventUpdate=this._focusOnBlur=true;this.val(this._lastSearchVal=b(d.target).closest("li").text()).focus()._hideList();setTimeout(b.proxy(function(){this._focusOnBlur=false},this),50);return false});return c.appendTo("body")}),_getList:b.memoize(function(){return this._getListContainer().find("ul")}),_getStorage:b.memoize(function(){var c=this;return c._params.storage.source=="remote"?new a.Storage.Remote(b.extend({name:c._params.storage.name||this.getName(),widgets:b.map((c._params.storage.values||"").split(","),function(d){var d=b.trim(d);return d?c._form.getWidgetByName(d):null})},c._params.storage)):new a.Storage.Local(c._params.storage)}),_refocus:function(){if(document.selection){var c=this._elem[0].createTextRange();c.collapse(true);c.moveStart("character",1000);c.moveEnd("character",1000);c.select()}return this},_enableElems:function(){this.__base();this._enableArrow(true)},_disableElems:function(){this.__base();this._enableArrow(false)},_enableArrow:function(c){var d=this._params.arrow;d&&(d[(c?"remove":"add")+"Class"](this.__self.CSS_CLASS_DISABLED))[0].tagName=="INPUT"&&d.attr("disabled",!c)},_getDefaultParams:function(c){return b.extend(this.__base(),{showAllOnFocus:false,showListOnEmpty:true,reposList:false,debounceInterval:c.storage.source=="remote"?200:50,listItemRenderFn:this.__self._listItemRender})},_destruct:function(){this._hideList();this.__base();this._getListContainer().remove()},_unbindAll:function(){this.__base();this._params.arrow&&this._params.arrow.unbind()}},{CSS_CLASS_LIST:a.CSS_CLASS_WIDGET+"-list",CSS_CLASS_ARROW_PRESSED:a.CSS_CLASS_WIDGET+"-comboarrow-pressed",_listItemRender:function(e,d,c){var f=e.toLowerCase().indexOf(c.toLowerCase());return"<li"+(d==e?' class="'+this.CSS_CLASS_SELECTED+'"':"")+">"+(f>-1?e.substr(0,f)+"<strong>"+e.substr(f,c.length)+"</strong>"+e.substr(f+c.length):e)+"</li>"}});a.Widget.Container=b.inherit(a.Widget,{__constructor:function(){this.__base.apply(this,arguments);this._children=[]},addChild:function(){var c=0,d;while(d=arguments[c++]){(d._parent=this)._children.push(d)}return this},focus:function(){var c=this._children[0];c&&c.focus();return this},enable:function(c){return this.__base(c)._applyFnToChildren("enable",[true])},disable:function(){return this.__base()._applyFnToChildren("disable")},reset:function(){return this.__base()._applyFnToChildren("reset")},_removeChild:function(e){var d=this._children,c=0,f;while(f=d[c++]){if(f===e){d.splice(c-1,1);return true}}return false},_init:function(){this._applyFnToChildren("_init").__base();var d=this._children,c=0,e;while(e=d[c++]){this._bindChildEvents(e)}return this},_reinit:function(){return this._applyFnToChildren("_reinit").__base()},_bindChildEvents:function(c){this._hasVal()||this._bindTo(c,"value-change enable disable",this._onChildChange)},_onChildChange:function(){this.trigger("value-change",this)},_setForm:function(c){return this._applyFnToChildren("_setForm",arguments).__base(c)},_checkDependencies:function(c,d){this.__base(c,d);d&&this._applyFnToChildren("_checkDependencies",arguments);return this},_beforeSubmit:function(){this._applyFnToChildren("_beforeSubmit").__base()},_checkRequired:function(g){if(this._hasVal()){return this.__base(g)}var e=this._children,d=0,h,c=0;while(h=e[d++]){if(h._dependencies.required){h.isRequired()||++c}else{var f=g.pattern;g.pattern=g.patternChild;h._checkRequired(g)&&++c;g.pattern=f}if(c>=g.min){return true}}return false},_processFirstUnreadyWidget:function(){var c=this.__base();if(c||this._hasVal()){return c}return this._processFirstUnreadyChildWidget()},_processFirstUnreadyChildWidget:function(){var d=this._children,c=0,f,e;while(f=d[c++]){if(e=f._processFirstUnreadyWidget()){return e}}},_destruct:function(){this._applyFnToChildren("_destruct").__base();delete this._children},_triggerRemove:function(){return this._applyFnToChildren("_triggerRemove").__base()},_applyFnToChildren:function(d,c){var f=this._children,e=0,g;while(g=f[e++]){g[d].apply(g,c||[])}return this}});a.Widget.Container.Form=b.inherit(a.Widget.Container,{__constructor:function(){this.__base.apply(this,arguments);this._widgetsByName={};this._widgetsDataById={};this._unreadyWidgetIds={};this._unreadyCounter=this._changedCounter=0},isChanged:function(){return this._changedCounter>0},isReady:function(){return this._unreadyCounter==0&&(!this._params.heedChanges||this.isChanged())},getWidgetByName:function(c){return this._widgetsByName[c]},getWidgetById:function(c){return this._widgetsDataById[c].widget},serialize:function(){var c={};b.each(this._widgetsByName,function(d){this._hasVal()&&this.isEnabled()&&(c[d]=this.val())});return c},submit:function(){this._elem.submit()},init:function(c){c?c._setForm(this)._init()._checkDependencies(null,true):this.__base();return this},_init:function(){this._setForm(this).__base()._checkDependencies().addCSSClass(this.__self.CSS_CLASS_INITED).__self._addInstance(this);this._unreadyCounter==0&&this.trigger("ready-change",this);this._elem.trigger("init.jz",this);return this},_reinit:function(){this._changedCounter=0;return this.__base()},_bindChildEvents:function(){},_bindEvents:function(){return this._bindToElem({submit:this._onSubmit,keydown:function(c){c.keyCode==27&&c.preventDefault()}})},_onSubmit:function(){if(this.isReady()){this._beforeSubmit();var c=this._params.preventSubmit;this.trigger("before-submit",this);return !c}var d=this;if(this._unreadyCounter>0){b.each(this._unreadyWidgetIds,function(e){d._widgetsDataById[e].widget._setNoReady(true)});this._params.focusOnNoReady&&this._processFirstUnreadyWidget().focus()}return false},_processFirstUnreadyWidget:function(){return this._processFirstUnreadyChildWidget()},_checkDependencies:function(){var c=this;b.each(c._widgetsDataById,function(){c!==this.widget&&this.widget._checkDependencies()});return c},_getDefaultParams:function(){return{heedChanges:false,preventSubmit:false,focusOnNoReady:true}},_addWidget:function(c){this._widgetsDataById[c.getId()]={widget:c,isReady:true};!!c.getName()&&(this._widgetsByName[c.getName()]=c);c!==this._bindTo(c,"focus",function(){this.__self._currentInstance=this})&&this._bindTo(c,{"ready-change":this._onWidgetReadyChange,remove:this._onWidgetRemove});c._hasVal()&&this._bindTo(c,"initial-value-change",this._onWidgetInitialValueChange)},_onWidgetReadyChange:function(g,f){var c=f.getId(),h=this._widgetsDataById[c],d=f.isReady();if(h.isReady!=d){this._unreadyCounter+=(h.isReady=d)?-1:1;d?delete this._unreadyWidgetIds[c]:this._unreadyWidgetIds[c]=true;this.trigger("ready-change",this)}},_onWidgetInitialValueChange:function(d,f){var c=this._changedCounter;this._changedCounter=c+(f?1:-1);c+this._changedCounter==1&&this.trigger("ready-change",this)},_onWidgetRemove:function(f,d){var c=d.getId(),g=this._widgetsDataById[c];if(g){delete this._widgetsDataById[c];!!d.getName()&&delete this._widgetsByName[d.getName()];if(!g.isReady){this._unreadyCounter--;delete this._unreadyWidgetIds[c]}this._changedCounter++;this.trigger("ready-change",this)}},_destruct:function(){this.removeCSSClass(this.__self.CSS_CLASS_INITED).__base();this.__self._removeInstance(this);this._delete("_widgetsByName","_widgetsDataById","_unreadyWidgetIds")}},{_currentInstance:null,_instanceCounter:0,_addInstance:function(c){this._currentInstance=c;++this._instanceCounter==1&&b(document).bind("keyup.jz",b.proxy(function(d){this._currentInstance&&d.keyCode==13&&d.ctrlKey&&this._currentInstance.submit()},null,this))},_removeInstance:function(c){this._currentInstance==c&&(this._currentInstance=null);--this._instanceCounter==0&&b(document).unbind("keyup.jz")}});a.Storage=b.inherit({__constructor:function(c){this._params=c},filter:function(c,d){}});a.Storage.Remote=b.inherit(a.Storage,{filter:function(c,e){var d=this._params;b.ajax(b.extend({success:function(f){e(c,f)},error:function(){e(c,[])},dataType:"json",data:(function(){var f={};f[d.name]=c;b.each(d.widgets,function(){f[this.getName()]=this.val()});return f})()},d.ajax))}});a.Value=b.inherit({__constructor:function(c){this._val=null;this.reset();typeof c!="undefined"&&this.set(c)},reset:function(){this.set("")},get:function(){return this._val},set:function(c){this._val=c.toString()},match:function(c){return c.test(this.get())},clone:function(){return new this.__self(this.get())},isEqual:function(c){return this._checkForCompareTypes(c)&&this.get()===new this.__self((c instanceof a.Value)?c.get():c).get()},isGreater:function(c){return this._checkForCompareTypes(c)&&this.get().length>new this.__self((c instanceof a.Value)?c.get():c).get().length},isGreaterOrEqual:function(c){return this.isGreater(c)||this.isEqual(c)},isLess:function(c){return this._checkForCompareTypes(c)&&!this.isGreaterOrEqual(c)},isLessOrEqual:function(c){return this._checkForCompareTypes(c)&&!this.isGreater(c)},isEmpty:function(){return this.get()===""},toString:function(){return this.get().toString()},_checkForCompareTypes:function(c){return c instanceof this.__self||typeof c=="string"}});a.Builder=b.inherit({__constructor:function(){this._widgets=[];this._widgetsByName={};this._widgetsById={}},build:function(f){var j=this,e=this._widgets.length,g,h;b.each(f.add(f.find("."+a.CSS_CLASS_WIDGET)),function(k){g=j._makeWidgetByElem(b(this));j._widgets.push(j._widgetsById[g.getId()]=g);k==0&&(h=g)});var d=j._widgets,c=e;while(g=d[c++]){g._hasVal()&&(j._widgetsByName[g.getName()]=g)}while(g=d[e++]){this._buildDependencies(g)}if(f[0].tagName.toLowerCase()=="form"){f.data("jz-builder",this);h.bind("remove",b.proxy(this._onFormRemove,this)).init()}else{d[0].init(h)}return h},_makeWidgetByElem:function(e){var d=this.__self,f=d._extractParamsFromElem(e),c=new (d._getWidgetClassByType(f.type))(e,d._getClassElem(e,f),f);f.type!="form"&&this._getParentWidget(e).addChild(c);return c},_getParentWidget:function(e){var d=e[0].parentNode,c=" "+a.CSS_CLASS_WIDGET+" ";do{if((" "+d.className+" ").indexOf(c)>-1){return this._widgetsById[a._identifyNode(d)]}}while(d=d.parentNode)},_buildDependencies:function(c){var d=c._params,e=this;b.each(["enabled","valid","required"],function(){this in d&&c.addDependence(this,e._buildDependence(this,c,d[this]))})},_buildDependence:function(c,e,d){return b.isArray(d)?(typeof d[0]=="string"?new a.Dependence.Composition.NOT({dependencies:[this._buildDependence(c,e,d[1])]}):new a.Dependence.Composition[d[1].toUpperCase()]({dependencies:[this._buildDependence(c,e,d[0]),this._buildDependence(c,e,d[2])]})):new a.Dependence[c.charAt(0).toUpperCase()+c.substr(1).toLowerCase()](b.extend(d,{widget:this._getFromWidget(d,e)}))},_getFromWidget:function(d,c){return d.id?this._widgetsById[d.id]:(d.name?this._widgetsByName[d.name]:c)||a._throwException('widget with name/id = "'+(d.id||d.name)+'" not found"')},_onFormRemove:function(d,c){c.getElement().removeData("jz-builder");delete this._widgets;delete this._widgetsByName;delete this._widgetsById}},{registerWidget:function(d,f,c,e){if(typeof f!="string"){e=c;c=f;f=undefined}this._types.push(d);this._typeToWidgetClass[d]=b.inherit(f?this._getWidgetClassByType(f):a.Widget,c,e)},_getClassElem:function(c,d){if(d.container){return c.closest(d.container)}switch(d.type){case"form":case"fieldset":case"button":case"submit":return c;case"rbgroup":case"cbgroup":case"state":return c.parent();default:return c.parent().parent()}},_extractParamsFromElem:function(d){var c=d[0].onclick?d[0].onclick().jz||{}:{};c.type||(c.type=this._extractTypeFromElem(d));if(c.type=="combo"){var e=d.parent().find("."+a.CSS_CLASS_WIDGET+"-comboarrow");e.length&&(c.arrow=e)}return c},_extractTypeFromElem:function(d){var c=d[0].tagName.toLowerCase();if(c=="input"){switch(d.attr("type")){case"radio":case"checkbox":return"state";case"button":return"button";case"image":case"submit":return"submit"}}return c=="select"||c=="fieldset"||c=="form"?c:(this._cssClassToType(d.attr("class"))||"text")},_types:["number","combo","datetime","date","fieldset","rbgroup","cbgroup","submit"],_typeRE:null,_rebuildTypeRE:function(){return this._typeRE=new RegExp(a.CSS_CLASS_WIDGET+"-("+this._types.join("|")+")")},_cssClassToType:function(c){return(c.match(this._typeRE||this._rebuildTypeRE())||[])[1]},_typeToWidgetClass:{text:a.Widget.Input.Text,combo:a.Widget.Input.Text.Combo,fieldset:a.Widget.Container,form:a.Widget.Container.Form},_getWidgetClassByType:function(c){return this._typeToWidgetClass[c]||a._throwException('undefined type "'+c+'"')}});return a})(jQuery);function undef(a){return a}function Autoarea(b,a){if(typeof b=="undefined"||y5.Classes.test(b,"js-not-resizable")){return}this.textarea=(typeof(b)!="string")?b:document.getElementById(b);if(this.textarea.autoarea){return}this.inplace=new MozillaInplace(b,a);if(typeof(document.execCommand)=="undefined"){return}this.bind();this.resizeArea()}Autoarea.prototype={bind:function(){var a=this;new y5.AEventListener("keyup",function(b){a.keyUp()},this.textarea,true);this.onerow=this.textarea.cloneNode(true);this.onerow.removeAttribute("id");this.onerow.removeAttribute("name");this.onerow.value="";this.onerow.style.position="absolute";this.onerow.style.top=0;this.onerow.style.left="-100%";this.onerow.style.visibility="hidden";this.onerow.style.height="1.2em";this.onerow.style.lineHeight="1.2em";this.textarea.style.lineHeight="1.2em";this.inplace.holster.style.lineHeight="1.2em";this.textarea.parentNode.appendChild(this.onerow);this.textarea.autoarea=this},keyUp:function(a){this.resizeArea()},resizeArea:function(){var a=this.inplace.getHeight();var b=this.textarea.rows*this.onerow.offsetHeight;if(a<b){a=b}a+=this.onerow.offsetHeight*2;this.textarea.style.height=a+"px"}};function MozillaInplace(b){var f=document.getElementById;var a=window.opera&&f;var e=a;var c=f&&(navigator.appName=="Netscape");var d=document.all&&document.all.item&&!e;this.isO8=a;this.isMZ=c;this.isIE=d;this.textarea=(typeof(b)!="string")?b:document.getElementById(b);this.bind();this.sophisticatedRegExp=new RegExp("^( +)",this.isMZ?"gmi":"gi")}MozillaInplace.prototype.bind=function(){var b=this.textarea;var d=this.getXY(b);var a=d[0];var e=d[1];this.holster=document.createElement("div");var c=this.holster;c.className="mozilla-inplace-holster";c.style.position="absolute";c.style.overflow="hidden";c.style.top=e+"px";c.style.left=(a-2000)+"px";if(document.getElementById("actionsMenusContainer")){document.getElementById("actionsMenusContainer").appendChild(c)}else{document.body.appendChild(c)}this.getCursor()};MozillaInplace.prototype.getXY=function(d){var b=(typeof(d)!="string")?d:document.getElementById(d);if(!b){return[-1,-1]}var a=0;var c=0;do{a+=parseInt(isNaN(parseInt(b.offsetLeft))?0:b.offsetLeft);c+=parseInt(isNaN(parseInt(b.offsetTop))?0:b.offsetTop);b=b.offsetParent}while(b);return[a,c]};MozillaInplace.prototype.getHeight=function(){var c=this.textarea;var e=this.holster;var f=c.value+"\n";var a="~spli\04tter~";var d=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(this.sophisticatedRegExp,a+"$1"+a).replace(/\n/g,"<br/>");var g=d.split(a);d="";for(var b=0;b<g.length;b++){if(b%2==0){d+=g[b]}else{d+=g[b].replace(/ /g,"&nbsp;")}}e.innerHTML=d;e.style.width=c.clientWidth+"px";return e.clientHeight};MozillaInplace.prototype.getCursor_ie=function(){var f=document.body;if((document.compatMode)&&(document.compatMode=="CSS1Compat")){f=document.documentElement}var b=document.selection;var g=b.createRange();var a=this.textarea;var e=f.scrollLeft+a.scrollLeft+g.boundingLeft;var c=f.scrollTop+a.scrollTop+g.boundingTop;return[e,c]};MozillaInplace.prototype.getCursor=function(){if(this.isIE){return this.getCursor_ie()}if(!this.isMZ){return false}var b=this.textarea;var a=0,c=0;try{a=b.selectionStart;c=b.selectionEnd}catch(d){}return this._getXYbySE(a,c)||false};MozillaInplace.prototype._getXYbySE=function(f,b){var j=this.textarea;var s=this.holster;var o="~spli\01tter~";var n="~spli\02tter~";var m="~spli\03tter~";var l="~spli\04tter~";var q=f;var w=b;var k=j.value;var c=k.substr(0,q);var v=k.substr(q);c=c.replace(/(\S*)$/i,n+"$1");v=v.replace(/^(\S*)/i,"$1"+m);k=c+o+v;var p="a"+new Date().getMilliseconds();var y=k.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\n/g,"<br/>").replace(o,"<span id='"+p+"' class='mozilla-inplace-cursor'></span>").replace(n,"<nobr>").replace(m,"</nobr>");var h=y.split(l);y="";for(var u=0;u<h.length;u++){if(u%2==0){y+=h[u]}else{y+=h[u].replace(/ /g,"&nbsp;")}}s.innerHTML=y;var g=document.defaultView.getComputedStyle(j,null).getPropertyValue("width");s.style.width=(parseInt((g).substr(0,g.length-2),10)-2)+"px";var e=document.getElementById(p);var a=this.getXY(s);var d=this.getXY(j);return[(e.offsetLeft+d[0]-j.scrollLeft),(e.offsetTop+d[1]-j.scrollTop),q,w]};MozillaInplace.prototype.getWordXY=function(b){var l=this.textarea;var k=" "+l.value.replace(/\r/ig,"")+" ";var h=[];var j=0;var a=0;var g=new RegExp("^\\W[^ ]+\\W$","");while(a>=0){a=k.indexOf(b,j);j=a+1;if(a>=0){var m=a-1;var e=b.length+2;if(m<0){m=0}var d=k.substr(m,e);if(g.test(d)){h[a-1]=a-1}}}if(this.isIE){return this._getMatchesXY_ie(b,h)}if(!this.isMZ){return[]}var c=[];for(var f in h){c[f]=this._getXYbySE(h[f],h[f]+b.length)}return c};MozillaInplace.prototype._getMatchesXY_ie=function(a,f){var g=document.body;if((document.compatMode)&&(document.compatMode=="CSS1Compat")){g=document.documentElement}var k=this.textarea;var b=[];for(var e in f){var h=k.createTextRange();h.collapse(true);h.moveStart("character",f[e]);h.moveEnd("character",a.length);var c=g.scrollLeft+k.scrollLeft+h.boundingLeft;var j=g.scrollTop+k.scrollTop+h.boundingTop;b[e]=[c,j,f[e],f[e]+a.length]}return b};MozillaInplace.prototype.makeSelection=function(b,c){if(this.isIE){return this._makeSelection_ie(b,c)}if(!this.isMZ){return false}var a=this.textarea;a.selectionStart=b;a.selectionEnd=c;return true};MozillaInplace.prototype._makeSelection_ie=function(b,d){var a=this.textarea;var c=a.createTextRange();c.collapse(true);c.moveStart("character",b);c.moveEnd("character",d-b);c.select();return c};MozillaInplace.prototype.replaceSelection=function(b){if(this.isIE){return this._replaceSelection_ie(b)}if(!this.isMZ){return false}var a=this.textarea;a.value=a.value.substr(0,a.selectionStart)+b+a.value.substr(a.selectionEnd);return true};MozillaInplace.prototype._replaceSelection_ie=function(b){var a=document.selection.createRange();a.text=b}
/*! SWFObject v2.0 <http://code.google.com/p/swfobject/>
Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
;var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF&&typeof doc.appendChild!=UNDEF&&typeof doc.replaceChild!=UNDEF&&typeof doc.removeChild!=UNDEF&&typeof doc.cloneNode!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
ie = true;
@if (@_win32)
windows = true;
@elif (@_mac)
mac = true;
@end
@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return}addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var s=getElementById("__ie_ondomload");if(s){s.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);callDomLoadFunctions()}}}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function callDomLoadFunctions(){if(isDomLoaded){return}if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return}}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){win.attachEvent("onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName.toLowerCase()=="data"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName.toLowerCase()=="param"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function fixObjectLeaks(id){if(ua.ie&&ua.win&&hasPlayerVersion("8.0.0")){win.attachEvent("onunload",function(){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=function(){}}}obj.parentNode.removeChild(obj)}})}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";win.attachEvent("onload",function(){obj.parentNode.removeChild(obj)})}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";win.attachEvent("onload",function(){obj.parentNode.removeChild(obj)})}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName.toLowerCase()=="param")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";fixObjectLeaks(attObj.id);r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){e.setAttribute(l,parObj[l])}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function getElementById(id){return doc.getElementById(id)}function createElement(el){return doc.createElement(el)}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10);v[2]=parseInt(v[2],10);return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return}var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return}var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom&&isDomLoaded){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return}widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att=(typeof attObj==OBJECT)?attObj:{};att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par=(typeof parObj==OBJECT)?parObj:{};if(typeof flashvarsObj==OBJECT){for(var i in flashvarsObj){if(flashvarsObj[i]!=Object.prototype[i]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+i+"="+flashvarsObj[i]}else{par.flashvars=i+"="+flashvarsObj[i]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}});return true}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)});return true}}return false},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom&&isDomLoaded){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return q}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();function yauserHost(b){var a=window.location.host;var c=window.location.host.indexOf(".");return b+a.substring(c)}function yacommunityHost(b){var a=window.location.host;var c=window.location.host.indexOf(".");return"clubs"+a.substring(c)+"/"+b}function yasourceLink(b){var a;if(y5.Types.string(b)){a=yauserHost(b)}else{if(b.type=="community"){a=yacommunityHost(b.login)}else{a=yauserHost(b.login)}}return"http://"+a+"/"}function friendsFullURL(a,b,c){return yasourceLink(a)+friendsURL4xml(b,c)}function friendsURL(a,d){var c;var e=g_globals.current_location.source;if(e.type&&e.type=="community"){c=yacommunityHost(e.login)}else{var b=new y5.URL();c=b.host();if(b.port()){c+=":"+b.port()}}return"http://"+c+"/"+friendsURL4xml(a,d)}function friendsMineURL(a,d){var c;var e=g_globals.current_location.source;if(e.type&&e.type=="community"){c=yacommunityHost(e.login)}else{var b=new y5.URL();c="my"+b.host().slice(b.host().indexOf("."));if(b.port()){c+=":"+b.port()}}return"http://"+c+"/"+friendsURL4xml(a,d)}function friendsURL4xml(a,b){if(!a){return""}if(b){return a+".xml?"+b}else{if(a.indexOf(".xml?")>-1){return a}else{return a+".xml"}}}Friends.UserPanelActions=new function(){this.createFromTag=function(a){new Friends.UserPanelActions.Constructor(a)}};Friends.UserPanelActions.Constructor=function(a){this.control=a;this.button=0;this.actionsMenu=0;this.actionsMenu_button=0;this.init()};Friends.UserPanelActions.Constructor.prototype=new function(){this.showActions=function(a,b){a.cancelBubble=true;this.adjustActionsMenu(null,b);return false};this.init=function(){var a=this;this.button=y5.Dom.getDescendant(this.control,"a","or");if(!this.button){return}if(!g_source){this.button.style.visibility="hidden"}new y5.AEventListener("click",function(b){a.showActions(b);b.stopPropagation();b.preventDefault()},this.button,true);y5.ShortCut.press([{key:y5.ShortCut.ENTER}],function(b){a.showActions(b,true);b.stopPropagation();b.preventDefault()},this.button,false);this.initActionsMenu()};this.destruct=function(){if(this.button){if(this.button.onclick){this.button.onclick=null}this.button=null}};this.initActionsMenu=function(){this.actionsMenu=y5.Dom.getDescendant(this.control,"div","b-actions-select");y5.Dom.getBody().appendChild(this.actionsMenu);var a=this.actionsMenu.getElementsByTagName("a");this.actionsMenuFirstLink=a[0];this.actionsMenu_button=a[1];this.actionsList=y5.Dom.getDescendant(this.control,"*","b-actions-list");y5.Utils.fakeFrame.init(this.actionsMenu);var b=this;if(y5.Vars.is_ie){this.actionsMenu.outListener=new y5.AEventListener("focusout",function(c){if(y5.Dom.isChild(c.toElement,b.actionsMenu)){return}b.adjustActionsMenu(false)},this.actionsMenu,false)}else{if(y5.Vars.is_opera){this.actionsMenu.outListener=new y5.AEventListener("keyup",function(c){if(y5.Dom.isChild(c.target,b.actionsMenu)){return}b.adjustActionsMenu(false)},document,false)}else{this.actionsMenu.outListener=new y5.AEventListener("blur",function(c){if(y5.Dom.isChild(c.explicitOriginalTarget,b.actionsMenu)){return}b.adjustActionsMenu(false)},document,false)}}this.actionsMenu.mousedownListener=new y5.AEventListener("mousedown",function(c){if(y5.Dom.isChild(c.target,b.actionsMenu)){return}b.adjustActionsMenu(false)},document,false);this.actionsMenu.resizeListener=new y5.AEventListener("resize",function(c){b.adjustActionsMenu(false)},window,false);new y5.AEventListener("click",function(c){b.adjustActionsMenu(false);c.preventDefault();c.stopPropagation()},this.actionsMenu_button,true)};this.adjustActionsMenu=function(b,c){if(b==null){b=(0==(this.actionsMenu.offsetHeight||0))}if(b){var a=y5.Dom.getOffsset(this.actionsList);this.actionsMenu.style.top=a[1]-6+"px";this.actionsMenu.style.left=a[0]-3+"px";this.actionsMenu.style.display="block";if(c){if((this.actionsMenuFirstLink.offsetHeight||0)>0){this.actionsMenuFirstLink.focus()}}else{if(this.actionsMenu.focus){this.actionsMenu.focus();this.actionsMenu.blur()}}this.actionsMenu.outListener.add();this.actionsMenu.mousedownListener.add();this.actionsMenu.resizeListener.add()}else{this.actionsMenu.style.display="none";this.actionsMenu.outListener.remove();this.actionsMenu.mousedownListener.remove();this.actionsMenu.resizeListener.remove()}y5.Utils.fakeFrame.adjust(this.actionsMenu)}};y5.require(["Events","Dom","Arrays","ShortCuts","Utils"],function(){y5.loaded("{Friends}.UserPanelActions")});jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};(function(e){var b=(function(){_}).toString().indexOf("_")>-1,a=e.browser.msie,c=a?["toString","valueOf"]:null,f=function(){};function d(h,g,i){var k=false;if(a){var j=[];e.each(c,function(){i.hasOwnProperty(this)&&(k=true)&&j.push({name:this,val:i[this]})});if(k){e.each(i,function(l){j.push({name:l,val:this})});i=j}}e.each(i,function(m,n){if(k){m=n.name;n=n.val}if(e.isFunction(n)&&(!b||n.toString().indexOf(".__base")>-1)){var l=h[m]||function(){};g[m]=function(){var p=this.__base;this.__base=l;var o=n.apply(this,arguments);this.__base=p;return o}}else{g[m]=n}})}e.inherit=function(){var l=arguments,n=e.isFunction(l[0]),h=n?l[0]:f,m=l[n?1:0]||{},j=l[n?2:1],o=m.__constructor||(n&&h.prototype.__constructor)?function(){return this.__constructor.apply(this,arguments)}:function(){};if(!n){o.prototype=m;o.prototype.__self=o.prototype.constructor=o;return e.extend(o,j)}e.extend(o,h);var i=function(){},k=i.prototype=h.prototype,g=o.prototype=new i();g.__self=g.constructor=o;d(k,g,m);j&&d(h,o,j);return o};e.inheritSelf=function(j,h,i){var g=j.prototype;d(g,g,h);i&&d(j,j,i);return j}})(jQuery);(function(c){var a=0,d="__"+(+new Date),b=function(){return"uniq"+ ++a};c.identify=function(g,f){if(!g){return b()}var e="uniqueID" in g?"uniqueID":d;return f||e in g?g[e]:g[e]=b()}})(jQuery);(function(a){a.isEmptyObject||(a.isEmptyObject=function(c){for(var b in c){return false}return true})})(jQuery);(function(a){a.extend({debounce:function(c,d,e,b){if(arguments.length==3&&typeof e!="boolean"){b=e;e=false}var f;return function(){var g=arguments;b=b||this;e&&!f&&c.apply(b,g);clearTimeout(f);f=setTimeout(function(){e||c.apply(b,g);f=null},d)}},throttle:function(e,f,b){var g,d,c;return function(){d=arguments;c=true;b=b||this;g||(function(){if(c){e.apply(b,d);c=false;g=setTimeout(arguments.callee,f)}else{g=null}})()}}})})(jQuery);(function(d){var a="__"+ +new Date+"storage",c=function(f,e){return d.identify(f)+(e?d.identify(e):"")},b={buildEventName:function(f){return f},on:function(o,j,p,t,m){if(typeof o=="string"){if(d.isFunction(j)){t=p;p=j;j=undefined}var f=c(p,t),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,s={fn:p,data:j,ctx:t,special:m};if(n.last){n.last.next=s;s.prev=n.last}else{n.first=s}q.ids[f]=n.last=s}}}else{var k=this;d.each(o,function(u,i){k.on(u,i,j,m)})}return this},onFirst:function(i,h,g,f){return this.on(i,h,g,f,{one:true})},un:function(p,q,u){if(typeof p=="string"||typeof p=="undefined"){var n=this[a];if(n){if(p){var h=p.split(" "),k=0,s;while(p=h[k++]){p=this.buildEventName(p);if(s=n[p]){if(q){var g=c(q,u),f=s.ids;if(g in f){var o=s.list,t=f[g],j=t.prev,l=t.next;if(j){j.next=l}else{if(t===o.first){o.first=l}}if(l){l.prev=j}else{if(t===o.last){o.last=j}}delete f[g]}}else{delete this[a][p]}}}}else{delete this[a]}}}else{var m=this;d.each(p,function(v,i){m.un(v,i,u)})}return this},trigger:function(j,h){var l=this,k=l[a],i;typeof j==="string"?j=d.Event(l.buildEventName(i=j)):j.type=l.buildEventName(i=j.type);j.target||(j.target=l);if(k&&(k=k[j.type])){var g=k.list.first,f;while(g){j.data=g.data;f=g.fn.call(g.ctx||l,j,h);if(typeof f!=="undefined"){j.result=f;if(f===false){j.preventDefault();j.stopPropagation()}}g.special&&g.special.one&&l.un(i,g.fn,g.ctx);g=g.next}}return this}};d.observable=d.inherit(b,b)})(jQuery);(function(f,h){var e=[],g={},a={};function d(k,j,i){return(k?"__elem_"+k:"")+"__mod"+(j?"_"+j:"")+(i?"_"+i:"")}function c(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})})}function b(j,i){return i?Array.isArray(i)?function(m){var l=0,k=i.length;while(l<k){if(m.hasMod(j,i[l++])){return true}}return false}:function(k){return k.hasMod(j,i)}:function(k){return k.hasMod(j)}}this.BEM=f.inherit(f.observable,{__constructor:function(j,k,i){var l=this;l._modCache=j||{};l._processingMods={};l._params=k;l.params=null;i!==false?l._init():l.afterCurrentEvent(function(){l._init()})},_init:function(){if(!this._initing&&!this.hasMod("js","inited")){this._initing=true;if(!this.params){this.params=f.extend(this.getDefaultParams(),this._params);delete this._params}this.setMod("js","inited");delete this._initing;this.hasMod("js","inited")&&this.trigger("init")}return this},changeThis:function(j,i){return j.bind(i||this)},afterCurrentEvent:function(j,i){this.__self.afterCurrentEvent(this.changeThis(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(l,m,j){var i=arguments.length,n=false;if(i==1){j="";m=l;l=h;n=true}else{if(i==2){if(typeof l=="string"){j=m;m=l;l=h}else{j="";n=true}}}var k=this.getMod(l,m)===j;return n?!k:k},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?i.forEach(function(n){m._modCache[n]=k[n]}):m._modCache=k}return k},setMod:function(k,p,q){if(typeof q=="undefined"){q=p;p=k;k=h}var l=this;if(!k||k[0]){var m=(k&&k[0]?f.identify(k[0]):"")+"_"+p;if(this._processingMods[m]){return l}var j,n=k?l._getElemMod(p,k,j=l.__self._extractElemNameFrom(k)):l.getMod(p);if(n===q){return l}this._processingMods[m]=true;var i=true,o=[p,q,n];k&&o.unshift(k);[["*","*"],[p,"*"],[p,q]].forEach(function(s){i=l._callModFn(j,s[0],s[1],o)!==false&&i});!k&&i&&(l._modCache[p]=q);i&&l._afterSetMod(p,q,n,k,j);delete this._processingMods[m]}return l},_afterSetMod:function(l,i,m,j,k){},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{}},channel:function(j,i){return this.__self.channel(j,i)},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(){}},{_name:"i-bem",blocks:g,decl:function(j,k,m){if(typeof j=="string"){j={block:j}}else{if(j.name){j.block=j.name}}if(j.baseBlock&&!g[j.baseBlock]){throw ('baseBlock "'+j.baseBlock+'" for "'+j.block+'" is undefined')}k||(k={});if(k.onSetMod){c(k.onSetMod,k);delete k.onSetMod}if(k.onElemSetMod){f.each(k.onElemSetMod,function(p,o){c(o,k,p)});delete k.onElemSetMod}var l=g[j.baseBlock||j.block]||this;if(j.modName){var i=b(j.modName,j.modVal);f.each(k,function(o,p){f.isFunction(p)&&(k[o]=function(){var s;if(i(this)){s=p}else{var q=l.prototype[o];q&&q!==k[o]&&(s=this.__base)}return s?s.apply(this,arguments):h})})}var n;j.block==l._name?(n=f.inheritSelf(l,k,m))._processLive(true):(n=g[j.block]=f.inherit(l,k,m))._name=j.block;return n},_processLive:function(i){return false},create:function(j,i){typeof j=="string"&&(j={block:j});return new g[j.block](j.mods,i)},getName:function(){return this._name},_extractElemNameFrom:function(i){},afterCurrentEvent:function(j,i){e.push({fn:j,ctx:i})==1&&setTimeout(this._runAfterCurrentEventFns,0)},_runAfterCurrentEventFns:function(){var j=e.length;if(j){var i,k=e.splice(0,j);while(i=k.shift()){i.fn.call(i.ctx||this)}}},changeThis:function(j,i){return j.bind(i||this)},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},channel:function(j,i){if(typeof j=="boolean"){i=j;j=h}j||(j="default");if(i){if(a[j]){a[j].un();delete a[j]}return}return a[j]||(a[j]=new f.observable())}})})(jQuery);(function(){Object.keys||(Object.keys=function(c){var b=[];for(var a in c){c.hasOwnProperty(a)&&b.push(a)}return b})})();(function(){var a=Array.prototype,d=Object.prototype.toString,b={indexOf:function(h,g){g=+(g||0);var f=this,e=f.length;if(e>0&&g<e){g=g<0?Math.ceil(g):Math.floor(g);g<-e&&(g=0);g<0&&(g=g+e);while(g<e){if(g in f&&f[g]===h){return g}++g}}return -1},forEach:function(j,f){var h=-1,g=this,e=g.length;while(++h<e){h in g&&(f?j.call(f,g[h],h,g):j(g[h],h,g))}},map:function(k,f){var j=-1,h=this,e=h.length,g=new Array(e);while(++j<e){j in h&&(g[j]=f?k.call(f,h[j],j,h):k(h[j],j,h))}return g},filter:function(k,f){var j=-1,h=this,e=h.length,g=[];while(++j<e){j in h&&(f?k.call(f,h[j],j,h):k(h[j],j,h))&&g.push(h[j])}return g},reduce:function(k,j){var h=-1,g=this,e=g.length,f;if(arguments.length<2){while(++h<e){if(h in g){f=g[h];break}}}else{f=j}while(++h<e){h in g&&(f=k(f,g[h],h,g))}return f},some:function(j,f){var h=-1,g=this,e=g.length;while(++h<e){if(h in g&&(f?j.call(f,g[h],h,g):j(g[h],h,g))){return true}}return false},every:function(j,f){var h=-1,g=this,e=g.length;while(++h<e){if(h in g&&!(f?j.call(f,g[h],h,g):j(g[h],h,g))){return false}}return true}};for(var c in b){a[c]||(a[c]=b[c])}Array.isArray||(Array.isArray=function(e){return d.call(e)==="[object Array]"})})();(function(){var a=Array.prototype.slice;Function.prototype.bind||(Function.prototype.bind=function(b){var d=this,c=a.call(arguments,1);return function(){return d.apply(b,c.concat(a.call(arguments)))}})})();(function(i,b,a){var g="_",c="__",d="[a-zA-Z0-9-]+";function e(l,j,k){k.push(g,l,g,j)}function f(l,m,j,k){k.push(l);j&&e(m,j,k)}function h(n,l,m,j,k){f(n,a,a,k);k.push(c,l);j&&e(m,j,k)}i.INTERNAL={NAME_PATTERN:d,MOD_DELIM:g,ELEM_DELIM:c,buildModPostfix:function(m,j,k){var l=k||[];e(m,j,l);return k?l:l.join("")},buildClass:function(p,n,o,j,k){var m=typeof o;if(m=="string"){if(typeof j!="string"){k=j;j=o;o=n;n=a}}else{if(m!="undefined"){k=o;o=a}else{if(n&&typeof n!="string"){k=n;n=a}}}if(!(n||o||k)){return p}var l=k||[];n?h(p,n,o,j,l):f(p,o,j,l);return k?l:l.join("")},buildClasses:function(n,m,l,j){if(m&&typeof m!="string"){j=l;l=m;m=a}var k=j||[];m?h(n,m,a,a,k):f(n,a,a,k);l&&b.each(l,function(p,o){if(o){k.push(" ");m?h(n,m,p,o,k):f(n,p,o,k)}});return j?k:k.join("")}}})(BEM,jQuery);(function(o,g,e){var k=o.INTERNAL,j=k.ELEM_DELIM,l={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},f=k.buildClass,m=k.buildClasses,n={};function i(p,q,s){(p[q]||(p[q]=[])).unshift(s)}function d(p,q){return q.modName?function(s){(s._curBlock.mods||{})[q.modName]===q.modVal&&p(s)}:p}function c(q,p){var t=g.isArray(p),s;g.isArray(q)?t?s=q.concat(p):(s=q).push(p):t?(s=p).unshift(q):s=[q,p];return s}var b={'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"},a=/["&<>]/g;function h(p){return p.replace(a,function(q){return b[q]})}o.HTML={decl:function(s,q){typeof s=="string"&&(s={block:s});s.name&&(s.block=s.name);var p=n[s.block]||(n[s.block]={});q.onBlock&&i(p,"_block",d(q.onBlock,s));if(q.onElem){g.isFunction(q.onElem)?i(p,"_elem",d(q.onElem,s)):g.each(q.onElem,function(u,t){i(p,"_elem"+(u==="*"?"":j+u),d(t,s))})}},build:function(q){var p=new this.Ctx(q);p._buildAll();return p._flush()},Ctx:g.inherit({__constructor:function(p){this._buffer=[];this._params=p;this._tParams=null;this._tParamsChanges=null;this._curBlock=e},pos:function(){return this._params._pos},isFirst:function(){return this._params._pos===1},isLast:function(){var p=this._params;return p._pos===p._siblingsCount},params:function(p){var q=this;if(typeof p=="undefined"){return q._params}q._params=p;return q},param:function(p,t,q,v){var u=this,s=u._params;if(typeof t=="undefined"){return s[p]}if(q||!(p in s)){s[p]=t}else{if(v){s[p]=g.extend(t,s[p])}}return u},attrs:function(q,p){return this.param("attrs",q,p,true)},attr:function(q,t,s){var u=this;if(typeof t=="undefined"){return(u._params.attrs||{})[q]}var p=u._params.attrs;p?(s||!(q in p))&&(p[q]=t):(u._params.attrs={})[q]=t;return u},tag:function(q,p){return this.param("tag",q,p)},cls:function(q,p){return this.param("cls",q,p)},mods:function(q,p){return this.param("mods",q,p,true)},mod:function(p,t,s){var u=this;if(typeof t=="undefined"){return(u._params.mods||{})[p]}var q=u._params.mods;q?(s||!(p in q))&&(q[p]=t):(u._params.mods={})[p]=t;return u},mix:function(s,p){var t=this,q=t._params;if(typeof s=="undefined"){return q.mix}if(p||!("mix" in q)){q.mix=s}else{q.mix=q.mix.concat(s)}return t},js:function(p){return this.param("js",p)},content:function(q,p){return this.param("content",q,p)},wrapContent:function(p){var s=this,q=s._params;p.content=q.content;q.content=p;return s},beforeContent:function(p){var s=this,q=s._params;q.content=c(p,q.content);return s},afterContent:function(p){var s=this,q=s._params;q.content=c(q.content,p);return s},wrap:function(p){var s=this,q=s._params;p.block||(p._curBlock=s._curBlock);p.content=q._wrapper?q._wrapper:q;q._wrapper=p;return s},tParam:function(p,t){var u=this,s=u._tParams||(u._tParams={});if(typeof t=="undefined"){return s[p]}var q=u._tParamsChanges||(u._tParamsChanges={});p in q||(q[p]=s[p]);s[p]=t;return u},generateId:function(){return g.identify()},stop:function(){this._params._isStopped=true},_buildAll:function(){var x=this,q=x._buffer,w=x._params,u=typeof w;if(u=="string"||u=="number"){q.push(w)}else{if(g.isArray(w)){var t=0,p=w.length,s,v;while(t<p){x._params=s=w[t++];v=typeof s;if(v=="string"||v=="number"){q.push(s)}else{if(s){s._pos=t;s._siblingsCount=p;x._buildByDecl()}}}}else{if(w){x._params._pos=x._params._siblingsCount=1;x._buildByDecl()}}}},_build:function(){var x=this,s=x._buffer,v=x._params,p=v.tag||"div",u,t=v.block||v.elem,w=t&&(v.block||x._curBlock.block),q=false;if(v.js){(u={})[f(w,v.elem)]=v.js===true?{}:v.js;q=!v.elem}s.push("<",p);if(t||v.cls){s.push(' class="');if(t){m(w,v.elem,v.mods,s);v.mix&&g.each(v.mix,function(y,z){if(z){s.push(" ");m(z.block,z.elem,z.mods,s);if(z.js){(u||(u={}))[f(z.block,z.elem)]=z.js===true?{}:z.js;q||(q=!z.elem)}}})}v.cls&&s.push(t?" ":"",v.cls);q&&s.push(" i-bem");s.push('"')}u&&s.push(' onclick="return ',h(JSON.stringify(u)),'"');v.attrs&&g.each(v.attrs,function(y,z){typeof z!="undefined"&&z!==null&&z!==false&&s.push(" ",y,'="',z.toString().replace(/"/g,"&quot;"),'"')});if(l[p]){s.push("/>")}else{s.push(">");if(typeof v.content!="undefined"){x._params=v.content;x._buildAll()}s.push("</",p,">")}},_flush:function(){var p=this._buffer.join("");delete this._buffer;return p},_buildByDecl:function(){var t=this,w=t._curBlock,p=t._params;p._curBlock&&(t._curBlock=p._curBlock);p.block&&(t._curBlock=p);if(!p._wrapper){if(p.block||p.elem){var v=n[t._curBlock.block];if(v){var x;if(p.elem){x=v["_elem"+j+p.elem];v._elem&&(x=(x?x.concat(v._elem):v._elem))}else{x=v._block}if(x){var q=0,u;while(u=x[q++]){u(t);if(p._isStopped){break}}}}}if(p._wrapper){p._curBlock=t._curBlock;t._params=p._wrapper;return t._buildAll()}}var y=t._tParamsChanges;t._tParamsChanges=null;t._build();t._curBlock=w;if(y){var s=t._tParams;g.each(y,function(z,A){typeof A=="undefined"?delete s[z]:s[z]=A})}}})}})(BEM,jQuery);(function(c){if(window.JSON){return}var b=Object.prototype.toString,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d;window.JSON={stringify:d=function(l){if(l===null){return"null"}if(typeof l==="undefined"){return c}switch(b.call(l)){case"[object String]":return'"'+(e.test(l)?l.replace(e,function(i){var m=a[i];return typeof m==="string"?m:"\\u"+("0000"+i.charCodeAt(0).toString(16)).slice(-4)}):l)+'"';case"[object Number]":case"[object Boolean]":return""+l;case"[object Array]":var k="[",j=0,f=l.length,h;while(j<f){h=d(l[j]);k+=(j++?",":"")+(typeof h==="undefined"?"null":h)}return k+"]";case"[object Object]":var k="{",j=0,h;for(var g in l){if(l.hasOwnProperty(g)){h=d(l[g]);typeof h!=="undefined"&&(k+=(j++?",":"")+'"'+g+'":'+h)}}return k+"}";default:return c}}}})();(function(i,e,h){var d=e(window),z=e(document),n={},x={},B={},f={},q={},w=i.blocks,b=i.INTERNAL,k=b.NAME_PATTERN,p=b.MOD_DELIM,j=b.ELEM_DELIM,A=b.buildModPostfix,u=b.buildClass;function s(E,C){var D=E[0];e.each(t(D),function(F,H){c(H,D,F,C);var G=x[H.uniqId];if(G){if(G.domElem.index(D)<0){G.domElem=G.domElem.add(E);e.extend(G._params,H)}}else{a(F,E,H)}})}function a(K,G,F,D,L){if(typeof F=="boolean"){L=D;D=F;F=h}var H=G[0];F=c(F||t(H)[K],H,K);var J=F.uniqId;if(x[J]){return x[J]._init()}n[J]=n[J]?n[J].add(G):G;var C=H.parentNode;if(!C||C.nodeType===11){e.unique(n[J])}var I=w[K]||v.decl(K,{},{live:true});if(!(I._liveInitable=!!I._processLive())||D||F.live===false){var E=new I(n[J],F,!!D);delete n[J];L&&L.apply(E,Array.prototype.slice.call(arguments,4));return E}}function c(H,E,D,C){(H||(H={})).uniqId||(H.uniqId=(H.id?D+"-id-"+H.id:e.identify())+(C||e.identify()));var G=e.identify(E),F=B[G]||(B[G]={});F[D]||(F[D]=H);return H}function y(D,C,F){var E=D.find(C);return F?E:E.add(D.filter(C))}function t(C){var D=e.identify(C);return B[D]||(B[D]=g(C))}function g(E){var D=E.onclick||E.ondblclick;if(!D&&E.tagName.toLowerCase()=="body"){var F=e(E),C=F.attr("onclick")||F.attr("ondblclick");C&&(D=Function(C))}return D?D():{}}function m(C){delete B[e.identify(C)]}function l(D,C){D.domElem.length===1?D.destruct(true):D.domElem=D.domElem.not(C)}function o(){return z[0][e.support.boxModel?"documentElement":"body"]}e.fn.bem=function(C,D){return a(C,this,D,true)};var v=i.DOM=i.decl("i-bem__dom",{__constructor:function(D,E,C){var F=this;F.domElem=D;F._eventNameCache={};F._elemCache={};x[F._uniqId=E.uniqId||e.identify(F)]=F;F._needSpecialUnbind=false;F.__base(null,E,C)},findBlocksInside:function(C,D){return this._findBlocks("find",C,D)},findBlockInside:function(C,D){return this._findBlocks("find",C,D,true)},findBlocksOutside:function(C,D){return this._findBlocks("parents",C,D)},findBlockOutside:function(C,D){return this._findBlocks("closest",C,D)[0]||null},findBlocksOn:function(C,D){return this._findBlocks("",C,D)},findBlockOn:function(C,D){return this._findBlocks("",C,D,true)},_findBlocks:function(M,C,E,F){if(!E){E=C;C=h}var H=C?(typeof C=="string"?this.findElem(C):C):this.domElem,G=typeof E=="string",L=G?E:(E.block||E.blockName),D="."+(G?u(L):u(L,E.modName,E.modVal))+(F?":first":""),I=H.filter(D);M&&(I=I.add(H[M](D)));if(F){return I[0]?a(L,I.eq(0),true):null}var K=[],J={};e.each(I,function(N,O){var P=a(L,e(O),true);if(!J[P._uniqId]){J[P._uniqId]=true;K.push(P)}});return K},bindToDomElem:function(D,E,C){var F=this;C?D.bind(F._buildEventName(E),function(G){(G.data||(G.data={})).domElem=e(this);return C.apply(F,arguments)}):e.each(E,function(H,G){F.bindToDomElem(D,H,G)});return F},bindToDoc:function(D,C){this._needSpecialUnbind=true;return this.bindToDomElem(z,D,C)},bindToWin:function(D,C){this._needSpecialUnbind=true;return this.bindToDomElem(d,D,C)},bindTo:function(E,D,C){if(!D||e.isFunction(D)){C=D;D=E;E=this.domElem}else{if(typeof E=="string"){E=this.elem(E)}}return this.bindToDomElem(E,D,C)},unbindFromDomElem:function(C,D){C.unbind(this._buildEventName(D));return this},unbindFromDoc:function(C){return this.unbindFromDomElem(z,C)},unbindFromWin:function(C){return this.unbindFromDomElem(d,C)},unbindFrom:function(D,C){if(!C){C=D;D=this.domElem}else{if(typeof D=="string"){D=this.elem(D)}}return this.unbindFromDomElem(D,C)},_buildEventName:function(C){var D=this;return C.indexOf(" ")>1?C.split(" ").map(function(E){return D._buildOneEventName(E)}).join(" "):D._buildOneEventName(C)},_buildOneEventName:function(E){var G=this,C=G._eventNameCache;if(E in C){return C[E]}var F="."+G._uniqId;if(E.indexOf(".")<0){return C[E]=E+F}var D=".bem_"+G.__self._name;return C[E]=E.split(".").map(function(I,H){return H==0?I+D:D+"_"+I}).join("")+F},trigger:function(D,C){this.__base(D=this.buildEvent(D),C).domElem&&this._ctxTrigger(D,C);return this},_ctxTrigger:function(D,C){var G=this,F=f[G.__self._buildCtxEventName(D.type)],E={};F&&G.domElem.each(function(){var I=this,H=F.counter;while(I&&H){var K=e.identify(I,true);if(K){if(E[K]){break}var J=F.ctxs[K];if(J){e.each(J,function(M,L){L.fn.call(L.ctx||G,D,C)});H--}E[K]=true}I=I.parentNode}})},setMod:function(D,E,C){if(D&&typeof C!="undefined"&&D.length>1){var F=this;D.each(function(){var G=e(this);G.__bemElemName=D.__bemElemName;F.setMod(G,E,C)});return F}return this.__base(D,E,C)},_extractModVal:function(G,D,F){var C=(D||this.domElem)[0],E;C&&(E=C.className.match(this.__self._buildModValRE(G,F||D)));return E?E[2]:""},_extractMods:function(C,G){var F={},D=!C.length,E=0;((G||this.domElem)[0].className.match(this.__self._buildModValRE("("+(D?k:C.join("|"))+")",G,"g"))||[]).forEach(function(H){var J=(H=H.trim()).lastIndexOf(p),I=H.substr(0,J-1).lastIndexOf(p);F[H.substr(I+1,J-I-1)]=H.substr(J+1);++E});E<C.length&&C.forEach(function(H){H in F||(F[H]="")});return F},_afterSetMod:function(H,K,J,D,C){var F=this.__self,G=F._buildModClassPrefix(H,C),I=F._buildModValRE(H,C),E=K==="";(D||this.domElem).each(function(){var L=this.className;L.indexOf(G)>-1?this.className=L.replace(I,(E?"":"$1"+G+K)+"$3"):E||e(this).addClass(G+K)});C&&this.dropElemCache(C,H,J).dropElemCache(C,H,K)},findElem:function(F,H,G,E){if(arguments.length%2){E=G;G=H;H=F;F=this.domElem}else{if(typeof F=="string"){F=this.findElem(F)}}var D=this.__self,C="."+H.split(" ").map(function(I){return u(D._name,I,G,E)}).join(",.");return y(F,C)},_elem:function(D,G,C){var F=D+A(G,C),E;if(!(E=this._elemCache[F])){E=this._elemCache[F]=this.findElem(D,G,C);E.__bemElemName=D}return E},elem:function(F,E,C){if(E&&typeof E!="string"){E.__bemElemName=F;return E}if(F.indexOf(" ")<0){return this._elem(F,E,C)}var D=e([]),G=this;F.split(" ").forEach(function(H){D=D.add(G._elem(H,E,C))});return D},dropElemCache:function(F,E,C){if(F){var G=this,D=A(E,C);F.indexOf(" ")<0?delete G._elemCache[F+D]:F.split(" ").forEach(function(H){delete G._elemCache[H+D]})}else{this._elemCache={}}return this},elemParams:function(C){var D;if(typeof C=="string"){D=C;C=this.elem(C)}else{D=this.__self._extractElemNameFrom(C)}return g(C[0])[u(this.__self.getName(),D)]||{}},containsDomElem:function(D){var C=false;this.domElem.each(function(){return !(C=D.parents().andSelf().index(this)>-1)});return C},buildSelector:function(D,E,C){return this.__self.buildSelector(D,E,C)},destruct:function(D){var E=this,C=E.__self;E._isDestructing=true;E._needSpecialUnbind&&C.doc.add(C.win).unbind("."+E._uniqId);E.dropElemCache().domElem.each(function(F,G){var H=t(G);e.each(H,function(I,J){var K=x[J.uniqId];if(K){if(!K._isDestructing){l(K,G);delete H[I]}}else{delete n[J.uniqId]}});e.isEmptyObject(H)&&m(G)});D||E.domElem.remove();delete x[E.un()._uniqId];delete E.domElem;delete E._elemCache;E.__base()}},{doc:z,win:d,_processLive:function(D){var F=this,E=F._liveInitable;if("live" in F){var C=typeof E=="undefined";if(C^D){if(e.isFunction(F.live)){E=F.live()!==false;F.live=function(){}}else{E=F.live}}}return E},init:function(D,F,E){if(!D||e.isFunction(D)){E=F;F=D;D=z}var C=e.identify();y(D,".i-bem").each(function(){s(e(this),C)});F&&this.afterCurrentEvent(function(){F.call(E||this,D)});this._runAfterCurrentEventFns();return D},destruct:function(D,C,E){if(typeof D!="boolean"){E=C;C=D;D=h}y(C,".i-bem",E).each(function(F,G){var H=t(this);e.each(H,function(I,J){if(J.uniqId){var K=x[J.uniqId];if(K){l(K,G);delete H[I]}else{delete n[J.uniqId]}}});e.isEmptyObject(H)&&m(this)});D||(E?C.empty():C.remove())},update:function(C,D,F,E){this.destruct(C,true);this.init(C.html(D),F,E)},append:function(C,D){this.init(e(D).appendTo(C))},prepend:function(C,D){this.init(e(D).prependTo(C))},before:function(C,D){this.init(e(D).insertBefore(C))},after:function(C,D){this.init(e(D).insertAfter(C))},_buildCtxEventName:function(C){return this._name+":"+C},_liveClassBind:function(D,E,I,C){var H=this;if(E.indexOf(" ")>-1){E.split(" ").forEach(function(J){H._liveClassBind(D,J,I,C)})}else{var G=q[E],F=e.identify(I);if(!G){G=q[E]={};z.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,C)});G.uniqIds[F]=G.fns.length-1}}return this},_liveClassUnbind:function(E,F,I){var H=q[F];if(H){if(I){if(H=H[E]){var G=e.identify(I);if(G in H.uniqIds){var D=H.uniqIds[G],C=H.fns.length-1;H.fns.splice(D,1);while(D<C){H.uniqIds[H.fns[D++].uniqId]=D-1}delete H.uniqIds[G]}}}else{delete H[E]}}return this},_liveClassTrigger:function(I){var H=q[I.type];if(H){var E=I.target,C=[];for(var J in H){H.hasOwnProperty(J)&&C.push(J)}do{var D=" "+E.className+" ",G=0;while(J=C[G++]){if(D.indexOf(" "+J+" ")>-1){var F=0,L=H[J].fns,K;while(K=L[F++]){K.fn.call(e(E),I)}if(I.isPropagationStopped()){return}C.splice(--G,1)}}}while(C.length&&(E=E.parentNode))}},_buildLiveEventFn:function(E,C){var D=this;return function(G){var F=[D._name,((G.data||(G.data={})).domElem=e(this)).closest(D.buildSelector()),true],H=a.apply(null,C?F.concat([E,G]):F);H&&(C||(E&&E.apply(H,arguments)))}},liveInitOnEvent:function(D,C,E){return this.liveBindTo(D,C,E,true)},liveBindTo:function(G,D,F,C){if(!D||e.isFunction(D)){F=D;D=G;G=h}if(!G||typeof G=="string"){G={elem:G}}G.elemName&&(G.elem=G.elemName);var E=this;if(G.elem&&G.elem.indexOf(" ")>1){G.elem.split(" ").forEach(function(H){E._liveClassBind(u(E._name,H,G.modName,G.modVal),D,F,C)});return E}return E._liveClassBind(u(E._name,G.elem,G.modName,G.modVal),D,F,C)},liveUnbindFrom:function(D,C,F){var E=this;if(D.indexOf(" ")>1){D.split(" ").forEach(function(G){E._liveClassUnbind(u(E._name,G),C,F)});return E}return E._liveClassUnbind(u(E._name,D),C,F)},_liveInitOnBlockEvent:function(E,D,G,F){var C=this._name;w[D].on(E,function(I){var H=arguments,J=I.block[F](C);G&&J.forEach(function(K){G.apply(K,H)})});return this},liveInitOnBlockEvent:function(D,C,E){return this._liveInitOnBlockEvent(D,C,E,"findBlocksOn")},liveInitOnBlockInsideEvent:function(D,C,E){return this._liveInitOnBlockEvent(D,C,E,"findBlocksOutside")},liveInitOnBlockInit:function(C,D){return this.liveInitOnBlockEvent("init",C,D)},liveInitOnBlockInsideInit:function(C,D){return this.liveInitOnBlockInsideEvent("init",C,D)},on:function(C,G,F,E,D){return C.jquery?this._liveCtxBind(C,G,F,E,D):this.__base(C,G,F,E)},un:function(C,F,E,D){return C.jquery?this._liveCtxUnbind(C,F,E,D):this.__base(C,F,E)},liveCtxBind:function(C,G,F,E,D){return this._liveCtxBind(C,G,F,E,D)},_liveCtxBind:function(C,H,G,F,E){var J=this;if(typeof H=="string"){if(e.isFunction(G)){E=F;F=G;G=h}if(H.indexOf(" ")>-1){H.split(" ").forEach(function(K){J._liveCtxBind(C,K,G,F,E)})}else{var D=J._buildCtxEventName(H),I=f[D]||(f[D]={counter:0,ctxs:{}});C.each(function(){var L=e.identify(this),K=I.ctxs[L];if(!K){K=I.ctxs[L]={};++I.counter}K[e.identify(F)+(E?e.identify(E):"")]={fn:F,data:G,ctx:E}})}}else{e.each(H,function(L,K){J._liveCtxBind(C,L,K,G)})}return J},liveCtxUnbind:function(C,F,E,D){return this._liveCtxUnbind(C,F,E,D)},_liveCtxUnbind:function(C,F,E,D){var H=this,G=f[F=H._buildCtxEventName(F)];if(G){C.each(function(){var J=e.identify(this,true),I;if(J&&(I=G.ctxs[J])){E&&delete I[e.identify(E)+(D?e.identify(D):"")];if(!E||e.isEmptyObject(I)){G.counter--;delete G.ctxs[J]}}});G.counter||delete f[F]}return H},_extractElemNameFrom:function(C){if(C.__bemElemName){return C.__bemElemName}var D=C[0].className.match(this._buildElemNameRE());return D?D[1]:h},extractParams:g,_buildModClassPrefix:function(D,C){return u(this._name)+(C?j+(typeof C==="string"?C:this._extractElemNameFrom(C)):"")+p+D+p},_buildModValRE:function(D,C,E){return new RegExp("(\\s?)"+this._buildModClassPrefix(D,C)+"("+k+")(\\s|$)",E)},_buildElemNameRE:function(){return new RegExp(this._name+j+"("+k+")(?:\\s|$)")},buildSelector:function(D,E,C){return"."+u(this._name,D,E,C)},getBlockByUniqId:function(C){return x[C]},getWindowSize:function(){return{width:d.width(),height:d.height()}}})})(BEM,jQuery);(function(){String.prototype.trim||(String.prototype.trim=function(){var c=this.replace(/^\s\s*/,""),a=/\s/,b=c.length;while(a.test(c.charAt(--b))){}return c.slice(0,b+1)})})();(function(a){if(!a){a=window.Lego={}}a.isSessionValid=function(){return !!a.getCookie("yandex_login")}})(window.Lego);BEM.DOM.decl("i-global",{onSetMod:{js:function(){this.del(this.__self._params=$.extend({},this.params),"uniqId","name");var a=this.__self._params;a["passport-msg"]||(a["passport-msg"]=a.id);if(a["show-counters"]===undefined){a["show-counters"]=Math.round(Math.random()*100)<=a["show-counters-percent"]}a.locale=a.lang;$(function(){a.oframebust&&Lego.oframebust(a.oframebust)})}},getDefaultParams:function(){return{id:"",login:Lego.isSessionValid()?$.cookie("yandex_login")||"":"",yandexuid:$.cookie("yandexuid"),lang:"ru",retpath:window.location.toString(),"passport-host":"https://passport.yandex.ru","pass-host":"//pass.yandex.ru","social-host":"//social.yandex.ru","lego-path":"/lego","show-counters-percent":100}}},{param:function(a){return(this._params||{})[a]}});(function(b){if(!b){b=window.Lego={}}!b.params&&(b.params={});function a(c){return c.replace(/^(?:https?:)?\/\//,"")}b.c=function(d,c,j){var i=a((j&&j.host)||BEM.blocks["i-global"].param("click-host")||"clck.yandex.ru"),e=function(l,n,m,k){n=n.replace("'","%27");return n.indexOf("/dtype=")>-1?n:location.protocol+"//"+i+"/"+m+"/dtype="+l+"/rnd="+((new Date()).getTime()+Math.round(Math.random()*100))+(k?"/*"+(n.match(/^http/)?n:location.protocol+"//"+location.host+(n.match("^/")?n:"/"+n)):"/*data="+encodeURIComponent("url="+encodeURIComponent((n.match(/^http/)?n:location.protocol+"//"+location.host+(n.match("^/")?n:"/"+n)))))},g=function(){var k=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0];var h=document.createElement("script");h.setAttribute("src",e(d,location.href,"jclck"));k.insertBefore(h,k.firstChild)};if(c){if(c.className.match(/b-link_pseudo_yes/)||(c.href&&c.href.match(/^mailto:/))||(j&&j.noRedirect===true)){g()}else{if(c.href){var f=c.href;c.href=e(d,f,"redir");setTimeout(function(){c.href=f},500)}else{if(c.form){if(c.type.match(/submit|button|image/)){var f=c.form.action;c.form.action=e(d,f,"redir",true);setTimeout(function(){c.form.action=f},500)}else{g()}}else{if(c.action){c.action=e(d,c.action,"redir",true)}else{throw"counter.js: not link and not form!"}}}}}else{g()}}})(window.Lego);(function(a){if(!a){a=window.Lego={}}a.cp=function(f,c,e,b,d){a.c("stred/pid="+f+"/cid="+c+(e?"/path="+e:""),b,d)}})(window.Lego);(function(a){if(!a){a=window.Lego={}}a.ch=function(c,b){BEM.blocks["i-global"].param("show-counters")&&a.cp(0,2219,c,b)}})(window.Lego);(function(a){if(!a){a=window.Lego={}}a.getCookie=function(h){var g=document.cookie;if(g.length<1){return false}var d=g.indexOf(h+"=");if(d==-1){return false}d+=(h.length+1);var f=g.indexOf(";",d);return decodeURIComponent((f==-1)?g.substring(d):g.substring(d,f))}})(window.Lego);(function(b,a){if(!a){a=window.Lego={}}a.init||(a.init=function(c){(c=a.params=b.extend({id:"",login:a.isSessionValid()?a.getCookie("yandex_login")||"":"",yandexuid:a.getCookie("yandexuid"),locale:"ru",retpath:window.location.toString(),"passport-host":"//passport.yandex.ru","pass-host":"//pass.yandex.ru","passport-msg":c.id,"social-host":"//social.yandex.ru","lego-path":"/lego","show-counters-percent":100},c,a.params))["show-counters"]=Math.round(Math.random()*100)<=c["show-counters-percent"];BEM.blocks["i-global"]._params||b.extend(BEM.blocks["i-global"]._params={},c);b(function(){c.oframebust&&a.oframebust(c.oframebust)});return c});a.block||(a.block={});a.blockInit||(a.blockInit=function(c,d){c=c||document;d=d||".g-js";b(c).find(d).each(function(){var h=b(this),g=this.onclick?this.onclick():{},e=g.name||"",f=a.block[e];if(f&&!h.data(e)){f.call(h,g);h.data(e,true).addClass(e+"_js_inited")}})});a.blockInitBinded||(a.blockInitBinded=!!b(document).ready(function(){a.blockInit()}))})(jQuery,window.Lego);$(function(){BEM.DOM.init()});(function(a){if(!a){a=window.Lego={}}a.messages=a.messages||{};a.message=function(c,b){return a.params.locale=="ru"?b:(a.messages[c]||b)}})(window.Lego);(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(c){if(!c.button){c.type="leftclick";a.event.handle.apply(this,arguments);c.type="click"}}}})(jQuery);BEM.DOM.decl({name:"b-pseudo-link",modName:"is-bem",modVal:"yes"},{_onClick:function(a){a.preventDefault();this.hasMod("disabled","yes")||this.afterCurrentEvent(function(){this.trigger("click")})}},{live:function(){this.liveBindTo({modName:"is-bem",modVal:"yes"},"leftclick",function(a){this._onClick(a)})}});BEM.HTML.decl("b-pseudo-link",{onBlock:function(a){var b=a.param("url");a.tag(b?"a":"span").js(true);b&&a.attr("href",b)}});(function(a){BEM.DOM.decl("b-dropdowna",{onSetMod:{js:function(){this._getSwitcher().on("click",this._toggle,this)},disabled:function(c,b){this._getSwitcher().setMod(c,b);b=="yes"&&this.getPopup().hide()}},_getSwitcher:function(){return this._switcher||(this._switcher=this.findBlockInside("b-"+(this.getMod(this.elem("switcher"),"type")||"link")))},_toggle:function(){this.getPopup().toggle(this.elem("switcher"))},getPopup:function(){return this._popup||(this._popup=this.findBlockInside("b-popupa")).on("outside-click",function(c,b){this._getSwitcher().containsDomElem(a(b.domEvent.target))&&c.preventDefault()},this)},destruct:function(){var b=this._popup;b&&b.destruct();this.__base.apply(this,arguments)}},{live:function(){this.liveInitOnEvent("switcher","leftclick",function(){})}})})(jQuery);BEM.HTML.decl("b-dropdowna",{onBlock:function(a){a.js(true)}});(function(c){BEM.DOM.decl("b-popupa",{onSetMod:{js:function(){this._owner=null;this._isShowed=false;this._direction=this.getMod("direction")||"down";this._lastDirection=null}},show:function(k){if(!this._isShowed||this._owner!==k){this._owner=k;this._getUnder().show({left:-10000,top:-10000});this.pos();this._getUnder().setMod("animate","yes")}return this},hide:function(){this._isShowed&&this._getUnder().hide();return this},toggle:function(k){return this.isShowed()?this.hide():this.show(k)},_pos:function(){var k=this._calcParams(this._owner);this.elem("tail").css(k.tailOffsets);this.setMod("direction",k.direction)._getUnder().show(k.offsets);return this},pos:function(){if(!this._isShowed){return this}return this._pos()},isShowed:function(){return this._isShowed},setDirection:function(k){if(this._direction!=k){this._direction=k;this.isShowed()&&this.pos()}},setContent:function(k,m,l){BEM.DOM.update(this.elem("content"),k,m,l);return this.isShowed()?this.pos():this},_isOwnerNode:function(){return !!(this._owner&&this._owner.jquery)},_calcDimensions:function(){var q=this._getUnder().domElem,v=this._getUnder()._getUnder(),t=this.__self.win,n=this._owner,w=this._isOwnerNode(),u=w?n.offset():n,l=w?n.outerWidth():0,m=w?n.outerHeight():0,p=t.scrollLeft(),o=t.scrollTop(),s=this.__self.getWindowSize(),k=parseInt(this.elem("content").css("border-top-width"),10);return{ownerWidth:l,ownerHeight:m,ownerLeft:u.left,ownerTop:u.top,ownerRight:u.left+l,ownerBottom:u.top+m,ownerHorizMiddle:u.left+l/2,ownerVertMiddle:u.top+m/2,posWidth:q.outerWidth(),posHeight:q.outerHeight(),underWidth:v.outerWidth(),underHeight:v.outerHeight(),borderWidth:isNaN(k)?0:k,windowLeft:p,windowRight:p+s.width,windowTop:o,windowBottom:o+s.height}},_calcParams:function(){var p=this._calcDimensions();if(this.hasMod("adjustable","no")){return e(this._direction,p)}var k={},m=this.params.directions,q=c.inArray(this._direction,m);q>-1||(q=0);var l=q,o,n;do{o=m[q];n=k[o]=e(o,p);if(!n.factor){this._lastDirection=o;return n}++q==m.length&&(q=0)}while(q!==l);return k[this._lastDirection||m[0]]},getDefaultParams:function(){return{directions:h}},destruct:function(){var k=this._under;if(!k){this.__base.apply(this,arguments)}else{if(!this._destructing){this._destructing=true;this.hide();BEM.DOM.destruct(false,k.domElem);this.__base(true)}}},_getUnder:function(){if(!this._under){var k=c(BEM.HTML.build({block:"i-popup",zIndex:this.params.zIndex,mods:{autoclosable:this.getMod("autoclosable")||"yes",fixed:this.hasMod("direction","fixed")&&"yes"},underMods:this.params.underMods,underMix:[{block:"b-popupa",elem:"under"}]}));(this._under=this.findBlockOn(k,"i-popup")).on({show:this._onUnderShowed,hide:this._onUnderHidden,"outside-click":this._onUnderOutsideClicked},this).elem("content").append(this.domElem)}return this._under},_onUnderShowed:function(){this._isShowed=true;this.bindToWin("resize",this.pos)._isOwnerNode()&&this.bindToDomElem(this._owner.parents().add(this.__self.win),"scroll",this.pos);this.trigger("show")},_onUnderHidden:function(){this._isShowed=false;this.unbindFromWin("resize")._isOwnerNode()&&this.unbindFromDomElem(this._owner.parents().add(this.__self.win),"scroll");this.trigger("hide")},_onUnderOutsideClicked:function(){this.trigger.apply(this,arguments)}},{live:function(){this.liveBindTo("close","leftclick",function(){this.hide()})}});var d=19,a=9,i=19,f=19,g=10,j=7,h=["down-right","down","down-left","up","up-right","up-left","right-down","right","right-up","left-down","left","left-up"];function e(q,s){var m,n={top:0,left:0},l={marginLeft:0,marginTop:0},p=q.split("-")[0],o=s.ownerWidth<i?(i-s.ownerWidth)/2:0,k=s.ownerHeight<f?(f-s.ownerHeight)/2:0;switch(q){case"up":case"down":n.left=s.ownerHorizMiddle-s.posWidth/2;n.top=q=="down"?s.ownerBottom+g:s.ownerTop-s.posHeight-g;l.marginLeft=s.posWidth/2-i/2;l.marginTop=q=="down"?0-g:0;break;case"up-left":case"up-right":case"down-left":case"down-right":n.left=q=="down-right"||q=="up-right"?s.ownerLeft-o:s.ownerRight-s.posWidth+o;n.top=p=="down"?s.ownerBottom+g:s.ownerTop-s.posHeight-g;l.marginLeft=s.ownerWidth>s.posWidth?s.posWidth/2-i/2:s.ownerHorizMiddle-n.left-i/2;l.marginTop=p=="down"?s.borderWidth-g:0-s.borderWidth;break;case"left-down":case"right-down":n.left=q=="left-down"?s.ownerLeft-s.posWidth-a:s.ownerRight+a;n.top=s.ownerTop-k;l.marginLeft=q=="left-down"?0-s.borderWidth:s.borderWidth-a;l.marginTop=s.ownerHeight<s.posHeight?s.ownerVertMiddle-n.top-f/2:s.posHeight/2-f/2;break;case"left":case"right":n.left=q=="left"?s.ownerLeft-s.posWidth-a:s.ownerRight+a;n.top=s.ownerVertMiddle-s.posHeight/2;l.marginLeft=q=="left"?0-s.borderWidth:s.borderWidth-a;l.marginTop=s.posHeight/2-f/2;break;case"left-up":case"right-up":n.left=q=="left-up"?s.ownerLeft-s.posWidth-a:s.ownerRight+a;n.top=s.ownerBottom-s.posHeight+k;l.marginLeft=p=="left"?0-s.borderWidth:s.borderWidth-a;l.marginTop=s.ownerHeight>s.posHeight?s.posHeight/2-f/2:s.ownerVertMiddle-n.top-f/2}m=b(n,s);return{direction:p,factor:m,offsets:n,tailOffsets:l}}function b(m,l){var k=0;l.windowTop>m.top&&(k+=l.windowTop-m.top);m.top+l.underHeight>l.windowBottom&&(k+=m.top+l.underHeight-l.windowBottom);l.windowLeft>m.left&&(k+=l.windowLeft-m.left);m.left+l.underWidth>l.windowRight&&(k+=m.left+l.underWidth-l.windowRight);return k}BEM.HTML.decl("b-popupa",{onBlock:function(k){var l=false;c.each(k.param("content"),function(m,n){return !(l=n.elem=="close")});k.mods({theme:"ffffff",direction:"down","has-close":l&&"yes"}).js(true).afterContent({elem:"shadow"})},onElem:{content:function(k){k.wrap({elem:"wrap-cell",tag:"td"}).wrap({tag:"tr"}).wrap({elem:"wrap",tag:"table"})},close:function(k){k.tag("i")},shadow:function(k){k.tag("i")},tail:function(k){k.tag("i").wrapContent({elem:"tail-i",tag:"i"})}}})})(jQuery);(function(d){var c,g=[],a=d.browser;function f(){return g.length?g.shift():c?c.clone():c=b()}function e(h){g.push(h)}function b(){return d((a.safari||a.webkit)&&navigator.userAgent.toLowerCase().indexOf("mobile")>-1?"<div/>":"<iframe"+(a.msie&&a.version<9?' frameborder="0"':"")+"/>")}BEM.DOM.decl("i-popup",{onSetMod:{visibility:{visible:function(){var h=this._getUnder(),i=h.parent();this.hasMod(h,"type","paranja")?i.is("body")||h.appendTo("body"):(i[0]!==this.domElem[0])&&h.prependTo(this.domElem);this._inBody||(this._inBody=!!this.domElem.appendTo("body"));this.trigger("show")},"":function(){var h=this._getUnder();this.hasMod(h,"type","paranja")&&h.remove();this._putUnder();this.trigger("hide")}}},_getUnder:function(){return this._under||(this._under=f().attr("class",this._underClass||(this._underClass=this.findElem("under").remove().attr("class"))))},_putUnder:function(){e(this._under);delete this._under},show:function(h){h&&this.domElem.css(h);return this.setMod("visibility","visible")},hide:function(){return this.delMod("animate").delMod("visibility")}},{live:true})})(jQuery);BEM.HTML.decl("i-popup",{onBlock:function(a){a.mod("autoclosable","yes").js(true).wrapContent({elem:"content"}).afterContent({elem:"under",mods:a.param("underMods"),mix:a.param("underMix")}).param("zIndex")&&a.attr("style","z-index:"+(32700+a.param("zIndex")))}});(function(a){var b=(a.browser.opera&&a.browser.version<12.1)?"keypress":"keydown";BEM.DOM.decl({name:"i-popup",modName:"autoclosable",modVal:"yes"},{onSetMod:{visibility:{visible:function(){this.afterCurrentEvent(function(){if(this.hasMod("visibility","visible")){var c=this._under;this.bindToDoc("leftclick",function(d){this.containsDomElem(a(d.target))||this._onOutClick(d)}).bindToDoc(b,function(d){d.keyCode==27&&this.hide()});if(c&&c.is("iframe")&&this.hasMod(c,"type","paranja")){this.bindToDomElem(a([c[0].contentWindow,c[0].contentWindow.document]),"leftclick",this.hide)}}});this.__base.apply(this,arguments)},"":function(){return this.unbindFromDoc("leftclick "+b).__base.apply(this,arguments)}}},_onOutClick:function(c){var d=a.Event("outside-click");this.trigger(d,{domEvent:c});d.isDefaultPrevented()||this.hide()}})})(jQuery);BEM.HTML.decl("b-dropdowna",{onElem:{switcher:function(a){a.tag("span")}}});BEM.DOM.decl("b-dropdown",{onSetMod:{js:function(){Lego.block["b-dropdown"].call(this.domElem,this.params)}}});(function(b,a){a.block["b-dropdown"]=function(e){var d=this,c,i,g,j,h=false,l=false,k=function(){c=d.find(".b-dropdown__list");i=b('<div class="b-dropdown__popup"/>');g=b('<iframe class="b-dropdown__iframe" frameborder="0" src="javascript:\'<body style=\\\'background:none;overflow:hidden\\\'>\'"/>');j=c.clone(true).addClass("b-dropdown__list_clone").hide();c.before(i);i.after(j);f();b(document).keydown(function(m){if(m.keyCode==27&&!(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)){f()}}).click(function(m){if(!b(m.target).is(".b-dropdown *")){f()}}).bind("popupsClose.lego",f);l=true},f=(function(){if(h){return}i.css("visibility","hidden").before(c).hide();j.hide();h=true});d.find(".b-dropdown__or").click(function(n){n.preventDefault();if(!l){k()}if(d.hasClass("b-dropdown_state_disabled")){d.trigger("popupDisabled.lego");return}if(h){b(document).trigger("popupsClose.lego",{source:d[0]});var o=b.Event("popupOpen.lego");d.trigger(o);if(!o.isDefaultPrevented()){j.css("display","");i.append(c).css("visibility","");if(e.direction=="up"||d.hasClass("b-dropdown_direction_up")){var m=i.height()-j.height();i.css("margin-top",-(m-(parseInt(c.css("padding-bottom"),10)+parseInt(b(this).closest(".b-dropdown__item").css("padding-bottom"),10))))}i.prepend(g).css("display","");h=false}}else{f()}})}})(jQuery,window.Lego);(function(a){a=a||{};a.oframebustMatchDomain=function(g,h){g=Object.prototype.toString.call(g)==="[object Array]"?g:(function(){var d=[];for(var e in g){g.hasOwnProperty(e)&&d.push(e)}return d}());for(var c=0,b=g.length;c<b;c++){var k=g[c];if(typeof(k)=="string"){if(/(\?|\*)/.test(k)){var f=k.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".{1}");if((new RegExp("^"+f+"$")).test(h)){return true}}else{if(h==k){return true}}}else{try{if(k.test(h)){return true}}catch(j){}}}}})(window.Lego);(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(a.oframebustMatchDomain(c,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);BEM.HTML.decl("b-link",{onBlock:function(a){a.tag("a").attr("href",a.param("url"));var b=["title","target"],c;while(c=b.pop()){a.param(c)&&(a.attr(c,a.param(c)))}}});(function(){BEM.DOM.decl("b-statcounter__metrika",{onSetMod:{js:function(){this.__self.loadMetrika();this.addCounter(this.params)}},addCounter:function(d){var a=window.Ya&&Ya.Metrika,c=window.yandex_metrika_callbacks||(window.yandex_metrika_callbacks=[]),b=function(){window["yaCounter"+d.id]=new Ya.Metrika(d)};if(!d.id){throw new Error([BEM.I18N("b-statcounter__metrika","JSERR_incorrectID"),"block: "+this.__self.getName(),"method: addCounter"].join("\n"))}a?b():c.push(b)},getDefaultParams:function(){return{enableAll:true}}},{loadMetrika:function(){var a=window.Ya&&Ya.Metrika,c=document.location.protocol=="https:"?"https:":"http:",b="//mc.yandex.ru/metrika/watch.js";!a&&$("script")[0].parentNode.appendChild($("<script>").attr({type:"text/javascript",async:true,src:c+b})[0]);this.loadMetrika=function(){}}})})();(function(c,a){BEM.DOM.decl("b-head-tabs",{onSetMod:{js:function(){a.block["b-head-tabs"].call(this.domElem[0],this.params)}}});var b=a.block["b-head-tabs"]=function(v){var f=c(this),y=c(".b-head-search"),x=y.find(".b-search .b-form-input input:first"),o=BEM.blocks["i-global"].param("id"),k=(function(){var A=q(window.location.search),z=/^#.*(\?.+)$/.exec(window.location.hash);z&&c.extend(A,q(z[1]));return A}()),j={www:505,search:521,images:526}[o]||527,g={market:{cvredirect:1,clid:j}},d=document.location.hostname.indexOf(".com")>-1?"2":"",m={news:{rpt:"nnews"+d,grhow:"clutop"},haber:{rpt:"nnews2",grhow:"clutop"},yaca:{rpt:"rs2"},market:{cvredirect:1,clid:j},blogs:{ft:"blog"},people:{filter:"people"}},w=(function(){var z={};c.each(["news","yaca","market","blogs","maps","adresa","video","fotki","slovari","auto","images","music","www","aile","yandex","haber","gorsel"],function(){z[this]=["family"]});return z})(),s=(function(){var z={};c.each(["news","yaca","market","blogs","maps","adresa","video","fotki","slovari","auto","images","music","www","aile","yandex","haber","gorsel"],function(){z[this]=["noreask","family"]});return z})(),t=f.find(':not(strong)>a.b-head-tabs__link:not([href$="/all"])').map(function(){var A=this.host.split(".")[0],B=q(this.search),D=B.clid,z=decodeURIComponent(c.param(c.extend(B,h(A,D)),true)),E=this.pathname.replace(/^\/?(.*)/,"/$1"),C=b.getHostToUrlMap()[A];C&&E.indexOf((C.charAt(0)==="/"?"":"/")+C)>-1&&(C="");E=E.slice(1);if(E.length){E=E.replace(/\/*$/,"/")}return{node:this,clid:D,toServiceId:A,path:C,pathname:E,host:this.host,searchHost:b.getHostMap()[A],noSearchParamsUrl:z?"?"+z:"",searchParams:c.extend(B,p(A,D))}}).filter(function(){return typeof this.path!=="undefined"}),n,u=y.find(".b-search__advanced")[0];if(u&&u.pathname){var i=q(u.search),l=u.pathname.replace(/^\/?(.*)/,"$1");i.text="";t.push({node:u,clid:i.clid,toServiceId:o,path:"",pathname:l,host:u.host,noSearchParamsUrl:"?"+c.param(i,true),searchParams:i})}(function(){var z=c.trim(x.val())||v["default"];if(n!=z){n=z;c.each(t,function(){z&&(this.searchParams[b.getSearchParamName(this.toServiceId)]=z);this.node.href=[this.node.protocol+"/",z&&this.searchHost?this.searchHost:this.host,this.pathname+(z?this.path+"?"+c.param(this.searchParams,true):this.noSearchParamsUrl)].join("/")})}setTimeout(arguments.callee,200)})();function h(z,A){var B=g[z]||{};!B.clid&&A&&(B.clid=A);c.each(w[z]||[],function(){k[this]&&(B[this]=k[this])});return B}function p(A,B){var D=[].concat(s[A]),z=A+o;(z=="imageswww"||z=="wwwimages")&&D.push("site");var C=m[A]||{};c.each(D,function(){k[this]&&(C[this]=k[this])});!C.clid&&B&&A!=="www"&&(C.clid=B);return C}function q(z){var A={};if(!z){return A}c.each(z.substr(1).split("&"),function(E){var F=this.split("="),B=F[0],D=F[1];if(B){if(A.hasOwnProperty(B)){var C=A[B];c.isArray(C)?C.push(D):A[B]=[C,D]}else{A[B]=D}}});return c.decodeURIComponent!==undefined?e(A):A}function e(A){var z=["site"];c.each(A,function(B,C){if(c.inArray(B,z)>-1){A[B]=c.isArray(C)?C.map(function(D){return c.decodeURIComponent(D)}):c.decodeURIComponent(C)}});return A}};c.extend(b,{getHostToUrlMap:function(){var d={www:"yandsearch",market:"search.xml",maps:"",music:"#!/search",video:"search"};d.translate=d.ceviri=d.harita=d.maps;d.blogs=d.adresa=d.fotki=d.slovari=d.auto=d.rabota=d.market;d.people=d.news=d.yaca=d.images=d.gorsel=d.haber=d.yandex=d.www;d.afisha=d.pogoda=d.hava=d.video;return d},getHostMap:function(){return{}},getSearchParamName:function(d){switch(d){case"pogoda":case"hava":return"request";default:return"text"}}})})(jQuery,window.Lego);BEM.DOM.decl({name:"b-link",modName:"pseudo",modVal:"yes"},{_onClick:function(a){a.preventDefault();this.hasMod("disabled","yes")||this.afterCurrentEvent(function(){this.trigger("click")})}},{live:function(){this.__base.apply(this,arguments);this.liveBindTo({modName:"pseudo",modVal:"yes"},"leftclick",function(a){this._onClick(a)})}});BEM.HTML.decl({name:"b-link",modName:"pseudo",modVal:"yes"},{onBlock:function(a){a.tag(a.param("url")?"a":"span");a.wrapContent({elem:"inner"});a.js(true)},onElem:{inner:function(a){a.tag("span")}}});(function(){BEM.DOM.decl("i-menu",{onElemSetMod:{item:{state:{current:function(c,d,a,e){if(e=="disabled"){return false}var b=this.elem("item","state","current");this.delMod(b,"state").trigger("current",{prev:b,current:c})}}}},onItemSelectorClick:function(b){var a=this._getItemByEvent(b);this.setMod(a,"state","current")},_getItemByEvent:function(a){return a.data.domElem.closest(this.buildSelector("item"))}},{live:function(){this.liveBindTo("item-selector","leftclick",function(a){this.onItemSelectorClick(a)})}})})();(function(){BEM.DOM.decl({name:"b-menu-horiz",baseBlock:"i-menu"})})();BEM.HTML.decl("b-link",{onBlock:function(a){a.tag("a").attr("href",a.param("url"))}});(function(){var a={};BEM.decl("i-request",{onSetMod:{js:function(){this._preventCache=false}},get:function(c,e,b,d){if(!$.isFunction(b)){d=b;b=this.params.onError}this._get(c,e,b,$.extend({},this.params,d))},_get:function(e,g,d,f){var c=this._buildCacheKey(e,f),b=a[f.cacheGroup];f.cache&&b&&c in b.data?g.call(this.params.callbackCtx,b.data[c]):this._do(e,g,d,f)},_do:function(c,e,b,d){},_onSuccess:function(c,b,d,e){e.cache&&!this._preventCache&&this.putToCache(e,c,d);this._preventCache=false},_buildCacheKey:function(b,c){return typeof b=="string"?b:$.param(b)},putToCache:function(f,d,e){var b=a[f.cacheGroup]||(a[f.cacheGroup]={keys:[],data:{}});if(b.keys.length>=f.cacheSize){delete b.data[b.keys.shift()]}var c=this._buildCacheKey(d,f);b.data[c]=e;b.keys.push(c)},dropCache:function(){delete a[this.params.cacheGroup]},getDefaultParams:function(){return{cache:false,cacheGroup:"default",cacheSize:100,callbackCtx:this}}})})();BEM.decl({block:"i-request_type_ajax",baseBlock:"i-request"},{onSetMod:{js:function(){this.__base();this._requestNumber=this._number=this._preventNumber=this._retryCount=0}},_get:function(b,d,a,c){this._number++;this._requestNumber++;this._retryCount=c.retryCount;this.__base.apply(this,arguments)},_do:function(d,f,c,e){var g=this;if(g._number>g._preventNumber){var a=arguments,b={data:e.data?$.extend({},e.data,d):d,success:g._wrapCallback(function(j,h,i){g._onSuccess(g._buildCacheKey(d,e),d,j[0],e);g._allowCallback(h,i)&&f.apply(e.callbackCtx,j)}),error:g._wrapCallback(function(j,h,i){g._allowCallback(h,i)&&(g._retryCount-->0?setTimeout(function(){g._do.apply(g,a)},e.retryInterval):c&&c.apply(e.callbackCtx,j))})};$.each(["url","dataType","timeout","type","jsonp","jsonpCallback"].concat(e.paramsToSettings||[]),function(j,h){b[h]=e[h]});$.ajax(b)}},_wrapCallback:function(c){var a=this._requestNumber,b=this._number;return function(d){d!==null&&c(arguments,a,b)}},_allowCallback:function(a,b){return b>this._preventNumber&&this._requestNumber==a},_buildCacheKey:function(a,b){return typeof a=="string"?a:this.__base(a)+b.url},abort:function(){this._preventNumber=++this._number},preventCallbacks:function(){this.abort()},getDefaultParams:function(){return $.extend(this.__base(),{cache:true,type:"GET",dataType:"jsonp",timeout:20000,retryCount:0,retryInterval:2000})}});(function(){var c=false,a=false,b=[];BEM.decl("i-https",{},{isHTTPSSupported:function(){return a},enableHTTPS:function(){a=true;var d;while(d=b.shift()){d()}},getHTTPSHost:function(){var d=BEM.blocks["i-global"].param("lego-static-host");if(d){if(d.indexOf("https:")==0){return d}if(d.indexOf("http:")==0){return"https"+d.substr(4)}if(d.indexOf("//")==0){return"https:"+d}else{return"https://"+location.host+d}}else{return"https://"+location.host}},checkForHTTPS:function(d){if(a){return d()}b.push(d);if(c){return}c=true;BEM.create("i-request_type_ajax",{url:this.getHTTPSHost()+"/blocks-desktop/i-https/check-https.js",dataType:"script",cache:true,paramsToSettings:["cache"]}).get({},function(){},false,this)}})})();(function(){var a=BEM.blocks["i-https"];BEM.DOM.decl("b-head-userinfo",{onSetMod:{js:function(){var b=this;a.checkForHTTPS(function(){b._onHttps()})}},_onHttps:function(){var b=this.findBlockInside(this.elem("exit"),"b-link"),c=b&&(b=b.domElem,b.attr("href"));if(c&&a.isHTTPSSupported()){b.attr("href",c.replace(/^(https?:)?/,"https:"))}}})}());$(document).ready(function(){$(".b-head-userinfo__search .b-form-input__input").focus(function(){$(this).parents(".b-head-userinfo__search .b-form-input").addClass("b-form-input_wide_yes");$(this).parents(".b-head-userinfo__search .b-form-input").find(".b-form-input__hint").removeClass("b-form-input__hint_visibility_visible");$(this).parents(".b-head-userinfo__search .b-form-input").find(".b-search-specification").removeClass("b-search-specification_state_off")});$(".b-head-userinfo__search .b-form-input__input").blur(function(){})});BEM.decl("i-common__string",{},{cleverSubstring:(function(){var a="…";return function(d,b,c){return(d.length>b+c)?d.substring(0,b-1)+a:d}})(),escapeHTML:(function(){var b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},a=function(c){return b[c]||c};return function(c){return String(c).replace(/&(?!\w+;)|[<>"']/g,function(d){return b[d]||d})}})(),escapeRegExp:function(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},highlight:function(e,a){if(!$.isArray(a)){return e}var f=[],d=0,b,c=a.sort(function(h,g){return h[0]-g[0]});c.forEach(function(g){b=(d>g[0])?d:g[0];f.push({tag:"span",elem:"span",content:this.escapeHTML(e.slice(d,b))});f.push({tag:"em",elem:"em",content:this.escapeHTML(e.slice(b,d=g[1]))})},this);f.push({tag:"span",elem:"span",content:this.escapeHTML(e.slice(d))});return f}});BEM.decl("i-user-services",{},{get:function(a){this._data?a(this._data):this._get(a)},getApiUrl:function(){return BEM.blocks["i-global"].param("pass-host")+"/services?callback=?"},_callbacks:[],_get:function(a){var b=this;b._callbacks.push(a);b._callbacks.length==1&&$.getJSON(b.getApiUrl(),{locale:BEM.blocks["i-global"].param("lang"),login:"yes","current-login":BEM.blocks["i-global"].param("login"),yu:$.cookie("yandexuid")},function(c){b._data=c;$.each(b._callbacks,function(){this(c)});b._callbacks.length=0})}});(function(d,a,b,c){b.DOM.decl("b-head-user",{onSetMod:{js:function(){var e=this;this._maxLength=parseInt(this.params.maxlength,10);this._maxLengthRel=parseInt(this.params["maxlength-relative"],10);if(c.param("login")!==""||c.param("displayName")){b.blocks["i-user-services"].get(function(f){e.buildHtml(f)})}}},getDefaultParams:function(){return{maxlength:20,"maxlength-relative":3}},getUserItems:function(g){var f=g.displayName&&g.displayName.social?[{name:b.I18N("b-head-user","profiles"),url:c.param("social-host")}]:[{name:b.I18N("b-head-user","passport"),url:c.param("passport-host")+"/passport?mode=passport"},{name:b.I18N("b-head-user","change-password"),url:c.param("passport-host")+"/passport?mode=changepass&retpath="+encodeURIComponent(c.param("retpath"))+"/"}];var e="";d.each(f,function(j,h){e+='<li class="b-menu__layout-vert-cell'+(j==f.length-1?" b-menu__layout-vert-cell_position_last":"")+'"><div class="b-menu__item"><a class="b-link b-head-user__link" href="'+h.url+'">'+h.name+"</a></div></li>"});return e},buildHtml:function(i){if(!i||!i.services){return}var k=this,f=i.displayName&&i.displayName.social,m=b.blocks["i-common__string"].cleverSubstring(d("<div/>").text(k.getUserLogin(i)).html(),k._maxLength,k._maxLengthRel),h=this.findBlocksOn("i-ctr")&&c.param("show-counters"),g,l,e="",j;g=f?'<b class="b-user b-user_social_yes"><span class="b-user__provider-ico" style="background:url(//static.yandex.st/social/current/icons/16/'+f.provider+'.png)"></span>'+m+"</b>":'<b class="b-user"><b class="b-user__first-letter">'+m.substring(0,1)+"</b>"+m.substring(1)+"</b>";if(k.params.href){e=k.params.href}else{if(f){e=c.param("social-host")}else{if(/\.com(.tr)?$/.test(location.hostname)){e=c.param("passport-host")}else{e=c.param("i-host")||"https://i.yandex.ru"}}}l='<a class="b-link b-link_pseudo_yes '+(h?"i-ctr i-ctr_click_b-link ":"")+"i-bem\" onclick=\"return {'b-link':{}"+(h?",'i-ctr':{stat:'head-login'}":"")+'}"'+(!f&&k.hasMod("type","com")?"":' href="'+e+'"')+'><span class="b-link__inner">'+g+"</span></a>";j='<div class="b-dropdowna b-dropdowna i-bem" onclick="return {\'b-dropdowna\':{}}"><span class="b-dropdowna__switcher">'+l+'</span><div class="i-popup i-popup_autoclosable_yes i-popup i-bem" onclick="return {\'i-popup\':{}}"><div class="i-popup__content"><div class="i-popup__under b-popupa__under"></div><div class="b-popupa b-popupa_theme_ffffff b-popupa_direction_down i-bem b-dropdowna__popup" onclick="return {\'b-popupa\':{}}"><i class="b-popupa__shadow"></i><i class="b-popupa__tail"><i class="b-popupa__tail-i"></i></i><table cellpadding="0" cellspasing="0" class="b-popupa__wrap"><tr><td class="b-popupa__wrap-cell"><div class="b-popupa__content"><div class="b-menu b-menu_layout_vert b-dropdowna__menu"><ul class="b-menu__layout-vert">';f&&k.setMod("social","yes");d.each(i.services,function(n){j+='<li class="b-menu__layout-vert-cell'+(n===0?" b-menu__layout-vert-cell_position_first":"")+'"><div class="b-menu__item">';if(c.param("id")==this.id&&c.param("index")){j+="<strong>"+this.title+"</strong>"}else{j+='<a class="b-link b-head-user__link" href="'+this.url+'" onmousedown="Lego.ch(\''+c.param("id")+".login.myservices."+this.id+"',this)\">"+this.title+"</a>"}j+="</div></li>"});if(i.services.length){j+='<li class="b-menu__layout-vert-separator"><i class="b-menu__separator"></i></li>'}j+=k.getUserItems(i);j+="</ul></div></div></td></tr></table></div></div></div></div>";b.DOM.update(k.findBlockInside("b-user").domElem,j)},getUserLogin:function(f){var e=c.param("displayName");return e&&e.social&&e.name||f.displayName&&f.displayName.name||c.param("login")||f.login}})})(jQuery,window.Lego,BEM,BEM.blocks["i-global"]);(function(){var a=[];function b(){Lego.c("lego-ctr/p=show("+d(f())+")");a=[]}function e(h){var g=h.split("-");return g.join("(")+new Array(g.length).join(")")}function f(){var g=[];for(var m=0,n=a.length;m<n;m++){var p=a[m].split("-"),l=g;for(var k=0,o=p.length-1;k<o;k++){var h=p[k];if(!l[h]){l[h]=[];l.push(h)}l=l[h]}l.push(p[p.length-1])}return g}function d(h){var g="",m=[],j=[];for(var l=0;l<h.length;l++){var k=h[l];h[k]?m.push(k+"("+d(h[k])+")"):j.push(k)}m.length&&j.push(m.join(""));return j.join(",")}function c(g){var h="-"+BEM.blocks["i-global"].param("id");return g.indexOf(h,g.length-h.length)===-1?g+=h:g}BEM.DOM.decl("i-ctr",{onSetMod:{js:function(){this.setupShow();this.setupClick()}},setupShow:function(){var g=c(this.params.stat);a.push(g);a.length==1&&this.afterCurrentEvent(function(){b()})},setupClick:function(){var g=this.getMod("click");g?this.findBlockOn(g).on("click",function(){this.sendClick()},this):this.bindTo("mousedown",this.sendClick)},sendClick:function(g){Lego.c("lego-ctr/p=click("+e(c(this.params.stat))+")",g&&g.target&&g.target.tagName.toUpperCase()==="A"&&g.target)}})})();(function(){var c,b,d=function(){var e,f=0;while(e=c[f++]){e.val(e.elem("input").val())}},a=function(g){try{return g.activeElement}catch(f){}};BEM.DOM.decl("b-form-input",{onSetMod:{js:function(){var h=this,f=h.elem("input"),g=a(h.__self.doc[0]),e=h.params.autoFocus&&!(g&&$(g).is("input, textarea"));h._val=f.val();if(g===f[0]||e){h.setMod("focused","yes")._focused=true}if(!b){c=[];b=h.channel("sys").on({tick:d,idle:function(){b.un("tick",d)},wakeup:function(){b.on("tick",d)}})}h._instanceIndex=c.push(h.bindTo(f,{focus:h._onFocus,blur:h._onBlur}))-1;h.params.shortcut&&h.bindToDoc("keydown",function(i){if(i.ctrlKey&&i.keyCode==38&&!$(i.target).is("input, textarea")){h.setMod("focused","yes")}})},disabled:function(f,e){this.elem("input").attr("disabled",e=="yes")},focused:function(f,e){if(this.hasMod("disabled","yes")){return false}var g=e=="yes";g?this._focused||this._focus():this._focused&&this._blur();this.afterCurrentEvent(function(){this.trigger(g?"focus":"blur")})}},onElemSetMod:{message:{visibility:function(h,i,e){var j=this,g=j.getMod(h,"type");if(g){var f=true;e||j.elem("message","type",g).each(function(){this!=h[0]&&j.hasMod($(this),"visibility","visible")&&(f=false)});f&&j.toggleMod("message-"+g,"yes","",e==="visible")}}}},val:function(g,f){if(typeof g=="undefined"){return this._val}if(this._val!=g){var e=this.elem("input");e.val()!=g&&e.val(g);this._val=g;this.trigger("change",f)}return this},getSelectionEnd:function(){var i=this.elem("input")[0],g=0;if(typeof(i.selectionEnd)=="number"){g=i.selectionEnd}else{var h=document.selection.createRange();if(h&&h.parentElement()==i){var f=i.value.length,e=i.createTextRange();e.moveToBookmark(h.getBookmark());var j=i.createTextRange();j.collapse(false);g=e.compareEndPoints("EndToEnd",j)>-1?f:-e.moveEnd("character",-f)}}return g},name:function(e){return this.elem("input").attr("name")},_onFocus:function(){this._focused=true;return this.setMod("focused","yes")},_onBlur:function(){this._focused=false;return this.delMod("focused")},_focus:function(){var f=this.elem("input")[0];if(f.createTextRange&&!f.selectionStart){var e=f.createTextRange();e.move("character",f.value.length);e.select()}else{f.focus()}},_blur:function(){this.elem("input").blur()},destruct:function(){this.__base.apply(this,arguments);this.params.shortcut&&this.unbindFromDoc("keydown");c.splice(this._instanceIndex,1);var f=this._instanceIndex,e;while(e=c[f++]){--e._instanceIndex}}});BEM.HTML.decl("b-form-input",{onBlock:function(e){var f=e.param("id")||e.generateId();e.tag("span").tParam("id",f).tParam("has-clear",e.mod("has-clear")==="yes").tParam("type",e.mod("type")||"input").afterContent({elem:"box",tag:"span",content:{elem:"input",attrs:{value:e.param("value"),name:e.param("name"),id:f}}}).js(true)},onElem:{input:function(e){e.tag(e.tParam("type"))},label:function(e){e.tag("label").attr("for",e.tParam("id"))},box:function(e){if(e.tParam("has-clear")){e.afterContent({elem:"clear",tag:"span"})}},hint:function(e){e.tag("label").attr("for",e.tParam("id"))}}})})();(function(){var f,a=0,c=false,e=0,d=BEM.channel("sys"),b=50;BEM.decl("i-system",{},{start:function(){$(document).bind("mousemove keydown",function(){e=0;if(c){c=false;d.trigger("wakeup")}});this._tick()},_tick:function(){var g=this;d.trigger("tick",{counter:a++});if(!c&&(e+=b)>3000){c=true;d.trigger("idle")}f=setTimeout(function(){g._tick()},b)}}).start()})();BEM.DOM.decl("b-form-input",{onSetMod:{js:function(){this.__base.apply(this,arguments);(this._hasHint=!!this.elem("hint")[0])&&this.on("change",this._updateHint)._updateHint()},focused:function(){this.__base.apply(this,arguments);this._hasHint&&this._updateHint()}},_updateHint:function(){this.toggleMod(this.elem("hint-wrap"),"visibility","visible",!(this._focused||this.val()))}});(function(d,a,b){var e=b.blocks["i-https"],c=b.blocks["i-global"];a.block["b-domik"]=function(w){var g=this,t=g.find(".b-domik__social"),v=t.length&&b.DOM.extractParams(t[0])["b-domik__social"].size,l=arguments.callee,n=d('<input type="hidden" name="timestamp"/>'),u=this.attr("class").match(/\bb-domik_type_(\w+)\b/)[1],f=g.find(".b-domik__button .b-form-button:first").bem("b-form-button"),j={host:c.param("social-host"),providers:c.param("social-providers"),sprites:c.param("social-sprites")};if(t.length&&j.host){if(j.providers&&j.sprites){x(j.providers,j.sprites[v])}else{d.getJSON(j.host+"/providers2.jsonp?callback=?",function(z){x(z.providers,z.icon_sprites[v])})}var y=new a.block["i-social"];d(".b-domik__social-link").live("click",function(z){k();d(".b-domik__social-popup").each(function(){d(this).bem("b-popupa").hide()});y.start(function(){var A=c.param("retpath");(!A||top.location.href==A)?top.location.reload():(top.location.href=A)},function(){t.removeClass("b-domik__social_loading_yes").css("height","").find(".b-spin").bem("b-spin").delMod("progress")},{provider:b.DOM.extractParams(this)["b-domik__social-link"].provider});z.preventDefault()})}function x(B,A){if(!B.length){t.remove();return}t.html(m(B,A));var C=t.find(".b-dropdowna");if(!C.length){return}b.DOM.init(C);b.DOM.init(t.find(".b-spin"));var D=C.bem("b-dropdowna").getPopup();function z(){D.pos()}D.on("show",function(){d(window).scroll(z)}).on("hide",function(){d(window).unbind("scroll",z)})}function m(C,B){var D=[{block:"b-domik",elem:"social-title",content:b.I18N("b-domik","enter-with")}];C=d.grep(C,function(E){return E.enabled});var A=d.grep(C,function(E){return E.primary});A=d.map(A,function(E){return{block:"b-domik",tag:"a",elem:"social-link",content:{tag:"i",elem:"social-icon",attrs:{style:'background-image:url("'+B+'");background-position: 0px -'+(E.id-1)*32+"px;"}},js:{provider:E.code},attrs:{tabIndex:103}}});[].push.apply(D,A);function z(H){var G=d.map(H,function(J){return{block:"b-domik",tag:"a",elem:"social-link",mods:{},attrs:{tabIndex:103},js:{provider:J.code},content:[{tag:"i",elem:"social-icon",attrs:{style:'background-image:url("'+B+'");background-position: 0px -'+(J.id-1)*32+"px;"}},J.display_name]}});G.length%2&&(G[G.length]="");var F=[],I;for(var E=0;E<G.length;E++){E%2||F.push(I={tag:"tr",content:[]});I.content.push({tag:"td",elem:"provider",content:G[E]})}return F}if(A.length<C.length){D.push({tag:"div",block:"b-dropdowna",js:true,content:[{elem:"switcher",tag:"span",content:{tag:"a",block:"b-link",mods:{pseudo:"yes","is-bem":"yes"},js:true,attrs:{href:b.I18N("b-domik","passport-link"),tabIndex:103}}},{block:"b-popupa",js:{zIndex:"1"},tag:"div",mix:[{block:"b-dropdowna",elem:"popup"},{block:"b-domik",elem:"social-popup",mods:{type:u}}],content:[{elem:"tail",tag:"i"},{elem:"content",content:[{elem:"providers",tag:"table",content:z(C)}]}]}]})}D.push({block:"b-spin",js:true,mods:{size:u=="bigform"?"45":"27",theme:u=="bigform"?"white-45":"white-27","is-bem":"yes"},content:{block:"b-icon",tag:"img",attrs:{src:"//yandex.st/lego/_/La6qi18Z8LwgnZdsAr1qy1GwCwo.gif"}}});return b.HTML.build(D)}function k(){t.css("height",t.height()).addClass("b-domik__social_loading_yes").find(".b-spin").bem("b-spin").setMod("progress","yes")}l.isHTTPSSupported=false;g.append(n).submit(function(){var z=g.attr("action");f.setMod("disabled","yes");n.val(+new Date);if(z){a.block["b-domik"].isHTTPSSupported?/^http:/.test(z)&&g.attr("action",z.replace(/^http:/,"https:")):/^https:/.test(z)&&g.attr("action",z.replace(/^https:/,"http:"))}});var q=g.find("input[name=login]"),p=g.find("input[name=passwd]"),s=g.find("input[type=submit]");q.change(function(){var z=q.val();z.indexOf("@")==-1&&!(/^[a-z0-9A-Z!@#\$%\^&\*\(\)_\-\+:;\,\.]*$/i.test(z))?h(w&&w.err_msg||b.I18N("b-domik","wrong-keyboard-layout")):o()});q.change();p.change(function(){var z=p.val();z.length&&!(/^[0-9a-zA-Z`!@#\$%\^&\*\(\)_=\-\+\[\]\{\}:;"\,\.<>\\|\/\?]*$/i.test(z))?h(b.I18N("b-domik","wrong-keyboard-layout")):o()});p.change();var i;function h(z){!i&&(i=d('<div class="b-domik__error"/>').insertAfter(g.find(".b-domik__password")));i.text(z).show()}function o(){i&&i.hide()}l.enableHTTPS=function(){l.isHTTPSSupported=true};l.checkForHTTPS=e.checkForHTTPS;e.checkForHTTPS(function(){l.enableHTTPS()})}})(jQuery,window.Lego,BEM);(function(a){BEM.DOM.decl("b-domik",{onSetMod:{js:function(){this.bindTo("input","keyup",this._onChange)}},_onChange:function(b){a(b.target).trigger("change")}})}(jQuery));BEM.DOM.decl("b-spin",{onSetMod:{js:function(){this._size=this.getMod("size")||/[\d]+/.exec(this.getMod("theme"))[0];this._bgProp="background-position";this._posPrefix="0 -";if(this.elem("icon").css("background-position-y")){this._bgProp="background-position-y";this._posPrefix="-"}this._curFrame=0;this.hasMod("progress")&&this.channel("sys").on("tick",this._onTick,this)},progress:{yes:function(){this.channel("sys").on("tick",this._onTick,this)},"":function(){this.channel("sys").un("tick",this._onTick,this)}}},_onTick:function(){var a=++this._curFrame*this._size;(a>=this._size*36)&&(this._curFrame=a=0);this.elem("icon").css(this._bgProp,this._posPrefix+a+"px")},destruct:function(){this.channel("sys").un("tick",this._onTick,this);this.__base.apply(this,arguments)}});BEM.HTML.decl("b-icon",{onBlock:function(c){var b={src:"//yandex.st/lego/_/La6qi18Z8LwgnZdsAr1qy1GwCwo.gif",alt:""},f=c.params(),d=["alt","width","height"],e;f.url&&(b.src=f.url);while(e=d.shift()){f[e]&&(b[e]=f[e])}c.tag("img").attrs(b)}});(function(b,a){window.Lego||(window.Lego={block:{}});Lego.block["i-social"]=function(e){function g(l){var k=this,i={};this.url=l.startUrl+"?";delete l.startUrl;this.popupName=l.popupName;this.yaWindow=null;this.wTimer=null;this.paramsDefault=l;function n(){var o;if(!k.yaWindow){return true}try{o=k.yaWindow.closed}catch(p){o=true}return o}function m(){if(n()){k.wTimer=clearInterval(k.wTimer);k.onFailure({status:"error"})}}function h(y){var B=k.popupName,t=500,C=280,v=Math.round(((window.opera?window.innerWidth:screen.availWidth)-t)/2),z=Math.round(((window.opera?window.innerHeight:screen.availHeight)-C)/2),q="scrollbars=yes, resizable=1, menubar=0, toolbar=0, status=0, location=0, directories=0, left="+v+", top="+z+", width="+t+", height="+C;var u={};for(var x in k.paramsDefault){u[x]=k.paramsDefault[x]}for(var x in y){u[x]=y[x]}if(u.display&&u.display!="popup"){u.retpath=u.retnopopup||window.location.href}else{var A="ddom="+(u.ddom||(location.hostname==document.domain?"":document.domain));if("retnopopup" in u){delete u.retnopopup}u.retpath+=(u.retpath.match("#")?"&":"#")+A}var o=k.url;var s=[];for(var w in u){s.push(encodeURIComponent(w)+"="+encodeURIComponent(u[w]))}o+=s.join("&");if(u.display&&u.display!="popup"){window.location.href=o;return}k.yaWindow=window.open(o,B,q);k.yaWindow.focus();if(k.yaWindow){k.wTimer=setInterval(m,500)}}function j(){this.handlers={onSuccess:null,onFailure:null};k.wTimer=clearInterval(k.wTimer);n()||k.yaWindow.close();k.yaWindow=false}this.start=function(p,o,q){j();k.handlers={onSuccess:p,onFailure:o};h(q)};this.onSuccess=function(p){j();var o=k.handlers.onSuccess;o&&o.call(k,p)};this.onFailure=function(p){j();var o=k.handlers.onFailure;o&&o.call(k,p)}}arguments.callee.Broker=g;var f=a.param("id"),d=arguments.callee.defaultParams={startUrl:a.param("social-startUrl")||a.param("social-host")+"/broker/start",retpath:a.param("social-retpath")||location.protocol+"//"+location.host+a.param("lego-path")+"/blocks-desktop/i-social/closer/i-social__closer.html",retnopopup:a.param("social-retnopopup")||false,consumer:f||"morda",popupName:"social_"+(f||"morda"),application:"",action_if_anonymous:"authorize",result_location:"fragment"},c=arguments.callee.broker=new g(b.extend(d,e));return c}})(jQuery,BEM.blocks["i-global"]);BEM.DOM.decl("b-form-button",{onSetMod:{js:function(){var a=this.isDisabled();(this._href=this.domElem.attr("href"))&&a&&this.domElem.removeAttr("href");this.elem("input").attr("disabled",a)},focused:{yes:function(){var a=this;if(a.isDisabled()){return false}a.bindTo("keydown",this._onKeyDown).elem("input").is(":focus")||a.elem("input").focus();a._unloadInited||(a._unloadInited=$(window).bind("unload",function(){a.delMod("focused")}))},"":function(){this.unbindFrom("keydown").elem("input").blur()}},disabled:function(c,a){var b=a=="yes";this._href&&(b?this.domElem.removeAttr("href"):this.domElem.attr("href",this._href));b&&this.domElem.keyup();this.afterCurrentEvent(function(){this.domElem&&this.elem("input").attr("disabled",b)})},pressed:function(b,a){this.isDisabled()||this.trigger(a=="yes"?"press":"release")},hovered:{"":function(){this.delMod("pressed")}},"*":function(a){if(this.isDisabled()&&"hovered pressed".indexOf(a)>-1){return false}}},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(b){var a=b.keyCode;if((a==13||a==32)&&!this._keyDowned){this._keyDowned=true;this.setMod("pressed","yes").bindTo("keyup",function(){this.delMod("pressed").unbindFrom("keyup");delete this._keyDowned;if(a==32&&this.domElem.attr("href")){document.location=this.domElem.attr("href")}})}},_onClick:function(a){this.isDisabled()?a.preventDefault():this.afterCurrentEvent(function(){this.trigger("click")})},destruct:function(){this.delMod("focused");this.__base.apply(this,arguments)}},{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(c){var b=a[c.type];this.setMod(b.name,b.val||"")}).liveBindTo("mousedown",function(c){var b=a[c.type];c.which==1&&this.setMod(b.name,b.val||"")})}});BEM.HTML.decl("b-form-button",{onBlock:function(a){a.tag(a.param("url")?"a":"span").attrs({href:a.param("url"),target:a.param("target")}).mods({size:a.mod("size"),theme:a.mod("theme")}).content([{elem:"left",tag:"i"},{elem:"content",tag:"span",content:{elem:"text",tag:"span",content:a.content()}}],true).afterContent(a.param("type")?{elem:"input",attrs:{value:a.param("value")||"",type:a.param("type"),name:a.param("name"),disabled:a.mod("disabled")&&"disabled"}}:{elem:"click"}).js(true)},onElem:{input:function(a){a.tag("input")},click:function(a){a.tag("i")}}});BEM.DOM.decl({name:"b-domik",modName:"type",modVal:"popup"},{onSetMod:{js:function(){this.__base.apply(this,arguments);Lego.block["b-domik_type_popup"].call(this.domElem,this.params)}}});(function(c,a,b){a.block["b-domik_type_popup"]=function(j){var f=c(this),h=b.param("passport-host"),e;c(".b-head-userinfo__entry .b-link_pseudo_yes").click(function(k){k.preventDefault();setTimeout(function(){d()},0)});function d(l){if(!e){i()}l||(l=b.param("retpath"));var k="&from="+b.param("passport-msg")+"&retpath="+encodeURIComponent(l);f.attr("action",h+"/passport?mode=auth"+k);e.find(".b-domik__register .b-domik__link").attr("href",h+"/passport?mode="+(j.regMode||"register")+k);c(document).bind("keyup.b-domik",function(m){if(m.keyCode==27){g()}}).bind("click.b-domik",function(o){var n=c(o.target),m=n.parents().andSelf();if(n.is("input[type=button]")||m.index(e)==-1&&!m.is(".b-popupa")){g()}});e.hasClass("b-domik_position_popup-50-50")||window.scrollTo(0,0);e.show().find("input[name=login]").focus();c(document).trigger("show.b-domik_type_popup")}function g(){c(document).unbind(".b-domik");e.hide()}function i(){e=c(BEM.HTML.build({block:"b-domik",mods:{type:"popup"},js:{uniqId:j.uniqId},content:[{elem:"form",content:[{elem:"title",content:(j.title||BEM.I18N("b-domik","title"))},{elem:"username",content:{block:"b-form-input",id:"b-domik_popup-username",name:"login",mods:{theme:"grey",size:"m"},attrs:{tabindex:"11"},mix:[{block:"b-domik",elem:"input"}],content:[{elem:"hint-wrap",content:{elem:"hint",content:BEM.I18N("b-domik","login")}}]}},{elem:"password",content:{block:"b-form-input",id:"b-domik_popup-password",name:"passwd",mods:{theme:"grey",size:"m",type:"password"},attrs:{tabindex:"11"},mix:[{block:"b-domik",elem:"input"}],content:[{elem:"hint-wrap",content:{elem:"hint",content:BEM.I18N("b-domik","password")}},{block:"b-domik"}]}},{elem:"permanent",content:[{block:"b-form-checkbox",mods:{theme:"grey-m",size:"m",checked:"yes"},mix:[{block:"b-domik",elem:"check"}],checkboxAttrs:{id:"b-domik_popup-permanent",name:"twoweeks",value:"yes"}},{tag:"label",attrs:{"for":"b-domik_popup-permanent"},content:BEM.I18N("b-domik","permanent")}," ",{elem:"help",tag:"span",content:["(",{block:"b-link",url:BEM.I18N("b-domik","help-link"),attrs:{tabindex:12},content:BEM.I18N("b-domik","help")},")"]}]},{elem:"button",content:[{block:"b-form-button",mods:{theme:"grey-m",size:"m",valign:"middle"},type:"submit",attrs:{tabindex:11},content:BEM.I18N("b-domik","logon")},{block:"b-form-button",mods:{theme:"grey-m",size:"m",valign:"middle"},type:"button",attrs:{tabindex:11},content:BEM.I18N("b-domik","cancel")}]},{elem:"social",js:{size:16}},{elem:"register",content:{block:"b-link",mix:[{block:"b-domik",elem:"link"}],url:"",attrs:{tabindex:11},content:(j.register||BEM.I18N("b-domik","register"))}},{elem:"remember",content:{block:"b-link",mix:[{block:"b-domik",elem:"link"}],url:h+"/passport?mode=restore",content:BEM.I18N("b-domik","remember")}}]}]}));e.submit(function(k){k.preventDefault();f.find("input[name=login]").val(e.find("input[name=login]").change().val()).end().find("input[name=passwd]").val(e.find("input[name=passwd]").change().val()).end().find("input[name=twoweeks]").attr("checked",e.find("input[name=twoweeks]").attr("checked")||false).end().append('<input type="hidden" name="timestamp" value="'+ +new Date+'"/>').attr("action",a.block["b-domik"].isHTTPSSupported?f.attr("action").replace(/^(:?http:)?\/\//,"https://"):f.attr("action")).submit()});a.block["b-domik"]&&a.block["b-domik"].call(e);BEM.DOM.append(c("body"),e)}arguments.callee.login=function(){var k=arguments;setTimeout(function(){d.apply(this,k)},0)}}})(jQuery,window.Lego,BEM.blocks["i-global"]);BEM.HTML.decl({block:"b-domik",modName:"type",modVal:"popup"},{onBlock:function(a){a.tag("form").attr("action","post").wrapContent([{elem:"roof"},{elem:"shadow",content:a.content()},{elem:"under"}])},onElem:{roof:function(a){a.tag("i")},shadow:function(a){a.tag("table").wrapContent([{tag:"tr",content:[{elem:"shadow__lt",tag:"td",content:"&nbsp;"},{elem:"shadow__t",tag:"td"},{elem:"shadow__rt",tag:"td",content:"&nbsp;"}]},{tag:"tr",content:[{elem:"shadow__l",tag:"td",content:"&nbsp;"},{elem:"shadow__m",tag:"td",content:a.content()},{elem:"shadow__r",tag:"td",content:"&nbsp;"},]},{tag:"tr",content:[{elem:"shadow__lb",tag:"td",content:"&nbsp;"},{elem:"shadow__b",tag:"td"},{elem:"shadow__rb",tag:"td",content:"&nbsp;"}]}])},under:function(a){a.tag("iframe").attr("frameborder",0)}}});(function(){BEM.HTML.decl({block:"b-form-input",modName:"type",modVal:"password"},{onElem:{input:function(a){a.tag("input").attr("type","password")}}})}());BEM.DOM.decl("b-form-checkbox",{onSetMod:{js:function(){var d=this,a=d.elem("checkbox");try{var c=d.__self.doc[0].activeElement}catch(b){}d.setMod("checked",a.attr("checked")?"yes":"");c===a[0]&&d.setMod("focused","yes")},focused:{yes:function(){if(this.isDisabled()){return false}this.elem("checkbox").focus()},"":function(){this.elem("checkbox").blur()}},checked:function(b,a){this.elem("checkbox").attr("checked",a=="yes");this.elem("tick").attr("alt",((a=="yes")?" v":""));this.afterCurrentEvent(function(){this.trigger("change")})},disabled:function(b,a){this.elem("checkbox").attr("disabled",a=="yes")}},isDisabled:function(){return this.hasMod("disabled","yes")},isChecked:function(){return this.hasMod("checked","yes")},toggle:function(){this.toggleMod("checked","yes","")},val:function(b){var a=this.elem("checkbox");return b==undefined?a.val():a.val(b)},_onClick:function(a){if(a.button){return}this.isDisabled()||this.setMod("focused","yes")},_onChange:function(a){a.target.checked?this.setMod("checked","yes"):this.delMod("checked")}},{live:function(){this.liveBindTo("checkbox","click",function(a){this._onClick(a)}).liveBindTo("checkbox","change",function(a){this._onChange(a)}).liveBindTo("checkbox","focusin focusout",function(a){this.setMod("focused",a.type=="focusin"?"yes":"")});return false}});BEM.HTML.decl("b-form-checkbox",{onBlock:function(b){var a=b.param("checkboxAttrs")||{};b.js(true).mix(!b.mod("size")?[{block:"b-form-checkbox",mods:{size:"m"}}]:"").tag("span").tParam("checkboxAttrs",$.extend(a||{},{id:b.param("id")||a.id||$.identify(),checked:b.mod("checked")?"checked":undefined,disabled:b.mod("disabled")?"disabled":undefined})).beforeContent({elem:"inner",content:[{elem:"checkbox",attrs:b.tParam("checkboxAttrs")},{elem:"bg"}]})},onElem:{label:function(a){a.tag("label").attr("for",a.tParam("checkboxAttrs").id)},checkbox:function(a){a.tag("input").attrs($.extend(a.attrs(),{type:"checkbox"}))},bg:function(a){a.tag("i").content({elem:"tick"})},tick:function(a){a.tag("i")},inner:function(a){a.tag("span")}}});BEM.DOM.decl({name:"b-domik",modName:"type",modVal:"bigform"},{onSetMod:{js:function(){this.__base.apply(this,arguments);Lego.block["b-domik_type_bigform"].call(this.domElem,this.params)}}});(function(b,a){a.block["b-domik_type_bigform"]=function(d){var c=this;a.block["b-domik"]&&a.block["b-domik"].call(c);setTimeout(function(){c.find("input[name=login]").focus()},0)}})(jQuery,window.Lego);BEM.DOM.decl("b-hint-input",{onSetMod:{js:function(){Lego.block["b-hint-input"].call(this.domElem,this.params)}}});(function(b,a){a.block["b-hint-input"]=function(){var i=this,e=b("#"+i.attr("for")),g=function(){i.hide()},d=function(){i.show()},c=function(){h||e.val()?g():d()},h=false;e.bind("focus blur",function(j){h=j.type=="focus";c()}).bind("change mouseover",c);i.click(function(){e.focus()});e.change();var f=e.val();(function(){if(e.val()!=f){b(e).trigger("change");f=e.val()}setTimeout(arguments.callee,200)})()}})(jQuery,window.Lego);BEM.DOM.decl("b-pager",{onSetMod:{js:function(){if(!this.params.keydownReaction){return}var b=navigator.userAgent.match(/mac os x (\d+)[._](\d+)/i);if(b){var c=parseInt(b.pop(),10),a=parseInt(b.pop(),10);if(a>10||(a===10&&c>6)){this.__self.MODIFIER_KEY="altKey";this.elem("key").html(function(e,d){return d.replace("Ctrl","Alt")})}this.isMac=true}this.bindToDoc("keydown",this.onKeyDown)}},navigate:function(a){a&&(window.location.href=a)},onKeyDown:function(b){if(this.isMac&&(b.ctrlKey&&(b.metaKey||b.altKey))){return}if(!b.ctrlKey&&!b.altKey||$(b.target).is("input, textarea")||(b.ctrlKey&&b.shiftKey)){return}if(b[this.__self.MODIFIER_KEY]){var a=b.keyCode===37?this.elem("prev"):b.keyCode===39?this.elem("next"):null;a&&a.attr("href")&&this.navigate(a.attr("href"))}}},{MODIFIER_KEY:"ctrlKey"});(function(d){var c,b={},a=BEM.decl("i-loader",{},{load:function(n,f,k,h,g){if(typeof f!="string"){g=h;h=k;k=f;f=n}if(g===undefined&&h!==undefined&&typeof h!="function"){g=h;h=undefined}var o=b[n],i=this;if(o){if(o.successFns){o.successFns.push(k);h&&o.errorFns.push(h)}else{setTimeout(function(){k()},0)}return}var m=document,l=m.createElement("script"),j=function(){a._error(n)},e=f.split(".");if(d.browser.msie&&m.documentMode<=8){e.splice(-1,0,"ie")}if(g){e.splice(-1,0,typeof g=="string"?g:BEM.blocks["i-global"].param("lang"))}l.type="text/javascript";l.charset="utf-8";l.src=e.join(".");l.onerror=j;setTimeout(function(){(c||(c=d("head")[0])).insertBefore(l,c.firstChild)},0);b[n]={successFns:[k],errorFns:h?[h]:[],timer:setTimeout(j,20000)}},loaded:function(f){var j=b[f.id];clearTimeout(j.timer);f.js&&f.js();f.css&&a._appendCss(f.css);if(f.hcss){var i=[],e=window._ycssjs;f.hcss.forEach(function(k){if(e){if(k[0] in e){return}e(k[0])}i.push(k[1])});i.length&&a._appendCss(i.join(""))}var g=j.successFns,h;while(h=g.shift()){h()}delete j.successFns},_error:function(f){var h=b[f],e=h.errorFns,g;clearTimeout(h.timer);while(g=e.shift()){g()}delete b[f]},_appendCss:function(e){var f=document.createElement("style");f.type="text/css";c.insertBefore(f,c.firstChild);f.styleSheet?f.styleSheet.cssText=e:f.appendChild(document.createTextNode(e))}})})(jQuery);(function(a,c,b){a.DOM.decl("b-head-stripe",{onSetMod:{js:function(){var d=this.params.theme;this.hasMod("theme")?this._show():this._loadTheme(d,this._show)}},_install:function(f){f.preventDefault();var d=this.params.download_url;d&&(window.location=d)},_close:function(f){f.preventDefault();f.stopPropagation();var d=this.params.close_url;d&&((new Image()).src=d);this.domElem.animate({"margin-top":"-20px"},500);this.setMod("state","closed")},_loadTheme:function(f,h){if(!f){return}var g=this,e="b-head-stripe_theme_"+f,d=c.param("lego-static-host")+"/blocks-desktop/b-head-stripe/_theme/b-head-stripe_theme_"+f+".bembundle.js";a.blocks["i-loader"].load(e,d,h)},_show:function(){this._generateCounter().delMod("state")},_generateCounter:function(){var d=this.params.counter;d&&((new Image()).src=d);return this}},{live:function(){this.liveBindTo("close","leftclick",function(d){this._close(d)});this.liveBindTo("leftclick",function(d){this._install(d)});return false}})})(BEM,BEM.blocks["i-global"],jQuery);var i18n=i18n||{};(function(e,d){var a={},j=[],k="_",g="__",f="ru";function l(m){typeof m==="string"&&(m={block:m});return m.block+(m.elem?(g+m.elem):"")+(m.modName?k+m.modName+k+m.modVal:"")}function h(n){var m={};n.split(g).forEach(function(q,o){var p=[o?"elem":"block","mod","val"];q.split(k).forEach(function(t,s){m[p[s]]=t})});return m}function c(n){if(!n){return false}var m=j.length;return !(m&&j[m-1]===n)&&j.push(n)}function b(n){var m=j.length;return m&&j[m-1]!==n&&j.pop()}function i(){this._lang="";this._prj="lego";this._keyset="";this._key=""}i.prototype={lang:function(m){this._lang=m;return this},project:function(m){this._prj=m;return this},keyset:function(m){c(this._keyset);this._keyset=l(m);return this},key:function(m){this._key=m;return this},decl:function(p){var n=h(this._keyset),q=n.block==="i-tanker"?"tanker":this._prj,t=n.elem||this._keyset,s=this._key;q=i18n[q]||(i18n[q]={});t=q[t]||(q[t]={});t[s]=typeof p==="function"?p:(function(u){return(p)});var m=a[this._lang]||(a[this._lang]={}),o=m[this._keyset]||(m[this._keyset]={});o[s]=p},val:function(p,m){var n=a[this._lang]&&a[this._lang][this._keyset];if(!n){console&&console.log&&console.log("[Error] keyset: "+this._keyset+" key: "+this._key+" (lang: "+this._lang+")");return""}n=n[this._key];if(!n){return""}try{return typeof n==="string"?n:m?n.call(m,p):n.call(this,p)}catch(o){throw"[Error] keyset: "+this._keyset+" key: "+this._key+" (lang: "+this._lang+")"}},_c:function(){return a}};e.I18N=(function(n){var m=function(p,o,q){return m.keyset(p).key(o,q)};["project","keyset"].forEach(function(o){m[o]=function(p){this._i18n[o](p);return this}});m.key=function(p,t){var q=this._i18n,s,o;q.lang(this._currentLang).key(p);o=q.val.call(q,t,m);s=b(q._keyset);s&&q.keyset(s);return o};m.decl=function(o,t,q){var s=this._i18n,p;q||(q={});q.lang&&s.lang(q.lang);s.keyset(o);for(p in t){s.key(p).decl(t[p])}return this};m.lang=function(o){typeof o!=="undefined"&&(this._currentLang=o);return this._currentLang};m._i18n=n;m._currentLang=f;return m}(new i()));BEM=this.BEM=e})(typeof BEM==="undefined"?{}:BEM);BEM.I18N.decl("b-copyright",{link:function(a){return"ООО «"+a.content+"»"},yandex:"Яндекс"},{lang:"ru"});BEM.I18N.decl("b-domik",{"bigform-logo-alt":"Яндекс","bigform-logo-link":"http://www.yandex.ru","bigform-logo-url":"/blocks-desktop/b-domik/_type/b-domik_type_bigform__logo.png",cancel:"Отмена",help:"что это","help-link":"http://help.yandex.ru/passport/?id=922493",login:"логин",logon:"Войти",password:"пароль",permanent:"запомнить меня",register:"Зарегистрироваться",remember:"Напомнить пароль",title:"Вход","wrong-keyboard-layout":"смените раскладку","enter-with":"Войти при помощи","passport-link":"http://passport.yandex.ru/"},{lang:"ru"});BEM.I18N.decl("b-foot",{about:"О компании",advert:"Реклама",agreement:"Пользовательское соглашение",beta:"β-версия",design:"Дизайн","design-artlebedev":"Студия Артемия Лебедева","design-artlebedev-url":"http://www.artlebedev.ru",mobile:"Мобильная версия","services-button-value":"Перейти",stat:"Статистика",termsofuse:"Лицензия на поиск",vacancies:"Вакансии","yandex-is-local":"Яндекс локален","yandex-is-not-local":"Как сделать Яндекс локальным","terms-of-service":function(a){return},"privacy-policy":function(a){return},"copyright-notice":function(a){return}},{lang:"ru"});BEM.I18N.decl("b-head-line",{simple:"простой поиск"},{lang:"ru"});BEM.I18N.decl("b-head-logo",{yandex:"Яндекс"},{lang:"ru"});BEM.I18N.decl("b-head-name",{beta:"бета"},{lang:"ru"});BEM.I18N.decl("b-head-tabs",{more:"ещё",or:"или"},{lang:"ru"});BEM.I18N.decl("b-head-user",{"change-password":"Сменить пароль",passport:"Паспорт",profiles:"Мои профили"},{lang:"ru"});BEM.I18N.decl("b-head-userinfo",{enter:"Войти",exit:"Выход",help:"Помощь","my-services":"Мои сервисы",region:"Регион","search-label":"поиск","search-value":"Найти",setup:"Настройка"},{lang:"ru"});BEM.I18N.decl("b-statcounter__metrika",{JSERR_incorrectID:"Incorrect ID has been passed."},{lang:"ru"});BEM.I18N.decl("i-services",{"404":"404",admins:"Админы",adresa:"Адреса",advertising:"Реклама",afisha:"Афиша",all:"Все сервисы",api:"API",appsearch:"Поиск приложений",auto:"Авто",aziada:"Азиада",ba:"Баян",backapv:"Партнер Я.Карт",balance:"Баланс",bar:"Бар","bar-ie":"Бар для ИЕ","bar-ie9":"Бар для ИЕ9",bayan:"Баннеры Яндекса",blogmon:"Блогмонитор",blogs:"Блоги",bond:"Брак",books:"Книги",calendar:"Календарь",captcha:"ой...",cards:"Открытки",catalogwdgt:"Каталог виджетов",center:"Интранет",chrome:"Хром с поиском Яндекса",city:"Города",cityday:"День города",collection:"Коллекция",company:"Компания",contest:"Contest",desktop:"Персональный поиск",diary:"Этушка",direct:"Директ","direct.market":"Маркет",disk:"Диск",doc:"Документация",ege:"ЕГЭ",expert:"Эксперт",feedback:"Обратная связь",ff:"ФФ с поиском Яндекса",fotki:"Фотки",games:"Игрушки",gap:"Планировщик отсутствий",geocontext:"Геоконтекст",goroda:"Города",help:"Помощь",i:"Мои сервисы",ie:"ИЕ с поиском Яндекса",images:"Картинки","images-com":"Картинки",interests:"Интересы",internet:"Интернет","intranet-passport":"Внутренний паспорт",jabber:"Джаббер","jams-arm":"АРМ экспертов Яндекс.Пробок",jing:"Джинг",jira:"Jira",job:"Job-jira",keyboard:"Клавиатура",kraski:"Краски",kuda:"Куда все идут",large:"Яндекс для слабовидящих",legal:"Правовые документы",lego:"Лего",lenta:"Лента",libra:"Библиотека",literacy:"Неделя борьбы за грамотность",local:"Локальная сеть",lost:"Незабудки",love:"День взаимного тяготения — 13 августа",lunapark:"Лунапарк",mail:"Почта",maillists:"Рассылки",maps:"Карты","maps-wiki":"Народная карта",market:"Маркет","market.advertising":"Маркет",metrika:"Метрика",metro:"Метро",mobile:"Мобильный",moikrug:"Мой Круг",money:"Деньги",museums:"Дни исторического и культурного наследия",music:"Музыка","music-partner":"Музыка: статистика",nahodki:"Мои находки",nano:"Нано",narod:"Народ",news:"Новости",oauth:"Авторизация",online:"Онлайн",openid:"OpenID",opera:"Opera Software",opinion:"Цитаты",otrs:"OTRS",partners:"Рекламная сеть",partnersearch:"Поиск для партнеров",passport:"Паспорт",pdd:"Почта для домена",peoplesearch:"Поиск людей",perevod:"Перевод",planner:"Переговорки",probki:"Пробки",projects:"Проекты",pulse:"блоги: пульс",punto:"Punto switcher",pvo:"Ответы",rabota:"Работа",rasp:"Расписания",realty:"Недвижимость",referats:"Рефераты",rk:"Есть вопросы?",root:"Яндекс.Олимпиада для Unix администраторов",school:"Школа",search:"Поиск",server:"Сервер",site:"Поиск для сайта",slovari:"Словари",so:"Самооборона",social:"Социализм",soft:"Программы",sprav:"Справочник",staff:"Стафф",start:"Стартовая страница",stat:"Статистика",statface:"Статистика",subs:"Подписки",taxi:"Такси",terms:"Разговорник",tests:"Тесты и опросы",time:"Яндекс.Время",toster:"Тосты",translate:"Перевод",tune:"Настройки",tv:"Телепрограмма",uslugi:"Услуги",video:"Видео","video-com":"Видео",videoteka:"Видеотека",wdgt:"Виджеты",weather:"Погода",webmaster:"Вебмастер",widgets:"Виджеты",wiki:"Вики",wordstat:"Статистика",wow:"Я.ру",www:"Поиск",xmlsearch:"XML",yaca:"Каталог",yamb:"Медийные баннеры",zakladki:"Закладки",newhire:"Наниматор",access:"Доступ",sport:"Спорт"},{lang:"ru"});BEM.I18N.lang("ru");function BlogCompose(){this.form=null;this.defaultHeight=0;this.inplace=null}BlogCompose.prototype.init=function(b){this.form=b;this.form.reset();var a=document.getElementById("formBody"),c=this;if(a&&window.MozillaInplace){iTextAreaDefaultHeight=a.offsetHeight;a.onkeyup=a.onkeypress=function(){if(this.value.length){if(c.inplace){var d=c.inplace.getHeight()+50;this.style.height=d>c.defaultHeight?d:c.defaultHeight}}else{this.style.height=c.defaultHeight}};this.inplace=new MozillaInplace("formBody","hook")}};BlogCompose.prototype.checkSubmitForm=function(){$(this.form).find("input[name='title'],input[name='URL'],input[name='email']").each(function(){if($(this).hasClass("b-input-empty")){this.value=""}});$(this.form).find("input[name='URL']").each(function(){if(this.value!=""&&(!/^\w+:\/\//.test(this.value))){this.value="http://"+this.value}})};BlogCompose.prototype.saveFromW5g=function(){if((typeof tinyMCE!=="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.destroyed){tinyMCE.activeEditor.save()}};BlogCompose.prototype.sanitize=function(){if(this.form){this.checkSubmitForm();this.saveFromW5g()}};$(document).ready(function(){window.blogCompose=new BlogCompose();var a=document.getElementById("post");if(a){blogCompose.init(a);if(window.tinyMCE){w5ginit();window.w5GControl=new W5GControl(a,"w5g",g_globals.current_location.page=="posts_add_text")}}});(function(b){var a=b.ya||{};a.isShowLog=a.devMode=false;a.log=function(c){if(a.isShowLog&&b.console&&b.console.log){console.log(c)}};a.error=function(c,d){if(c instanceof Object&&c&&a.devMode){var e=c.info&&a.devMode?c.info:"";alert(e+d)}};a.random=function(){return String(Math.random()).substr(2,12)};a.onReadyNamespace=function(i,j){var d=i.split("."),k=null,h=(arguments.length>2)?arguments[2]:5000,c=0,f=500;var g=function(m,l){return m[l]||null};var e=function(){for(var n=0,m=d.length;n<m;n++){if(n===0&&d[n]==="window"){continue}else{k=g(k?k:b,d[n]);if(!k){if(c<h){c+=f;b.setTimeout(arguments.callee,f)}return}}}j(k)};e()};a.ready=a.onReadyNamespace;a.insistentCallback=function(d){var f=0,e=500;timeout=(arguments.length>1)?arguments[1]:5000;var c=function(g){try{g()}catch(i){var h=arguments.callee;if(f<timeout){f+=e;b.setTimeout(function(){h(g)},e)}}};c(d)};a.getParams=function(){return b.g_globals};a.getParamsFromAttr=function(e,c){var d=d||"onclick";return e[d]&&"function"===typeof e[d]?e[d]():null};a.getId=function(c){if(!c.id){c.id="id"+a.random()}return c.id};a.getIdSelector=function(c){return"#"+a.getId(c)};a.bindSelector=function(d,c){if(c.match(/^\./)){$(d).addClass(c.substring(1))}};a.unbindSelector=function(d,c){if(c.match(/^\./)){$(d).removeClass(c.substring(1))}};a.replaceSelector=function(d,c,e){$(d).removeClass(c.substring(1)).addClass(e.substring(1))};a.instances=function(){var c={};return{push:function(d){if(d instanceof Object&&d.info){c[d.info]=d}},list:function(){return c},getById:function(d){return Boolean(c[d])}}}();a.forceRedraw=function(d){d=d||null;if(d&&d.nodeType&&d.nodeType===1&&!d.nodeName.match(/body/i)){d.style.display="none";var c=d.offsetHeight;d.style.display="block"}};a.xmlEscape=function(c){return !c?c:c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};a.xmlDecode=function(c){return !c?c:c.replace(/&#39;/g,"'").replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")};a.support_columns=function(e){var c=$(e);if(c.length<1){return false}var d=c[0].style;return(d.columnWidth!==undefined||d.MozColumnWidth!==undefined||d.WebkitColumnWidth!==undefined)}})(window);ya.loadScript=function(b,c,a){var a=arguments.length>2?arguments[2]:true;return CJS.execScript((a?b:b+"?yr="+ya.random()),c)};(function(a){a.url=function(b,d){loc=d||location;if(loc.protocol&&loc.host&&loc.pathname){var c=loc.pathname.match(/\/([\w-]+)\//);return(loc.protocol+"//"+loc.host+"/"+(loc.host.match(/^clubs/)&&c?c[1]+"/":"")+b)}}})(ya);ya.processTemplate=function(j,d){var g=d||{},l=[],i="",e,a=/\{\((\w*)\)(\(|\[)/g,k=/\{\((\w*)\)(\(|\[)|\)(?:\}|\[)/g,b=/\{\((\w*)\)(\(|\[)|\]\}/g,c=0,h=0,f={drop:-1,regexp:a};while(e=f.regexp.exec(j),e!==null){h=f.regexp.lastIndex;if(f.drop===-1){i+=j.substr(c,h-c-e[0].length)}c=h;if(e[1]){l.push({drop:f.drop,regexp:f.regexp});if(f.drop===-1){f.drop=g[e[1]]?-1:1}else{f.drop=0}if(e[2]==="["){f.regexp=b;f.drop=-f.drop}else{f.regexp=k}}else{if(e[0]===")["){f.drop=-f.drop;f.regexp=b}else{f=l.pop()}}f.regexp.lastIndex=h}i+=j.substr(h);return i.replace(/\{\s*([^{}\s]*)\s*\}/g,function(n,m){var o=g[m];return typeof o==="string"||typeof o==="number"?o:n})};(function(b){var a=function(g){var e=[],f;for(f in g){e.push(g[f])}return e},c=function(g,e){var f,h;if(!g){return e}g=g.split(".");for(f=0,h=g.length;f<h;f++){e=e[g[f]]}return e},d=function(e,j){var f=e.lastIndexOf("."),h=e.substr(0,f),g=c(h,window);return g[e.substr(f+1)].apply(g,a(j))};b.drawArray=function(f,k,j){var h,l,e="",g;for(h=0,l=f.length;h<l;h++){g=f[h].template||j;e+=b.drawObject(f[h],k,g)}return e};b.drawObject=function(f,k,j){var e,h;if(f instanceof Array){return b.drawArray(f,k,j)}else{if(typeof f!=="object"){return f}}var g;for(h in f){g=h.indexOf("@");if(g!==-1){e=h.substr(g+1);if(f[h] instanceof Array){f[h.substr(0,g)]=b.drawArray(f[h],k,e)}else{f[h.substr(0,g)]=b.drawObject(f[h],k,e)}delete f[h]}}if(!j){return f}if(j.indexOf("func:")===0){return d(j.substr(5),f)}else{return c(k,b.templates)[j](f)}}})(ya);
/*!
* Copyright (c) 2010, Yahoo! Inc. All rights reserved.
* Code licensed under the BSD License:
* http://developer.yahoo.com/yui/license.html
* version: 2.8.2r1
*/
ya.namespace=function(){var b=arguments,g=null,e,c,f;for(e=0;e<b.length;e=e+1){f=(""+b[e]).split(".");g=ya;for(c=(f[0]=="ya")?1:0;c<f.length;c=c+1){g[f[c]]=g[f[c]]||{};g=g[f[c]]}}return g};ya.addParams=function(a,b){$.each(b,function(c,d){var e=new RegExp("("+c+"\\=)\\w+","gi");if(a.match(e)){a.replace(e,"$1"+d)}else{a+=(a.match(/\?/g)?"&":"?")+c+"="+encodeURI(d)}});return a};ya.queue={queues:{},add:function(a,c){var b=ya.queue.queues;b[a]=b[a]||[];b[a].push(c)},exec:function(f,c){var d,e,a;if(!ya.queue.queues[f]){return false}e=ya.queue.queues[f];a=e.length;if(!c){c=document}for(d=0;d<a;d++){try{e[d](c)}catch(b){ya.log("не могу выполнить функцию №"+d+", потому что "+b)}}}};(function(a,c){var b=function(){if(arguments.length){var d=arguments[0],e=arguments[1];if(e){return function(f){return a.processTemplate(d,c.extend({},e,f))}}else{return function(f){return a.processTemplate(d,f)}}}};a.namespace("template");a.template=b})(window.ya,jQuery);(function(c,a){var b=a.template;a.namespace("templates");c.extend(a.templates,{user:{Ya:b(['{userpic}<b class="b-user">','<a class="b-user__link" href="{url}">{userWithUpperLetter}</a></b>'].join(""),{userpic:""}),Social:b(['<b class="b-user b-user_social_yes b-user_provider_{provider}">','<a class="b-user__link" href="{url}"><i class="b-user__provider-ico"></i>{name}</a></b>'].join("")),Light:b(['<b class="b-user b-user_provider_yandex" title="{title}">','<i class="b-user__provider-ico"></i>{name}</b>'].join("")),Qu:b("<sup>{qu}</sup>"),userWithUpperLetter:b('<b class="b-user__first-letter">{firstPart}</b>{secondPart}')},error:b('<div class="b-error b-notify b-notify_type_error" style="position:absolute">{text}</div>'),loader:b('<div class="b-candy b-candy_state_on" style="width: 5.4em;"/>'),userpicSmall:b('<a class="b-userpic b-userpic_type_small" href="{url}"><img src="{userpicURL}" class="b-userpic__img"><i class="b-userpic__i"></i></a>&#160;'),"lego.b-form-button":b(['<span class="b-form-button b-form-button_theme_{theme} b-form-button_size_{size} i-bem" role="button">','<i class="b-form-button__left"></i>','<span class="b-form-button__content">','<span class="b-form-button__text">{title}</span>',"</span>",'<input hidefocus="true" type="{type}" value="{value}" name="{name}" class="b-form-button__input {cssclass}" tabindex="1"/>',"</span>"].join(""),{theme:"grey-s",size:"s",type:"submit",cssclass:""}),"lego.b-form-button.link":b(['<a href="{url}" class="b-form-button b-form-button_theme_{theme} b-form-button_size_{size} b-form-button_valign_middle" role="button">','<i class="b-form-button__left"></i>','<span class="b-form-button__content">','<span class="b-form-button__text">','<xsl:value-of select="{title}"/>',"</span>","</span>",'<i class="b-form-button__click"></i>',"</a>"].join(""),{title:"",theme:"grey-s",height:"s",url:""}),popupLoader:b('<img src="{imgbase}ajax-loader.gif" />',{imgbase:g_globals.img_base})})})(window.jQuery,window.ya);(function(a){a.getViewUserByType=function(b,f,h,i){if(arguments.length){f=f||"Yaru";h=h||false;i=i||"im";switch(f){case"Social":b.name=a.xmlEscape(b.name);return a.templates.user.Social(b);case"Light":b.name=a.xmlEscape(b.name);if(!b.title){b.title="Пользователь без страницы на Яру"}return a.templates.user.Light(b);default:var e=(b.title_inflections&&b.title_inflections[i])||b.name||b.title||b.login;if(!e){return{im:"аноним",rod:"анонима",dat:"анониму",vin:"анонима",tvor:"анонимом",pred:"анониме"}[i]}var g=new RegExp("^(\\W*?)(\\w|[\\u00a0-\\uffff]|\\S(?!.*\\w))(.*)$"),d=e.match(g);if(d){var c=b.url?b.url:friendsFullURL(b);$.extend(b,{userWithUpperLetter:a.templates.user.userWithUpperLetter({firstPart:a.xmlEscape(d[2]),secondPart:a.xmlEscape(d[3])}),qu:"",url:c,userpic:h?a.templates.userpicSmall({url:c,userpicURL:b.picture_url+"small"}):""});return a.templates.user.Ya(b)}}}}})(ya);if(ya.devMode){$(document).ready(function(){ya.loadScript(g_globals.static_base+"/js/_ya.devMode.js")})}var search_settings={order:["diary_posts","club_posts","posts","my_diary_posts","diary","club","internet"],items:{diary:{key:"diary",title:"дневник",form:{action:"search_users_by_name.xml",params:[{name:"search_type",type:"hidden",value:"diary"}]}},posts:{key:"posts",title:"в я.ру",form:{action:"search_posts.xml",params:[{name:"search_type",type:"hidden",value:"posts"}]}},club:{key:"club",title:"клуб",form:{action:"search_clubs_by_name.xml",params:[{name:"search_type",type:"hidden",value:"club"}]}},internet:{key:"internet",title:"в интернете",form:{action:"http://yandex.ru/yandsearch",params:[{name:"search_type",type:"hidden",value:"internet"}]}}},cssSelectors:{container:".b-multisearch-container",selector_arrow:".darr",selector_with_value:".selected_value",inputFocus:".b-multisearch-focus",popupActive:".b-multisearch-popup-active",popup:".b-ya-search-p",popup_visible:".b-multisearch-popup-visible",popup_item:".b-ya-search-p-i",popup_item_selected:".b-dropdown__item-selected",bindedClassName:".b-multisearch-input",form_item:".b-ya-search-input"},templates:{darr:'<a class="{selector_arrow}" href="#">&#160;</a>',form_item:'<input class="{form_item}" type="{type}" name="{name}" value="{value}" />',popup:['<div class="b-dropdown__popup {popup}">','<iframe class="b-dropdown__iframe" frameborder="0" src="javascript:\'<body style=background:none;overflow:hidden>\'"></iframe>','<ul class="b-dropdown__list">{popup_items}</ul></div>'].join(""),popup_item:'<li class="b-dropdown__item {popup_item}"><a class="b-pseudo-link" onclick="return {\'type\':\'{key}\'}" href="#">{title}</a></li>',popup_item_selected:'<li class="b-dropdown__item {popup_item} {popup_item_selected}"><a class="b-pseudo-link" onclick="return {\'type\':\'{key}\'}" href="#">{title}</a></li>'}};(function(b,d){var e=function(f,h){var g=null;d.each(f,function(k,l){var j=l[h.name]&&l[h.name]==h.value;if(l[h.name]&&l[h.name]==h.value){g=l}});return g};var c=function(f){return f.replace(/\./,"")};var a=function(i,g){var f=this;this.$bindedElement=d(i);this.$bindedForm=this.$bindedElement.parents("form");this.$bindedElement.attr("autocomplete","off");this.options=d.extend({},this.options,g);this.$container=this.$bindedForm.find(this.options.cssSelectors.container);this.options.htmlSelectors={};d.each(this.options.cssSelectors,function(k,l){f.options.htmlSelectors[k]=c(l)});this.$popupElement=null;this.selectedItem=null;this.$container.append(ya.processTemplate(this.options.templates.darr,this.options.htmlSelectors));var j=e(this.options.items,{name:"selected",value:true});var h=function(k){f.$bindedElement.attr("title",k.title);f.selectedItem=k;f.prepareForm(k,f.options.templates.form_item)};if(j){h(j)}f.initChooser();f.initFocusChanger()};a.prototype.setDefaultValue=function(){this.$bindedElement[0].value=this.$bindedElement.attr("title")};a.prototype.initFocusChanger=function(){var f=this,h=f.options.cssSelectors,k=f.options.htmlSelectors;var g=function(){if(f.$bindedElement.attr("title")===f.$bindedElement[0].value){f.$bindedElement[0].value=""}f.$bindedForm.addClass(k.inputFocus)};if(f.$bindedElement.val()){g()}else{f.setDefaultValue()}var j=function(){f.$bindedForm.removeClass(k.popupActive).removeClass(k.inputFocus);f.setDefaultValue()};var i=function(){if(!f.$bindedElement[0].value.length&&f.$bindedElement.attr("title")!=f.$bindedElement[0].value&&!f.$bindedForm.hasClass(k.popupActive)){j()}};f.$bindedElement.focus(function(l){g()}).blur(function(l){window.setTimeout(i,200)})};a.prototype.prepareForm=function(k,g){var j=k.form,f=this,i=f.options.cssSelectors,l=f.options.htmlSelectors;if(!/^https?\:\/\//.test(j.action)){j.action=window.ya.base+j.action}ya.log(j.action);this.$bindedForm[0].action=j.action;this.$bindedForm.find(i.selector_arrow).text(k.title).addClass(l.selector_with_value);var h=function(m){if(m.useExisted){f.$bindedElement[0].name=m.name}else{if(f.$bindedForm[0][m.name]){f.$bindedForm[0][m.name].value=m.value}else{m.form_item=l.form_item;f.$bindedForm.prepend(ya.processTemplate(g,m))}}};d(i.form_item).remove();if(j.params){d.each(j.params,function(m,n){h(n)})}return true};a.prototype.initChooser=function(){var f=this,h=f.options.cssSelectors,k=f.options.htmlSelectors,g=f.$container.children(h.selector_arrow);var j=function(){if(f.$popupElement){f.$bindedElement[0].focus();f.$bindedForm.removeClass(k.popupActive);f.$popupElement.remove();f.$popupElement=null}};var i=function(){f.$popupElement=f.createPopup();f.$bindedForm.addClass(k.popupActive);var l=f.$popupElement.find(h.popup_item);l.click(function(n){var p=ya.getParamsFromAttr(n.target,"onclick");var o=p.type;var m=e(f.options.items,{name:"key",value:o});if(m){f.setSelectItem(m)}if(f.prepareForm(m,f.options.templates.form_item)){j()}});d(document).keydown(function(m){if(m.keyCode==27&&!(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)){j()}}).click(function(m){if(!d(m.target).is(h.selector_arrow)&&!d(m.target).is(h.popup)){j()}})};g.click(function(){if(f.$popupElement){j()}else{i()}})};a.prototype.setSelectItem=function(f){this.$bindedForm.find(this.options.cssSelectors.selector_arrow).html(f.title);this.selectedItem=f};a.prototype.createPopup=function(){var g=this,i=g.options.cssSelectors,m=g.options.htmlSelectors,j=g.options.templates;if(g.$bindedForm.children(i.popup)[0]){return}var f=e(g.options.items,{name:"default",value:true});var h=function(){var n=[];d.each(g.options.order,function(q,p){var s=g.options.items[p];if(s){var o=(g.selectedItem&&s.key===g.selectedItem.key)?ya.processTemplate(j.popup_item_selected,m):ya.processTemplate(j.popup_item,m);n.push(ya.processTemplate(o,s))}});return n.join("")}();g.$container.append(ya.processTemplate(j.popup,{popup_items:h,popup:m.popup}));var l=g.$bindedForm.find(i.popup),k=g.$bindedForm.find(i.selector_arrow).offset();return l};b.MultiSearch=a})(window,jQuery);$(document).ready(function(a){$(document).delegate(".b-login-popup","click",function(b){if(Lego&&Lego.block&&Lego.block["b-domik_type_popup"]&&Lego.block["b-domik_type_popup"].login&&Lego.block["b-domik_type_popup"].login instanceof Function){Lego.block["b-domik_type_popup"].login();b.preventDefault();b.stopPropagation()}})});(function(a){var b="i-hidden";a.fn.extend({yhide:function(){var c=arguments[0]||this;if(c instanceof a){return c.addClass(b)}},yshow:function(){var c=arguments[0]||this;if(c instanceof a){return c.removeClass(b)}},ytoggle:function(){var c=arguments[0]||this;if(c instanceof a){c.each(function(){var d=a(this);if(d.hasClass(b)){d.yshow()}else{d.yhide()}});return c}}})})(jQuery);(function(b,a){a.namespace("controls");a.controls.ChooseControlPermission=function(){this.controlSelector=".b-choose-permission";this.exportSelector=".b-export-item";var d=this;d.exportElements=[];var c=function(h){b.each(d.exportElements,function(j,k){k.disabled=h})};var g={"public":function(){c(false)},all_friends:function(){c(true)},"private":function(){c(true)}};var f=function(h){g[this.value].call(this)};var e=function(){b(d.exportSelector).each(function(h,j){d.exportElements.push(j)});b(d.controlSelector+":checked").each(f);b(d.controlSelector).bind("click",f)};return{init:e}};b(a.controls.ChooseControlPermission).trigger("ready")})(jQuery,ya);var targetNS=window.ya;(function(a,b){a.namespace("templates");a.templates.popup=a.template(['<div class="i-popup i-popup_autoclosable_yes i-popup_visibility_hidden" id="{id}">','<iframe class="i-popup__under b-popupa__under"></iframe>','<div class="i-popup__content">','<div class="b-popupa b-popupa_theme_ffffff b-popupa_direction_down b-dropdowna__popup_color_black b-dropdowna__popup_type_actions b-dropdowna__popup">','<i class="b-popupa__tail" style="margin-left: 3.5px; margin-top: -10px; "><i class="b-popupa__tail-i"></i></i>','<i class="b-popupa__shadow"></i>','<table class="b-popupa__wrap" cellpadding="0" cellspacing="0"><tbody><tr>','<td class="b-popupa__wrap-cell"><div class="b-popupa__content {contentClass}">{content}',"</div></td></tr></tbody></table>","</div>","</div>","</div>"].join(""))})(targetNS,jQuery);(function(a,d){var c=function(f){this.params=d.extend({id:"#id"+ya.random(),content:"",target:ya.getIdSelector(d("body")[0]),direction:"down"},f);this.info="Popup "+this.params.id+":";this.init()},b=10,e=9;c.prototype={bindTo:function(f){this.contextElementId=f;this.rebind()},selectors:{body:".b-popupa",content:".b-popupa__content",tail:".b-popupa__tail",visible:".i-popup_visibility_visible",hidden:".i-popup_visibility_hidden"},generatePopup:function(){var f=a.templates.popup({id:this.params.id.substring(1),content:this.params.content,contentClass:this.params.contentClass||""});d(this.params.target).append(f)},getAvailableDirections:function(k,h,t,v,n){var p=d(window).width(),j=d(window).height(),m=k.top-(window.pageYOffset?window.pageYOffset:document.body.scrollTop)-t,s=j+(window.pageYOffset?window.pageYOffset:document.body.scrollTop)-k.top-n-t,g=k.left-h,q=p-k.left-v-h,u,i,l=h/2,f=t/2,o={};m=m<0?-m:0;s=s<0?-s:0;g=g<0?-g:0;q=q<0?-q:0;u=(l>g?0:g-l)-(l>q?0:q-l);i=(f>m?0:m-f)-(f>s?0:s-f);if(Math.abs(u)<l){u-=l;if(!m){o.up=u}if(!s){o.down=u}}if(Math.abs(i)<f){i-=f;if(!g){o.left=i}if(!q){o.right=i}}return o},setCoordinates:function(n,p,k,i,q,s,o){var t=s/2,j=o/2,h=k.left,m=k.top,f=0,g=0,l;if(n==="up"){h+=p+t-e;m-=q+b;f=-p}else{if(n==="down"){h+=p+t-e;m+=o+b;f=-p;g=-b}else{if(n==="left"){h-=i+e;m+=p+j-b;g=-p}else{if(n==="right"){h+=s+e;m+=p+j-b;f=-e;g=-p}}}}d(this.params.id).css("top",m).css("left",h).find(this.selectors.tail).css("margin-left",f).css("margin-top",g);l=d(this.params.id).find(this.selectors.body)[0];l.className=l.className.replace(/b-popupa_direction_\w*/,"b-popupa_direction_"+n);this.lastDirection=n},rebind:function(){var g=d(this.contextElementId),j=g.offset(),f=d(this.params.id),h=f.width(),m=f.height(),n=g.width(),l=g.height(),i=this.getAvailableDirections(j,h,m,n,l),k=this.lastDirection||this.params.direction;if(i[k]!==undefined){this.setCoordinates(k,i[k],j,h,m,n,l)}else{for(k in i){this.setCoordinates(k,i[k],j,h,m,n,l);break}}a.log(this.info+"rebind")},attachHideEvents:function(){var f=this;d(this.contextElementId).bind("click.popup",function(g){f.hide();g.stopPropagation();return false});d(window).bind("resize.p"+this.params.id+" scroll.p"+this.params.id,function(){f.rebind()});window.setTimeout(function(){d("html").bind("click.popup",{popup:d(f.params.id)[0]},function(h){var g=h.target;while(g){if(g===h.data.popup){return}g=g.parentNode}f.hide()})},0)},detachHideEvents:function(){d("html").unbind("click.popup");d(window).unbind("resize.p"+this.params.id+" scroll.p"+this.params.id);d(this.contextElementId).unbind("click.popup")},show:function(f){this.hidden=false;this.rebind();ya.replaceSelector(this.params.id,this.selectors.hidden,this.selectors.visible);this.attachHideEvents()},hide:function(f){this.hidden=true;this.lastDirection=undefined;this.detachHideEvents();ya.replaceSelector(this.params.id,this.selectors.visible,this.selectors.hidden)},toggleView:function(){a.log(this.info+"toggleView: isHidden?"+this.hidden);if(this.hidden){this.show()}else{this.hide()}},update:function(f,g){d(this.params.id).find(this.selectors.content).html(f);this.bindTo(g||this.contextElementId)},init:function(){this.generatePopup();this.hidden=true},getId:function(){return this.params.id}};a.Popup=c})(targetNS,jQuery);(function(a,b){a.namespace("templates");a.templates.menuList=a.template(['<div class="b-menu b-menu_layout_vert b-menu_preset_vmenu">','<ul class="b-menu__layout-vert">{items}</ul>',"</div>"].join(""));a.templates.menuItem=a.template(['<li class="b-menu__layout-cell b-menu__layout-vert-cell">','<div class="b-menu__item">','<a class="b-link" href="{url}">{title}</a>',"</div>","</li>"].join(""))})(ya,jQuery);(function(a,c){var b=function(d){this.element=a.getIdSelector(d);this.params=a.getParamsFromAttr(d,"onclick");this.controlInfo="Menu "+this.element+": ";a.log(this.controlInfo+"init");this.attachEvents()};b.prototype={popupInit:function(){a.log(this.controlInfo+"popupInit");var f=this;for(var h=0,g="",e=f.params.items,d=e.length;h<d;h++){g+=a.templates.menuItem(e[h])}f.popup=new a.Popup({content:a.templates.menuList({items:g}),direction:"right"});f.popup.bindTo(c(f.element))},attachEvents:function(){var d=this;c(this.element).bind("click",function(f){if(!d.popup){d.popupInit()}d.popup.toggleView()})}};a.namespace("controls");a.controls.Menu=b;a.queue.add("onload",function(d){c(d).find(".b-control-menu").each(function(e,f){a.instances.push(new a.controls.Menu(f))})})})(ya,jQuery);var targetNS=window.ya;(function(b,c){b.namespace("templates");var a=b.template;b.templates.vote={itemVote:a(['<div class="b-poll">','<div class="b-poll__item">','<label class="b-poll__label">{input}<i class="b-poll__label-i">{title}</i></label>',"</div>","</div>"].join("")),itemResult:a(['<div class="b-poll__item">','<div class="b-poll__answer">','<div class="b-poll__result">','<div class="b-poll__result-graph" style="width: {percent}%"/>',"</div>{title}",'<span class="b-poll__num">{count}</span>',"</div>","</div>"].join("")),itemVoteSingle:a('<input type="radio" class="b-poll__input" name="vote-for" value="{value}" {checked}>',{checked:""}),itemVoteMultiply:a('<input type="checkbox" class="b-poll__input" name="vote-for" value="{value}" {checked}>',{checked:""}),layout:a('<div class="b-poll"><form>{items}{actions}</form></div>'),actionLink:a('<div class="b-poll__action"><span class="b-pseudo-link {selector}">{title}</span></div>'),expired:a('<div class="b-poll__action"><span>{title}</span></div>')}})(targetNS,jQuery);(function(a,b){a.namespace("locales.ru");a.locales.ru.vote={vote:"проголосовать",revote:"проголосовать заново",tovote:"вернуться к голосованию",expired:"время голосования истекло",results:"посмотреть результаты",unselected:"Вы не выбрали ни одного варианта",serverError:"Произошла ошибка при работе с сервером"};a.locale=a.locales.ru})(targetNS,jQuery);(function(b,c){var a=function(d){this.info="Vote control: ";this.id=b.getIdSelector(d);this.params=b.getParamsFromAttr(d,"onclick");this.init()};a.prototype={attachEvents:function(){b.log(this.info+"Attach Events");var d=this;c(this.id).delegate(this.selectors.revote,"click",function(){d.params.isResultsMode=false;d.draw()});c(this.id).delegate(this.selectors.results,"click",function(){d.params.isResultsMode=true;d.drawOrGetResults()});c(this.id).delegate(this.selectors.vote,"click",function(){d.params.isResultsMode=true;d.voteAction(true)})},getSelectedValues:function(){var d=[];c(this.id).find(this.selectors.inputChecked).each(function(e,f){d.push(f.value)});return d},update:function(d){c.extend(this.params,d);this.draw()},callbackOK:function(d){b.log(this.info+"callbackOK");this.update(d.data)},callbackNOK:function(){b.log(this.info+"callbackNOK");b.error(this,b.locale.vote.serverError)},voteAction:function(f){var e=null,d=this;if(f&&!this.getSelectedValues().length){b.error(this,b.locale.vote.unselected);return}var g={feed_id:this.params.feed_id,item_no:this.params.item_no,sk:g_globals.secret_key};if(f){g.mode="results";g.vote_for=this.getSelectedValues().join(",")}c.ajax({url:f?ya.url("json_do_vote.xml"):ya.url("jsonp_vote.xml"),type:f?"POST":"GET",dataType:f?"json":"jsonp",data:g,success:function(){d.callbackOK.apply(d,arguments)},error:function(){d.callbackNOK.apply(d,arguments)}})},selectors:{inputChecked:".b-poll__input:checked",revote:".b-action-revote",vote:".b-action-vote",results:".b-action-get-results"},drawOrGetResults:function(){if(this.params.isResultsMode&&!this.params.voteResults){this.voteAction()}else{this.draw()}},init:function(){b.log(this.info+"init");b.log(this.params);this.attachEvents();if(this.params.voteResults){this.draw()}else{this.voteAction()}},getResultById:function(g){b.log(this.info+"getResultById");var f=this.params.voteResults;if(!f){return null}for(var e=0,d=f.length;e<d;e++){if(f[e]["number"]===g){return f[e]}}return null},getViewVote:function(){b.log(this.info+"getViewVote");var k=b.templates,f=this.params,m=f.vars,n="",j=null,d=f.isSingle?k.vote.itemVoteSingle:k.vote.itemVoteMultiply;for(var h=0,e=m.length;h<e;h++){j=this.getResultById(m[h].id);n+=k.vote.itemVote({input:d({value:m[h].id,checked:j&&j.voted?"checked":""}),title:m[h].title})}var g=k.vote.actionLink({title:b.locale.vote.vote,selector:this.selectors.vote.substring(1)})+k.vote.actionLink({title:b.locale.vote.results,selector:this.selectors.results.substring(1)});return k.vote.layout({items:n,actions:g})},getViewResults:function(){b.log(this.info+"getViewResults");var f=b.templates,k=this.params,g=k.vars,d="",j=null;if(k.resultsHiddenUntil){d+="<span>Спасибо! Результаты будут доступны "+k.resultsHiddenUntil+"</span>"}else{for(var h=0,e=g.length;h<e;h++){j=this.getResultById(g[h].id);d+=f.vote.itemResult({value:g[h].id,percent:j?j.percent:0,count:j?j.votes:0,title:g[h].title})}if(k.hideResults){d+="<span>Результаты скрыты от других пользователей до окончания голосования</span>"}}return f.vote.layout({items:d,actions:f.vote.actionLink({title:this.params.isMeVoted?b.locale.vote.revote:b.locale.vote.tovote,selector:this.selectors.revote.substring(1)})})},getViewExpired:function(){b.log(this.info+"getViewExpired");var f=b.templates,k=this.params,g=k.vars,d="",j=null;for(var h=0,e=g.length;h<e;h++){j=this.getResultById(g[h].id);d+=f.vote.itemResult({value:g[h].id,percent:j?j.percent:0,count:j?j.votes:0,title:g[h].title})}return f.vote.layout({items:d,actions:f.vote.expired({title:b.locale.vote.expired})})},draw:function(){var d=this.params.expired?this.getViewExpired():this.params.isResultsMode?this.getViewResults():this.getViewVote();c(this.id).html(d)}};b.namespace("controls");b.controls.Vote=a;ya.queue.add("onload",function(d){c(d).find(".b-control-vote").each(function(f,g){ya.instances.push(new b.controls.Vote(g))})})})(targetNS,jQuery);y5.require(["Classes","Events"],function(){var a=function(){};a.prototype.register=function(){var d,c,b;for(b=0;b<arguments.length;b++){d=arguments[b];c=d[3]||this.control;this[d[0]]=y5.cssQuery(d[1],c)[0]}};a.prototype.show=function(){var c,b;for(b=0;b<arguments.length;b++){c=arguments[b];if(y5.Types.string(c)){c=this[c]}y5.Classes.remove(c,"i-hidden")}};a.prototype.hide=function(){var c,b;for(b=0;b<arguments.length;b++){c=arguments[b];if(y5.Types.string(c)){c=this[c]}y5.Classes.add(c,"i-hidden")}};a.prototype.on=function(d,c,b){y5.Events.observe(d,c,b,true,this);return this};Friends.BasicControl=a;y5.loaded("{Friends}.BasicControl")});y5.require(["{Friends}.BasicControl"],function(){var a=function(c){var b=function(){if(arguments.length>0){return this.init.apply(this,arguments)}};if(c){b.prototype=new c()}return b};Friends.CommonConstructor=a;y5.loaded("{Friends}.CommonConstructor")});y5.require(["Events","{Friends}.CommonConstructor"],function(){var a=Friends.CommonConstructor(Friends.BasicControl);a.prototype.init=function(c,d){this.control=c;this.params=d;this.input=y5.cssQuery("input[placeholder]",c)[0];if(!this.input){return}this.init=true;this.input.refInputPlaceholder=this;this.placeholder=this.input.getAttribute("placeholder");this.clearinput=true;var b=this.input.getAttribute("clearinput");if(b&&b=="no"){this.clearinput=false}if(this.placeholder&&this.input.value==""){this.disable(this.placeholder)}this.on("keyup",this.inputOut,this.input);this.on("focus",this.inputEnter,this.input);this.on("blur",this.inputOut,this.input);return this};a.prototype.inputEnter=function(b){if(this.isEmpty()){this.clearInput()}};a.prototype.inputOut=function(b){if(this.isEmpty()){var c=(b.type=="keyup"&&this.input.value!=this.placeholder)?"":this.placeholder;this.disable(c)}else{this.enable(this.input.value)}};a.prototype.isEmpty=function(){var b=(this.input.value==""||this.input.value==this.placeholder);return b};a.prototype.isTaint=function(){return !this.isEmpty()};a.prototype.clearInput=function(b){if(this.clearinput){this.input.value=""}var c=this.clearinput?"":this.input.value;this.disable(c)};a.prototype.disable=function(b){if(b!=this.input.value){this.input.value=b}y5.Classes.add(this.input,"b-input-empty")};a.prototype.enable=function(b){if(b!=this.input.value){this.input.value=b}y5.Classes.remove(this.input,"b-input-empty")};Friends.InputPlaceholder=a;y5.loaded("{Friends}.InputPlaceholder")});Friends.FriendControl=function(a){this.control=a;this.search=0;this.result=0;this.list=0;this.details=0;this.submit=0;this.textInitial="";this.searchSubmit=0;this.init()};Friends.FriendControl.prototype={clearSearchField:function(a){if(a.target.value==this.textInitial){a.target.value=""}y5.Classes.remove(a.target,"text-initial")},initialSearchField:function(a){if(y5.Strings.isEmpty(a.target.value)){y5.Classes.add(a.target,"text-initial");a.target.value=this.textInitial}},onCheckboxClick:function(b){b.stopPropagation();var a=y5.Dom.getDescendantOrSelf(b.target,"input","*");this.disableControl(a,(a.checked==""))},disableControl:function(g,f){var d=y5.Dom.getFollowing(y5.Dom.getAncestorOrSelf(g,"label","*"),"span","*")[0];y5.Classes.assign(d,"disabled",f);var c=y5.Dom.getDescendants(d,"input","*"),e,b;for(e=0,b=c.length;e<b;e++){c[e].disabled=f}},showUserInfo:function(){var c=this.list.selectedIndex;var d=this.list[c].value;var b=this.list[c].innerHTML;if(!d){return}this.setStatusMessage('Идёт загрузка карточки пользователя<br /><img src="'+g_globals.img_base+'bar.gif" alt=""/>');var a=this;g_sources.getSource(d,function(e){a.getUserResponseOK(e,{parent:a})},this.getUserResponseError,{parent:this},true)},getUserResponseOK:function(a,b){y5.Classes.remove(b.parent.details,"details-empty");b.parent.details.innerHTML=a.info||""},getUserResponseError:function(a,b){},onSearch:function(){this.setStatusMessage('Идёт загрузка пользователей<br /><img src="'+g_globals.img_base+'bar.gif" alt=""/>');var b=["textarea","select","button"];var d="input";var c=this.placeholders.filter(function(e){if(e.isEmpty()){d+='[name!="'+e.input.name+'"]'}return(!e.isEmpty()&&!y5.Strings.isVoid(e.input.value))})==0;b.push(d);if(c){this.setStatusMessage("Задан пустой поисковый запрос.");return false}var a=friendsURL("ajax/search_users",y5.FormCollector.collectTags(this.control,b));(function(e,f){jQuery.ajax({url:a,dataType:"json",success:function(g){e.searchResponseOK(g,f)},error:function(g){e.searchResponseError(g,f)}})})(this,{parent:this});return false},searchResponseOK:function(a,b){var c=b.parent;c.listParentNode.innerHTML=a.html;c.list=c.listParentNode.firstChild;if(c.list.length===0){c.setStatusMessage("никого не найдено");return}new y5.AEventListener("change",c.showUserInfo,c.list,true,c);c.list.selectedIndex=-1;c.setStatusMessage("&#8592;&#160;выберите человека")},searchResponseError:function(a){},setStatusMessage:function(a){y5.Classes.add(this.details,"details-empty");this.details.innerHTML=a},init:function(){var g=(y5.cssQuery('input[name="type"][type="hidden"]')[0]||{value:"unknown"}).value;y5.cssQuery(".b-write-friend-search input",this.control).forEach(function(a){y5.Events.observe("keypress",function(h){if(h.keyCode==13){h.preventDefault();h.stopPropagation();this.onSearch()}},a,true,this)},this);this.placeholders=y5.cssQuery(".Friends-later-InputPlaceholder",this.control).map(function(a){return new Friends.InputPlaceholder(a)});this.search=y5.Dom.getDescendant(this.control,"div","b-write-friend-search");this.searchSubmit=y5.Dom.getDescendant(this.search,"input","submit");y5.Events.observe("click",this.onSearch,this.searchSubmit,true,this);this.textInput=y5.Dom.getDescendant(this.search,"input","text");this.textInitial=this.textInput.value;new y5.AEventListener("focus",this.clearSearchField,this.textInput,true,this);new y5.AEventListener("blur",this.initialSearchField,this.textInput,true,this);var c=y5.Dom.getDescendants(this.search,"p","*"),d,b;for(d=0,b=c.length;d<b;d++){var f=y5.Dom.getDescendants(c[d],"label","*");if(f.length>0){y5.Events.observe("click",this.onCheckboxClick,f[0],true,this);this.disableControl(f[0],true)}}this.result=y5.Dom.getDescendant(this.control,"table","b-write-users-list");this.list=y5.Dom.getDescendants(y5.Dom.getDescendant(this.result,"td","list"),"select","*")[0];this.listParentNode=this.list.parentNode;this.details=y5.Dom.getDescendant(this.result,"td","details");var e=y5.Dom.getDescendant(this.control.parentNode,"div","b-write-submit");if(["congratulation","text"].indexOf(g)>-1){e=false}}};y5.require(["Strings","Dom","Classes","Events","Ajax","AjaxJS","FormCollector","{Friends}.InputPlaceholder"],function(){y5.loaded("{Friends}.FriendControl")});Friends.ProfileView=function(a){this.control=a;this.controlEdit=null;this.controlEditElements=[];this.headerId=null;this.contentNodeId=null;this.init();this.prevClassName=null};Friends.ProfileView.prototype={TAGNAME:"div",CLASSNAME:"c-profile-view",selectControl:function(b){var a=y5.Dom.getAncestorOrSelf(this.control,"*","b-profile-section-holster").parentNode;if(y5.Classes.test(a,"special")){this.control.style.borderColor=this.control.style.backgroundColor=getById(this.headerId).style.backgroundColor="#ffdba9"}else{this.control.style.borderColor="#c7c8ca"}},unselectControl:function(a){this.control.style.borderColor=this.control.style.backgroundColor=getById(this.headerId).style.backgroundColor=""},saveControlEditElements:function(){this.controlEditElements=[];var b=this.control.getElementsByTagName("input"),d,a;for(d=0,a=b.length;d<a;d++){var e=b[d];if(["hidden","text"].indexOf(e.type.toLowerCase())>-1){this.controlEditElements.push({element:e,value:e.value})}else{if(["checkbox","radio"].indexOf(e.type.toLowerCase())>-1){this.controlEditElements.push({element:e,checked:e.checked})}}}var c=this.control.getElementsByTagName("select");for(d=0,a=c.length;d<a;d++){var e=c[d];this.controlEditElements.push({element:e,value:e.value})}},cancelChanges:function(){var b,a;for(b=0,a=this.controlEditElements.length;b<a;b++){var c=this.controlEditElements[b];if(typeof(c.value)!=="undefined"){c.element.value=c.value}else{if(typeof(c.checked)!=="undefined"){c.element.checked=c.checked}else{if(typeof(c.display)!=="undefined"){c.element.style.display=c.display}}}if(c.element.type&&c.element.type=="text"){y5.Events.notify("y5:change",c.element,true,true)}}},editCategory:function(b){var c=this;var a={responseSuccess:function(d,f){c.container_edit=y5.Dom.getDescendant(c.control,"div","edit");c.container_view=y5.Dom.getDescendant(c.control,"div","view");c.container_edit.innerHTML=d;c.control.onclick=function(){return{name:c.categoryName}};var e=getById(c.contentNodeId);c.switchToProfileEdit();initAutoareas(e);appendInputField(e,{type:"hidden",name:"view_category",value:c.categoryName});c.controlEdit=new g_controls.ProfileEdit(e,false);c.controlEdit.activate=function(){return false};c.controlEdit.resizeAutoareas();c.controlEdit.trigger=function(g){g.preventDefault();g.stopPropagation();if(!c.controlEdit.saveButton.disabled){if(confirm("Профиль был изменен. Вы уверены, что хотите закрыть блок?")){c.cancelChanges();c.viewCategory()}}else{c.viewCategory()}return false};c.controlEdit.process_marking.responseSuccess=function(g,h){y5.Classes.add(c.controlEdit.spin,"i-hidden");c.viewCategory(g);c.controlEdit.tracker.initialState=c.controlEdit.tracker.controlsState()};y5.Components.init(c.control);c.saveControlEditElements()},responseError:function(d,e){y5.Console.error("Error loading form")}};jQuery.ajax({url:"ajax/profile_category_form.xml?category="+this.categoryName,dataType:"json",success:function(d){a.responseSuccess(d.html,{})},error:function(d){a.responseSuccess(d,{})}});b.preventDefault()},viewCategory:function(a){this.container_edit.style.display="none";y5.Classes.remove(getById(this.contentNodeId),"edit-mode");y5.Classes.remove(getById(this.headerId),"i-hidden");if(this.controlEdit.control.id=="id-category-special"){y5.Dom.removeNode(this.controlEdit.saveButton.parentNode)}else{y5.Classes.add(this.controlEdit.saveButton,"i-hidden")}y5.Classes.remove(y5.Dom.getAncestorOrSelf(this.control,"*","b-profile-section-holster"),"b-profile-section-holster-edit");this.control.className=this.prevClassName;getById(this.contentNodeId).className="profile-content";if(a){this.container_view.innerHTML=a}this.container_view.style.display="block";this.controlEdit.saveButton.disabled=true},init:function(){this.categoryName=this.control.getElementsByTagName("input")[0].value;this.contentNodeId=this.control.getElementsByTagName("fieldset")[0].id="id-category-"+this.categoryName.toLowerCase();this.headerId=this.control.getElementsByTagName("h3")[0].id="header-"+this.contentNodeId;var c=getById(this.headerId).getElementsByTagName("a");if(c){var d=this;function a(e){y5.Events.create("mouseover",function(f){d.selectControl(f)},e,true);y5.Events.create("mouseout",function(f){d.unselectControl(f)},e,true);y5.Events.create("click",function(f){if(!d.controlEdit||d.controlEdit.control.id=="id-category-special"){d.editCategory(f)}else{d.switchToProfileEdit();y5.Classes.add(getById(d.contentNodeId),"edit-mode");d.saveControlEditElements();y5.Classes.remove(d.controlEdit.saveButton,"i-hidden");d.controlEdit.resizeAutoareas();f.preventDefault()}},e,true)}for(var b=0;b<c.length;b++){a(c.item(b))}}},switchToProfileEdit:function(){this.prevClassName=this.control.className;y5.Classes.remove(this.control,"b-profile-view c-profile-view");var a=this.categoryName.toLowerCase();var b="Friends-c-ProfileBlock c-profile-edit b-profile-edit b-profile-edit-active i-clearfix b-profile-edit-"+a+" y5-friendsprofile-"+a;y5.Classes.add(this.control,b);y5.Classes.add(y5.Dom.getAncestorOrSelf(this.control,"*","b-profile-section-holster"),"b-profile-section-holster-edit");y5.Classes.add(getById(this.headerId),"i-hidden");y5.Classes.add(getById(this.contentNodeId),"edit-mode");if(this.categoryName=="Special"){y5.Classes.remove(this.control.parentNode.parentNode,"special")}this.container_edit.style.display="block";this.container_view.style.display="none"}};y5.require(["Events","Ajax","AjaxJS","Dom","cssQuery","Components","Classes"],function(){y5.loaded("{Friends}.ProfileView")});Friends.PseudoWidgetControl=function(){if(arguments.length>0){var a=new Friends.PseudoWidgetControl();a.init.apply(a,arguments);return a}};Friends.PseudoWidgetControl.prototype={init:function(a,b){this.control=a;this.btn_update=null;this.ajaxMethod_get=(b.ajaxMethod_get.indexOf("/")===-1?"ajax/":"")+b.ajaxMethod_get;this.ajaxMethod_post="ajax/"+b.ajaxMethod_post;this.ajaxParamName=b.ajaxParamName;if(b.dont_update){this.show(this.control.innerHTML)}else{this.update()}},enliveReloadLinks:function(){y5.cssQuery("a.js-pseudowidget-reload",this.control).forEach(function(a){this.createNavigationLink(a)},this)},createNavigationLink:function(a){y5.Events.observe("click",function(){var b=a.onclick();this.update(null,b.href)},a,true,this)},update:function(g,d){var i,h=this,c;if(!this.btn_update){d=d||friendsURL(this.ajaxMethod_get);i="GET"}else{g.preventDefault();g.stopPropagation();var a=this.btn_update.onclick();if(a){c=y5.Elements.createFromHTML('<div class="loading">&#160;</div>');y5.Dom.insertBefore(c,this.btn_update);d=friendsURL(this.ajaxMethod_post,this.ajaxParamName+"="+a);i="POST"}else{return false}}function b(e){y5.Dom.removeNode(c);y5.Classes.add(this.control,"i-hidden");y5.Events.notify("y5:widget:responseError",this.control,true)}var f=new y5.Request.XML(d,{callbackContext:this,method:i});f.onload=this.responseOK;f.onerror=b;f.send()},responseOK:function(a){if(!a.responseText){y5.Classes.add(this.control,"i-hidden")}this.show(a.responseText);y5.Events.notify("y5:widget:responseOK",this.control,true);ya.queue.exec("onload",this.control);ya.queue.exec("moods",this.control)},show:function(a){this.control.innerHTML=a;y5.Events.notify("y5:widget:html",this.control,true);y5.Components.init(this.control);this.enliveReloadLinks();this.btn_update=y5.Dom.getDescendant(this.control,"a","update");if(!this.btn_update){return}new y5.AEventListener("click",this.update,this.btn_update,true,this)}};if(y5.is_opera){Friends.PseudoWidgetControl.showOpera=Friends.PseudoWidgetControl.show;Friends.PseudoWidgetControl.show=function(a){this.control.innerHTML="";y5.Utils.setTimeout(function(){this.showOpera(a)},1,this)}}y5.require(["Ajax","AjaxObject","Dom","Events","Elements","Utils","Classes","Fx"],function(){y5.loaded("{Friends}.PseudoWidgetControl")});y5.require(["Fx","{Friends}.CommonConstructor"],function(){var a=Friends.CommonConstructor(Friends.BasicControl);a.prototype.init=function(c,d){var b=this;this.control=c;this.params=d;this.host_id=this.params.host_id||"host_id";this.common_link_selectors=[".js-widget-navigation a","div.b-pager a"];if(this.params.link_selectors){this.common_link_selectors=this.common_link_selectors.concat(this.params.link_selectors)}this.onInit();if(this.params.hot_load){this.loadWidget(this.params.src,{},{no_fader:true})}else{this.onLoadHandler()}};a.prototype.onInit=function(){};a.prototype.onLoadHandler=function(){};a.prototype.modeLoading=function(c){this.mode="loading";if(c){jQuery(this.control).find(".b-viewport-loading").remove()}else{var b=$('<div class="b-viewport-loading b-post"><span class="b-candy_state_on">обновление...</span></div>');b.css({height:$(this.control).height()});jQuery(this.control).prepend(b)}};a.prototype._addParams=function(k,e){var d=new (y5.URL)(location.href),h={},g,c;for(g=1;g<e.length;g++){if(e[g] instanceof Array){for(c=0;c<e[g].length;c++){if(typeof d.getParam(e[g][c])!=="object"){h[e[g][c]]=d.getParam(e[g][c])}}}else{for(c in e[g]){if(typeof e[g][c]!=="function"&&typeof e[g][c]!=="object"){h[c]=e[g][c]}}}}var b=new y5.URL(k);for(c in b.Query){if(!(c in h)){h[c]=b.Query[c]}}var f=(new (y5.URL)(b.Path)).addParams(h).toString();return f};a.prototype.loadWidget=function(e,d,b){b=b||{};this.modeLoading(b.no_fader);d=this.makeParams(d);e=this._addParams(e,[e,d]);var c=new y5.Request.XML(e,{callbackContext:this});c.onload=function(f){this.loadWidgetHandler(f)};if(typeof this.server==="object"&&typeof this.server.abort==="function"){this.server.abort()}c.send();this.server=c};a.prototype.makeParams=function(c){var b=c;if(typeof b!=="object"){b={}}if(!(this.host_id in b)){b[this.host_id]=g_globals.current_location.source.id}return b};a.prototype.enliveCommonNavigation=function(){this.common_link_selectors.forEach(function(b){y5.cssQuery(b,this.control).forEach(function(c){this.createNavigationLink(c)},this)},this)};a.prototype.redrawHTML=function(b){var c=this;$(this.control).html(b);y5.Components.init(this.control);ya.queue.exec("onload",this.control);this.enliveCommonNavigation()};a.prototype.loadWidgetHandler=function(b){var c=b.responseText;this.redrawHTML(c);this.onLoadHandler()};a.prototype.parseGetQuery=function(b){var d={};var c=new y5.URL(b);c.queryKeys().forEach(function(e){d[e]=c.getParam(e)});return d};a.prototype.createNavigationLink=function(c){var b=this;var d=function(g){g.stopPropagation();g.preventDefault();var f=c.getAttribute("href");var h=b.parseGetQuery(f);b.loadWidget(b.params.src,h)};$(c).unbind("click.getWidgetByClick").bind("click.getWidgetByClick",d)};Friends.WidgetLoader=a;y5.loaded("{Friends}.WidgetLoader")});Friends.Tips=function(a,b){this.control=a;this.__listeners=[];this.init(a,b)};Friends.Tips.prototype={init:function(a,b){this.table=y5.Dom.getAncestor(this.control,"table","b-tips");this.submitPseudoBtn=y5.Dom.getDescendant(this.control,"a","update");this.__listeners.push(new y5.AEventListener("click",this.onRequest,this.submitPseudoBtn,true,this))},onRequest:function(c){c.preventDefault();var b=new y5.Request.Form(this.control.action);var a=this;b.onload=function(d){y5.Classes.add(a.table,"i-hidden")};b.onerror=b.onload;b.send(this.control)},dectruct:function(){var b,a;for(b=0,a=this.__listeners.length;b<a;b++){this.__listeners[b].remove()}}};y5.require(["Dom","Events","Request.Form"],function(){y5.loaded("{Friends}.Tips")});Friends.Statface=function(b,c){this.control=b;this.init(b,c);var a=y5.Dom.getDescendant(this.control,"*");y5.Events.observe("y5:widget:html",function(){this.init(this.control,c)},a,true,this)};Friends.Statface.prototype={init:function(o,f){var a=[],p,e,d,b,g,h;for(p=0,e=f.length;p<e;p++){var c=f[p];if(y5.Types.array(c.className)){for(d=0,b=c.className.length;d<b;d++){a=y5.Dom.getDescendants(this.control,"a",c.className[d])}}else{a=y5.Dom.getDescendants(this.control,"a",c.className)}for(h=0,g=a.length;h<g;h++){this.addOnclickCounter(a[h],c)}}},addOnclickCounter:function(a,b){b.path=b.path||"";y5.Events.observe("click",function(){Lego.cp(b.pid,b.cid,b.path,this.control)},a,true)}};y5.require(["Dom","URL","Events"],function(){y5.loaded("{Friends}.Statface")});(function(a){var b=a.template;a.namespace("templates.widgets");a.templates.widgets={layout:b('<div class="b-yaru-widget"><div class="b-yaru-widget__title"><div class="b-yaru-widget__title-link">{title}{(titleButton)( <span class="b-yaru-widget__title-button"><a href="{titleButtonLink}" class="b-link">{titleButton}</a></span>)}</div></div><div class="b-yaru-widget__body"><div class="b-yaru-widget-line"></div></div><div class="b-yaru-widget__actions"><div class="b-menu b-menu_layout_horiz-complex"><table cellpadding="0" class="b-menu__layout"><tr><td class="b-menu__layout-cell b-menu__layout-cell_first">{(moreAsUpdate)[<div class="b-menu__item"><span class="b-pseudo-link update">я в курсе</span></div>]}</td><td class="b-menu__layout-gap"></td><td class="b-menu__layout-cell b-menu_layout__layout-cell_position_last">{(allItems)({(moreAsUpdate)(<div class="b-menu__item"><a class="b-pseudo-link update">{allItems}</a></div>)[<div class="b-menu__item"><a class="b-link more" href="{moreLink}">{allItems}</a></div>]})}</td></tr></table></div></div></div>'),viewportLayout:b('<table class="b-post-filter b-post-filter_type_outdoor"><tr><td class="b-post-filter__title">{(titleButton)(<a class="b-form-button b-form-button_theme_grey-m b-form-button_size_m b-form-button_valign_middle i-bem b-form-button_js_inited" href="{titleButtonLink}"><i class="b-form-button__left"></i><span class="b-form-button__content"><span class="b-form-button__text">{titleButton}</span></span><i class="b-form-button__click"></i></a>)}</td><td class="b-post-filter__selector"></td></tr></table></div><div class="b-yaru-widget"><div class="b-yaru-widget__body"><div class="b-yaru-widget-line"></div></div><div class="b-yaru-widget__actions"><div class="b-menu b-menu_layout_horiz-complex"><table cellpadding="0" class="b-menu__layout"><tr><td class="b-menu__layout-cell b-menu__layout-cell_first"><div class="b-menu__item"><span class="b-pseudo-link update">показать ещё</span></div></td><td class="b-menu__layout-gap"></td><td class="b-menu__layout-cell b-menu__layout-cell_position_last"><div class="b-menu__item"><a href="{moreLink}" class="b-link all">{allItems}</a></div></td></tr></table></div></div></div>'),group:b('<div class="b-yaru-widget-entry"><div class="b-yaru-widget-day__title">{timestamp}</div>{items}</div>'),item:b('<div class="b-yaru-widget-answer">{user}&nbsp;&mdash; <span class="b-yaru-widget-answer__answer"><a class="b-link" href="{url}">{title}</a></span></div>'),likeItem:b('<div class="b-yaru-widget-answer">{user}&nbsp;{appreciate} запись <span class="b-yaru-widget-answer__answer"><a class="b-link" href="{url}">{title}</a></span></div>'),recommendItem:b('<div class="b-usercard b-usercard_type_adding b-recommend-item"><span class="b-usercard__i">{user}<div class="b-usercard__adding b-make-friend"><a href="#" class="b-pseudo-link" onclick="return { uid: \'{uid}\', id: \'{id}\', markType: \'{markType}\', type: \'{type}\' }">{actionTitle}</a></div></span></div>'),replyItem:b('<div class="b-yaru-widget-answer">{user}{separator} <span class="b-yaru-widget-answer__answer update_one" widget_data="return {id: \'{id}\'}"><a class="b-link" href="{url}">{title}</a></span></div>'),photoItem:b('<div class="b-yaru-widget-photo__item"><a href="{url}" class="b-link"><img alt="{alt}" title="{alt}" src="{src}"></a></div>'),videoItem:b('<div class="b-yaru-widget-media__item"><div class="b-yaru-widget-media__head"><img alt="" src="//yandex.st/lego/_/La6qi18Z8LwgnZdsAr1qy1GwCwo.gif" class="b-ico">{duration}</div><a href="{url}" class="b-link"><img alt="" src="{src}"></a><div class="b-yaru-widget-media__desc"><a href="{url}" class="b-link">{title}</a></div></div>'),videoContainer:b('<div class="b-yaru-widget-media b-yaru-widget-media_type_video">{items}</div>'),albumsContainer:b('<div class="b-yaru-widget-photo b-yaru-widget-photo_type_album">{items}</div>'),videoCollection:a.template('<div class="b-yaru-widget-photo b-yaru-widget-photo_type_collection">{content}</div>',{content:""}),videoCollectionItem:b('<div class="b-yaru-widget-photo__item"><div class="b-yaru-widget-photo__thumb"><a class="b-link" href="{ url }"><span style="background-image:url({ cover });" class="b-ico-bg"><span class="b-ico-bg__center"></span></span></a></div><div class="b-yaru-widget-photo__title"><a class="b-link b-link_type_album-name" href="{url}">{name}</a></div><div class="b-yaru-widget-photo__comment">{count} видео</div></div>'),albumItem:b('<div class="b-yaru-widget-photo__item"><div class="b-yaru-widget-photo__thumb"><a href="{url}" class="b-link"><img alt="{title}" title="{title}" src="{src}" class="b-ico"></a></div><div class="b-yaru-widget-photo__title"><a href="{url}" class="b-link b-link_type_album-name">{title}</a></div><div class="b-yaru-widget-photo__comment">{count}</div></div>'),avatar:b("{user}"),holidayItem:b('<div class="b-yaru-widget-holiday"><div class="b-yaru-widget-holiday__title">{title}</div><div class="b-yaru-widget-holiday__celebrate"><a href="{url}" class="b-link">поздравить друзей</a></div></div>'),linkItem:b('<div class="b-yaru-widget-entry i-clearfix"><div class="b-yaru-widget-entry__item"><div class="b-yaru-widget-entry__title"><a href="{url}" class="b-link">{title}</a></div><div class="b-yaru-widget-entry__info">{info}</div></div></div>'),wishlistItem:b('<div class="b-yaru-widget-entry i-clearfix"><div class="b-yaru-widget-entry__item"><div class="b-yaru-widget-entry__img"><a href="{url}" class="b-link"><img alt="{title}" src="{src}" class="b-ico"></a></div><div class="b-yaru-widget-entry__title"><a href="{url}" class="b-link">{title}</a></div><div class="b-yaru-widget-entry__info">{info}</div></div></div>'),wishlistPromisedItem:b('<div class="b-yaru-widget-entry i-clearfix"><div class="b-yaru-widget-entry__item"><div class="b-yaru-widget-entry__img"><a href="{url}" class="b-link"><img alt="{info}" src="{src}" class="b-ico"></a></div><div class="b-yaru-widget-entry__title"><a href="{url}" class="b-link">{title}</a></div><div class="b-yaru-widget-entry__info">{info}</div><div class="b-yaru-widget-entry__cancel" onclick="return {param}"><span class="b-pseudo-link">отменить</span></div></div></div>'),ratingInfo:b('<div class="b-yaru-widget-entry__info_type_rating"><a href="{url}" class="b-link"><img alt="Рейтинг блогов" title="" src="{src}" class="b-ico"></a></div>'),onload:b('<div class="loading">&nbsp;</div>'),empty:b(""),textResponse:b("{page}")}})(ya);(function(a,c){var b=function(d,e){this.$target=c(d);this.data=e;if(typeof d.onclick==="function"){c.extend(this.data,d.onclick())}this.ids="";this.data.layoutTemplateName=this.data.layoutTemplateName||"layout";this.data.groupTemplateName=this.data.groupTemplateName||"group";this.data.itemTemplateName=this.data.itemTemplateName||"item";this.data.containerTemplate=this.data.containerTemplate||a.template("{content}",{content:""});this.data.data=this.data.data||{};this.bindEvents=this.data.bindEvents?this.data.bindEvents:null;if(this.data.updateCallback){this.updateCallback=this.data.updateCallback}this.init()};b.prototype={selectors:{content:".b-yaru-widget-line",title:".b-yaru-widget__title-link"},destroy:function(){this.$target.html("");this.$target.yhide()},updateCallback:function(e){var d="",f,j,h=e.data,g=[];if(e.title){this.$title.html(e.title)}this.ids="";if(!h.length){if(this.data.emptyTemplateName){this.$inner.html(a.templates.widgets[this.data.emptyTemplateName](e));this.$target.yshow()}else{this.$target.yhide()}}else{for(f=0,j=h.length;f<j;f++){g.push(h[f].id)}this.ids=g.join(",");if(this.data.groupBy){h=this.groupBy(this.data.groupBy,h);d=a.drawArray(h,"widgets",this.data.groupTemplateName)}else{d=a.drawArray(h,"widgets",this.data.itemTemplateName)}this.$inner.html(this.data.containerTemplate({content:d}));this.$target.yshow()}if(this.bindEvents instanceof Function){this.bindEvents(e)}},groupBy:function(k,h){var e=[],g,l,f="",j,d={};for(g=0,l=h.length;g<l;g++){f=h[g][k];if(!d[f]){d[f]=[]}d[f].push(h[g])}for(f in d){j={};j["items@"+this.data.itemTemplateName]=d[f];j[k]=f;e.push(j)}return e},update:function(d){this.updateCallback(d)},drawWidget:function(){var d=this.$target;d.html(a.templates.widgets[this.data.layoutTemplateName](this.data));this.$inner=d.find(this.selectors.content);this.$title=d.find(this.selectors.title)},init:function(){var d=this;d.ids="";c.ajax({url:this.data.ajaxMethod_get,type:"get",data:this.data.data,dataType:"jsonp",success:function(e){if(e.status==="Success"){d.drawWidget();d.update(e);a.queue.exec("onload",d.$target[0])}}})}};a.namespace("controls");a.controls.JsonpWidget=b;a.controls.JsonpWidget.hideLinks=function(e){var d=this.$target,f=g_source?g_source.id:-1,g=e.data;d.find(".update").yhide();if(!g||!g.length){if(!e.page||f!==this.data.data.host_id){d.yhide()}else{d.find(".more").yhide()}}}})(ya,jQuery);(function(a,b){a.namespace("controls");var c=a.controls.DropdownFilters={};c.selectors={checkAll:".b-check-all",uncheckAll:".b-clear-all",form:"#filters",list:".b-menu",filterCheckox:":checkbox.filter"};c.switchTrigger=function(d){b(this).parents(c.selectors.list).find(c.selectors.filterCheckox).each(function(e,f){f.checked=d})};c.handlers={checkAll:function(d){c.switchTrigger.call(this,true)},uncheckAll:function(d){c.switchTrigger.call(this,false)},submit:function(d){b(this).find(".b-dropdown__list_clone").remove();if(this.elements.remember&&this.elements.remember.checked){c.handlers.filterAndSave.call(this,d)}else{c.handlers.filterOnce.call(this,d)}},filterAndSave:function(f){var d=this;d.action=ya.url("options_do_friendsfeed.xml")},filterOnce:function(n){var d=this,m=[],o=window.location.pathname;for(var j=0,g=d.elements.length;j<g;j++){var f=d.elements[j];if(f.name==="posttypes"&&f.checked){m.push(f.value)}else{if(f.name==="retpath"){o=f.value.replace(/(\?|&)(posttypes|sourcesfilter)=[^&]*/ig,"")}}}var k=b(d).find(':checkbox.source[checked=true][name!="read-self"]'),h="mine";if(k.length){h=(k.length==1)?k[0].value:"all"}n.preventDefault();n.stopPropagation();window.location=o+(o.indexOf("?")!==-1?"&":"?")+"posttypes="+m.join()+"&sourcesfilter="+h}};c.init=function(){ya.log("DropdownFilters: init");var d=function(){var f=c.selectors;var e=c.handlers;ya.log("DropdownFilters: attach events");b(f.checkAll).live("click",e.checkAll);b(f.uncheckAll).live("click",e.uncheckAll);b(f.form).live("submit",e.submit)};d()};c.init()})(window.ya,window.jQuery);(function(a,c){var b=function(d){var e=this;this.popup=new a.Popup({content:a.templates.popupLoader()});c(d).live("click",function(f){var g;if(e.targetElement===f.target&&!e.popup.hidden){return}e.targetElement=f.target;g=a.getParamsFromAttr(f.target,"onclick")||{};e.activatePopup(f.target);if(g.url){e.loadFromURL(g.url)}else{e.loadFromHTML(c(g.contentSelector,f.target).html())}})};b.prototype={activatePopup:function(d){this.popup.bindTo(d);this.popup.show()},loadFromURL:function(e){var d=this;this.popup.update(a.templates.popupLoader());c.ajax({url:e,success:function(f){d.callbackOK(f)},error:function(f){d.callbackNOK(f)}})},loadFromHTML:function(d){this.popup.update(d)},callbackOK:function(d){this.popup.update(d)},callbackNOK:function(){a.log("ошибка при загрузке содержимого loadablePopup");this.popup.hide()}};a.instances.push(new b(".js-filter"))})(ya,jQuery);(function(a){a.texts={"захотел":{one:"захотел",one:"захотела",one:"захотело"},"призвал":{one:"призвал",one:"призвала",one:"призвало"},"упоминал":{one:"упоминал",one:"упоминала",one:"упоминало"},"удалил":{one:"удалил",one:"удалила",one:"удалило"},"активный участник":{one:"активный участник",one:"активная участница",one:"активный участник"},"модель":{one:"модель",some:"моделей",many:"модели",zero:"нет моделей"},"желание":{one:"желание",some:"желаний",many:"желания",zero:"нет желаний"},"ответ":{one:"ответ",some:"ответов",many:"ответа",zero:"нет ответов"},"клуб":{one:"клуб",some:"клубов",many:"клуба",zero:"нет клубов"},"комментарий":{one:"комментарий",some:"комментариев",many:"комментария",zero:"нет комментариев"},"запись":{one:"запись",some:"записей",many:"записи",zero:"нет записей"},"модерационное уведомление":{one:"уведомление из клубов",some:"уведомлений из клубов",many:"уведомления из клубов",zero:"нет уведомлений из клубов"},"новая запись":{one:"новой записи",some:"новых записей",many:"новых записей",zero:"нет новых записей"},"год":{one:"год",some:"лет",many:"года",zero:"не указан"},"взаимный":{one:"взаимный",some:"взаимных",many:"взаимных",zero:"взаимных"},"друг":{one:"друг",one:"подруга",one:"друг",one:"друг",some:"друзей",many:"друга",zero:"нет друзей"},"модератор":{one:"модератор",some:"модераторов",many:"модератора",zero:"нет модераторов"},"участник":{one:"участник",some:"участников",many:"участника",zero:"нет участников"},"пользователь":{one:"пользователь",some:"пользователей",many:"пользователя",zero:"нет пользователей"},"друга":{one:"друга",one:"подругу",one:"друга",some:"друзей",many:"друга"},"ним":{one:"ним",one:"ней",one:"ним",some:"ними",many:"ними"},"другом":{one:"другом",some:"друзьями",many:"друзьями",zero:"нет друзей"},"человеком":{one:"человеком",some:"людьми",many:"людьми",zero:""},"человек":{one:"человек",some:"человек",many:"человека",zero:"нет никого"},"человека":{one:"человека",some:"человек",many:"человека",zero:"нет никого"},"человека2":{one:"человека",some:"человек",many:"человек",zero:"нет никого"},"раз":{one:"раз",some:"раз",many:"раза",zero:"поровну"},"автора":{one:"автора",some:"авторов",many:"авторов",zero:"нет авторов"},"метода":{one:"метода",some:"методов",many:"методов",zero:"методов"},"Дневник":{one:"Дневник",some:"Дневники",many:"Дневники",zero:"Дневников"},"приглашение":{one:"приглашение",some:"приглашений",many:"приглашения",zero:"0 приглашений"},"фотка":{one:"фотка",some:"фоток",many:"фотки",zero:"нет фоток"},"фотку":{one:"фотку",some:"фотки",many:"фотки",zero:"фотки"},"фотки":{one:"фотку",some:"фоток",many:"фотки",zero:"нет фоток"},"фото":{one:"фото",some:"фото",many:"фото",zero:"нет фото"},"отзыв":{one:"отзыв",some:"отзывов",many:"отзыва",zero:"0 отзывов"},"альбом":{one:"альбом",some:"альбомов",many:"альбома",zero:"нет альбомов"},"ролик":{one:"ролик",some:"роликов",many:"ролика",zero:""},"коллекцию":{one:"коллекцию",some:"коллекции",many:"коллекции",zero:"-"},"он":{one:"он",one:"она",one:"оно",some:"они",many:"они"},"его":{one:"его",one:"её",one:"его",some:"их",many:"их"},"отозвался":{one:"отозвался",one:"отозвалась",one:"отозвалось",some:"отозвались",many:"отозвались"},"спросил":{one:"спросил",one:"спросила",one:"спросило",some:"спросили",many:"спросили"},"написал":{one:"написал",one:"написала",one:"написало",some:"написали",many:"написали"},"ответил":{one:"ответил",one:"ответила",one:"ответило",some:"ответили",many:"ответили"},"добавил":{one:"добавил",one:"добавила",one:"добавило",some:"добавили",many:"добавили"},"пнул":{one:"пнул",one:"пнула",one:"пнуло",some:"пнули",many:"пнули"},"сменил":{one:"сменил",one:"сменила",one:"сменило",some:"сменили",many:"сменили"},"изменил":{one:"изменил",one:"изменила",one:"изменило",some:"изменили",many:"изменили"},"пригласил":{one:"пригласил",one:"пригласила",one:"пригласило",some:"пригласили",many:"пригласили"},"рассказал":{one:"рассказал",one:"рассказала",one:"рассказало",some:"рассказали",many:"рассказали"},"обратился":{one:"обратился",one:"обратилась",one:"обратилось",some:"обратились",many:"обратились"},"опубликовал":{one:"опубликовал",one:"опубликовала",one:"опубликовало",some:"опубликовали",many:"опубликовали"},"был":{one:"был",one:"была",one:"было",some:"были",many:"были"},"играл":{one:"играл",one:"играла",one:"играло",some:"играли",many:"играли"},"поиграл":{one:"поиграл",one:"поиграла",one:"поиграло",some:"поиграли",many:"поиграли"},"поймал":{one:"поймал",one:"поймала",one:"поймало",some:"поймали",many:"поймали"},"получил":{one:"получил",one:"получила",one:"получило",some:"получили",many:"получили"},"решил":{one:"решил",one:"решила",one:"решило",some:"решили",many:"решили"},"родился":{one:"родился",one:"родилась",one:"родилось",some:"родились",many:"родились"},"собрался":{one:"собрался",one:"собралась",one:"собралось",some:"собрались",many:"собрались"},"ему":{one:"ему",one:"ей",one:"ему",some:"им",many:"им"},"подружился":{one:"подружился",one:"подружилась",one:"подружилось",some:"подружились",many:"подружились"},"проголосовал":{one:"проголосовал",one:"проголосовала",one:"проголосовало",some:"проголосовали",many:"проголосовали"},"сделал":{one:"сделал",one:"сделала",one:"сделало",some:"сделали",many:"сделали"},"сказал":{one:"сказал",one:"сказала",one:"сказало",some:"сказали",many:"сказали"},"поссорился":{one:"поссорился",one:"поссорилась",one:"поссорилось",some:"поссорились",many:"поссорились"},"поделился":{one:"поделился",one:"поделилась",one:"поделилось",some:"поделились",many:"поделились"},"загрузил":{one:"загрузил",one:"загрузила",one:"загрузило",some:"загрузили",many:"загрузили"},"вывесил":{one:"вывесил",one:"вывесила",one:"вывесило",some:"вывесили",many:"вывесили"},"зарегистрировался":{one:"зарегистрировался",one:"зарегистрировалась",one:"зарегистрировалось",some:"зарегистрировались",many:"зарегистрировались"},"нашел":{one:"нашёл",one:"нашла",one:"нашло",some:"нашли",many:"нашли"},"присоединился":{one:"присоединился",one:"присоединилась",one:"присоединилось",some:"присоединились",many:"присоединились"},"задал":{one:"задал",one:"задала",one:"задало",some:"задали",many:"задали"},"ушёл":{one:"ушёл",one:"ушла",one:"ушло",some:"ушли",many:"ушли"},"поздравил":{one:"поздравил",one:"поздравила",one:"поздравило",some:"поздравили",many:"поздравили"},"пожаловался":{one:"пожаловался",one:"пожаловалась",one:"пожаловалось",some:"пожаловались",many:"пожаловались"},"любимого":{one:"любимого",one:"любимую",one:"любимое",some:"любимых",many:"любимых",zero:""},"которого":{one:"которого",some:"которых",many:"которых",zero:""},"который":{one:"который",some:"которые",many:"которые",zero:""},"знает":{one:"знает",some:"знают",many:"знают",zero:""},"переехал":{one:"переехал",some:"переехало",many:"переехало"},"может":{one:"может",some:"могут",many:"могут",zero:""},"умеет":{one:"умеет",some:"умеют",many:"умеют",zero:""},"подружившийся":{one:"подружившийся",some:"подружившихся",many:"подружившихся",zero:""},"считает":{one:"считает",some:"считают",many:"считают",zero:""},"хочет":{one:"хочет",some:"хотят",many:"хотят",zero:""},"ваш новый друг":{one:"ваш новый друг",some:"ваши новые друзья",many:"ваши новые друзья",zero:""},"новый друг":{one:"новый друг",some:"новые друзья",many:"новые друзья",zero:""},"новый друг2":{one:"новый друг",some:"новых друзей",many:"новых друга",zero:""},"непрочитанный ответ":{one:"непрочитанный ответ",some:"непрочитанных ответов",many:"непрочитанных ответа",zero:"Нет непрочитанных ответов"},"опубликован":{one:"опубликован",some:"опубликовано",many:"опубликовано",zero:"опубликовано"},"оценил":{one:"оценил",some:"оценили",many:"оценили",zero:"оценили"},"запись будет принята":{one:"запись будет принята",some:"записей будет принято",many:"записи будут приняты",zero:"ни одной записи не будет принято"},"запись будет удалена":{one:"запись будет удалена",some:"записей будeт удалено",many:"записи будут удалены",zero:"ни одной записи не будет удалено"},"пользователь будет забанен":{one:"пользователь будет забанен",some:"пользователей будет забанено",many:"пользователи будут забанены",zero:"ни одного пользователя не будет забаненно"},"сослался":{one:"сослался",one:"сослалась",one:"сослалось"}}})(ya);(function(a,b){a.decline=function(d,j){var e=d||0,k=j||"",c=e%10,f=e%100,i=e!=Math.round(e),h=arguments[2]||false,g=h&&(e>0)?e+" ":"";if(k){if(e===0){g+=k.zero}else{if(i){g+=k.many}else{if((f>=5)&&(f<=20)){g+=k.some}else{if(c==1){g+=k.one}else{if(c>=2&&c<=4){g+=k.many}else{g+=k.some}}}}}}return g}})(ya,jQuery);(function(a,b){a.getTextByGender=function(e,c){var d=e||"man",f=c||null;if(d&&f){switch(d){case"man":return f;case"woman":return(f+="a");default:return(f+="о")}}else{return""}}})(ya,jQuery);(function($){$.fn.columnize=function(options){var defaults={width:400,columns:false,buildOnce:false,overflow:false,doneFunc:function(){},target:false,ignoreImageLoading:true,columnFloat:"left",lastNeverTallest:false,accuracy:false};var options=$.extend(defaults,options);if(typeof(options.width)=="string"){options.width=parseInt(options.width);if(isNaN(options.width)){options.width=defaults.width}}return this.each(function(){var $inBox=options.target?$(options.target):$(this);var maxHeight=$(this).height();var $cache=$("<div></div>");var lastWidth=0;var columnizing=false;var adjustment=0;$cache.append($(this).contents().clone(true));if(!options.ignoreImageLoading&&!options.target){if(!$inBox.data("imageLoaded")){$inBox.data("imageLoaded",true);if($(this).find("img").length>0){var func=function($inBox,$cache){return function(){if(!$inBox.data("firstImageLoaded")){$inBox.data("firstImageLoaded","true");$inBox.empty().append($cache.children().clone(true));$inBox.columnize(options)}}}($(this),$cache);$(this).find("img").one("load",func);$(this).find("img").one("abort",func);return}}}$inBox.empty();columnizeIt();if(!options.buildOnce){$(window).resize(function(){if(!options.buildOnce&&$.browser.msie){if($inBox.data("timeout")){clearTimeout($inBox.data("timeout"))}$inBox.data("timeout",setTimeout(columnizeIt,200))}else{if(!options.buildOnce){columnizeIt()}else{}}})}function columnize($putInHere,$pullOutHere,$parentColumn,height){while($parentColumn.height()<height&&$pullOutHere[0].childNodes.length){$putInHere.append($pullOutHere[0].childNodes[0])}if($putInHere[0].childNodes.length==0){return}var kids=$putInHere[0].childNodes;var lastKid=kids[kids.length-1];$putInHere[0].removeChild(lastKid);var $item=$(lastKid);if($item[0].nodeType==3){var oText=$item[0].nodeValue;var counter2=options.width/18;if(options.accuracy){counter2=options.accuracy}var columnText;var latestTextNode=null;while($parentColumn.height()<height&&oText.length){if(oText.indexOf(" ",counter2)!="-1"){columnText=oText.substring(0,oText.indexOf(" ",counter2))}else{columnText=oText}latestTextNode=document.createTextNode(columnText);$putInHere.append(latestTextNode);if(oText.length>counter2){oText=oText.substring(oText.indexOf(" ",counter2))}else{oText=""}}if($parentColumn.height()>=height&&latestTextNode!=null){$putInHere[0].removeChild(latestTextNode);oText=latestTextNode.nodeValue+oText}if(oText.length){$item[0].nodeValue=oText}else{return false}}if($pullOutHere.children().length){$pullOutHere.prepend($item)}else{$pullOutHere.append($item)}return $item[0].nodeType==3}function split($putInHere,$pullOutHere,$parentColumn,height){if($pullOutHere.children().length){$cloneMe=$pullOutHere.children(":first");$clone=$cloneMe.clone(true);if($clone.prop("nodeType")==1&&!$clone.hasClass("dontend")){$putInHere.append($clone);if($clone.is("img")&&$parentColumn.height()<height+20){$cloneMe.remove()}else{if(!$cloneMe.hasClass("dontsplit")&&$parentColumn.height()<height+20){$cloneMe.remove()}else{if($clone.is("img")||$cloneMe.hasClass("dontsplit")){$clone.remove()}else{$clone.empty();if(!columnize($clone,$cloneMe,$parentColumn,height)){if($cloneMe.children().length){split($clone,$cloneMe,$parentColumn,height)}}if($clone.get(0).childNodes.length==0){$clone.remove()}}}}}}}function singleColumnizeIt(){if($inBox.data("columnized")&&$inBox.children().length==1){return}$inBox.data("columnized",true);$inBox.data("columnizing",true);$inBox.empty();$inBox.append($("<div class='first last column' style='width:100%; float: "+options.columnFloat+";'></div>"));$col=$inBox.children().eq($inBox.children().length-1);$destroyable=$cache.clone(true);if(options.overflow){targetHeight=options.overflow.height;columnize($col,$destroyable,$col,targetHeight);if(!$destroyable.contents().find(":first-child").hasClass("dontend")){split($col,$destroyable,$col,targetHeight)}while(checkDontEndColumn($col.children(":last").length&&$col.children(":last").get(0))){var $lastKid=$col.children(":last");$lastKid.remove();$destroyable.prepend($lastKid)}var html="";var div=document.createElement("DIV");while($destroyable[0].childNodes.length>0){var kid=$destroyable[0].childNodes[0];for(var i=0;i<kid.attributes.length;i++){if(kid.attributes[i].nodeName.indexOf("jQuery")==0){kid.removeAttribute(kid.attributes[i].nodeName)}}div.innerHTML="";div.appendChild($destroyable[0].childNodes[0]);html+=div.innerHTML}var overflow=$(options.overflow.id)[0];overflow.innerHTML=html}else{$col.append($destroyable)}$inBox.data("columnizing",false);if(options.overflow){options.overflow.doneFunc()}}function checkDontEndColumn(dom){if(dom.nodeType!=1){return false}if($(dom).hasClass("dontend")){return true}if(dom.childNodes.length==0){return false}return checkDontEndColumn(dom.childNodes[dom.childNodes.length-1])}function columnizeIt(){if(lastWidth==$inBox.width()){return}lastWidth=$inBox.width();var numCols=Math.round($inBox.width()/options.width);if(options.columns){numCols=options.columns}if(numCols<=1){return singleColumnizeIt()}if($inBox.data("columnizing")){return}$inBox.data("columnized",true);$inBox.data("columnizing",true);$inBox.empty();$inBox.append($("<div style='width:"+(Math.floor(100/numCols))+"%; float: "+options.columnFloat+";'></div>"));$col=$inBox.children(":last");$col.append($cache.clone());maxHeight=$col.height();$inBox.empty();var targetHeight=maxHeight/numCols;var firstTime=true;var maxLoops=3;var scrollHorizontally=false;if(options.overflow){maxLoops=1;targetHeight=options.overflow.height}else{if(options.height&&options.width){maxLoops=1;targetHeight=options.height;scrollHorizontally=true}}for(var loopCount=0;loopCount<maxLoops;loopCount++){$inBox.empty();var $destroyable;try{$destroyable=$cache.clone(true)}catch(e){$destroyable=$cache.clone()}$destroyable.css("visibility","hidden");for(var i=0;i<numCols;i++){var className=(i==0)?"first column":"column";var className=(i==numCols-1)?("last "+className):className;$inBox.append($("<div class='"+className+"' style='width:"+(Math.floor(100/numCols))+"%; float: "+options.columnFloat+";'></div>"))}var i=0;while(i<numCols-(options.overflow?0:1)||scrollHorizontally&&$destroyable.contents().length){if($inBox.children().length<=i){$inBox.append($("<div class='"+className+"' style='width:"+(Math.floor(100/numCols))+"%; float: "+options.columnFloat+";'></div>"))}var $col=$inBox.children().eq(i);columnize($col,$destroyable,$col,targetHeight);if(!$destroyable.contents().find(":first-child").hasClass("dontend")){split($col,$destroyable,$col,targetHeight)}else{}while(checkDontEndColumn($col.children(":last").length&&$col.children(":last").get(0))){var $lastKid=$col.children(":last");$lastKid.remove();$destroyable.prepend($lastKid)}i++}if(options.overflow&&!scrollHorizontally){var IE6=false
/*@cc_on || @_jscript_version < 5.7 @*/
;var IE7=(document.all)&&(navigator.appVersion.indexOf("MSIE 7.")!=-1);if(IE6||IE7){var html="";var div=document.createElement("DIV");while($destroyable[0].childNodes.length>0){var kid=$destroyable[0].childNodes[0];for(var i=0;i<kid.attributes.length;i++){if(kid.attributes[i].nodeName.indexOf("jQuery")==0){kid.removeAttribute(kid.attributes[i].nodeName)}}div.innerHTML="";div.appendChild($destroyable[0].childNodes[0]);html+=div.innerHTML}var overflow=$(options.overflow.id)[0];overflow.innerHTML=html}else{$(options.overflow.id).empty().append($destroyable.contents().clone(true))}}else{if(!scrollHorizontally){$col=$inBox.children().eq($inBox.children().length-1);while($destroyable.contents().length){$col.append($destroyable.contents(":first"))}var afterH=$col.height();var diff=afterH-targetHeight;var totalH=0;var min=10000000;var max=0;var lastIsMax=false;$inBox.children().each(function($inBox){return function($item){var h=$inBox.children().eq($item).height();lastIsMax=false;totalH+=h;if(h>max){max=h;lastIsMax=true}if(h<min){min=h}}}($inBox));var avgH=totalH/numCols;if(options.lastNeverTallest&&lastIsMax){adjustment+=30;if(adjustment<100){targetHeight=targetHeight+30;if(loopCount==maxLoops-1){maxLoops++}}else{loopCount=maxLoops}}else{if(max-min>30){targetHeight=avgH+30}else{if(Math.abs(avgH-targetHeight)>20){targetHeight=avgH}else{loopCount=maxLoops}}}}else{$inBox.children().each(function(i){$col=$inBox.children().eq(i);$col.width(options.width+"px");if(i==0){$col.addClass("first")}else{if(i==$inBox.children().length-1){$col.addClass("last")}else{$col.removeClass("first");$col.removeClass("last")}}});$inBox.width($inBox.children().length*options.width+"px")}}$inBox.append($("<br style='clear:both;'>"))}$inBox.find(".column").find(":first.removeiffirst").remove();$inBox.find(".column").find(":last.removeiflast").remove();$inBox.data("columnizing",false);if(options.overflow){options.overflow.doneFunc()}options.doneFunc()}})}})(jQuery);jQuery(document).ready(function(){ya.queue.exec("onload");if(jQuery.browser.msie&&parseInt(jQuery.browser.version,10)>=9){y5.Notify("dom:loaded",y5,null,true)}$(".b-informer-switcher").live("click",function(a){$(this).closest(".b-important-info").find(".b-informer-block").toggleClass("i-hidden");a.preventDefault()})});