function getquotedcontent(a,b){if(b==""){return"2 [b]"+a+"[/b]: "}else{return"[b]"+a+"[/b] "+lang.comment.says+":\n[quote]"+b+"[/quote]\n"}}function quotecomment(e,a){var d=document.getElementById("comment");var c=document.getElementById("commentcontent-"+e);if(window.getSelection){var b=window.getSelection()}else{if(document.getSelection){var b=document.getSelection()}else{if(document.selection){var b=document.selection.createRange().text}else{var b=""}}}if(b==""){if(c.innerText){b=c.innerText}else{b=c.textContent}}d.value+=getquotedcontent(a,b);d.focus()}function replycomment(c,a){var b=document.getElementById("comment");b.value+=getquotedcontent(a,"");b.focus()};
var commentform={fields:["name","email","url"],subscribed:[],unsubscribed:[],error_dialog:false,confirm_dialog:false,get:function(a){return $("input[name='"+a+"']","#commentform").val()},set:function(a,b){$("input[name='"+a+"']","#commentform").val(b)},find:function(a){if(a=="content"){return $("textarea[name='content']","#commentform")}return $("input[name='"+a+"']","#commentform")},init_field:function(a){var b=get_cookie("comuser_"+a);if(!b){return false}this.set(a,b);return true},init_subscribe:function(){var a=typeof ltoptions.idpost=="string"?ltoptions.idpost:ltoptions.idpost.toString();this.subscribed=get_cookie("comuser_subscribed").split(",");this.unsubscribed=get_cookie("comuser_unsubscribed").split(",");if($.inArray(a,this.subscribed)>=0){$("input[name='subscribe']").attr("checked",true)}else{if($.inArray(a,this.unsubscribed)>=0){$("input[name='subscribe']").attr("checked",false)}}},update_subscribe:function(){var a=typeof ltoptions.idpost=="string"?ltoptions.idpost:ltoptions.idpost.toString();if($("input[name='subscribe']").attr("checked")){if($.inArray(a,this.subscribed)==-1){this.subscribed.unshift(a)}this.unsubscribed=$.grep(this.unsubscribed,function(b){return b!=a})}else{if($.inArray(a,this.unsubscribed)==-1){this.unsubscribed.unshift(a)}this.subscribed=$.grep(this.subscribed,function(b){return b!=a})}set_cookie("comuser_subscribed",this.subscribed.join(","));set_cookie("comuser_unsubscribed",this.unsubscribed.join(","))},init:function(){$("#commentform").submit(commentform.submit);if(commentform.init_field("name")){commentform.init_field("email");commentform.init_field("url");commentform.init_subscribe()}else{var a=get_cookie("userid");if(!a){return}$.get(ltoptions.url+"/ajaxcommentform.htm",{getuser:a,idpost:ltoptions.idpost},function(c){var b=$.parseJSON(c);commentform.set("name",b.name);commentform.set("email",b.email);commentform.set("url",b.url);set_cookie("comuser_name",b.name);set_cookie("comuser_email",b.email);set_cookie("comuser_url",b.url);$("input[name='subscribe']").attr("checked",b.subscribe);commentform.update_subscribe()})}},set_cookie:function(a){set_cookie("comuser_"+a,this.get(a))},error:function(b,a){$.load_ui(function(){if(!commentform.error_dialog){commentform.error_dialog=$('<div class="ui-helper-hidden" title="'+ltoptions.commentform.error_title+'"><h4></h4></div>').appendTo($("input[name='name']").closest("form"))}$("h4",commentform.error_dialog).text(b);$(commentform.error_dialog).dialog({autoOpen:true,modal:true,buttons:[{text:"Ok",click:function(){$(this).dialog("close");if(a){commentform.find(a).focus()}}}]})})},confirm:function(a){$.load_ui(function(){if(!commentform.confirm_dialog){commentform.confirm_dialog=$('<div class="ui-helper-hidden" title="'+a.title+'"><h4>'+a.formhead+"</h4></div>").appendTo($("input[name='name']").closest("form"))}$(commentform.confirm_dialog).dialog({autoOpen:true,modal:true,buttons:[{text:a.robot,click:function(){$(this).dialog("close")}},{text:a.human,click:function(){$(this).dialog("close");commentform.sendconfirm(a.confirmid)}}]})})},empty:function(a){if(""==$.trim(this.get(a))){this.error(lang.comment.emptyname,a);return true}return false},validemail:function(){var a=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!a.test(this.get("email"))){this.error(lang.comment.invalidemail,"email");return false}return true},validate:function(){if(this.empty("name")||this.empty("email")||!this.validemail()){return false}if(""==$.trim(this.find("content").val())){this.error(lang.comment.emptycontent,"content");return false}return true},submit:function(){if(!commentform.validate()){return false}commentform.set_cookie("name");commentform.set_cookie("email");commentform.set_cookie("url");commentform.update_subscribe();commentform.send();return false},send:function(){var b=$("input[name='name']").closest("form");var a={};$("input, textarea, checkbox",b).each(function(){a[$(this).attr("name")]=$(this).val();$(this).attr("disabled",true)});$.post(ltoptions.url+"/ajaxcommentform.htm",a,function(f){try{var c=$.parseJSON(f);switch(c.code){case"confirm":commentform.confirm(c);break;case"success":commentform.success(c);break;default:commentform.error(c.msg,false);break}}catch(d){commentform.error(d.message,false)}}).error(function(c){commentform.error(c,false)}).complete(function(){$("input, textarea, checkbox",b).attr("disabled",false)})},sendconfirm:function(a){$.post(ltoptions.url+"/ajaxcommentform.htm",{confirmid:a},function(d){try{var b=$.parseJSON(d);switch(b.code){case"success":commentform.success(b);break;default:commentform.error(b.msg,false);break}}catch(c){commentform.error(c.message,false)}}).error(function(b){commentform.error(b,false)})},success:function(a){set_cookie("userid",a.userid);window.location=a.posturl}};$(document).ready(commentform.init);
var lang;
if (lang == undefined) lang = {};
lang.comment = {"0":"\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0435\u0442","1":"\u041e\u0434\u0438\u043d \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439","2":"\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 (%d)","name":"\u0418\u043c\u044f (\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e)","url":"\u0421\u0430\u0439\u0442","email":"E-Mail (\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f)","content":"\u0422\u0435\u043a\u0441\u0442","subscribe":"\u041f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438","hold":"\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f","closed":"\u041e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u043e","topost":"\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c","attime":"\u0432","leavereply":"\u041e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439","sendreply":"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442","says":"\u043f\u0438\u0448\u0435\u0442","pingbacks":"\u041f\u0438\u043d\u0433\u0431\u0435\u043a\u0438","emptycontent":"\u041e\u0448\u0438\u0431\u043a\u0430. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0435\u0449\u0435 \u0440\u0430\u0437","emptyname":"\u041e\u0448\u0438\u0431\u043a\u0430! \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0435\u0449\u0435 \u0440\u0430\u0437","invalidemail":"\u041e\u0448\u0438\u0431\u043a\u0430! \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 E-Mail. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443.","spamdetected":"\u041e\u0448\u0438\u0431\u043a\u0430! \u041d\u0435\u0432\u0435\u0440\u043d\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430,, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443.","duplicate":"\u041e\u0448\u0438\u0431\u043a\u0430! \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439","toomany":"\u0421\u043b\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432","from":"\u041e\u0442","onpost":"\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043d\u0430","onrecent":"\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0434\u043b\u044f ","commentsdisabled":"\u041e\u0448\u0438\u0431\u043a\u0430! \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u043e","commentondraft":"\u041e\u0448\u0438\u0431\u043a\u0430! \u0412\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0431\u044b\u043b\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430."};
ltoptions.commentform = {"error_title":"\u041e\u0448\u0438\u0431\u043a\u0430"};
