1function nixp_auto_complete_disable_enter(){Prototype.Browser.Opera&&alert("Тег добавлен!")}function nixp_add_tag(e,t){return $(e).value&&(","==$(e).value.substr(-1)?$(e).value+=" ":", "!=$(e).value.substr(-2)&&($(e).value+=", ")),$(e).value+=t.innerHTML+", ",$(e).focus(),!1}function switchVisibility(e,t){var i=$(e);return i.visible()?(i.hide(),$(t).show()):($(t).hide(),i.show()),!1}BBCodeUtils={lamda:function(e){return e},filterArray:function(e,t,i){"undefined"==typeof i&&(i=this);for(var n=[],r=0;r<e.length;++r)t.call(i,e[r])&&n.push(e[r]);return n},itemEquals:function(e,t){return BBCodeUtils.JSONstring.make(e)==BBCodeUtils.JSONstring.make(t)},JSONstring:{compactOutput:!1,includeProtos:!1,includeFunctions:!1,detectCirculars:!0,restoreCirculars:!0,make:function(e,t){return this.restore=t,this.mem=[],this.pathMem=[],this.toJsonStringArray(e).join("")},toObject:function(x){if(!this.cleaner)try{this.cleaner=new RegExp('^("(\\\\.|[^"\\\\\\n\\r])*?"|[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t])+?$')}catch(a){this.cleaner=/^(true|false|null|\[.*\]|\{.*\}|".*"|\d+|\d+\.\d+)$/}if(!this.cleaner.test(x))return{};if(eval("this.myObj="+x),!this.restoreCirculars||!alert)return this.myObj;if(this.includeFunctions){var x=this.myObj;for(var i in x)"string"!=typeof x[i]||x[i].indexOf("JSONincludedFunc:")||(x[i]=x[i].substring(17),eval("x[i]="+x[i]))}this.restoreCode=[],this.make(this.myObj,!0);var r=this.restoreCode.join(";")+";";return eval('r=r.replace(/\\W([0-9]{1,})(\\W)/g,"[$1]$2").replace(/\\.\\;/g,";")'),eval(r),this.myObj},toJsonStringArray:function(e,t){t||(this.path=[]),t=t||[];var i;switch(typeof e){case"object":if(this.lastObj=e,this.detectCirculars){for(var n=this.mem,r=this.pathMem,o=0;o<n.length;o++)if(e===n[o])return t.push('"JSONcircRef:'+r[o]+'"'),t;n.push(e),r.push(this.path.join("."))}if(e){if(e.constructor==Array){t.push("[");for(var o=0;o<e.length;++o)this.path.push(o),o>0&&t.push(",\n"),this.toJsonStringArray(e[o],t),this.path.pop();return t.push("]"),t}if("undefined"!=typeof e.toString){t.push("{");var s=!0;for(var o in e)if(this.includeProtos||e[o]!==e.constructor.prototype[o]){this.path.push(o);var a=t.length;s||t.push(this.compactOutput?",":",\n"),this.toJsonStringArray(o,t),t.push(":"),this.toJsonStringArray(e[o],t),t[t.length-1]==i?t.splice(a,t.length-a):s=!1,this.path.pop()}return t.push("}"),t}return t}return t.push("null"),t;case"unknown":case"undefined":case"function":if(!this.includeFunctions)return t.push(i),t;e="JSONincludedFunc:"+e,t.push('"');var l=["\n","\\n","\r","\\r",'"','\\"'];e+="";for(var o=0;6>o;o+=2)e=e.split(l[o]).join(l[o+1]);return t.push(e),t.push('"'),t;
1case"string":this.restore&&0==e.indexOf("JSONcircRef:")&&this.restoreCode.push("this.myObj."+this.path.join(".")+"="+e.split("JSONcircRef:").join("this.myObj.")),t.push('"');var l=["\n","\\n","\r","\\r",'"','\\"'];e+="";for(var o=0;6>o;o+=2)e=e.split(l[o]).join(l[o+1]);return t.push(e),t.push('"'),t;default:return t.push(String(e)),t}}},isInArray:function(e,t){for(var i=0;i<e.length;++i)if(BBCodeUtils.itemEquals(e[i],t))return!0;return!1},includeIntoArray:function(e,t){return this.isInArray(e,t)||e.push(t),e},type:function(e){if(void 0==e)return!1;if(e.nodeName)switch(e.nodeType){case 1:return"element";case 3:return/\S/.test(e.nodeValue)?"textnode":"whitespace"}else if("number"==typeof e.length){if(e.callee)return"arguments";if(e.item)return"collection"}return typeof e}},BBCodeConvertRule=function(e){this.options={appliesToBB:function(){return!1},toBBStart:BBCodeUtils.lambda,toBBEnd:BBCodeUtils.lambda,toBBContent:BBCodeUtils.lambda,appliesToHTML:function(){return!1},toHTMLStart:BBCodeUtils.lambda,toHTMLEnd:BBCodeUtils.lambda,toHTMLContent:BBCodeUtils.lambda};for(var t in e)this.options[t]=e[t]},BBCodeConvertRule.prototype={parser:null,appliesToBB:function(e){return"function"==BBCodeUtils.type(this.options.appliesToBB)?!!this.options.appliesToBB.call(this,e):!1},toBBStart:function(e){return"function"==BBCodeUtils.type(this.options.toBBStart)?this.options.toBBStart.call(this,e):"string"==BBCodeUtils.type(this.options.toBBStart)?this.options.toBBStart:this.options.toBBStart},toBBContent:function(e){return"function"==BBCodeUtils.type(this.options.toBBContent)?this.options.toBBContent.call(this,e):"string"==BBCodeUtils.type(this.options.toBBStart)?this.options.toBBContent:this.options.toBBContent},toBBEnd:function(e){return"function"==BBCodeUtils.type(this.options.toBBEnd)?this.options.toBBEnd.call(this,e):"string"==BBCodeUtils.type(this.options.toBBEnd)?this.options.toBBEnd:this.options.toBBEnd},doesToBBContent:function(e){return this.options.toBBContent==BBCodeUtils.lambda?!1:this.toBBContent(e)!==!1},appliesToHTML:function(e){return"function"==BBCodeUtils.type(this.options.appliesToHTML)?this.options.appliesToHTML(e):!1},toHTMLStart:function(e){return"function"==BBCodeUtils.type(this.options.toHTMLStart)?this.options.toHTMLStart(e):"string"==BBCodeUtils.type(this.options.toHTMLStart)?this.options.toHTMLStart:""},toHTMLEnd:function(e){return"function"==BBCodeUtils.type(this.options.toHTMLEnd)?this.options.toHTMLEnd(e):"string"==BBCodeUtils.type(this.options.toHTMLEnd)?this.options.toHTMLEnd:""},toHTMLContent:function(e){return"function"==BBCodeUtils.type(this.options.toHTMLContent)?this.options.toHTMLContent(e):"string"==BBCodeUtils.type(this.options.toHTMLContent)?this.options.toHTMLContent:!1},doesToHTMLContent:function(e){return this.options.toHTMLContent!==BBCodeUtils.lambda}},BBCodeTree=function(e,t){this.options={tagsSingle:[]},this.rules=[];for(var i in t)this.options[i]=t[i];this.text=e,this.toTree()},BBCodeTree.prototype={tagStack:[],offset:0,text:"",tree:[],toTree:function(){this.tree=[];for(var e=this.locateTagAfter(this.offset);e!==!1;){if(e.start>this.offset&&(0==this.tagStack.length?this.tree.push(this.text.substring(this.offset,e.start)):this.tagStack[this.tagStack.length-1].children.push(this.text.substring(this.offset,e.start))),"start"==e.data.type)BBCodeUtils.isInArray(this.options.tagsSingle,e.data.tag)?0==this.tagStack.length?this.tree.push(e):this.tagStack[this.tagStack.length-1].children.push(e):this.tagStack.push(e);else if(this.tagStack.length>0)if(e.data.tag==this.tagStack[this.tagStack.length-1].data.tag)1==this.tagStack.length?this.tree.push(this.tagStack.pop()):this.tagStack[this.tagStack.length-2].children.push(this.tagStack.pop());else if(BBCodeUtils.filterArray(this.tagStack,function(e){return e.data.tag==this.data.tag},e)){for(;e.data.tag!==this.tagStack[this.tagStack.length-1].data.tag;)this.tagStack[this.tagStack.length-2].children.push(this.tagStack.pop());1==this.tagStack.length?this.tree.push(this.tagStack.pop()):this.tagStack[this.tagStack.length-2].children.push(this.tagStack.pop())}this.offset=e.end,e=this.locateTagAfter(this.offset)}for(this.offset<this.text.length&&(0==this.tagStack.length?this.tree.push(this.text.substring(this.offset)):this.tagStack[this.tagStack.length-1].children.push(this.text.substring(this.offset)));this.tagStack.length>0;)1==this.tagStack.length?this.tree.push(this.tagStack.pop()):this.tagStack[this.tagStack.length-2].children.push(this.tagStack.pop())},locateTagAfter:function(e){for(var t=-2;-2==t&&e<=this.text.length;){if(t=this.text.substr(e).indexOf(this.options.openSymbol),-1==t)return!1;var i=this.text.substr(e+t+1).indexOf(this.options.closeSymbol);if(!(this.text.substr(e+t+1).indexOf(this.options.openSymbol)<i&&this.text.substr(e+t+1).indexOf(this.options.openSymbol)>=0))return{data:this.tagToObject(this.text.substr(e+t+1,i)),start:e+t,end:e+t+i+2,children:[]};e=e+t+1,t=-2}},tagToObject:function(e){if("/"==e.substr(0,1)){var t="end";e=e.substr(1)}else var t="start";parts=e.match(/([^\s=]+(=("[^"]+"|[^\s]+))?)/gi);var i={};if(parts[0].indexOf("=")>0)var e=parts[0].split("=")[0];else var e=parts[0];for(var n=0;n<parts.length;++n)if(parts[n].indexOf("=")>0){var r=parts[n].split("=").slice(1).join("=");'"'==r[0]&&'"'==r[r.length-1]&&(r=r.substring(1,r.length-2)),i[parts[n].split("=")[0]]=r}else i[parts[n]]=parts[n];return{tag:e,params:i,type:t,children:[]}}},BBCode=function(e){this.options={tagsSingle:[],openSymbol:"[",closeSymbol
1:"]"};for(var t in e)this.options[t]=e[t]},BBCode.prototype={rules:[],BBTextFilters:[],HTMLTextFilters:[],addRule:function(e){return this.rules.push(new BBCodeConvertRule(e)),this},addBBTextFilter:function(e){return"function"==BBCodeUtils.type(e)&&(this.BBTextFilters=BBCodeUtils.includeIntoArray(this.BBTextFilters,e)),this},addHTMLTextFilter:function(e){return"function"==BBCodeUtils.type(e)&&(this.HTMLTextFilters=BBCodeUtils.includeIntoArray(this.HTMLTextFilters,e)),this},toBBCode:function(e){var t=document.createElement("div");t.innerHTML=unescape(e);var i=this.nodesToBBcode(t.childNodes);return i},toHTML:function(e){var t=new BBCodeTree(e,this.options);return this.nodesToHTML(t.tree)},applyBBTextFilters:function(e){if(void 0==e)return"";for(var t=0;t<this.BBTextFilters.length;++t){var i=this.BBTextFilters[t](e);void 0!=i&&(e=i)}return e},applyHTMLTextFilters:function(e){if(void 0==e)return"";for(var t=0;t<this.HTMLTextFilters.length;++t){var i=this.HTMLTextFilters[t](e);void 0!=i&&(e=i)}return e},nodeToBBcode:function(e){var t="";if("textnode"==BBCodeUtils.type(e))return this.applyBBTextFilters("undefined"!=typeof e.textContent?e.textContent:e.data);if("whitespace"==BBCodeUtils.type(e))return this.applyBBTextFilters("undefined"!=typeof e.textContent?e.textContent:e.data);if("element"!==BBCodeUtils.type(e))return"";for(var i=BBCodeUtils.filterArray(this.rules,function(e){return e.appliesToHTML(this)},e),n=0;n<i.length;++n){var r=i[n].toBBStart(e);"undefined"!=typeof r&&(t+=r)}var o=BBCodeUtils.filterArray(i,function(e){return e.doesToBBContent(this)},e);t+=o.length>0?o[0].toBBContent(e):this.nodesToBBcode(e.childNodes);for(var n=i.length-1;n>=0;--n){var r=i[n].toBBEnd(e);"undefined"!=typeof r&&(t+=r)}return t},nodesToBBcode:function(e){for(var t="",i=0;i<e.length;++i)t+=this.nodeToBBcode(e[i]);return t},nodeToHTML:function(e){var t="";if("string"==BBCodeUtils.type(e))return this.applyHTMLTextFilters(e);for(var i=BBCodeUtils.filterArray(this.rules,function(e){return e.appliesToBB(this)},e),n=0;n<i.length;++n){var r=i[n].toHTMLStart(e);void 0!=r&&(t+=r)}var o=BBCodeUtils.filterArray(i,function(e){return e.doesToHTMLContent(this)},e);t+=o.length>0?o[0].toHTMLContent(e):this.nodesToHTML(e.children);for(var n=i.length-1;n>=0;--n){var r=i[n].toHTMLEnd(e);void 0!=r&&(t+=r)}return t},nodesToHTML:function(e){for(var t="",i=0;i<e.length;++i)t+=this.nodeToHTML(e[i]);return t}},function($){$.fn.markItUp=function(settings,extraSettings){var method,params,options,ctrlKey,shiftKey,altKey;ctrlKey=shiftKey=altKey=!1,"string"==typeof settings&&(method=settings,params=extraSettings),options={id:"",nameSpace:"",root:"",previewHandler:!1,previewInWindow:"",previewInElement:"",previewAutoRefresh:!0,previewPosition:"after",previewTemplatePath:"~/templates/preview.html",previewParser:!1,previewParserPath:"",previewParserVar:"data",resizeHandle:!0,beforeInsert:"",afterInsert:"",onEnter:{},onShiftEnter:{},onCtrlEnter:{},onTab:{},markupSet:[{}]},$.extend(options,settings,extraSettings),options.root||$("script").each(function(e,t){miuScript=$(t).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/),null!==miuScript&&(options.root=miuScript[1])});var uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},matched=uaMatch(navigator.userAgent),browser={};return matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),this.each(function(){function localize(e,t){return t?e.replace(/("|')~\//g,"$1"+options.root):e.replace(/^~\//,options.root)}function init(){id="",nameSpace="",options.id?id='id="'+options.id+'"':$$.attr("id")&&(id='id="markItUp'+$$.attr("id").substr(0,1).toUpperCase()+$$.attr("id").substr(1)+'"'),options.nameSpace&&(nameSpace='class="'+options.nameSpace+'"'),$$.wrap("<div "+nameSpace+"></div>"),$$.wrap("<div "+id+' class="markItUp"></div>'),$$.wrap('<div class="markItUpContainer"></div>'),$$.addClass("markItUpEditor"),header=$('<div class="markItUpHeader"></div>').insertBefore($$),$(dropMenus(options.markupSet)).appendTo(header),footer=$('<div class="markItUpFooter"></div>').insertAfter($$),options.resizeHandle===!0&&browser.safari!==!0&&(resizeHandle=$('<div class="markItUpResizeHandle"></div>').insertAfter($$).bind("mousedown.markItUp",function(e){var t,i,n=$$.height(),r=e.clientY;t=function(e){return $$.css("height",Math.max(20,e.clientY+n-r)+"px"),!1},i=function(){return $("html").unbind("mousemove.markItUp",t).unbind("mouseup.markItUp",i),!1},$("html").bind("mousemove.markItUp",t).bind("mouseup.markItUp",i)}),footer.append(resizeHandle)),$$.bind("keydown.markItUp",keyPressed).bind("keyup",keyPressed),$$.bind("insertion.markItUp",function(e,t){t.target!==!1&&get(),textarea===$.markItUp.focused&&markup(t)}),$$.bind("focus.markItUp",function(){$.markItUp.focused=this}),options.previewInElement&&refreshPreview()}function dropMenus(markupSet){var ul=$("<ul></ul>"),i=0;return $("li:hover > ul",ul).css("display","block"),$.each(markupSet,function(){var button=this,t="",title,li,j;if(title=button.key?(button.name||"")+" [Ctrl+"+button.key+"]":button.name||"",key=button.key?'accesskey="'+button.key+'"':"",button.separator)li=$('<li class="markItUpSeparator">'+(button.separator||"")+"</li>").appendTo(ul);else{for(i++,j=levels.length-1;j>=0;j--)t+=levels[j]+"-";li=$('<li class="markItUpButton markItUpButton'+t+i+" "+(button.className||"")+'"><a href="" '+key+' title="'+title+'">'+(button.name||"")+"</a></li>").bind("contextmenu.markItUp",function(){return!1}).bind("click.markItUp",function(e){e.preventDefault()}).bind("focusin.markItUp",function(){$$.focus()}).bind("mouseup",function(){return button.call&&eval(button.call)(),setTimeout(function(){markup(button)},1),!1}).bind("mouseenter.markItUp",function(){$("> ul",this).show(),$(document).one("click",function(){$("ul ul",header).hide()})}).bind("mouseleave.markItUp",function(){$("> ul",this).hide()}
1).appendTo(ul),button.dropMenu&&(levels.push(i),$(li).addClass("markItUpDropMenu").append(dropMenus(button.dropMenu)))}}),levels.pop(),ul}function magicMarkups(e){return e?(e=e.toString(),e=e.replace(/\(\!\(([\s\S]*?)\)\!\)/g,function(e,t){var i=t.split("|!|");return altKey===!0?void 0!==i[1]?i[1]:i[0]:void 0===i[1]?"":i[0]}),e=e.replace(/\[\!\[([\s\S]*?)\]\!\]/g,function(e,t){var i=t.split(":!:");return abort===!0?!1:(value=prompt(i[0],i[1]?i[1]:""),null===value&&(abort=!0),value)})):""}function prepare(e){return $.isFunction(e)&&(e=e(hash)),magicMarkups(e)}function build(e){var t=prepare(clicked.openWith),i=prepare(clicked.placeHolder),n=prepare(clicked.replaceWith),r=prepare(clicked.closeWith),o=prepare(clicked.openBlockWith),s=prepare(clicked.closeBlockWith),a=clicked.multiline;if(""!==n)block=t+n+r;else if(""===selection&&""!==i)block=t+i+r;else{e=e||selection;var l=[e],c=[];a===!0&&(l=e.split(/\r?\n/));for(var h=0;h<l.length;h++){line=l[h];var u;c.push((u=line.match(/ *$/))?t+line.replace(/ *$/g,"")+r+u:t+line+r)}block=c.join("\n")}return block=o+block+s,{block:block,openBlockWith:o,openWith:t,replaceWith:n,placeHolder:i,closeWith:r,closeBlockWith:s}}function markup(e){var t,i,n,r;if(hash=clicked=e,get(),$.extend(hash,{line:"",root:options.root,textarea:textarea,selection:selection||"",caretPosition:caretPosition,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey}),prepare(options.beforeInsert),prepare(clicked.beforeInsert),(ctrlKey===!0&&shiftKey===!0||e.multiline===!0)&&prepare(clicked.beforeMultiInsert),$.extend(hash,{line:1}),ctrlKey===!0&&shiftKey===!0){for(lines=selection.split(/\r?\n/),i=0,n=lines.length,r=0;n>r;r++)""!==$.trim(lines[r])?($.extend(hash,{line:++i,selection:lines[r]}),lines[r]=build(lines[r]).block):lines[r]="";string={block:lines.join("\n")},start=caretPosition,t=string.block.length+(browser.opera?n-1:0)}else ctrlKey===!0?(string=build(selection),start=caretPosition+string.openWith.length,t=string.block.length-string.openWith.length-string.closeWith.length,t-=string.block.match(/ $/)?1:0,t-=fixIeBug(string.block)):shiftKey===!0?(string=build(selection),start=caretPosition,t=string.block.length,t-=fixIeBug(string.block)):(string=build(selection),start=caretPosition+string.block.length,t=0,start-=fixIeBug(string.block));""===selection&&""===string.replaceWith&&(caretOffset+=fixOperaBug(string.block),start=caretPosition+string.openBlockWith.length+string.openWith.length,t=string.block.length-string.openBlockWith.length-string.openWith.length-string.closeWith.length-string.closeBlockWith.length,caretOffset=$$.val().substring(caretPosition,$$.val().length).length,caretOffset-=fixOperaBug($$.val().substring(0,caretPosition))),$.extend(hash,{caretPosition:caretPosition,scrollPosition:scrollPosition}),string.block!==selection&&abort===!1?(insert(string.block),set(start,t)):caretOffset=-1,get(),$.extend(hash,{line:"",selection:selection}),(ctrlKey===!0&&shiftKey===!0||e.multiline===!0)&&prepare(clicked.afterMultiInsert),prepare(clicked.afterInsert),prepare(options.afterInsert),previewWindow&&options.previewAutoRefresh&&refreshPreview(),shift
1Key=altKey=ctrlKey=abort=!1}function fixOperaBug(e){return browser.opera?e.length-e.replace(/\n*/g,"").length:0}function fixIeBug(e){return browser.msie?e.length-e.replace(/\r*/g,"").length:0}function insert(e){if(document.selection){var t=document.selection.createRange();t.text=e}else textarea.value=textarea.value.substring(0,caretPosition)+e+textarea.value.substring(caretPosition+selection.length,textarea.value.length)}function set(e,t){if(textarea.createTextRange){if(browser.opera&&browser.version>=9.5&&0==t)return!1;range=textarea.createTextRange(),range.collapse(!0),range.moveStart("character",e),range.moveEnd("character",t),range.select()}else textarea.setSelectionRange&&textarea.setSelectionRange(e,e+t);textarea.scrollTop=scrollPosition,textarea.focus()}function get(){if(textarea.focus(),scrollPosition=textarea.scrollTop,document.selection)if(selection=document.selection.createRange().text,browser.msie){var e=document.selection.createRange(),t=e.duplicate();for(t.moveToElementText(textarea),caretPosition=-1;t.inRange(e);)t.moveStart("character"),caretPosition++}else caretPosition=textarea.selectionStart;else caretPosition=textarea.selectionStart,selection=textarea.value.substring(caretPosition,textarea.selectionEnd);return selection}function preview(){"function"==typeof options.previewHandler?previewWindow=!0:options.previewInElement?previewWindow=$(options.previewInElement):!previewWindow||previewWindow.closed?options.previewInWindow?(previewWindow=window.open("","preview",options.previewInWindow),$(window).unload(function(){previewWindow.close()})):(iFrame=$('<iframe class="markItUpPreviewFrame"></iframe>'),"after"==options.previewPosition?iFrame.insertAfter(footer):iFrame.insertBefore(header),previewWindow=iFrame[iFrame.length-1].contentWindow||frame[iFrame.length-1]):altKey===!0&&(iFrame?iFrame.remove():previewWindow.close(),previewWindow=iFrame=!1),options.previewAutoRefresh||refreshPreview(),options.previewInWindow&&previewWindow.focus()}function refreshPreview(){renderPreview()}function renderPreview(){if(options.previewHandler&&"function"==typeof options.previewHandler)options.previewHandler($$.val());else if(options.previewParser&&"function"==typeof options.previewParser){var e=options.previewParser($$.val());writeInPreview(localize(e,1))}else""!==options.previewParserPath?$.ajax({type:"POST",dataType:"text",global:!1,url:options.previewParserPath,data:options.previewParserVar+"="+encodeURIComponent($$.val()),success:function(e){writeInPreview(localize(e,1))}}):template||$.ajax({url:options.previewTemplatePath,dataType:"text",global:!1,success:function(e){writeInPreview(localize(e,1).replace(/<!-- content -->/g,$$.val()))}});return!1}function writeInPreview(e){if(options.previewInElement)$(options.previewInElement).html(e);else if(previewWindow&&previewWindow.document){try{sp=previewWindow.document.documentElement.scrollTop}catch(t){sp=0}previewWindow.document.open(),previewWindow.document.write(e),previewWindow.document.close(),previewWindow.document.documentElement.scrollTop=sp}}function keyPressed(e){if(shiftKey=e.shiftKey,altKey=e.altKey,ctrlKey=e.altKey&&e.ctrlKey?!1:e.ctrlKey||e.metaKey,"keydown"===e.type){if(ctrlKey===!0&&(li=$('a[accesskey="'+(13==e.keyCode?"\\n":String.fromCharCode(e.keyCode))+'"]',header).parent("li"),0!==li.length))return ctrlKey=!1,setTimeout(function(){li.triggerHandler("mouseup")},1),!1;if(13===e.keyCode||10===e.keyCode)return ctrlKey===!0?(ctrlKey=!1,markup(options.onCtrlEnter),options.onCtrlEnter.keepDefault):shiftKey===!0?(shiftKey=!1,markup(options.onShiftEnter),options.onShiftEnter.keepDefault):(markup(options.onEnter),options.onEnter.keepDefault);if(9===e.keyCode)return 1==shiftKey||1==ctrlKey||1==altKey?!1:-1!==caretOffset?(get(),caretOffset=$$.val().length-caretOffset,set(caretOffset,0),caretOffset=-1,!1):(markup(options.onTab),options.onTab.keepDefault)}}function remove(){$$.unbind(".markItUp").removeClass("markItUpEditor"),$$.parent("div").parent("div.markItUp").parent("div").replaceWith($$),$$.data("markItUp",null)}var $$,textarea,levels,scrollPosition,caretPosition,caretOffset,clicked,hash,header,footer,previewWindow,template,iFrame,abort;if($$=$(this),textarea=this,levels=[],abort=!1,scrollPosition=caretPosition=0,
1caretOffset=-1,options.previewParserPath=localize(options.previewParserPath),options.previewTemplatePath=localize(options.previewTemplatePath),method)switch(method){case"remove":remove();break;case"insert":markup(params);break;default:$.error("Method "+method+" does not exist on jQuery.markItUp")}else init()})},$.fn.markItUpRemove=function(){return this.each(function(){$(this).markItUp("remove")})},$.markItUp=function(e){var t={target:!1};return $.extend(t,e),t.target?$(t.target).each(function(){$(this).focus(),$(this).trigger("insertion",[t])}):void $("textarea").trigger("insertion",[t])}}(jQuery),mySettings={previewParserPath:"/bbcode/action/ajaxPreview",markupSet:[{name:"Bold",key:"B",openWith:"[b]",closeWith:"[/b]"},{name:"Italic",key:"I",openWith:"[i]",closeWith:"[/i]"},{name:"Underline",key:"U",openWith:"[u]",closeWith:"[/u]"},{name:"Stroke",key:"S",openWith:"[s]",closeWith:"[/s]"},{separator:"---------------"},{name:"Picture",key:"P",replaceWith:"[img][![Url]!][/img]"},{name:"Link",key:"L",openWith:"[url=[![Url]!]]",closeWith:"[/url]",placeHolder:"Your text to link here..."},{separator:"---------------"},{name:"Bulleted list",openWith:"[list]\n",closeWith:"\n[/list]"},{name:"Numeric list",openWith:"[list=]\n",closeWith:"\n[/list]"},{name:"List item",openWith:"[*] "},{separator:"---------------"},{name:"Quotes",openWith:"[quote]",closeWith:"[/quote]"},{name:"Code",openWith:"[code]",closeWith:"[/code]"},{separator:"---------------"},{name:"Preview",className:"preview",call:"preview"}]},InlineHelp={init:function(){$$("*[help]").each(this.treatEl,this)},treatEl:function(e){e.observe("focus",this.focus.bindAsEventListener(this)),e.observe("blur",this.blur.bindAsEventListener(this)),e.getForm().observe("submit",this.treatFocus.bind(this,e)),e.addClassName("inline-helped"),this.treatBlur(e)},focus:function(e){this.treatFocus(e.element())},treatFocus:function(e){e.readAttribute("help")==e.getValue()&&(e.removeClassName("inline-helped-passive"),e.setValue(""))},blur:function(e){this.treatBlur(e.element())},treatBlur:function(e){e.getValue()||(e.addClassName("inline-helped-passive"),e.setValue(e.readAttribute("help")))}},document.observe("dom:loaded",InlineHelp.init.bind(InlineHelp)),main={alertTimeout:1e4,errorMessages:{s403:"У Ð²Ð°Ñ Ð½ÐµÑ Ð´Ð¾ÑÑÑпа Ð´Ð»Ñ Ð²ÑÐ¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ ÑÑой опеÑаÑии.",s404:"ÐбÑÐµÐºÑ Ð½Ðµ найден в базе даннÑÑ
. Ðозможно, он бÑл Ñдален.",s500:"СеÑÐ²ÐµÑ Ð²Ñеменно не обÑлÑÐ¶Ð¸Ð²Ð°ÐµÑ Ð·Ð°Ð¿ÑоÑÑ. ÐопÑобÑйÑе повÑоÑиÑÑ Ñвой запÑÐ¾Ñ Ð¿Ð¾Ð·Ð¶Ðµ.",s0:"СеÑÐ²ÐµÑ Ð²Ñеменно недоÑÑÑпен. Ðозможно, Ñ Ð²Ð°Ñ Ð¿ÑÐ¾Ð±Ð»ÐµÐ¼Ñ Ñ Ð´Ð¾ÑÑÑпом в инÑеÑнеÑ. ÐопÑобÑйÑе повÑоÑиÑÑ Ñвой запÑÐ¾Ñ Ð¿Ð¾Ð·Ð¶Ðµ.",other:"ÐÑоизоÑла непÑÐµÐ´Ð²Ð¸Ð´ÐµÐ½Ð½Ð°Ñ Ð¾Ñибка. ÐопÑобÑйÑе повÑоÑиÑÑ Ñвой запÑÐ¾Ñ Ð¿Ð¾Ð·Ð¶Ðµ.",norights:"У Ð²Ð°Ñ Ð½ÐµÐ´Ð¾ÑÑаÑоÑно пÑав"},href:"javascript:void(0)",checkRequest:function(e){(e.success()===!1||0==e.getStatus())&&this.handleError(e)},handleError:function(e){var t,i=e.getStatus();switch(i){case 400:break;case 401:User.showLoginForm();break;case 403:t=e.transport.responseText?e.transport.responseText:this.errorMessages["s"+i],this.alert(t);break;case 404:this.reload();break;case 500:case 0:this.alert(this.errorMessages["s"+i]);break;default:this.alert(this.errorMessages.other)}},showGrid:function(){($(document.body).getWidth()||document.viewport.getWidth())+"px",($(document.body).getHeight()||document.viewport.getHeight())+"px";$("grid").setStyle({display:"block"})},hideGrid:function(){$("grid").hide()},alert:function(e,t){if(!e)return this.hideGrid(),$("messageAlert").remove(),Event.stopObserving(window,"keydown",this.alertEscapeObserver),User&&User.hideLoginForm(),!0;this.showGrid();var i='<div id="messageAlert"><div id="messageAlertText"><a id="alert_close" href="#" onClick="main.alert(); return false;"></a><strong>'+e+"</strong>"+(t?'<div id="messageAlertCloseText"><a href="#" onClick="main.alert(); return false;">'+t+"</a></div>":"")+"</div></div>";return $(document.body).insert({bottom:i}
1),Event.observe(window,"keydown",this.alertEscapeObserver),!0},alertEscapeObserver:function(e){e.keyCode==Event.KEY_ESC&&main.alert()},recalculateReloadSeconds:function(e){var t=Math.round(e/1e3);t&&($("messageAlertSeconds").innerHTML=t+" ÑекÑнд"+(1==t?"Ñ":5>t?"Ñ":""),e-=1e3,setTimeout(this.recalculateReloadSeconds.bind(this,e),1e3))},reload:function(){this.alert('<div>СÑÑаниÑа бÑÐ´ÐµÑ Ð°Ð²ÑомаÑиÑеÑки пеÑезагÑÑжена ÑеÑез <span id="messageAlertSeconds"></span>.</div><a class="alert_okay" href="#" onClick="javascript:window.location.reload();">ÐÑ Ð¸ ладно!</a>'),this.recalculateReloadSeconds(this.alertTimeout),setTimeout("location.reload()",this.alertTimeout)},check42:function(){return"42"==$("searchInput").value?(Effect.toggle("aum42","slide"),!1):!0},extractUoi:function(e,t){return t=t||"-",e.substr(e.lastIndexOf(t)+1)},extractId:function(e){return e.substr(e.lastIndexOf(":")+1)},extractModel:function(e){var t=e.lastIndexOf("-");return e.substring(t+1,e.lastIndexOf(":"))},isDev:function(){var e=location.href.match(/dev.php/);return!!e},makeUrl:function(e){return this.isDev()?"/dev.php"+e:e},ensureVisibility:function(e,t,i){if(e){t=t||e;var n=e.viewportOffset(),r=t.viewportOffset();(n.top<0||r.top+t.getHeight()>document.viewport.getHeight())&&Effect.ScrollTo(e.id,i)}else Effect.ScrollTo(t.id,Object.extend({offset:-200},i))},begPardon:function(){this.alert('Ð ÑожалениÑ, ÑÑи даннÑе Ð¼Ñ Ð²Ð°Ð¼ пока не покажем. Ð ÑÑо Ð²Ñ Ñ
оÑели Ð¾Ñ Ð°Ð»ÑÑа-веÑÑии?<em>P.S. Ðе волнÑйÑеÑÑ: вÑе бÑÐ´ÐµÑ â <a href="http://bugs.nixp.ru/milestone/Irgendwann">Irgendwann</a>.</em>')},link:function(e,t){return e.href=this.href,e.observe("click",t),t},setCookie:function(e,t,i){i||(i=30);var n="",r=new Date;r.setTime(r.getTime()+24*i*60*60*1e3),n="; expires="+r.toGMTString(),document.cookie=e+"="+t+n+"; path=/"},getCookie:function(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var r=i[n];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return null},removeCookie:function(e){createCookie(e,"",-1)},setHash:function(e,t){var i=this.getHash(e),n=";"+e+"="+t;if(i){var r=new RegExp(";"+e+"=([^;]*)");location.hash=location.hash.replace(r,n)}else location.hash+=n},getHash:function(e){if(!e)return location.hash.substr(1);var t=new RegExp(";"+e+"=([^;]*)"),i=location.hash.match(t);return i&&i[1]},nixpAntiMsiePolicy:function(){if(!Prototype.Browser.IE)return!0;Prototype.Browser.IE6=Prototype.Browser.IE&&6==parseInt(navigator.userAgent.
1substring(navigator.userAgent.indexOf("MSIE")+5)),Prototype.Browser.IE7=Prototype.Browser.IE&&7==parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)),Prototype.Browser.IE8=Prototype.Browser.IE&&!Prototype.Browser.IE6&&!Prototype.Browser.IE7;var e='<div id="stopmsie"><strong>nixp.ru ÑекомендÑÐµÑ Ð²Ð°Ð¼ оÑказаÑÑÑÑ Ð¾Ñ Internet Explorer</strong> в полÑÐ·Ñ Ð°Ð´ÐµÐºÐ²Ð°ÑнÑÑ Ð¸ оÑкÑÑÑÑÑ Ð±ÑаÑзеÑов: <a href="http://www.mozilla.com?from=sfx&uid=191642&t=556">Firefox</a> или <a href="http://www.google.ru/chrome">Chrome</a>.</div>';if($("nixp").insert({before:e}),Prototype.Browser.IE6){$("nixp").addClassName("hidden");var t='<div id="ie6blocker" class="ie6fixed"><div>ÐÑоÑел Ñже не один год Ñ ÑÐµÑ Ð¿Ð¾Ñ, как <strong>иÑполÑзÑемÑй вами бÑаÑÐ·ÐµÑ ÐºÐ°ÑегоÑиÑеÑки ÑÑÑаÑел</strong>. ÐÑоме Ñого, <strong>он не поддеÑÐ¶Ð¸Ð²Ð°ÐµÑ Ð¼Ð¸ÑовÑе ÑÑандаÑÑÑ Ð² должной меÑе</strong>.<br /><br />Ðо ÑÑим пÑиÑинам <strong>Ð¼Ñ Ð½Ðµ можем гаÑанÑиÑоваÑÑ Ð°Ð´ÐµÐºÐ²Ð°Ñное оÑобÑажение и ÑÑнкÑиониÑование ÑайÑа</strong>.<br /><br />ÐаÑÑойÑиво <strong>ÑекомендÑем вам ÑмениÑÑ Ð±ÑаÑзеÑ</strong> на Ñакие пÑодÑкÑÑ, завоевавÑие миÑовое пÑизнание, как <a href="http://www.mozilla.com?from=sfx&uid=191642&t=556">Mozilla Firefox</a> или <a href="http://www.google.ru/chrome">Google Chrome</a>. ÐÑи Open Source-ÑазÑабоÑки не ÑолÑко гаÑанÑиÑÑÑÑ Ð±Ð¾Ð»ÐµÐµ вÑÑокое каÑеÑÑво оÑобÑÐ°Ð¶ÐµÐ½Ð¸Ñ ÑÑÑаниÑ, но и пÑедоÑÑавлÑÑÑ Ð±<em>о</em>лÑÑие возможноÑÑи, а Ñакже обеÑпеÑиваÑÑ Ð½Ð°Ð´ÐµÐ¶Ð½ÑÑ Ð¸ безопаÑнÑÑ ÑабоÑÑ Ð² инÑеÑнеÑе.<span><a onclick="main.nixpAntiMsiePolicyDisableIE6();" href="javascript:void(0);">Ðкей, Ñ ÑÐ¼ÐµÐ½Ñ Ð±ÑаÑзеÑ, но пока попÑобÑÑ Ð¿Ð¾ÑмоÑÑеÑÑ Ð¸Ð· IE6</a></span></div></div>';$("nixp").insert({before:t})}else $("nixp").addClassName("topfixed");return!0},nixpAntiMsiePolicyDisableIE6:function(){$("ie6blocker").remove(),$("nixp").removeClassName("hidden")}},main.waitingRoom={domLoaded:[main.nixpAntiMsiePolicy],windowLoaded:[],caller:function(e){this[e].invoke("call")},append:function(e){for(var t=1;t<arguments.length;t++)this[e].push(arguments[t])}},document.observe("dom:loaded",main.waitingRoom.caller.bind(main.waitingRoom,"domLoaded")),Event.observe(window,"load",main.waitingRoom.caller.bind(main.waitingRoom,"windowLoaded")),main.ajaxResponder={onFailure:main.checkRequest.bind(main)},Ajax.Responders.register(main.ajaxResponder),main.Object={redefine:function(e,t){var i;for(i in t)e["_original_"+i]=e[i],e[i]=t[i];return e},unredefine:function(e){var t,i;for(t in e)t.startsWith("_original_")&&(i=t.gsub("_original_",""),e[i]=e[t],delete e[t]);return e}},Object.extend(Object,main.Object),User={data:{},permanent:{},checkLogin:function(e,t){if(this.isAuthenticated())return!0;var i=e.element();return this.afterLogin=t?t:i.fireNativeEvent.bind(i,e.eventType||e.type),this.showLoginForm(),e.stop(),!1},showLoginForm:function(e){e?$("loginCloseLink").hide():(this.loginFormObserver=this.hideLoginForm.bindAsEventListener(this),Event.observe(window,"keydown",this.loginFormObserver)),main.showGrid(),$("loginform").setStyle({display:"block"}),$("loginFormUsername").value?$("loginFormPassword")?$("loginform").down(".login_enter").focus():$("loginFormPassword").focus():$("loginFormUsername").focus()},hideLoginForm:function(e){e&&e.keyCode!=Event.KEY_ESC||(main.hideGrid(),this.loginFormObserver&&(Event.stopObserving(window,"keydown",this.loginFormObserver),delete this.loginFormObserver),this.afterLogin&&delete this.afterLogin,$("loginError").update(""),$("loginform").hide())},login:function(e){var t={requestedData:this.stateChange.collectData().toJSON()};return t=Object.extend(t,e.serialize("hash")),Prototype.Browser.Opera||e.disable(),new Ajax.Request(e.action,{method:"post",parameters:t,onSuccess:this.loginSuccess.bind(this),onComplete:this.loginComplete.bind(this)}),!1},logout:function(){if(!this.inAdminPanel){var e=new Ajax.Request("/ajaxLogout",{onSuccess:this.logoutSuccess.bind(this)});return e}location.href=$("logout-link").href},loginSuccess:function(e){if(result=e.responseText.evalJSON(),this.loginComplete(),result.success){Object.extend(this.data,result.user); 2var t=this.afterLogin;this.hideLoginForm(),$("loginFormPassword").clear(),this.stateChange.login(result),t&&t()}else $("loginError").update(result.reason),$("loginFormPassword").focus()},loginComplete:function(){$("loginFormReal").enable()},logoutSuccess:function(e){result=e.responseText.evalJSON(),result.success&&(this.permanent.isSecure?location.reload(!0):(this.data={},this.stateChange.logout()))},hasCredential:function(e){return this.data.credentials&&-1!=this.data.credentials.indexOf(e)},getPreference:function(e){return this.data.preferences&&this.data.preferences[e]},setLocalPreference:function(e,t){return this.data.preferences[e]=t},setPreference:function(e,t){var i=this.getPreference(e),n=e+"-"+t.toString()+"-link",r=$(n);return new Ajax.Request(r.href),this.data.preferences[e]=t,this.stateChange.preferenceChanged(e,i,t),this},togglePreference:function(e){var t=this.getPreference(e),i="."+e+"-"+t.toString(),n="."+e+"-"+(!t).toString();return $$(i).invoke("toggle"),$$(n).invoke("toggle"),this.setPreference(e,!t),this},isAuthenticated:function(){return this.data.isAuthenticated}
2,attachEffect:function(){var e=$("profileCollapseLink");e&&(this.profileCollapseLinkObserver&&e.stopObserving("click",this.profileCollapseLinkObserver),this.profileCollapseLinkObserver=this.isAuthenticated()?Effect.toggle.bind(Effect,"profileCollapse","blind"):this.showLoginForm.bind(this,!1),e.observe("click",this.profileCollapseLinkObserver))},attachKeyNav:function(){Event.observe(document,"keydown",this.handleKeyNav.bindAsEventListener(this))},handleKeyNav:function(e){switch(e.keyCode){case 222:e.ctrlKey&&(this.toggleLogin(),Event.stop(e))}},toggleLogin:function(e){e&&$(e).blur(),this.isAuthenticated()?this.logout():this.showLoginForm()},stateChangeHandlers:{updateProfile:function(){this.attachEffect(),Effect.toggle("profileCollapse","blind");var e=$$("#profileCollapseLink span");e[0].update(this.data.displayName);var t=$("avatar");t.src=this.data.avatar,t.title=this.data.displayName,t.up("a").href=this.data.linkInfo,$("commentary-counter").update(this.data.commentaryCounter),$("update-counter-holder").update(this.data.updateCounter),$("update-counter-wrapper").show(),$("votesHTML").update(this.data.votesHTML),$("profileExitLink").show(),$("profileRegisterLink").hide()},defaultProfile:function(){for(var e,t,i=[["#profileCollapseLink span","<em>ÐойÑи</em>"]],n=0;n<i.length;n++)e=i[n][0],(t=$$(e))&&t.invoke("update",i[n][1]);var r=$("profileCollapse");r.visible()&&Effect.BlindUp("profileCollapse"),$("profileExitLink").hide(),$("profileRegisterLink").show()},redefineVisualEffects:function(){var e=User.getPreference("ShowVisualEffects");e===!1&&Object.redefine(Effect.Base.prototype,{start:function(e){e.duration=0,this._original_start(e)}})},unRedefineVisualEffects:function(){Object.unredefine(Effect.Base.prototype)},addGlobalListeners:function(){$$(".beg-pardon").each(function(e){e.href="javascript:void(0)",e.observe("click",main.begPardon.bind(main))})}}},User.stateChange={loadFuncs:[],loginFuncs:[],logoutFuncs:[],dataFuncs:[],preferenceChangeFuncs:{},append:function(){for(var e,t=0;t<arguments.length;t++)if(e=arguments[t],"function"==typeof e&&(e={load:e,login:e,logout:e}),"object"==typeof e.data&&(e.data=function(){return e.data}),e.load&&(document.loaded?e.load.call(this):this.loadFuncs.push(e.load)),e.login&&this.loginFuncs.push(e.login),e.logout&&this.logoutFuncs.push(e.logout),e.data&&this.dataFuncs.push(e.data),e.preferenceChange)for(var i in e.preferenceChange)this.preferenceChangeFuncs[i]||(this.preferenceChangeFuncs[i]=[]),this.preferenceChangeFuncs[i].push(e.preferenceChange[i])},load:function(){this.loadFuncs.invoke("call",this),delete this.loadFuncs},login:function(e){this.loginFuncs.invoke("call",this,e)},logout:function(){this.logoutFuncs.invoke("call",this)},collectData:function(){var e=[];return this.dataFuncs.each(function(t){e.push(t())}),e=e.compact()},preferenceChanged:function(e,t,i){var n=this.preferenceChangeFuncs[e];n&&n.invoke("call",this,t,i)}},main.waitingRoom.append("domLoaded",User.stateChange.load.bind(User.stateChange)),User.stateChange.append({load:User.attachKeyNav.bind(User)},{load:User.stateChangeHandlers.redefineVisualEffects.bind(User),login:User.stateChangeHandlers.redefineVisualEffects.bind(User),logout:User.stateChangeHandlers.unRedefineVisualEffects.bind(User),preferenceChange:{ShowVisualEffects:function(e,t){var i=["redefineVisualEffects","unRedefineVisualEffects"];User.stateChangeHandlers[i[+t]]()}}},User.attachEffect.bind(User),{login:User.stateChangeHandlers.updateProfile.bind(User),logout:User.stateChangeHandlers.defaultProfile.bind(User)},{preferenceChange:{ShowPreferences:function(e,t){$("user-preferences")[t?"show":"hide"]()}},load:User.stateChangeHandlers.addGlobalListeners.bind(User)}),Search={init:function(){this.tags=$("searchInput"),this.tags&&(this.form=this.tags.getForm(),this.form.observe("submit",this.prepareUrl.bindAsEventListener(this)))},prepareUrl:function(e){e&&e.stop();var t=this.tags.getValue();location.href=this.form.readAttribute("action")+"/"+encodeURIComponent("ÐÑе Ñ Ñег"+(-1==t.indexOf(",")?"ом":"ами")+" "+t).replace("%2F","[:slash:]").replace("%5C","[:backslash:]").replace("%3F","[:questionmark:]")+"/from/search"}},document.observe("dom:loaded",Search.init.bind(Search)),Vote={votesClasses:[[-2,"awful"],[-1,"bad"],[1,"good"],[2,"best"]],init:function(){document.body.linkify(this.put.bindAsEventListener(this))},translate:function(e,t){var i;return this.votesClasses.each(function(n){if(n[t]==e)throw i=n[1-t],$break}),i},put:function(e){var t=e.findElement("a");if(t&&t.up().hasClassName("votes")){if(e.stop(),t.up().hasClassName("blocked"))return void main.alert("Ðа Ñвои обÑекÑÑ Ð³Ð¾Ð»Ð¾ÑоваÑÑ Ð½ÐµÐ»ÑÐ·Ñ :-(","ХоÑоÑо, не бÑдÑ!");if(User.checkLogin(e,this.put.bind(this,e))){var i=$w(t.className).first().split("-"),n=i[0],r=(i[1],this.translate(n,1)),o=t.up().getUoi();if(!t.hasClassName("vote_set")){var s=$("current-votes-for-"+o),a=$("current-votes-sum-for-"+o),l=$("current-user-vote-for-"+o),c=s.innerHTML.split(" "),h=$("voting-panel-for-"+o),u=parseInt(c[0]),p=parseInt(l.innerHTML),d=parseInt(a.innerHTML);isNaN(u)?u=1:0==p&&(u+=1),l.innerHTML=r.toString(),d+=r-p,a.innerHTML=d.toString();var f=d/u;f=0>f?Math.floor(f):Math.ceil(f),0==f&&(f=1),s.setAttribute("class","vote"),s.addClassName(this.translate(f,0)+"-mini"),s.show();for(var g=h.childElements(),m=0;m<g.length;m++)g[m].addClassName("vote_faded"),g[m].hasClassName("vote_set")&&g[m].removeClassName("vote_set");t.removeClassName("vote_faded"),t.addClassName("vote_set"),s.innerHTML=u.toString(),new Ajax.Request(t.dataset.link)}}}},updateUserVote:function(e,t){var i={"vote-2":0,"vote-1":1,vote1:2,vote2:3};$("current-user-vote-for-"+e).update(t);for(var n=$("voting-panel-for-"+e),r=n.childElements(),o=0;o<r.length;o++)n.hasClassName("blocked")||r[o].addClassName("vote_faded"),r[o].hasClassName("vote_set")&&r[o].removeClassName("vote_set");t&&(r[i["vote"+t]].removeClassName("vote_faded"),r[i["vote"+t]].addClassName("vote_set"))},showVotingPanels:function(e){var e=e.collectVotingData;$$(".votes").each(function(t){var i=main.extractUoi(t.id);t[(e[i].couldSetVote?"remove":"add")+"ClassName"]("blocked"),this.updateUserVote(i,e[i].vote)},this)},hideVotingPanels:function(){$$(".votes").each(function(e){e.removeClassName("blocked"),e.childElements().invoke("removeClassName","vote_faded")},this)},collectVotingData:function(){var e=[];return $$(".votes").each(function(t){e.push(main.extractUoi(t.id))}),{func:"collectVotingData",arguments:e}}},User.stateChange.append({load:Vote.init.bind(Vote),login:Vote.showVotingPanels.bind(Vote),logout:Vote.hideVotingPanels.bind(Vote),data:Vote.collectVotingData.bind(Vote)});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.