function JCommentsEvents(){}function JCommentsInput(){}function JCommentsIndicator(){this.init()}function JCommentsForm(b,a){this.init(b,a)}function JCommentsEditor(a,b){this.init(a,b)}function JComments(b,c,a){this.init(b,c,a)}JCommentsEvents.prototype={add:function(d,c,b){if(d.addEventListener){d.addEventListener(c,b,false);return true}else{if(d.attachEvent){var a=d.attachEvent("on"+c,b);return a}else{return false}}},remove:function(c,b,a){if(c.removeEventListener){c.removeEventListener(b,a,false)}else{if(c.detachEvent){c.detachEvent("on"+b,c[b+a]);c[b+a]=null;c["e"+b+a]=null}}},cancel:function(a){if(a.stopPropagation){a.cancelBubble=true;a.preventDefault();a.stopPropagation()}a.returnValue=false;return false},target:function(b){var a;if(!b){b=window.event}if(b.target){a=b.target}else{if(b.srcElement){a=b.srcElement}}if(a.nodeType==3){a=a.parentNode}return a}};JCommentsInput.prototype={register:function(b){if(b){var c=this,a=new JCommentsEvents();a.add(b,"focus",function(d){return c.onFocus(d)});a.add(b,"blur",function(d){return c.onBlur(d)})}},unregister:function(b){if(b){var c=this,a=new JCommentsEvents();a.remove(b,"focus",function(d){return c.onFocus(d)});a.remove(b,"blur",function(d){return c.onBlur(d)})}},onFocus:function(b){var a=JCommentsEvents.prototype.target(b);if(a!=null){a.className=a.className.replace("error","")+" selected"}},onBlur:function(b){var a=JCommentsEvents.prototype.target(b);if(a!=null){a.className=a.className.replace("error","").replace("selected").replace(/^\s+/g,"")}}};JCommentsEditor.prototype={ta:null,l10n:{},tags:{},smiles:{},events:null,counter:null,focused:false,resizable:true,init:function(c,b){this.ta=JComments.prototype.$(c);this.panelElements={};this.l10n={counterPre:"",counterPost:" symbols left",enterValue:"Enter value"};this.resizable=b;this.events=new JCommentsEvents();this.defaultHeight=this.ta.clientHeight;this.defaultRows=this.ta.rows;if(this.resizable){this.addGrippie()}this.isWebkit=/webkit/.test(navigator.userAgent.toLowerCase());var a=this;this.events.add(document,!window.opera&&document.all?"keydown":"keypress",function(d){return a.onKeyPress(d)});this.events.add(this.ta,"click",function(d){return a.storeCaret(this.ta)});this.events.add(this.ta,"select",function(d){return a.storeCaret(this.ta)});this.events.add(this.ta,"change",function(d){a.onChange();return a.storeCaret(this.ta)});this.events.add(this.ta,"keyup",function(d){return a.onChange()});this.events.add(this.ta,"focus",function(d){return a.focused=true});this.events.add(this.ta,"blur",function(d){return a.focused=false})},onKeyPress:function(d){if(!this.focused){return}var c=false,a=String.fromCharCode(d.keyCode?d.keyCode:d.charCode),b=null;for(var f in this.tags){b=this.tags[f];if(!b.key||a.toUpperCase()!=b.key.toUpperCase()){continue}if(b.ctrl&&!d[b.ctrl+"Key"]){continue}this.insertTag(f);return this.events.cancel(d)}return d.returnValue},defined:function(a){return(typeof(a)!="undefined")},clear:function(){this.ta.value="";if(this.defaultHeight){this.ta.style.height=this.defaultHeight+"px"}this.updateCounter()},focus:function(){this.ta.focus()},storeCaret:function(){var a=this.ta;if(a.createTextRange){a.caretPos=document.selection.createRange().duplicate()}},getElementPos:function(b){var a={left:0,top:0,right:0,bottom:0};while(b!=null){a.left+=b.offsetLeft;a.top+=b.offsetTop;b=b.offsetParent}a.right+=a.left;a.bottom+=a.top;return a},getSelection:function(){var a=this.ta,b="";if(document.selection&&document.selection.createRange){b=document.selection.createRange().text}else{b=a.value.substr(a.selectionStart,a.selectionEnd-a.selectionStart)}return b},insertText:function(f){var a=this.ta;if(this.defined(a.caretPos)&&a.createTextRange){a.focus();var e=document.selection.createRange();e.text=e.text+f;a.focus()}else{if(this.defined(a.selectionStart)){var b=a.value.substr(0,a.selectionStart);var d=a.value.substr(a.selectionEnd),c=a.scrollTop;a.value=b+f+d;if(a.setSelectionRange){a.focus();a.setSelectionRange(b.length+f.length,b.length+f.length)}a.scrollTop=c}else{a.value+=f;a.focus(a.value.length-1)}}},surroundText:function(f,e){var d=this.ta;if(this.defined(d.caretPos)&&d.createTextRange){var h=d.caretPos,j=h.text.length;h.text=h.text.charAt(h.text.length-1)==" "?f+h.text+e+" ":f+h.text+e;if(j==0){h.moveStart("character",-e.length);h.moveEnd("character",-e.length);h.select()}else{d.focus(h)}}else{if(this.defined(d.selectionStart)){var k=d.value.substr(0,d.selectionStart),g=d.value.substr(d.selectionEnd);var b=d.value.substr(d.selectionStart,d.selectionEnd-d.selectionStart);var c=d.selectionStart,a=d.scrollTop;d.value=k+f+b+e+g;if(d.setSelectionRange){if(b.length==0){d.setSelectionRange(c+f.length,c+f.length)}else{d.setSelectionRange(c,c+f.length+b.length+e.length)}d.focus()}d.scrollTop=a}else{d.value+=f+e;d.focus(d.value.length-1)}}},insertTag:function(d){var a=this.tags[d],b=this.ta,c="";if(!a){return}c=this.getSelection();if(c.length>0){this.surroundText(a.open,a.close)}},initTags:function(){if(this.bbc==null||this.bbc.length==0){this.bbc={};this.bbc.b={id:"bbcode-b",open:"[b]",close:"[/b]",key:"B",ctrl:"ctrl",hint:"Bold"};this.bbc.i={id:"bbcode-i",open:"[i]",close:"[/i]",key:"I",ctrl:"ctrl",hint:"Italic"};this.bbc.u={id:"bbcode-u",open:"[u]",close:"[/u]",key:"u",ctrl:"ctrl",hint:"Underline"};this.bbc.s={id:"bbcode-s",open:"[s]",close:"[/s]",key:null,ctrl:null,hint:"Strikeout"};this.bbc.img={id:"bbcode-img",open:"[img]",close:"[/img]",key:null,ctrl:null,hint:"Image"};this.bbc.url={id:"bbcode-url",open:"[url]",close:"[/url]",key:null,ctrl:null,hint:"Link"};this.bbc.hide={id:"bbcode-hide",open:"[hide]",close:"[/hide]",key:null,ctrl:null,hint:"Hidden"};this.bbc.quote={id:"bbcode-quote",open:"[quote]",close:"[/quote]",key:"Q",ctrl:"ctrl",hint:"Quote"};this.bbc.list={id:"bbcode-list",open:"[list][*]",close:"[/list]",key:"L",ctrl:"ctrl",hint:"List"}}},createButton:function(d,b,j,g){var h=document.createElement("a");h.style.display="block";h.setAttribute("href","#");if(d){h.setAttribute("id",d)}if(b){h.setAttribute("title",b)}if(j){h.className=j}var a=h;h.onclick=(g!=null?function(){g(a);return false}:function(){return false});return h},addButton:function(g,b,e){if(this.ta){this.initTags();var a=this.bbc[g],c=this;if(!a){return}if(this.bbcPanel==null){this.bbcPanel=document.createElement("span");this.bbcPanel.className="bbcode";this.bbcPanel.style.display="block";this.ta.parentNode.insertBefore(this.bbcPanel,this.ta)}var d=function(){var h=c.getSelection();if(h.length>0){c.surroundText(a.open,a.close)}else{var f=prompt(e,"");if(null!=f&&""!=f){c.insertText(a.open+f+a.close)}}return false};a.e=this.createButton(a.id,(b!=null?b:a.hint),a.id,d);this.bbcPanel.appendChild(a.e);this.tags[a.id]=a}},initSmiles:function(c){this.smilesPath=c;if(this.ta){this.smilesPanel=document.createElement("div");this.smilesPanel.className=this.bbcPanel?"smilespanel":"smiles";if(this.bbcPanel){this.smilesPanel.setAttribute("style","display: none;");this.smilesPanel.onclick=function(){this.style.display="none"};var a=this,b=function(h){var f=a.smilesPanel,g=a.getElementPos(h);if(f){var d=f.style;d.display=(d.display=="none"||d.display==""?"block":"none");d.left=g.left+"px";d.top=g.bottom+h.offsetHeight+"px";d.zIndex=99}return false};this.bbcPanel.appendChild(this.createButton(null,null,"bbcode-smile",b))}this.ta.parentNode.insertBefore(this.smilesPanel,this.bbcPanel?this.bbcPanel:this.ta)}},addSmile:function(b,d){if(this.ta){if(!this.smilesPath||!this.smilesPanel){return}var a=this,c=document.createElement("img");c.setAttribute("src",this.smilesPath+"/"+d);c.setAttribute("alt",b);c.className="smile";c.onclick=function(){a.insertText(" "+b+" ")};this.smilesPanel.appendChild(c)}},addCounter:function(b,e,l,j){if(this.ta){if(e!=null){this.l10n.counterPre=e}if(l!=null){this.l10n.counterPost=l}var a=document.createElement("span");a.className=j!=null?j:"";var g=document.createTextNode(this.l10n.counterPre+" "),f=document.createTextNode(" "+this.l10n.counterPost);var k=document.createElement("span");a.appendChild(g);a.appendChild(k);a.appendChild(f);if(this.resizable){if(this.grippie!=null){this.grippie.appendChild(a)}}else{var h=document.createElement("div");h.className="counterpanel";this.ta.parentNode.insertBefore(h,this.ta.nextSibling);h.appendChild(a)}this.counter={e:k,max:b};this.updateCounter()}},addGrippie:function(){this.offset=null;this.dragging=false;this.grippie=document.createElement("div");this.grippie.className="grippie";this.ta.parentNode.insertBefore(this.grippie,this.ta.nextSibling);var a=this;this.events.add(this.grippie,"mousedown",function(b){return a.onMouseDown(b)})},updateCounter:function(){if(this.counter!=null){var b=this.ta,d=this.counter.e;try{var f=document.createElement(d.tagName),a=this.counter.max-b.value.length;f.innerHTML=(a>=0)?a:0;d.parentNode.replaceChild(f,d);this.counter.e=f}catch(c){}}},mousePosition:function(c){var b=0,a=0;if(!c){c=window.event}if(c.pageX||c.pageY){b=c.pageX;a=c.pageY}else{if(c.clientX||c.clientY){b=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;a=c.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return{x:b,y:a}},onChange:function(){this.updateCounter();if(this.ta&&!this.isWebkit){var a=this.ta.value.split("\n");this.ta.rows=(a.length<this.defaultRows)?this.defaultRows:a.length+1}return false},onMouseDown:function(b){this.offset=this.mousePosition(b).y;this.height=this.ta.clientHeight;this.dragging=true;var a=this;this.events.add(document,"mousemove",function(c){return a.onMouseMove(c)});this.events.add(document,"mouseup",function(c){return a.onMouseUp(c)});return false},onMouseUp:function(a){this.dragging=false},onMouseMove:function(a){if(this.dragging){this.ta.style.height=Math.max(this.defaultHeight,this.height+this.mousePosition(a).y-this.offset)+"px"}return false}};JCommentsForm.prototype={id:null,form:null,events:null,editor:null,elements:{},store:new Array("name","email","homepage"),fadeTimer:null,init:function(c,a){var b=this;this.id=c;this.form=this.$(c);this.editor=a;this.events=new JCommentsEvents();this.setElements(new Array("name","email","homepage","comment"));this.restoreValues();this.setCaptcha()},setCaptcha:function(){this.captchaImage=this.$(this.id+"-captcha-image");this.register("captcha")},setEditor:function(a){this.editor=a},setElements:function(a){for(i=0;i<a.length;i++){try{this.register(a[i])}catch(a){}}},$:function(a){return JComments.prototype.$(a)},register:function(c){var a=this,b=this.$(this.id+"-"+c);if(b){this.elements[c]=b;JCommentsInput.prototype.register(b);this.events.add(b,!window.opera&&document.all?"keydown":"keypress",function(d){return a.keypress(d)})}},message:function(a,d){clearTimeout(this.fadeTimer);var b=this.$("comments-form-message");if(!b){b=JComments.prototype.createElement("div","comments-form-message","");if(this.form){JComments.prototype.moveElement(b,this.form,this.form.firstChild)}else{return}}if(!d){d="info"}b.className="comments-form-message-"+d;b.innerHTML=a;b.style.display="block";JComments.prototype.setOpacity(b.id,100);this.fadeTimer=setTimeout(function(){JComments.prototype.fade("comments-form-message",100,0,1000)},3000)},error:function(a,f,d){var b=this.elements[f];if(b){b.focus();b.className="error";if(d){b.value=""}}this.message(a,"error")},clear:function(d){if(d==null){if(this.form!=null){this.form.reset()}return}switch(d){case"comment":if(this.editor!=null){this.editor.clear()}break;case"captcha":var b=this.captchaImage,a=this.elements.captcha;if(b){b.src=b.src.replace(/&ac=\d+/g,"&ac="+new String(Math.floor(Math.random()*100000)))}if(a){a.value=""}break;default:var c=this.elements[d];if(c){c.value=""}break}},focus:function(c){var b;if(c==null){for(var a in this.elements){b=this.elements[a];if(b){b.focus();break}}}else{b=this.elements[c];if(b){b.focus()}}},keypress:function(a){if(a.ctrlKey&&(a.keyCode==13||(a.type=="keypress"&&a.keyCode==10))){this.submit();a.returnValue=false;return this.events.cancel(a)}return this.keypressed(a)},add:function(d,b,a){if(this.form!=null){var c=document.createElement("input");c.setAttribute("type","hidden");c.setAttribute("name",d);c.setAttribute("id",b);c.setAttribute("value",a);this.form.appendChild(c)}},remove:function(a){var b=this.$(a);if(b){b.value=0;b.parentNode.removeChild(b)}},setText:function(c,a){if(c=="comment"){if(this.editor!=null){this.editor.clear();this.editor.insertText(a)}}else{var b=this.elements[c];if(b){b.value=a}}},insertText:function(c,a){if(c=="comment"){if(this.editor!=null){this.editor.insertText(a)}}else{var b=this.elements[c];if(b){b.value+=a}}},storeValues:function(){for(var a=0;a<this.store.length;a++){try{var b=JComments.prototype.$(this.id+"-"+this.store[a]);if(b){JComments.prototype.setCookie(this.store[a],encodeURIComponent(b.value),14)}}catch(c){}}},restoreValues:function(){for(var a=0;a<this.store.length;a++){try{var b=JComments.prototype.$(this.id+"-"+this.store[a]);if(b){b.value=decodeURIComponent(JComments.prototype.getCookie(this.store[a]))}}catch(c){}}},submit:function(){},keypressed:function(a){}};JCommentsIndicator.prototype={e:null,init:function(){if(this.e==null){this.e=document.createElement("div");this.e.className="busy"}},move:function(c,a){if(c){if(this.e.parentNode){this.e.parentNode.removeChild(this.e)}if(a){c.insertBefore(this.e,a)}else{c.appendChild(this.e)}}},show:function(){this.e.style.display="block"},hide:function(){this.e.style.display="none"},start:function(c,a){this.move(c,a);this.show()},stop:function(){this.hide()}};JComments.prototype={oi:null,og:null,debug:false,requestURI:"",oldRequestURI:"",busy:null,form:null,cache:{},mode:"add",readyList:[],isReady:false,init:function(d,e,c){var a=navigator.userAgent.toLowerCase();this.browser={safari:/webkit/.test(a),opera:/opera/.test(a),msie:/msie/.test(a)&&!(/opera/.test(a)),mozilla:/mozilla/.test(a)&&!(/(compatible|webkit)/.test(a))};this.oi=d;this.og=e;this.busy=new JCommentsIndicator();this.requestURI=c;var b=this;jtajax.startLoading=function(){b.busy.show()};jtajax.finishLoading=function(){b.busy.hide()}},setForm:function(b){this.form=b;this.form_id=b.id;this.setMode("add",null);var a=this;this.form.submit=function(){a.saveComment()};this.form.keypressed=function(c){if(c.keyCode==27&&a.mode=="reply"){a.restoreForm(false)}};this.formLoaded()},setList:function(a){this.list_id=a},setMode:function(c,e){var a=this.$("comments-form-cancel"),d=this;if(a!=null){a.style.display=(c!="add")?"":"none";a.onclick=(c=="edit"?function(){d.cancelEdit(e)}:(c=="reply"?function(){d.cancelReply()}:null))}this.mode=c},$:function(b){if(!b){return null}var a=document.getElementById(b);if(!a&&document.all){a=document.all[b]}return a},ajax:function(d,b,j){var c,h;try{h=jtajax.options.url;jtajax.setup({url:this.requestURI});c=jtajax.call(d,b,"post",j);jtajax.options.url=h}catch(g){jtajax.options.url=h}return c},initOnReady:function(){if(this.isReadyInited){return}this.isReadyInited=1;var a=this;if(this.browser.mozilla||this.browser.opera){JCommentsEvents.prototype.add(document,"DOMContentLoaded",a.ready)}else{if(this.browser.msie){(function(){try{document.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,50);return}a.ready()})()}else{if(this.browser.safari){(function(){if(a.isReady){return}if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return}a.ready()})()}}}JCommentsEvents.prototype.add(window,"load",function(){a.ready(a)})},onReady:function(b){if(this.isReady){b()}else{var a=this;a.readyList.push(b);a.initOnReady()}},ready:function(){var b=window.jcomments;if(b.isReady||b.readyList==null){return}b.isReady=1;for(var c=0,a=b.readyList.length;c<a;c++){try{b.readyList[c]()}catch(d){}}b.readyList=null},setAntiCache:function(d,b,a){this.aca=d;this.acp=b;this.acf=a;this.onReady(this.loadComments)},loadComments:function(){var b=window.jcomments;var a=document.location.href,e=true,d=a.lastIndexOf("#comment-");b.clear("captcha");if(b.aca){if(d!=0){var f=a.substring(d+9,a.length);if(!isNaN(f)){e=false;b.showComment(f)}}}if(b.acp){if(e==true){b.showPage(b.oi,b.og,0)}}if(b.acf){if(a.lastIndexOf("#addcomment")!=-1){b.showForm(b.oi,b.og,"comments-form-link")}}},setCookie:function(g,a,f){var c="";if(f){var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));c="; expires="+b.toGMTString()}document.cookie="jc_"+g+"="+a+c+"; path=/"},getCookie:function(c){var a=new RegExp("(;|^)[^;]*(jc_"+c+")=([^;]*)(;|$)");var b=a.exec(document.cookie);return b!=null?b[3]:""},removeCookie:function(a){this.setCookie(a,"",-1)},scrollTo:function(c){if(c!=null){var b=this.$(c);if(b){t=b.offsetTop;for(var a=b.offsetParent;a;a=a.offsetParent){t+=a.offsetTop}scrollTo(0,t)}}},scrollToList:function(){this.scrollTo(this.list_id)},scrollToForm:function(a){this.scrollTo(this.form_id)},scrollToComment:function(a){this.scrollTo("comment-"+a)},moveElement:function(d,c,a){if(d){if(c){if(d.parentNode){d.parentNode.removeChild(d)}if(a){c.insertBefore(d,a)}else{c.appendChild(d)}}}},createElement:function(b,a,f){var d=document.createElement(b);if(a){d.setAttribute("id",a)}if(f){d.className=f}return d},fade:function(h,b,d,a){var c=Math.round(a/100),g=0;if(b>d){for(i=b;i>=d;i--){setTimeout("JComments.prototype.setOpacity('"+h+"',"+i+")",(g*c));g++}var f=JComments.prototype.$(h);if(f){setTimeout(function(){f.style.display="none"},((b-d)*c))}}else{if(b<d){for(i=b;i<=d;i++){setTimeout("JComments.prototype.setOpacity('"+h+"',"+i+")",(g*c));g++}}}},setOpacity:function(d,a){var c=this.$(d);if(c){var b=c.style;b.opacity=(a/100);b.MozOpacity=(a/100);b.KhtmlOpacity=(a/100);b.filter="alpha(opacity="+a+")"}},error:function(a,d,b){if(this.form!=null){this.form.error(a,d,b)}},message:function(a,b){if(this.form!=null){this.form.message(a,"info")}},clear:function(a){if(this.form!=null){this.form.clear(a)}},insertText:function(b){if(this.form!=null){this.form.insertText("comment",b)}else{var a=this;window.setTimeout(function(){a.insertText(b)},500);return}},busyList:function(){if(this.list_id){var a=this.$(this.list_id);if(a){this.busy.move(a.parentNode,a)}}},busyForm:function(){if(this.form_id){var a=this.$(this.form_id);if(a){this.busy.move(a.parentNode,a)}}},busyComment:function(a){this.busy.move(this.$("comment-item-"+a),null)},saveComment:function(a){var b="";if(this.mode!="edit"){b="JCommentsAddComment";this.busyForm();if(this.form){this.form.storeValues()}this.busy.show()}else{b="JCommentsSaveComment";this.busy.show()}return this.ajax(b,null,this.form_id)},editComment:function(c){this.busyComment(c);var b=arguments;if(this.form==null){b=new Array(c,1)}return this.ajax("JCommentsEditComment",b)},cancelEdit:function(b){if((!this.cache[b])||(this.cache[b]=="")){this.$("comment-body-"+b).innerHTML=this.cache[b];this.cache[b]=""}if(this.form){this.form.remove("comment-id-hidden-"+b);this.restoreForm(true)}var a=this.$("comment-toolbar-"+b);if(a){a.style.display=""}return this.ajax("JCommentsCancelComment",arguments)},cancelReply:function(){if(this.form){this.form.remove("comment-parent-id-hidden");this.restoreForm(false)}},quoteComment:function(c){var b=arguments;if(this.form==null){b=new Array(c,1)}return this.ajax("JCommentsQuoteComment",b)},publishComment:function(a){if(this.form){this.restoreForm()}this.busyComment(a);return this.ajax("JCommentsPublishComment",arguments)},deleteComment:function(a){this.busyComment(a);return this.ajax("JCommentsDeleteComment",arguments)},jump2email:function(a){return this.ajax("JCommentsJump2email",arguments)},updateList:function(c,a){if(this.list_id){var b=this.$(this.list_id);if(!b){b=this.$("comments");a="a"}switch(a){case"a":b.innerHTML=b.innerHTML+c;break;case"p":b.innerHTML=c+b.innerHTML;break;case"r":b.parentNode.innerHTML=c;break}}},updateTree:function(b,c){var a;if(c==null){a=this.$("comments");if(a){a.innerHTML=b}return}a=this.$("comments-list-"+c);if(!a){var d=this.$("comment-item-"+c);if(d){this.busyComment(c);a=this.createElement("div","comments-list-"+c,"comments-list");a.innerHTML=b;d.parentNode.insertBefore(a,d.nextSibling)}}else{a.innerHTML=a.innerHTML+b}this.restoreForm(true)},updateComment:function(f,b){if(b==""){var e=this.$("comment-item-"+f);e.parentNode.removeChild(e);var a=this.$("comments-list-"+f);if(a){a.parentNode.removeChild(a)}return}this.$("comment-body-"+f).innerHTML=b;var d=this.$("comment-toolbar-"+f);if(d){d.style.display=""}if(this.form){this.form.remove("comment-id-hidden-"+f);this.restoreForm(true)}},voteComment:function(b){var a=this.$("comment-vote-holder-"+b);if(a){a.innerHTML="";this.busy.start(a,null)}return this.ajax("JCommentsVoteComment",arguments)},updateVote:function(b,a){this.busy.stop();var d=this.$("comment-vote-holder-"+b);if(d){d.innerHTML=a}},showComment:function(a){return this.ajax("JCommentsShowComment",arguments)},showPage:function(b,c,d){if(this.form){this.restoreForm()}var a=this.$(this.list_id);if(!a){a=this.$(this.list_id+"-0");if(a){this.list_id=this.list_id+"-0"}}this.busyList();return this.ajax("JCommentsShowPage",arguments)},showForm:function(b,c,a){if(this.form){this.moveElement(this.form.form,this.$(a));return}this.busyForm();return this.ajax("JCommentsShowForm",arguments)},showEdit:function(b,g,m,k,r){var q=this;if(this.form==null){window.setTimeout(function(){q.showEdit(b,g,m,k,r)},500);return}if((!this.cache[b])||(this.cache[b]=="")){this.cache[b]=this.$("comment-body-"+b).innerHTML}this.busy.stop();var l=this.form,a=this.form.form,p=this.$("comment-item-"+b);if(a!=null&&p!=null){l.add("id","comment-id-hidden-"+b,b);l.setText("name",g);l.setText("email",m);l.setText("homepage",k);l.setText("comment",r);var o=this.$("comments-inline-edit");if(o){o.parentNode.removeChild(o)}else{o=this.createElement("div","comments-inline-edit","comments-inline-edit")}p.appendChild(o);this.moveElement(a,o);this.setMode("edit",b);var j=this.$("comment-toolbar-"+b);if(j){j.style.display="none"}this.scrollTo("comments-inline-edit");this.form.focus("comment")}},showReply:function(g,b){this.busyComment(g);var o=this,n=this.$("comment-item-"+g),m=this.$("comments-inline-edit");if(m){m.parentNode.removeChild(m)}else{m=this.createElement("div","comments-inline-edit","comments-inline-edit")}n.appendChild(m);if(!this.form){var r="comments-inline-edit",j=this.$("comments-form-link");if(j){r="comments-form-link"}this.showForm(this.oi,this.og,r);var k=g;this.formLoaded=function(){var c=o.form;if(c!=null){c.add("parent","comment-parent-id-hidden",k)}o.setMode("reply",k);o.moveElement(o.form.form,o.$("comments-inline-edit"));o.form.focus();if(b){o.quoteComment(g)}}}else{var l=this.form,a=this.form.form,e=this.$("comment-parent-id-hidden");if(a!=null&&n!=null){if(!e){l.add("parent","comment-parent-id-hidden",g)}else{e.value=g}this.moveElement(a,m);this.setMode("reply",g);this.form.focus();if(b){this.quoteComment(g)}}}},formLoaded:function(){},restoreForm:function(l){var h=this.form;if(h!=null){var g=this.form.form,e=this;this.busy.stop();if(g!=null){if(l){h.clear(null)}h.restoreValues();var b=this.$("addcomments"),j=this.$("comment-parent-id-hidden");if(j){j.value=0}this.moveElement(g,b.parentNode,b);var k=this.$("comments-inline-edit");if(k){k.parentNode.removeChild(k)}this.setMode("add",null)}}},subscribe:function(b,a){return this.ajax("JCommentsSubscribe",arguments)},unsubscribe:function(b,a){return this.ajax("JCommentsUnsubscribe",arguments)},updateSubscription:function(a,c){var d=this.$("comments-subscription");if(d){var b=this;d.innerHTML=c;d.onclick=a?function(){b.unsubscribe(b.oi,b.og);return false}:function(){b.subscribe(b.oi,b.og);return false};d.blur()}},go:function(a){window.open(a);return}};