function setPath(b,c,a,d){d='<div style="width:100%;text-align:left;padding:5 0;">\u0412\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0437\u0434\u0435\u0441\u044c: ';if(b){d+='<a href="/channel/'+channel_slug+"/\" onclick=\"unsubscribeMultiplexer();cur_thread_id=0;cur_forum_id=0;$('#threads').hide();$('#comments').hide();setPath();return false;\">\u041c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u044b \u043a\u0430\u043d\u0430\u043b\u0430 "+htmlspecialchars(channel_name)+
"</a> &raquo; ";if(a){d+='<a href="/channel/'+channel_slug+"/fid/"+c+"\" onclick=\"unsubscribeMultiplexer();cur_thread_id=0;$('#comments').hide();setPath('"+b+"',"+c+');return false;">';d+=htmlspecialchars(unescape(b));d+="</a> &raquo; <b>"+htmlspecialchars(unescape(a))+"</b>";cur_activity!=""?$("#activity").html("<div class=gcloud><b>\u0421\u0435\u0439\u0447\u0430\u0441 \u0432 \u044d\u0444\u0438\u0440\u0435:</b> "+htmlspecialchars(unescape(cur_activity))+"</div>").highlightComment().show():$("#activity").hide()}else{d+=
"<b>"+htmlspecialchars(unescape(b))+"</b>";$(".thread").removeClass("ycloud").addClass("wcloud");$("#activity").hide()}}else{d+="<b>\u041c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u044b \u043a\u0430\u043d\u0430\u043b\u0430 "+htmlspecialchars(channel_name)+"</b>";$(".forum").removeClass("ycloud").addClass("wcloud");$("#activity").hide()}d+="</div>";$("#status").html(d)}function getUserLink(b){return cur_interface>0&&cur_interface!=20?"?action=user&slug="+b:"/user/"+b+"/"}
function reloadComments(){loadComments(cur_thread_id,cur_thread_name,cur_thread_page,cur_thread_ispublic,cur_tsort,cur_activity)}
function validateEditComment(b,c,a){f="#"+b;if($(f).val().length>a)$(f).val($(f).val().substring(0,a));else $(f).val().length>200?$("#"+c).html("\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432: "+(a-$(f).val().length)).show():$("#"+c).hide();$("#cComment").val().length==0?$("#cSubmitButton").attr("disabled",true):$("#cSubmitButton").removeAttr("disabled")}var is_sending=0;
function saveComment(){if(!is_sending){is_sending=1;if($("#cComment").val()=="")return false;$("#cForm :input").attr("disabled",true);$("#cMsg").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">');$.ajax({type:"POST",url:"/ajax/comment/save/",data:{tid:cur_thread_id,text:$("#cComment").val(),status:1,"interface":cur_interface},dataType:"json",success:function(b,c){$("#cForm :input").removeAttr("disabled");
b.Status>0?$("#cComment").val(""):$("#cMsg").html("<div class=err>"+b.Message+" <span class=fDate>(Err"+b.Status+")</span></div>").effect("pulsate",{times:3},300);$("#cComment").focus();validateEditComment("cComment","ccComment",255);is_sending=0},error:function(b,c,a){$("#cForm :input").removeAttr("disabled");$("#cMsg").html("<div class=err>"+c+" (Err "+a+")</div>").effect("pulsate",{times:3},300);is_sending=0}});$("#cMsg").html("")}return false}
function cite(b){$("#cComment").val($("#cComment").val()+"@"+b+" ");validateEditComment("cComment","ccComment",255);document.getElementById("cComment").setSelectionRange($("#cComment").val().length,$("#cComment").val().length);$("#cComment").focus();return false}function smile(b){b=$("#cComment").val()+"[img "+b+"]";if(b.length<=255){$("#cComment").val(b);validateEditComment("cComment","ccComment",255);$("#cComment").focus()}return false}
function deleteComment(b){$("#cMsg").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">').show();$.ajax({type:"POST",url:"/ajax/comment/save/",data:{tid:0,cid:b,status:-1},dataType:"json",success:function(c,a){if(c.Status>0){$("#c"+c.cid).slideUp();$("#cMsg").html("").hide()}else $("#cMsg").html("<div class=err>"+c.Message+" (Err"+c.Status+")</div>").effect("pulsate",{times:3},
300)},error:function(c,a,d){$("#cMsg").html("<div class=err>"+a+" (Err "+d+")</div>").effect("pulsate",{times:3},300)}})}
function blockComment(b,c){$("#cMsg").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">').show();$.ajax({type:"POST",url:"/ajax/comment/save/",data:{tid:0,cid:b,status:c},dataType:"json",success:function(a,d){if(a.Status>0){$("#cMsg").html("").hide();reloadComments()}else $("#cMsg").html("<div class=err>"+a.Message+" (Err"+a.Status+")</div>").effect("pulsate",{times:3},300)},error:function(a,
d,e){$("#cMsg").html("<div class=err>"+d+" (Err "+e+")</div>").effect("pulsate",{times:3},300)}})}
function loadSmiles(b){if(!cur_user_is_vip){var c='\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u0438 \u0438 \u0438\u043a\u043e\u043d\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e VIP-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c. <a href="http://vefire.ru/help/vip/">\u0421\u0442\u0430\u0442\u044c VIP!</a>';c+="<div class=smLinks><a href=\"javascript:;\" onclick=\"$('#smAll').toggle('highlight');return false;\">\u0417\u0430\u043a\u0440\u044b\u0442\u044c</a></div>";
$("#smAll").html(c);return false}$.ajax({type:"GET",url:"/ajax/comment/getSmiles/",data:{set:b},dataType:"json",success:function(a,d){d="";for(var e in a.Message)d+="<a href=\"javascript:;\" onclick=\"$('#smAll').toggle('highlight');return smile('"+a.Message[e]+'\');"><img src="http://s2.vefire.ru/img/icons/'+a.Message[e]+'.png" title="[img '+a.Message[e]+']" width=16 height=16></a>';d+="<div class=smLinks><a href=\"javascript:;\" onclick=\"$('#smAll').toggle('highlight');return false;\">\u0417\u0430\u043a\u0440\u044b\u0442\u044c</a>";
d+=' | <a href="javascript:;" onclick="return loadSmiles(';d+=b<7?b+1:"1";d+=');">\u0415\u0449\u0451 \u0438\u043a\u043e\u043d\u043a\u0438 &raquo;</a>';d+="</div>";$("#smAll").html(d)},error:function(a,d,e){$("#cMsg").html("<div class=err>"+d+" (Err "+e+")</div>").effect("pulsate",{times:3},300)}});return false}
function updateEmbed(b){$("#tCode").val('<script>function receiveSize(e){document.getElementById("thread").style.height=e.data+"px";};if(window.addEventListener)window.addEventListener("message",receiveSize, false);else window.attachEvent("onmessage",receiveSize);<\/script><iframe id=thread src="http://'+document.domain+"/apps/widgets/livethread/?slug="+channel_slug+"&tid="+b+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'+$("#tWidth").val()+"px; height:"+$("#tHeight").val()+
'px;" allowtransparency="true">\u0412\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u0440\u0435\u0439\u043c\u044b. \u0417\u0434\u0435\u0441\u044c \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u0435\u043d\u0442\u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043a\u0430\u043d\u0430\u043b\u0443 '+
channel_name+': <a href="http://'+document.domain+"/channel/"+channel_slug+'/">http://'+document.domain+"/channel/"+channel_slug+"/</a></iframe>")}
function embedThread(b){var c="";c+="<div id=eMsg></div>";c+='<div class="fSubtitle" style="padding:0 0 5 55;">\u0428\u0438\u0440\u0438\u043d\u0430 \u0416\u0438\u0432\u043e\u0439 \u041b\u0435\u043d\u0442\u044b:</div>';c+='<div style="padding:0 0 5 55;" class="fTextarea fl"><input type=text style="width:50px" id=tWidth value="530" onkeyup="return updateEmbed('+b+');" onpaste="return updateEmbed('+b+');"> px</div>';c+="<div class=cb></div>";c+='<div class="fSubtitle" style="padding:0 0 5 55;">\u0412\u044b\u0441\u043e\u0442\u0430 \u0416\u0438\u0432\u043e\u0439 \u041b\u0435\u043d\u0442\u044b:</div>';
c+='<div style="padding:0 0 5 55;" class="fTextarea fl"><input type=text style="width:50px" id=tHeight value="1300" onkeyup="return updateEmbed('+b+');" onpaste="return updateEmbed('+b+');"> px</div>';c+="<div class=cb></div>";c+='<div class="fSubtitle" style="padding:0 0 5 55;">HTML-\u043a\u043e\u0434 \u043b\u0435\u043d\u0442\u044b - \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435:</div>';c+='<div style="padding:0 0 5 55;" class="fTextarea fl"><textarea rows=10 class=fMessage id=tCode></textarea></div>';
c+="<div class=cb></div>";$("#oldComments").length==0&&$("#comments").after('<div id=oldComments style="display:none;"></div>');$("#oldComments").html($("#comments").html());c+="<input style=\"margin:0 0 5 55;\" onclick=\"$('#comments').html($('#oldComments').html());$('.comment').hover(function(){$('#'+$(this).attr('id')+'p').show();}, function(){$('#'+$(this).attr('id')+'p').hide();});return false;\" type=button id=tOK value=\"\u0417\u0430\u043a\u0440\u044b\u0442\u044c\"/></div>";c=cur_interface>
0?'<div style="width:100%">'+c+"</div>":'<div class=wgtl><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">'+c+"</div></div></div></div>";$("#comments").html(c);updateEmbed(b);$("#tWidth").focus();return false}
function getInterfaceLink(b,c){var a="";if(c==0){a+=b==0?'<a href="/help/all-applications/#site" target=_blank>':b==20?'<a href="/help/all-applications/#site" target=_top>':'<a href="?action=help&slug=all-applications#site">';a+="\u0441\u0430\u0439\u0442</a>"}else if(c==1){a+=b==0?'<a href="/help/all-applications/#vk" target=_blank>':b==20?'<a href="/help/all-applications/#vk" target=_top>':'<a href="?action=help&slug=all-applications#vk">';a+="\u0432\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435</a>"}else if(c==
2){a+=b==0?'<a href="/help/all-applications/#mm" target=_blank>':b==20?'<a href="/help/all-applications/#mm" target=_top>':'<a href="?action=help&slug=all-applications#mm">';a+="\u041c\u043e\u0439\u041c\u0438\u0440</a>"}else if(c==3){a+=b==0?'<a href="/help/all-applications/#fb" target=_blank>':b==20?'<a href="/help/all-applications/#fb" target=_top>':'<a href="?action=help&slug=all-applications#fb">';a+="Facebook</a>"}else if(c==4){a+=b==0?'<a href="/help/all-applications/#ii" target=_blank>':b==
20?'<a href="/help/all-applications/#ii" target=_top>':'<a href="?action=help&slug=all-applications#ii">';a+="IsraelInfo</a>"}else if(c==20){a+=b==0?'<a href="/help/all-applications/#lt" target=_blank>':b==20?'<a href="/help/all-applications/#lt" target=_top>':'<a href="?action=help&slug=all-applications#lt">';a+="\u043b\u0435\u043d\u0442\u0443</a>"}else{a+=b==0?'<a href="/help/all-applications/#app" target=_blank>':b==20?'<a href="/help/all-applications/#app" target=_top>':'<a href="?action=help&slug=all-applications#app">';
a+="\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435</a>"}return a}var autoupdate=1,normalTitle=document.title,pageTitle=normalTitle;function unsubscribeMultiplexer(){multiplexer.unsubscribe("t"+cur_thread_id,null);multiplexer.run()}
function updateLiveComments(){var b=cur_interface;multiplexer.subscribe("lru",function(c){if(c.command=="newcomment"&&$("#c"+c.cid).length==0){var a="";with(c){a+="<div id=c"+cid+" class=";a+=role_id!=0?"acloud":"wcloud";a+=">";if(ctry!="")a+='<img src="http://s2.vefire.ru/img/flags/'+ctry.toLowerCase()+'.gif" width=16 height=11> ';a+="<span class=fDate>"+date+"</span> ";if(c.is_vip==1)a+='<a href="http://vefire.ru/help/vip/"><img valign=middle border=0 src="http://s2.vefire.ru/img/icons/star.png" width=16 height=16 title="\u042d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u042d\u0444\u0438\u0440\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f!"></a>';
a+='@<a class=user href="'+getUserLink(added_by_username)+'">';a+='<img align=absmiddle src="http://a.vefire.ru/16/'+added_by_username.toLowerCase()+'" width=16 height=16>';a+=added_by_username+"</a> <span class=fDate>\u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b(\u0430) \u043a\u0430\u043d\u0430\u043b </span>";a+=' <a href="'+getDomain(lang,type);a+="/channel/"+slug+"/fid/"+fid+"/tid/"+tid+'">'+htmlspecialchars(name)+"</a>";a+="<span class=fDate>";
a+=" \u0447\u0435\u0440\u0435\u0437 ";var d=c.cur_interface;a+=getInterfaceLink(b,d);a+="</span>";a+="<br> <span class=rcomment>"+highlightComment(htmlspecialchars(text))+"</span>";a+="</div>"}$("#commentslist").prepend(a);$("#commentslist_status").remove();document.title=htmlspecialchars("@"+c.added_by_username+": "+c.text)+" - "+normalTitle;$(".comment").hover(function(){$("#"+$(this).attr("id")+"p").show()},function(){$("#"+$(this).attr("id")+"p").hide()});getuserinfo();$("#first").html(c[9]+"<br>");
$("#commentslist > div").slice(100).remove()}else c.command=="removecomment"&&$("#c"+c.cid).remove()});multiplexer.run()}
function updateLiveCommentsMenu(){multiplexer.subscribe("lru",function(b){if(b.command=="newcomment"&&$("#lc"+b.cid).length==0){var c="";with(b){c+='<div id="lc'+b.cid+'" style="border-bottom:1px dotted #ccc;">';if(is_vip==1)c+='<a href="http://vefire.ru/help/vip/"><img valign=middle border=0 src="http://s2.vefire.ru/img/icons/star.png" width=16 height=16 title="\u042d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u042d\u0444\u0438\u0440\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f!"></a>';c+=
'@<a class=user href="'+getUserLink(added_by_username)+'">';c+='<img class=fAvatar src="http://a.vefire.ru/16/'+added_by_username.toLowerCase()+'" valign=middle width=16 height=16>';c+=added_by_username+"</a> &raquo; ";c+='<a href="'+getDomain(lang,type);c+="/channel/"+slug+"/fid/"+fid+"/tid/"+tid+'">'+htmlspecialchars(name)+"</a>";c+="</div>"}$("#livecomments").prepend(c);$("#livecomments_status").remove();$("#livecomments > div").slice(5).remove()}else b.command=="removecomment"&&$("#lc"+b.cid).remove()});
multiplexer.run()}
function updatePromoComments(b){var c=cur_interface;$.ajax({type:"GET",url:"/ajax/comment/getComments/",data:{tid:b,page:1},dataType:"json",success:function(a,d){d="";if(a.Status>0){if(a.nrecords>0){d+="<div id=commentslist>";for(var e=0;e<a.Message.length;e++){d+='<div style="overflow:auto;z-index:1;" id=c'+a.Message[e].cid+' class="comment ';d+=a.Message[e].added_by_roleid>0?"acloud":"wcloud";d+='">';d+="<div id=c"+a.Message[e].cid+'p style="display:none;">';if(cur_edit_mode>=0)d+='<a class="fActionRe fr" title="\u041e\u0442\u0432\u0435\u0442\u0438\u0442\u044c" onclick="return cite(\''+
a.Message[e].added_by_username+"');\"> </a>";d+="</div>";if(a.Message[e].ctry!="")d+='<img src="http://s2.vefire.ru/img/flags/'+a.Message[e].ctry.toLowerCase()+'.gif" width=16 height=11> ';if(a.is_vip==1)d+='<a href="http://vefire.ru/help/vip/"><img valign=middle border=0 src="http://s2.vefire.ru/img/icons/star.png" width=16 height=16 title="\u042d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u042d\u0444\u0438\u0440\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f!"></a>';
d+='@<a href="'+getUserLink(a.Message[e].added_by_username)+'" class="user"><img class=fAvatar width=16 height=16 src="http://a.vefire.ru/16/'+a.Message[e].added_by_username.toLowerCase()+'" valign=middle>';d+=a.Message[e].added_by_username+"</a>: ";d+="<span class=rcomment>";d+=a.Message[e].status==0?"\u041d\u041b\u041e \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b\u043e \u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u043e \u044d\u0442\u0443 \u043d\u0430\u0434\u043f\u0438\u0441\u044c \u0437\u0434\u0435\u0441\u044c:<br><i>"+
a.Message[e].censored+"</i>":highlightComment(htmlspecialchars(a.Message[e].text));d+="</span></div>"}d+="</div>"}else d+="<div id=commentslist><div id=nocomments>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0432 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u043d\u0435\u0442.</div></div>";$("#commentsph").html(d);$(".comment").hover(function(){$("#"+$(this).attr("id")+"p").show()},function(){$("#"+$(this).attr("id")+"p").hide()});
getuserinfo()}else $("#commentsph").html("<div class=err>"+a.Message+" (Err "+a.Status+":"+a.Msg+")</div>").effect("pulsate",{times:3},300)},error:function(a,d,e){$("#commentsph").html("<div class=err>Err "+e+"! "+d+"</div>").effect("pulsate",{times:3},300)}});multiplexer.subscribe("t"+b,function(a){if(a.command=="newcomment"&&$("#c"+a.cid).length==0){var d="";with(a){d+='<div style="overflow:auto;z-index:1;" id=c'+a.cid+' class="comment ';d+=added_by_roleid!=0?"acloud":"wcloud";d+='">';d+="<div id=c"+
a.cid+'p style="display:none;">';if(cur_edit_mode>=0)d+='<a class="fActionRe fr" title="\u041e\u0442\u0432\u0435\u0442\u0438\u0442\u044c" onclick="return cite(\''+added_by_username+"');\"> </a>";d+="</div>";if(ctry!="")d+='<img src="http://s2.vefire.ru/img/flags/'+ctry.toLowerCase()+'.gif" width=16 height=11> ';d+='@<a class=user href="'+getUserLink(added_by_username)+'">';d+='<img align=absmiddle src="http://a.vefire.ru/16/'+added_by_username.toLowerCase()+'" width=16 height=16>';d+=added_by_username+
"</a>: </span>";d+="<span class=rcomment>"+highlightComment(htmlspecialchars(text))+"</span>";d+="</div>";$("#livecomments > div").slice(100).remove()}$("#commentslist").prepend(d);$(".comment").hover(function(){$("#"+$(this).attr("id")+"p").show()},function(){$("#"+$(this).attr("id")+"p").hide()});getuserinfo();$("#first").html(a[9]+"<br>")}else a.command=="removecomment"&&$("#c"+a.cid).remove()});multiplexer.run()}
function updateComments(){multiplexer.unsubscribe("t"+cur_thread_id,null);var b=cur_interface;multiplexer.subscribe("t"+cur_thread_id,function(c){if(c.command=="newcomment"&&$("#c"+c.cid).length==0){$("#nocomments").hide();$("#commentslist").prepend(formatComment(c,cur_forum_id,cur_thread_id));$(".comment").hover(function(){$("#"+$(this).attr("id")+"p").show()},function(){$("#"+$(this).attr("id")+"p").hide()});getuserinfo();cur_interface>0&&resizeFrame();$("#commentslist > div").slice(100).remove()}else if(c.command==
"removecomment")$("#c"+c.cid).remove();else c.command=="settopic"&&setChannelTopic(c.text)});multiplexer.run()}function setChannelTopic(b){b!=""?$("#activity").html('<div class="fl live" style="margin-bottom:1px;width:60px;">\u0432 \u044d\u0444\u0438\u0440\u0435</div><div style="margin-bottom:1px;line-height:14px;text-align:left;padding:2 5px;background:#e9eff5;width:915px" class=fl>'+htmlspecialchars(unescape(b))+"</div>").highlightComment().show():$("#activity").html("").hide()}
function getDomain(b,c){return b=="en"?"http://wefire.tv":c==2?"http://radio.vefire.ru":c==3?"http://games.vefire.ru":c==4?"http://video.vefire.ru":"http://vefire.ru"}
function formatComment(b,c,a){var d=cur_interface;with(b){var e="<div id=c"+cid+' class="comment" style="overflow:auto;z-index:1;border-bottom:1px #cbdef1 solid;padding:2px;background:';e+=added_by_roleid>0?"#ffff99":typeof cur_user!="undefined"&&cur_user!=""&&text.indexOf("@"+cur_user)>=0?"#ccffcc":"#fff";e+='">';e+="<a ";if(d==20)e+="target=_top ";e+='href="'+getUserLink(added_by_username)+'" class="user" style="font-weight:bold;"><img class=fAvatar width=16 height=16 src="http://a.vefire.ru/16/'+
added_by_username.toLowerCase()+'" valign=middle>';if(b.is_vip==1)e+='<img align=absmiddle style="margin:0 2px;" border=0 src="http://s2.vefire.ru/img/icons/star.png" width=16 height=16 title="\u042d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u042d\u0444\u0438\u0440\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f!">';e+=added_by_username+"</a>: ";e+="<span class=rcomment>";
if(status==0){if(cur_edit_mode>0&&cur_edit_mode!=5)e+=highlightComment(htmlspecialchars(text))+"<br>";e+="\u041d\u041b\u041e \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b\u043e \u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u043e \u044d\u0442\u0443 \u043d\u0430\u0434\u043f\u0438\u0441\u044c \u0437\u0434\u0435\u0441\u044c:<br><i>"+censored+"</i>"}else e+=highlightComment(htmlspecialchars(text));e+="</span><br>";if(ctry!="")e+='<img src="http://s2.vefire.ru/img/flags/'+
ctry.toLowerCase()+'.gif" width=16 height=11 class=fr>';e+="<span class=fDate>"+date;if(d!=2&&d!=5){e+="  \u0447\u0435\u0440\u0435\u0437 ";b=b.cur_interface;e+=getInterfaceLink(d,b)}e+="<span id=c"+cid+'p style="display:none;">';if(cur_edit_mode>=0){e+=' | <a title="\u041e\u0442\u0432\u0435\u0442\u0438\u0442\u044c" href="#" onclick="return cite(\''+added_by_username+"');\">\u041e\u0442\u0432\u0435\u0442\u0438\u0442\u044c</a>";if(cur_edit_mode>0&&cur_edit_mode!=5)e+=' | <a title="\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c/\u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439" href="#" onclick="blockComment('+
cid+","+(1-status)+');">\u0411\u043b\u043e\u043a.</a>';if(cur_edit_mode==1)e+=' | <a title="\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439" href="#" onclick="deleteComment('+cid+');">\u0423\u0434\u0430\u043b.</a>';e+=' | <a target=_top href="/channel/'+channel_slug+"/fid/"+c+"/tid/"+a+"/cid/"+cid+'" title="#'+cid+'" onclick="return false;">#</a>'}e+="</span>";e+="</span> ";e+="</div>";return e}}
function loadComments(b,c,a,d,e,j){$(".thread").removeClass("ycloud").addClass("wcloud");$("#t"+b).removeClass("wcloud").addClass("ycloud");var n=false;if(d!=cur_thread_ispublic)n=true;if(cur_thread_id!=b&&$("#commentsph").length>0){unsubscribeMultiplexer();$("#commentsph").html("")}cur_thread_id=b;cur_thread_name=c;cur_thread_page=a;cur_thread_ispublic=d;cur_tsort=e;cur_activity=j;if($("#commentsph").length==0||n){j=cur_interface>0?'<div style="width:100%;margin-bottom:3px;">':'<div class=wgtl><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">';
j+="<div id=poll></div>";if(cur_edit_mode>0&&cur_edit_mode!=5||cur_edit_mode==0&&d){j+='<div style="padding:2px;background:#e9eff5;border:1px #cbdef1 solid;margin-bottom:2px;">';j+='<form action="." id=cForm name=cForm method=post onsubmit="return saveComment();">';j+='<div class=fr><input id=cSubmitButton type=submit value="&crarr;" disabled ></div>';j+='<div style="margin-right:35px;"><textarea rows=1 style="width:310px;min-height:22px;border:1px #ccc solid;padding: 2px 5px;" class="fMessage" id=cComment onkeyup="validateEditComment(\'cComment\',\'ccComment\',255);" onpaste="validateEditComment(\'cComment\',\'ccComment\',255);" placeholder="\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439"></textarea></div>';
j+="<div class=cb></div>";j+='<div id=ccComment class="fDate cb" style="display:none"></div>';j+='<div class="cb smCont" id="smCont"><div class="smAll" id="smAll" style="margin:0;border-color:#ccc;"></div></div>';d=["confuse","cool","cry","eek","evil","kiss","lol","mad","mr-green","razz","red","sad","wink"];j+='<div id="sm cb" class="fl sm">';for(var h in d)j+='<a href="javascript:;" onclick="return smile(\'smiley-'+d[h]+'\');"><img src="http://s2.vefire.ru/img/icons/smiley-'+d[h]+'.png" title="[img smiley-'+
d[h]+']" align=absmiddle width=16 height=16></a>';j+='<a onclick="return smile(\'smiley\');"><img src="http://s2.vefire.ru/img/icons/smiley.png" title="[img smiley]" align=absmiddle width=16 height=16></a>';if(cur_interface==0)j+="<span> <a href=\"javascript:;\" onclick=\"$('#smAll').toggle('highlight');return loadSmiles(1);\">\u0415\u0449\u0451 \u0438\u043a\u043e\u043d\u043a\u0438 &raquo;</a></span>";j+="</div>";j+="<div class=cb></div>";j+="</form>";j+="</div>";j+='<script>$("#cComment").bind("keydown","return", function(evt) {return saveComment();});<\/script>'}else if(cur_edit_mode>=
0)j+="<div class=inf>\u0422\u0435\u043c\u0430 \u0437\u0430\u043a\u0440\u044b\u0442\u0430! \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u043d\u0435\u0451 \u043c\u043e\u0433\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b/\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b \u043a\u0430\u043d\u0430\u043b\u0430.</div>";j+="<div id=cMsg></div>";
j+="<div id=commentsph></div>";j+=cur_interface>0?"</div>":"</div></div></div></div>";$("#comments").html(j)}$("#comments").show();$("textarea#cComment").jGrow({rows:20});$("#cMsg").html('<div class=wcloud>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438...<img src="http://s2.vefire.ru/img/progress_big.gif"></div>').show();setPath(cur_forum_name,cur_forum_id,c,b);$.ajax({type:"GET",url:"/ajax/comment/getComments/",
data:{tid:b,page:a,tsort:e},dataType:"json",success:function(g,k){var l=cur_interface;k='<a class="wref fr" onclick="return reloadComments();" title="\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438"> </a>';if(cur_thread_page==1){k+='<div class=fr title="\u0410\u0432\u0442\u043e\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432"><input type=checkbox id=autoupdate';
if(autoupdate)k+=" checked";k+="><label for=autoupdate>\u0430\u0432\u0442\u043e</label></div>";k+="<script>";k+='$("#autoupdate").click(function(){';k+='var checked=$("#autoupdate").is(":checked");';k+="if(checked){autoupdate=1;updateComments();}";k+="else {autoupdate=0;unsubscribeMultiplexer();}";k+="});";if(autoupdate&&cur_thread_page==1)k+="updateComments();";else unsubscribeMultiplexer();k+="<\/script>"}if(l==0)k+='<a class="feed fl" target=_blank href="/channel/'+channel_slug+"/rss/tid/"+cur_thread_id+
'" title="RSS"> </a> ';k+='<a class="embed fl" onclick="return embedThread('+cur_thread_id+');" title="\u0412\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u0442\u0443 \u0416\u0438\u0432\u0443\u044e \u041b\u0435\u043d\u0442\u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0430\u0439\u0442"> </a> ';k+="<b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043f\u043e \u0442\u0435\u043c\u0435:</b><div class=cb></div>";
if(g.Status>0){if(typeof g.pollvoted!="undefined"){l='<div style="padding:5px;background:#e9eff5;border:1px #cbdef1 solid;">';l+='<b style="display:block;border-bottom:1px #cbdef1 solid;">\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435:</b>';if(g.pollvoted==1||g.poll.status==-1||cur_edit_mode<0)with(g.poll){l+='<div style="padding:5 0px">';l+=htmlspecialchars(question);if(cur_edit_mode>=0)l+=' <a href="#" onclick="return resetVotePoll('+cur_thread_id+');">\u041f\u0435\u0440\u0435\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u0442\u044c</a>';
l+="<br>";for(var o=0,m=1;m<16;m++)if(g.poll["a"+m]!="")o+=parseInt(g.poll["a"+m+"_count"]);for(m=1;m<16;m++)if(g.poll["a"+m]!=""){l+='<div style="line-height:normal;padding:1 3px">';var p=Math.round(o!=0?g.poll["a"+m+"_count"]/o*100:0);l+=htmlspecialchars(g.poll["a"+m])+" - <span class=fDate>"+p+"%";if(g.poll.showfigures==1)l+=" (\u0433\u043e\u043b\u043e\u0441\u043e\u0432: "+g.poll["a"+m+"_count"]+")";l+='</span><br><div style="width:100%;height:10px;border:1px lightgray solid;"><div style="width:'+
p+'%;height:10px;background-color:#0857a6"></div></div>';l+="</div>"}l+="</div>"}else with(g.poll){l+='<div style="padding:5px">';l+=htmlspecialchars(question)+"<br>";for(m=1;m<16;m++)if(g.poll["a"+m]!="")l+='<input type=button value="\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u0442\u044c" onclick="return votePoll('+cur_thread_id+","+m+');"> '+htmlspecialchars(g.poll["a"+m])+"<br>";l+="</div>"}l+="</div>";$("#poll").html(l).show()}else $("#poll").html("").hide();if(g.nrecords>0){k+='<div id=commentslist style="line-height:normal;padding:2px;border:1px #cbdef1 solid;">';
for(l=0;l<g.Message.length;l++)k+=formatComment(g.Message[l],g.fid,g.tid);k+="</div>";k+="<div align=center>";k+=pager(Math.ceil(g.nrecords/g.messages_per_page),cur_thread_page,"/channel/"+channel_slug+"/fid/"+cur_forum_id+"/fp/"+cur_forum_page+"/tid/"+cur_thread_id+"/tp/{0}","return loadComments("+cur_thread_id+",'"+cur_thread_name+"',{0},"+cur_thread_ispublic+","+cur_tsort+",'"+cur_activity+"');");k+="</div>"}else k+="<div id=commentslist><div id=nocomments>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0432 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u043d\u0435\u0442.</div></div>";
$("#commentsph").html(k);$("#cMsg").html("").hide();$(".comment").hover(function(){$("#"+$(this).attr("id")+"p").show()},function(){$("#"+$(this).attr("id")+"p").hide()});getuserinfo();cur_interface>0&&resizeFrame()}else{$("#commentsph").html(k);$("#cMsg").html("<div class=err>"+g.Message+" (Err "+g.Status+":"+g.Msg+")</div>").effect("pulsate",{times:3},300)}},error:function(g,k,l){$("#cMsg").html("<div class=err>Err "+l+"! "+k+"</div>").effect("pulsate",{times:3},300)}});return false}
function validateEditThread(b,c,a){textCounter(b,c,a);$("#tName").val().length==0?$("#tSaveThread").attr("disabled",true):$("#tSaveThread").removeAttr("disabled")}
function saveThread(b,c,a,d,e,j,n,h){jQuery("#tEdit :input").attr("disabled",true);jQuery("#tMsg").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">');jQuery.ajax({type:"POST",url:"/ajax/thread/save/",data:{tid:c,name:a,comment:d,fid:b,status:h,is_public:j,priority:e,tsort:n},dataType:"json",success:function(g,k){jQuery("#tEdit :input").removeAttr("disabled");g.Status>0?reloadThreads():
jQuery("#tMsg").html("<div class=err>"+g.Message+" (Err"+g.Status+")</div>").effect("pulsate",{times:3},300)},error:function(g,k,l){jQuery("#tEdit :input").removeAttr("disabled");jQuery("#tMsg").html("<div class=err>"+k+" (Err "+l+")</div>").effect("pulsate",{times:3},300)}});return false}
function editThread(b,c,a,d,e,j,n,h){var g="";g+="<div id=tMsg></div>";g+='<form id=tEdit method="post" onsubmit="return saveThread(jQuery(\'#tForum\').val(),'+c+",jQuery('#tName').val(),jQuery('#tComment').val(),jQuery('#tPriority').val(),jQuery('#tIsPublic').val(),jQuery('#tSort').val(),jQuery('#tStatus').val());\">";g+='<div class="fSubtitle" style="padding:0 0 5 55;">\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043c\u044b:</div>';g+='<span class="fCounter fl" id=tcName>128</span>';
g+='<div class="fTextarea fl"><input type=text name="tName" class="fMessage" id="tName" value="';if(a)g+=htmlspecialchars(unescape(a));g+="\" onkeyup=\"validateEditThread('tName','tcName',128);\" onpaste=\"validateEditForum('tName','tcName',128);\"/></div>";g+='<div style="clear:both"></div>';g+='<div class="fSubtitle" style="padding:0 0 5 55;">\u0422\u043e\u043f\u0438\u043a \u0442\u0435\u043c\u044b:</div>';g+='<span class="fCounter fl" id=tcComment>255</span>';g+='<div class="fTextarea fl"><textarea rows=3 name="tComment" class="fMessage" id="tComment" onkeyup="validateEditThread(\'tComment\',\'tcComment\',255);" onpaste="validateEditForum(\'tComment\',\'tcComment\',255);">';
if(h)g+=htmlspecialchars(unescape(h));g+="</textarea></div>";g+='<div style="clear:both"></div>';if(cur_edit_mode>=1&&cur_edit_mode<5||cur_edit_mode==6){g+='<div class="fSubtitle" style="padding:10 0 5 55;">\u0421\u0442\u0430\u0442\u0443\u0441 \u0442\u0435\u043c\u044b:</div>';g+='<select class=fl style="margin:0 0 5 55;" name="tStatus" id="tStatus">';g+="<option value=1>\u0410\u043a\u0442\u0438\u0432\u043d\u0430";g+="<option value=0";if(d==0)g+=" selected";g+=">\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0430";
g+="</select>";g+='<div style="clear:both"></div>';g+='<div class="fSubtitle" style="padding:10 0 5 55;">\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0442\u0435\u043c:</div>';g+='<select class=fl style="margin:0 0 5 55;" name="tPriority" id="tPriority">';for(a=1;a<10;a++){g+="<option value="+a;if(e==a)g+=" selected";g+=">"+a}g+="</select>";g+='<div style="clear:both"></div>';
g+='<div class="fSubtitle" style="padding:10 0 5 55;">\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c:</div>';g+='<select class=fl style="margin:0 0 5 55;" name="tIsPublic" id="tIsPublic">';g+="<option value=1>\u0414\u0430";g+="<option value=0";if(j==0)g+=" selected";g+=">\u041d\u0435\u0442";g+="</select>";g+='<div style="clear:both"></div>';g+='<div class="fSubtitle" style="padding:10 0 5 55;">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432:</div>';
g+='<select class=fl style="margin:0 0 5 55;" name="tSort" id="tSort">';g+="<option value=1>\u041f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u0434\u0430\u0442\u044b";g+="<option value=0 ";if(n==0)g+="selected";g+=">\u041f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u0434\u0430\u0442\u044b";g+="</select>";g+='<div style="clear:both"></div>';if(c!=0){g+='<div class="fSubtitle" style="padding:10 0 5 55;">\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u043a \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u0443:</div>';
g+='<select class=fl style="margin:0 0 5 55;width:350px;" name="tForum" id="tForum">';for(a=0;a<cur_forums.length;a++){e=cur_forums[a];g+="<option value="+e.id;if(b==e.id)g+=" selected";g+=">";g+=e.name.length>50?htmlspecialchars(e.name.substr(0,50))+"...":htmlspecialchars(e.name)}g+="</select>";g+='<div style="clear:both"></div>'}else g+="<input type=hidden id=tForum value="+b+">"}else g+="<input type=hidden id=tForum value="+b+">";g+='<div class="fSubmit" style="padding:5 0 5 55;"><input id="tSaveThread" type="submit" value="\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c" disabled/> ';
jQuery("#oldThreads").length==0&&jQuery("#threads").after('<div id=oldThreads style="display:none;"></div>');jQuery("#oldThreads").html(jQuery("#threads").html());g+="<input onclick=\"jQuery('#threads').html(jQuery('#oldThreads').html());jQuery('.threadp').hide();";g+="jQuery('.thread').hover(function() {jQuery('#'+jQuery(this).attr('id')+'p').show();}, function() {jQuery('#'+jQuery(this).attr('id')+'p').hide();});return false;\" type=button id=tSaveThread value=\"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c\"/>";
if(c!=0)g+=' <a href="javascript:" onclick="return editPoll('+c+');"><img src="http://s2.vefire.ru/img/icons/24.gif" align=absmiddle width=16 height=16 border=0>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435</a></div>';g+="</form>";g=cur_interface>0?'<div style="width:100%">'+g+"</div>":'<div class=wgtl><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">'+g+"</div></div></div></div>";jQuery("#threads").html(g);
c==0&&jQuery("textarea#tComment").jGrow();jQuery("#tName").focus();validateEditThread("tName","tcName",128);c==0&&validateEditThread("tComment","tcComment",255);return false}
function resetVotePoll(b){jQuery("#poll :input").attr("disabled",true);jQuery("#cMsg").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">');jQuery.ajax({type:"POST",url:"/ajax/poll/resetVote/",data:{tid:b},dataType:"json",success:function(c,a){jQuery("#poll :input").removeAttr("disabled");c.Status>0?reloadComments():jQuery("#cMsg").html("<div class=err>"+c.Message+" (Err"+c.Status+
")</div>").effect("pulsate",{times:3},300)},error:function(c,a,d){jQuery("#poll :input").removeAttr("disabled");jQuery("#cMsg").html("<div class=err>"+a+" (Err "+d+")</div>").effect("pulsate",{times:3},300)}});return false}
function votePoll(b,c){jQuery("#poll :input").attr("disabled",true);jQuery("#cMsg").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">');jQuery.ajax({type:"POST",url:"/ajax/poll/vote/",data:{tid:b,item:c},dataType:"json",success:function(a,d){jQuery("#poll :input").removeAttr("disabled");a.Status>0?reloadComments():jQuery("#cMsg").html("<div class=err>"+a.Message+" (Err"+a.Status+
")</div>").effect("pulsate",{times:3},300)},error:function(a,d,e){jQuery("#poll :input").removeAttr("disabled");jQuery("#cMsg").html("<div class=err>"+d+" (Err "+e+")</div>").effect("pulsate",{times:3},300)}});return false}
function savePoll(b){jQuery("#tEditPoll :input").attr("disabled",true);jQuery("#tMsg").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">');jQuery.ajax({type:"POST",url:"/ajax/poll/save/",data:{tid:b,question:$("#tQuestion").val(),status:$("#tPollStatus").val(),showfigures:$("#tPollFigures").val(),answer1:$("#tAnswer1").val(),answer2:$("#tAnswer2").val(),answer3:$("#tAnswer3").val(),
answer4:$("#tAnswer4").val(),answer5:$("#tAnswer5").val(),answer6:$("#tAnswer6").val(),answer7:$("#tAnswer7").val(),answer8:$("#tAnswer8").val(),answer9:$("#tAnswer9").val(),answer10:$("#tAnswer10").val(),answer11:$("#tAnswer11").val(),answer12:$("#tAnswer12").val(),answer13:$("#tAnswer13").val(),answer14:$("#tAnswer14").val(),answer15:$("#tAnswer15").val()},dataType:"json",success:function(c,a){jQuery("#tEditPoll :input").removeAttr("disabled");c.Status>0?reloadThreads():jQuery("#tMsg").html("<div class=err>"+
c.Message+" (Err"+c.Status+")</div>").effect("pulsate",{times:3},300)},error:function(c,a,d){jQuery("#tEdit :input").removeAttr("disabled");jQuery("#tMsg").html("<div class=err>"+a+" (Err "+d+")</div>").effect("pulsate",{times:3},300)}});return false}
function validateEditPoll(b,c,a){textCounter(b,c,a);b=false;if(jQuery("#tQuestion").val().length==0)b=true;else for(i=1;i<=nAnswers;i++)if(jQuery("#tAnswer"+i).val().trim()==""){b=true;break}b?jQuery("#tSavePoll").attr("disabled",true):jQuery("#tSavePoll").removeAttr("disabled")}var nAnswers=0;
function editPoll(b){cur_interface>0?jQuery("#threads").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">').show():jQuery("#threads").html('<div class=wgtl><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif"></div></div></div></div>').show();
jQuery.ajax({type:"GET",url:"/ajax/poll/get/",data:{tid:b},dataType:"json",success:function(c,a){if(!(c.Status<=0)){a="<div id=tMsg></div>";a+='<form id=tEditPoll method=post onsubmit="return savePoll('+c.tid+');">';a+='<div class=fSubtitle style="padding:0 0 5 55;">\u0412\u043e\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u044f:</div>';a+='<span class="fCounter fl" id=tcQuestion>'+(128-c.Message.question.length)+"</span>";a+='<div class="fTextarea fl"><input type=text class=fMessage id=tQuestion value="';
a+=htmlspecialchars(unescape(c.Message.question));a+="\" onkeyup=\"validateEditPoll('tQuestion','tcQuestion',128);\" onpaste=\"validateEditPoll('tQuestion','tcQuestion',128);\"/></div>";a+="<div class=cb></div>";a+='<div class="fSubtitle" style="padding:10 0 5 55;">\u0421\u0442\u0430\u0442\u0443\u0441 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u044f:</div>';a+='<select class=fl style="margin:0 0 5 55;" id="tPollStatus">';a+="<option value=1>\u0410\u043a\u0442\u0438\u0432\u043d\u043e (\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0434\u0435\u0442)";
a+="<option value=0";if(c.Message.status==0)a+=" selected";a+=">\u041d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e (\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e)";a+="<option value=-1";if(c.Message.status==-1)a+=" selected";a+=">\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e (\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e)";a+="</select>";
a+="<div class=cb></div>";a+='<div class="fSubtitle" style="padding:10 0 5 55;">\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0446\u0438\u0444\u0440\u044b \u0432 \u043e\u043f\u0440\u043e\u0441\u0435:</div>';a+='<select class=fl style="margin:0 0 5 55;" id="tPollFigures">';a+="<option value=1>\u0414\u0430";a+="<option value=0";if(c.Message.showfigures==0)a+=" selected";a+=">\u041d\u0435\u0442";a+="</select>";a+="<div class=cb></div>";var d=false;nAnswers=0;for(var e=1;e<16;++e){a+=
"<div id=answer"+e+' style="float:left;width:100%;';if((c.Message["a"+e]==""||d)&&e>2){a+="display:none;";d=true}a+='">';d||nAnswers++;a+='<div class=fSubtitle style="padding:0 0 5 55;">\u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 #'+e+":</div>";a+='<span class="fCounter fl" id=tcAnswer'+e+">"+(128-c.Message["a"+e].length)+"</span>";a+='<div class="fTextarea fl"><input type=text class=fMessage id=tAnswer'+e+' value="';a+=htmlspecialchars(unescape(c.Message["a"+e]));
a+='" onkeyup="validateEditPoll(\'tAnswer'+e+"','tcAnswer"+e+"',128);\" onpaste=\"validateEditPoll('tAnswer"+e+"','tcAnswer"+e+"',128);\"/>";a+="</div>";a+="<div class=cb></div>";a+="</div>"}a+='<div class=cb style="padding:0 0 5 55;width:100%;">';a+="<a "+(nAnswers==15?'style="display:none;" ':"")+"id=addVariant onclick=\"jQuery('#delVariant').show();nAnswers++;jQuery('#answer'+nAnswers).show();validateEditPoll('tQuestion','tcQuestion',128);if(nAnswers>=15)jQuery('#addVariant').hide();return false;\" href=\"javascript:\"><img src=\"http://s2.vefire.ru/img/icons/11.gif\" align=absmiddle width=16 height=16 border=0>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442</a> ";
a+="<a "+(nAnswers<=2?'style="display:none;" ':"")+"id=delVariant onclick=\"jQuery('#addVariant').show();jQuery('#tAnswer'+nAnswers).val('');jQuery('#answer'+nAnswers).hide();nAnswers--;if(nAnswers==2)jQuery('#delVariant').hide();validateEditPoll('tQuestion','tcQuestion',128);return false;\" href=\"javascript:\"><img src=\"http://s2.vefire.ru/img/icons/12.gif\" align=absmiddle width=16 height=16 border=0>\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442</a>";a+=
"<div class=cb></div>";a+="</div>";a+='<div class="fSubmit" style="padding:5 0 5 55;"><input id="tSavePoll" type="submit" value="\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c" disabled/> ';a+="<input onclick=\"jQuery('#threads').html(jQuery('#oldThreads').html());jQuery('.threadp').hide();";a+="jQuery('.thread').hover(function() {jQuery('#'+jQuery(this).attr('id')+'p').show();}, function() {jQuery('#'+jQuery(this).attr('id')+'p').hide();});return false;\" type=button id=tCancel value=\"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c\"/>";
a+="</div></form>";a=cur_interface>0?'<div style="width:100%">'+a+"</div>":'<div class=wgtl><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">'+a+"</div></div></div></div>";jQuery("#threads").html(a);validateEditPoll("tQuestion","tcQuestion",128)}}});return false}function reloadThreads(){return loadThreads(cur_forum_id,cur_forum_name,cur_forum_page,cur_fsort,1,cur_forum_ispublic,cur_ftype)}
function loadThreads(b,c,a,d,e,j,n){cur_forum_id=b;cur_forum_name=c;cur_forum_page=a;cur_forum_ispublic=j;cur_fsort=d;cur_ftype=n;j=0;if(cur_edit_mode>0&&cur_edit_mode<5||cur_edit_mode==6)j=1;if(e){jQuery("#comments").hide();setPath(c,b)}cur_interface>0?jQuery("#threads").html('\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u043c...<img src="http://s2.vefire.ru/img/progress_big.gif">').show():jQuery("#threads").html('<div class=wgtl><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u043c...<img src="http://s2.vefire.ru/img/progress_big.gif"></div></div></div></div>').show();
jQuery(".forum").removeClass("ycloud").addClass("wcloud");jQuery("#f"+b).removeClass("wcloud").addClass("ycloud");jQuery.ajax({type:"GET",url:"/ajax/thread/getThreads/",data:{fid:cur_forum_id,page:a,fsort:d,showblocked:j},dataType:"json",success:function(h,g){g=0;if(cur_edit_mode>0&&cur_edit_mode<5||cur_edit_mode==6)g=1;var k=cur_interface>0?'<div style="width:100%;margin-bottom:3px;">':'<div class=wgtl><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">';if(cur_edit_mode>=
0&&cur_forum_ispublic||g)k+=n==0?'<a class="badd fl" onclick="return editThread('+cur_forum_id+',0);" title="\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043c\u0443"> </a>':'<a class="badd fl" target=_blank href="/news/create/" title="\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0441\u0442\u044c"> </a>';k+='<a class="wref fr" onclick="return loadThreads(cur_forum_id,cur_forum_name,cur_forum_page,cur_fsort,0,cur_forum_ispublic,cur_ftype);" title="\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u043c\u044b"> </a>';
if(h.Status>0){k+='<a class="feed fl" target=_blank href="/channel/'+channel_slug+"/rss/fid/"+cur_forum_id+'" title="RSS"></a> ';k+="<b>\u0422\u0435\u043c\u044b \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u0430:</b>";if(h.nrecords>0){for(var l=0,o=0;o<h.Message.length;o++)with(h.Message[o]){(status&1)>0&&l++;k+="<div id=t"+id+' class="thread wcloud">';k+="<div id=t"+id+"p class=threadp>";if(g)k+=ttype==0?'<a class="bedt fr" onclick="return editThread('+b+","+id+",'"+escape(name)+
"',"+status+","+priority+","+is_public+","+tsort+",'"+escape(activity)+'\');" title="\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043c\u0443"> </a>':'<a class="bedt fr" target=_blank href="/news/'+htmlspecialchars(tparam)+'/edit/" title="\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0441\u0442\u044c"> </a>';k+="</div>";if((status&1)==0)k+="<del>";if(cur_thread_id==id||cur_thread_id==-1&&(status&
1)>0&&l==1)eval("loadComments("+id+",'"+escape(name)+"',"+cur_thread_page+","+is_public+","+tsort+",'"+escape(activity)+"');");k+='<strong><a href="/channel/'+channel_slug+"/fid/"+b+"/tid/"+id+'" onclick="';if(cur_interface==0)k+="jQuery(this).scrollTop();";k+="return loadComments("+id+",'"+escape(name)+"',1,"+is_public+","+tsort+",'"+escape(activity)+"');\">"+highlight(htmlspecialchars(name))+"</a></strong>";if((status&1)==0)k+="</del>";k+=" <span class=fDate>(\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:"+
nmessages+")</span><br>";k+="<span class=fDate>\u0421\u043e\u0437\u0434\u0430\u043d\u043e: "+create_date+"</span> ";if(last_msg_by){k+="<br><span class=fDate>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435:</span> ";k+='@<a href="'+getUserLink(last_msg_by)+'" class="user"><img class=fAvatar width=16 height=16 src="http://a.vefire.ru/16/'+last_msg_by.toLowerCase()+'" valign=middle>';k+=last_msg_by+"</a> ";k+="<span class=fDate>"+last_msg_date+"</span> "}if(n==1){k+='<div class=ok><a href="';
k+=cur_interface>0?"?action=news&slug="+htmlspecialchars(tparam):"/news/"+htmlspecialchars(tparam)+"/";k+='">\u041f\u043e\u043b\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u043e\u0432\u043e\u0441\u0442\u0438/\u0430\u043d\u043e\u043d\u0441\u0430 &#x226B;</a></div>'}k+="</div>"}k+=pager(Math.ceil(h.nrecords/h.messages_per_page),cur_forum_page,"/channel/"+channel_slug+"/fid/"+cur_forum_id+"/fp/{0}","return loadThreads("+cur_forum_id+",'"+cur_forum_name+"',{0},"+cur_fsort+",1,"+cur_forum_ispublic+
","+cur_ftype+");")}else k+="<div>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u0435 \u0442\u0435\u043c \u043d\u0435\u0442.</div>"}else k+="<div class=err>"+h.Message+" (Err"+h.Status+")</div>";k+=cur_interface>0?"</div>":"</div></div></div></div>";jQuery("#threads").html(k);jQuery(".thread").removeClass("ycloud").addClass("wcloud");jQuery("#t"+cur_thread_id).removeClass("wcloud").addClass("ycloud");if(g){jQuery(".threadp").hide();
jQuery(".thread").hover(function(){jQuery("#"+jQuery(this).attr("id")+"p").show()},function(){jQuery("#"+jQuery(this).attr("id")+"p").hide()})}getuserinfo();cur_interface>0&&resizeFrame()},error:function(h,g,k){jQuery("#status").html("<div class=err>Err "+k+"! "+g+"</div>").effect("pulsate",{times:3},300)}});return false}
function validateEditForum(b,c,a){textCounter(b,c,a);jQuery("#fName").val().length==0||jQuery("#fDesc").val().length==0?jQuery("#fSaveForum").attr("disabled",true):jQuery("#fSaveForum").removeAttr("disabled")}
function saveForum(b,c,a,d,e,j,n){jQuery("#fEditForum :input").attr("disabled",true);jQuery("#fMsg").html('\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...<img src="http://s2.vefire.ru/img/progress_big.gif">');jQuery.ajax({type:"POST",url:"/ajax/forum/save/",data:{channel_attr_id:channel_attr_id,id:b,name:c,desc:a,priority:d,is_public:e,fsort:j,status:n},dataType:"json",success:function(h,g){jQuery("#fEditForum :input").removeAttr("disabled");
if(h.Status>0)loadForums(1);else{h="<div class=err>"+h.Message+" (Err"+h.Status+")</div>";jQuery("#fMsg").html(h).effect("pulsate",{times:3},300)}},error:function(h,g,k){jQuery("#fEditForum :input").removeAttr("disabled");jQuery("#fMsg").html("<div class=err>"+g+" (Err "+k+")</div>").effect("pulsate",{times:3},300)}});return false}
function editForum(b,c,a,d,e,j,n){var h="";h+="<div id=fMsg></div>";h+='<form id=fEditForum method="post" onsubmit="return saveForum('+b+",jQuery('#fName').val(),jQuery('#fDesc').val(),jQuery('#fPriority').val(),jQuery('#fIsPublic').val(),jQuery('#fSort').val(),jQuery('#fStatus').val());\">";h+='<div class="fSubtitle" style="padding:0 0 5 55;">\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u0430:</div>';h+='<span class="fCounter fl" id=fcName>128</span>';
h+='<div class="fTextarea fl"><input type=text name="fName" class="fMessage" id="fName" value="'+htmlspecialchars(unescape(c))+"\" onkeyup=\"validateEditForum('fName','fcName',128);\" onpaste=\"validateEditForum('fName','fcName',128);\"/></div>";h+='<div style="clear:both"></div>';h+='<div class="fSubtitle" style="padding:0 0 5 55;">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u0430:</div>';h+='<span class="fCounter fl" id=fcDesc>255</span>';
h+='<div class="fTextarea fl"><textarea rows=3 name="fDesc" class="fMessage" id="fDesc" onkeyup="validateEditForum(\'fDesc\',\'fcDesc\',255);" onpaste="validateEditForum(\'fDesc\',\'fcDesc\',255);">'+htmlspecialchars(unescape(a))+"</textarea></div>";h+='<div style="clear:both"></div>';h+='<div class="fSubtitle" style="padding:10 0 5 55;">\u0421\u0442\u0430\u0442\u0443\u0441 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u0430:</div>';h+='<select class=fl style="margin:0 0 5 55;" name="fStatus" id="fStatus">';
h+="<option value=1>\u0410\u043a\u0442\u0438\u0432\u0435\u043d";h+="<option value=0";if(n==0)h+=" selected";h+=">\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d";h+="</select>";h+='<div style="clear:both"></div>';h+='<div class="fSubtitle" style="padding:10 0 5 55;">\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u043e\u0432:</div>';
h+='<select class=fl style="margin:0 0 5 55;" name="fPriority" id="fPriority">';for(b=1;b<10;b++){h+="<option value="+b;if(d==b)h+=" selected";h+=">"+b}h+="</select>";h+='<div style="clear:both"></div>';h+='<div class="fSubtitle" style="padding:10 0 5 55;">\u041a\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0442\u0435\u043c\u044b \u0432 \u044d\u0442\u043e\u043c \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u0435:</div>';
h+='<select class=fl style="margin:0 0 5 55;" name="fIsPublic" id="fIsPublic">';h+="<option value=1>\u0412\u0441\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438";h+="<option value=0";if(e==0)h+=" selected";h+=">\u0422\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u0438 \u043a\u0430\u043d\u0430\u043b\u0430";
h+="</select>";h+='<div style="clear:both"></div>';h+='<div class="fSubtitle" style="padding:10 0 5 55;">\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0435\u043c \u0432 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u0435:</div>';h+='<select class=fl style="margin:0 0 5 55;width:350px;" name="fSort" id="fSort">';h+="<option value=0>\u041f\u043e \u0434\u0430\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f, \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432 \u0442\u0435\u043c";
h+="<option value=1";if(j==1)h+=" selected";h+=">\u041f\u043e \u0434\u0430\u0442\u0435 \u0442\u0435\u043c\u044b (\u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e), \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432 \u0442\u0435\u043c";h+="<option value=2";if(j==2)h+=" selected";h+=">\u041f\u043e \u0434\u0430\u0442\u0435 \u0442\u0435\u043c\u044b (\u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e), \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432 \u0442\u0435\u043c";
h+="</select>";h+='<div style="clear:both"></div>';h+='<div class="fSubmit" style="padding:5 0 5 55;"><input id="fSaveForum" type="submit" value="\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c" disabled/> ';jQuery("#oldForums").length==0&&jQuery("#forums").after('<div id=oldForums style="display:none;"></div>');jQuery("#oldForums").html(jQuery("#forums").html());h+="<input onclick=\"jQuery('#forums').html(jQuery('#oldForums').html());jQuery('.forump').hide();jQuery('.forum').hover(function() {jQuery('#'+jQuery(this).attr('id')+'p').show();}, function() {jQuery('#'+jQuery(this).attr('id')+'p').hide();});return false;\" id=fSaveForum type=button value=\"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c\"/></div>";
h+="</form>";h=cur_interface>0?'<div style="width:100%">'+h+"</div>":'<div class=wgtl><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">'+h+"</div></div></div></div>";jQuery("#forums").html(h);jQuery("textarea#fDesc").jGrow();jQuery("#fName").focus();validateEditForum("fName","fcName",128);validateEditForum("fDesc","fcDesc",255);return false}
function loadForums(b){if(b){jQuery("#threads").hide();jQuery("#comments").hide();setPath()}cur_interface>0?jQuery("#forums").html('\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u043e\u0432...<img src="http://s2.vefire.ru/img/progress_big.gif">'):jQuery("#forums").html('<div class="wgtl"><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr style="padding:3px;">\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u043e\u0432...<img src="http://s2.vefire.ru/img/progress_big.gif"></div></div></div></div>');
jQuery.ajax({type:"GET",url:"/ajax/forum/getForums/",data:{channel_attr_id:channel_attr_id},dataType:"json",success:function(c,a){a=cur_interface>0?'<div style="width:100%;">':'<div class="fl wgtl"><div style="width:100%" class=wgtr><div class=wgbl><div class=wgbr id=forums style="padding:3px;">';if(cur_edit_mode>=1&&cur_edit_mode<=3)a+='<a class="badd fl" onclick="return editForum(0,\'\',\'\',1,1,0,1);" title="\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c"> </a>';
a+='<a class="wref fr" onclick="return loadForums();" title="\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u044b"> </a>';if(c.Status>0){a+='<a class="feed fl" target=_blank href="/channel/'+channel_slug+'/rss/" title="RSS"> </a> <b>\u041c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c\u044b \u043a\u0430\u043d\u0430\u043b\u0430 '+channel_name+"</b>";for(var d=0,e=0;e<c.Message.length;e++){cur_forums=c.Message;with(c.Message[e]){(status&
1)>0&&d++;if((status&1)==0&&cur_edit_mode>=1&&cur_edit_mode<=3||(status&1)==1){a+="<div id=f"+id+' class="forum wcloud">';if((status&1)==0)a+="<del>";if(cur_edit_mode>=1&&cur_edit_mode<=3&&ftype==0){a+="<div id=f"+id+"p class=forump>";a+='<a class="bedt fr" onclick="return editForum('+id+",'"+escape(name)+"','"+escape(desc)+"',"+priority+","+is_public+","+fsort+","+status+');" title="\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u0440\u0443\u043c"> </a>';
a+="</div>"}if(cur_forum_id==id||cur_forum_id==-1&&(status&1)>0&&d==1)eval("loadThreads("+id+",'"+escape(name)+"',"+cur_forum_page+","+fsort+",1,"+is_public+","+ftype+");");a+='<strong><a onclick="unsubscribeMultiplexer();cur_thread_id=0;return loadThreads('+id+",'"+escape(name)+"',1,"+fsort+",1,"+is_public+","+ftype+');" href="/channel/'+channel_slug+"/fid/"+id+'">';a+=htmlspecialchars(name)+"</a></strong>";if((status&1)==0)a+="</del>";a+="<br>"+highlight(htmlspecialchars(desc))+"<br>";if(last_msg_by){a+=
"<span class=fDate>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435:</span> ";a+='@<a href="'+getUserLink(last_msg_by)+'" class="user"><img class=fAvatar width=16 height=16 src="http://a.vefire.ru/16/'+last_msg_by.toLowerCase()+'" valign=middle>';a+=last_msg_by+"</a> ";a+="<span class=fDate>"+last_msg_date+"</span> ";a+='<a title="'+htmlspecialchars(last_msg_thread)+'" onclick="return loadThreads('+id+",'"+escape(last_msg_thread)+"',1,"+fsort+",1,"+ftype+');" href="/channel/'+channel_slug+"/fid/"+
id+"/tid/"+last_msg_threadid+'">';a+=last_msg_thread.length>15?htmlspecialchars(last_msg_thread.substr(0,12))+"...":htmlspecialchars(last_msg_thread);a+="</a>"}a+="</div>"}}}}else a+="<br><br><div class=err>"+c.Message+"</div>";a+=cur_interface>0?"</div>":"</div></div></div></div>";jQuery("#forums").html(a);jQuery(".forum").removeClass("ycloud").addClass("wcloud");jQuery("#f"+cur_forum_id).removeClass("wcloud").addClass("ycloud");jQuery(".forump").hide();jQuery(".forum").hover(function(){jQuery("#"+
jQuery(this).attr("id")+"p").show()},function(){jQuery("#"+jQuery(this).attr("id")+"p").hide()});getuserinfo();cur_interface>0&&resizeFrame()},error:function(c,a,d){jQuery("#status").html("<div class=err>Err "+d+"! "+a+"</div>").effect("pulsate",{times:3},300)}});return false}String.prototype.format=function(){var b=/\{\d+\}/g,c=arguments;return this.replace(b,function(a){return c[a.match(/\d+/)]})};
function pager(b,c,a,d){var e="";if(b>1){e+='<table align=center><tr><td align=right width="100">';if(c!=1){e+='<a href="'+a.format(1)+'"';if(d!="")e+=' onclick="'+d.format(1)+'"';e+='><div class="pagerl"></div></a>'}e+="</td><td width=129>";e+='<div class="pagerc"></div>';e+='</td><td width="100">';if(c!=b)e+='<a href="'+a.format(b)+'" onclick="'+d.format(b)+'"><div class="pagerr"></div></a>';e+="</td></tr>";e+='<tr><td colspan=3 align=center style="text-align:center;font-size:16;">';if(c!=1)e+=
'<a href="'+a.format(c-1)+'" onclick="'+d.format(c-1)+'">\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f</a>&nbsp;&nbsp;';if(c<=5)for(var j=1;j<=b&&j<=c+4;j++)e+=j==c?"<b>"+j+"</b>&nbsp;&nbsp;":'<a href="'+a.format(j)+'" onclick="'+d.format(j)+'">'+j+"</a>&nbsp;&nbsp;";else if(c<=b-4)for(j=c-4;j<=b&&j<=c+4;j++)e+=j==c?"<b>"+j+"</b>&nbsp;&nbsp;":'<a href="'+a.format(j)+'" onclick="'+d.format(j)+'">'+j+"</a>&nbsp;&nbsp;";else for(j=c-4;j<=b;j++)e+=j==c?"<b>"+j+"</b>&nbsp;&nbsp;":'<a href="'+
a.format(j)+'" onclick="'+d.format(j)+'">'+j+"</a>&nbsp;&nbsp;";if(c!=b)e+='<a href="'+a.format(c+1)+'" onclick="'+d.format(c+1)+'">\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f</a>';e+="</td></tr></table>"}return e}function textCounter(b,c,a){if(jQuery("#"+b).val().length>a){jQuery("#"+b).val(jQuery("#"+b).val().substring(0,a));return false}else jQuery("#"+c).html(a-jQuery("#"+b).val().length)}
function highlight(b){return b.replace(/ - /g," &mdash; ").replace(/\.\.\./g,"&#8230;").replace(/\n/g,"<br>")}function htmlspecialchars(b){for(var c=Array("&","<",">",'"'),a=Array("&amp;","&lt;","&gt;","&quot;"),d=0;d<c.length;d++){var e=new RegExp(c[d],"gi");if(e.test(b))b=b.replace(e,a[d])}return b}
var url_regex=/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,vimeo_regex=/http:\/\/vimeo.com\/([0-9]*)/ig,youtube_regex=/http:\/\/www.youtube.com\/watch\?v=([-_A-Za-z0-9]*)/ig,vesti_regex=/http:\/\/www.vesti.ru\/videos\?vid=([0-9]*)/ig,vimeo_regex2=/\[vimeo ([0-9]*)\]/ig,youtube_regex2=/\[youtube ([-_A-Za-z0-9]*)\]/ig,vesti_regex2=/\[vesti ([0-9]*)\]/ig;
jQuery(function(){jQuery.extend(jQuery.fn.highlightComment=function(){return this.each(function(){var b=" "+jQuery(this).html();b=b.replace(vimeo_regex,"[vimeo $1]");b=b.replace(youtube_regex,"[youtube $1]");b=b.replace(vesti_regex,"[vesti $1]");if(cur_interface==0||cur_interface==1||cur_interface==4||cur_interface==20)b=b.replace(url_regex,'<a href="$1" target=_top>$1</a>');b=b.replace(vimeo_regex2,'<iframe src="http://player.vimeo.com/video/$1" width=375 height=225 frameborder=0></iframe><br>');
b=b.replace(youtube_regex2,'<iframe src="http://www.youtube.com/embed/$1?rel=0&wmode=opaque" width=375 height=225 frameborder=0></iframe><br>');b=b.replace(vesti_regex2,'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,29,0" width=375 height=346 align=middle><param name=allowScriptAccess value=always /><param name=allowFullScreen value=true /><param name=movie value="http://www.vesti.ru/i/flvplayer_videoHost.swf?vid=$1&fbv=true&isHome=false" /><param name=quality value=high /><param name=wmode value=opaque /><param name=devicefont value=true /><param name=bgcolor value="#000000" /><param name=vid value=$q /><embed src="http://www.vesti.ru/i/flvplayer_videoHost.swf?vid=$1&fbv=true&isHome=false" quality=high devicefont=true bgcolor="#000000" width=375 height=346 align=middle allowScriptAccess=always allowFullScreen=true type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="opaque" /></object><br>');
b=cur_interface>0&&cur_interface!=20?b.replace(/(\s)@([A-Za-z0-9_-]{2,15})/g,function(c){return c.charAt(0)+'@<a href="?action=user&slug='+c.substring(2)+'" class=user><img class=fAvatar src="http://a.vefire.ru/16/'+c.substring(2).toLowerCase()+'" valign=middle width=16 height=16>'+c.substring(2)+"</a></span>"}):b.replace(/(\s)@([A-Za-z0-9_-]{2,15})/g,function(c){var a=c.charAt(0)+"@<a ";if(cur_interface==20)a+="target=_top ";a+='href="/user/'+c.substring(2)+'/" class="user"><img class=fAvatar src="http://a.vefire.ru/16/'+
c.substring(2).toLowerCase()+'" valign=middle width=16 height=16>'+c.substring(2)+"</a>";return a});b=b.replace(/ - /gi," &mdash; ");b=b.replace(/\n- /gi,"\n&#x2015; ");b=b.replace(/\.\.\. /gi,"&#8230; ");b=b.replace(/\n/g,"<br>");b=b.replace(/\[img ([a-zA-Z0-9-]{2,40})\.gif\]/g,'<img align="absmiddle" alt="[img $1.gif]" title="[img $1.gif]" src="http://s2.vefire.ru/img/icons/$1.gif">');b=b.replace(/\[img ([a-zA-Z0-9-]{2,40})\]/g,'<img align="absmiddle" alt="[img $1]" title="[img $1]" src="http://s2.vefire.ru/img/icons/$1.png">');
b=b.substring(1);jQuery(this).html(b)})})});
function highlightComment(b){b=" "+b;b=b.replace(vimeo_regex,"[vimeo $1]");b=b.replace(youtube_regex,"[youtube $1]");b=b.replace(vesti_regex,"[vesti $1]");if(cur_interface==0||cur_interface==1||cur_interface==4||cur_interface==20)b=b.replace(url_regex,'<a href="$1" target=_top>$1</a>');b=b.replace(vimeo_regex2,'<iframe style="margin:0px;" src="http://player.vimeo.com/video/$1" width=340 height=250 frameborder=0></iframe><br>');b=b.replace(youtube_regex2,'<iframe style="margin:0px;" src="http://www.youtube.com/embed/$1?rel=0&wmode=opaque" width=340 height=210 frameborder=0></iframe><br>');
b=b.replace(vesti_regex2,'<object style="margin:0px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,29,0" width=340 height=395 align=middle><param name=allowScriptAccess value=always /><param name=allowFullScreen value=true /><param name=movie value="http://www.vesti.ru/i/flvplayer_videoHost.swf?vid=$1&fbv=true&isHome=false" /><param name=quality value=high /><param name=wmode value=opaque /><param name=devicefont value=true /><param name=bgcolor value="#000000" /><param name=vid value=$q /><embed  style="margin:0px;" src="http://www.vesti.ru/i/flvplayer_videoHost.swf?vid=$1&fbv=true&isHome=false" quality=high devicefont=true bgcolor="#000000" width=340 height=295 align=middle allowScriptAccess=always allowFullScreen=true type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="opaque" /></object><br>');
b=cur_interface>0&&cur_interface!=20?b.replace(/(\s)@([A-Za-z0-9_-]{2,15})/g,function(c){return c.charAt(0)+'@<a href="?action=user&slug='+c.substring(2)+'" class=user><img class=fAvatar src="http://a.vefire.ru/16/'+c.substring(2).toLowerCase()+'" valign=middle width=16 height=16>'+c.substring(2)+"</a></span>"}):b.replace(/(\s)@([A-Za-z0-9_-]{2,15})/g,function(c){var a=c.charAt(0)+"@<a ";if(cur_interface==20)a+="target=_top ";a+='href="/user/'+c.substring(2)+'/" class="user"><img class=fAvatar src="http://a.vefire.ru/16/'+
c.substring(2).toLowerCase()+'" valign=middle width=16 height=16>'+c.substring(2)+"</a>";return a});b=b.replace(/ - /gi," &mdash; ");b=b.replace(/\n- /gi,"\n&#x2015; ");b=b.replace(/\.\.\. /gi,"&#8230; ");b=b.replace(/\n/g,"<br>");b=b.replace(/\[img ([a-zA-Z0-9-]{2,40})\.gif\]/g,'<img align="absmiddle" alt="[img $1.gif]" title="[img $1.gif]" src="http://s2.vefire.ru/img/icons/$1.gif">');b=b.replace(/\[img ([a-zA-Z0-9-]{2,40})\]/g,'<img align="absmiddle" alt="[img $1]" title="[img $1]" src="http://s2.vefire.ru/img/icons/$1.png">');
return b=b.substring(1)}jQuery(document).ready(function(){getuserinfo()});

