var cache_post=[];function ajax_post_edit(a){ShowLoading();if(!cache_post[a]||cache_post[a]=="")cache_post[a]=$("#post-id-"+a).html();$.post(forum_ajax+"editpost.php",{id:a,action:"edit"},function(b){$("#post-id-"+a).html(b)});HideLoading();return false}function ajax_cancel_post_edit(a){$("#post-id-"+a).html(cache_post[a]);return false} function ajax_save_post_edit(a,b){ShowLoading();var c="";c=b=="1"?$("#forum_post_"+a).html():$("#forum_post_"+a).val();$.post(forum_ajax+"editpost.php",{id:a,action:"save",wysiwyg:b,post_text:c},function(d){$("#post-id-"+a).html(d)});cache_post[a]="";HideLoading();return false} function doAddPost(){var a=document.getElementById("forum-post-form"),b="",c="",d="";if(forum_wysiwyg=="1"){b=$("#post_text").html();c="wysiwyg"}else b=$("#post_text").val();if(a.sec_code)d=a.sec_code.value;if(b==""){DLEalert("\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u044f","\u041e\u0448\u0438\u0431\u043a\u0430");return false}ShowLoading();var e=$("#topic_title").val(),f=$("#forum_id").val(), g=$("#topic_id").val(),h=$("#post_id").val();$.post(forum_ajax+"addpost.php",{post_text:b,topic_title:e,forum_id:f,topic_id:g,post_id:h,editor_mode:c,name:a.name.value,mail:a.mail.value,sec_code:d,skin:dle_skin},function(j){$("#ajax-post").html(j);$("#post_text").val("")});HideLoading();return false} function postDelete(a){DLEconfirm("\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435?",dle_confirm,function(){document.location=a})} function topicDelete(a){DLEconfirm("\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443?",dle_confirm,function(){document.location=a})} function rowDelete(a){DLEconfirm("\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u043f\u0438\u0441\u044c?",dle_confirm,function(){document.location=a})} function TopicMenu(a,b,c){var d=[];if(c)d[0]='<a href="'+b+"act=moderation&code=calc&tid="+a+'">\u041f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u0442\u0435\u043c\u0435</a>';d[1]='<a href="'+b+"act=subscription&code=add&tid="+a+'">\u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u0442\u0435\u043c\u0443</a>';d[2]='<a href="'+b+"act=_topic&code=forward&tid="+a+'">\u0421\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0443</a>'; d[3]='<a href="'+b+"act=_topic&code=print&tid="+a+'">\u0412\u0435\u0440\u0441\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0447\u0430\u0442\u0438</a>';return d} function ForumMenu(a,b,c){var d=[];if(b){d[0]='<a href="'+c+"showforum="+a+'&code=hidden">\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0442\u0435\u043c\u044b</a>';d[1]='<a href="'+c+"act=getforum&code=calc&fid="+a+'">\u041f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u0444\u043e\u0440\u0443\u043c\u0435</a>'}d[3]='<a href="'+c+"showforum="+a+'&code=today">\u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0435\u043c\u044b</a>'; d[4]='<a href="'+c+"showforum="+a+'&code=noreply">\u0422\u0435\u043c\u044b \u0431\u0435\u0437 \u043e\u0442\u0432\u0435\u0442\u043e\u0432</a>';return d}function PostEditMenu(a,b,c,d){var e=[];e[0]="<a onclick=\"ajax_post_edit('"+a+'\'); return false;" href="#">'+menu_short+"</a>";e[1]='<a href="'+b+"act=post&code=02&pid="+a+"&p="+c+"&pn="+d+'">'+menu_full+"</a>";return e} function FUserMenu(a,b,c,d){var e=[];e[0]='<a href="'+dle_root+"index.php?subaction=userinfo&user="+a+'">'+menu_profile+"</a>";e[1]='<a href="'+dle_root+"index.php?do=pm&doaction=newpm&user="+b+'">'+menu_send+"</a>";e[2]='<a href="'+d+"act=getforum&code=user&n="+a+'">\u041d\u0430\u0439\u0442\u0438 \u0442\u0435\u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f</a>';e[3]='<a href="'+d+"act=posts&user="+a+'">\u041d\u0430\u0439\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f</a>'; if(c=="1")e[4]="<a onclick=\"window.open('"+dle_root+dle_admin+"?mod=editusers&action=edituser&id="+b+"', 'User','toolbar=0,location=0,status=0, left=0, top=0, menubar=0,scrollbars=yes,resizable=0,width=540,height=500'); return false;\" href=\"#\">"+menu_uedit+"</a>";return e} function FWarn(a,b,c,d){ShowLoading();$("#warn-form").remove();$("body").append("<div id='warn-form' title='\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f' style='display:none'></div>");$.post(forum_ajax+"warn.php",{user_id:b,action:"get_form",forum_id:d,post_id:c},function(e){$("#warn-form").dialog({autoOpen:true,width:470,buttons:{"\u041e\u0442\u043c\u0435\u043d\u0430":function(){$(this).dialog("close");$("#warn-form").remove()},"\u0412\u0432\u043e\u0434":function(){if($("#cause").val()){ShowLoading(); $.post(forum_ajax+"warn.php",{user_id:b,action:a,forum_id:d,post_id:c,cause:$("#cause").val(),type:$("#warn_type").val(),time:$("#warn_time").val(),skin:dle_skin},function(f){$("#warn-"+c).html(f);$(this).dialog("close");$("#warn-form").remove();HideLoading()})}}}});$("#warn-form").html(e)});HideLoading();return false} function FRep(a,b,c,d){DLEprompt("\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u0438:","","\u0420\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044f",function(e){if(e){ShowLoading();$.post(forum_ajax+"reputation.php",{user_id:b,action:a,forum_id:d,post_id:c,cause:e,skin:dle_skin},function(f){$("#rep-"+c).html(f)});HideLoading()}});return false} function navigation(a,b){DLEprompt("","","\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435",function(c){if(a>=c)window.location.href=b+c})}function PostLink(a){DLEalert(window.location+"#post-"+a,"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438:")} function select_id(a){var b=[],c=[],d=1;tmp=document.modform.selected_id.value;if(tmp!="")b=tmp.split(",");for(i=0;i<b.length;i++)if(b[i]!="")if(b[i]==a)d=0;else c[c.length]=b[i];if(d)c[c.length]=a;newvalue=c.join(",");document.modform.selected_id.value=newvalue}function ShowHide(a,b){$("#"+a).is(":hidden")||b?$("#"+a).show(1E3):$("#"+a).hide(1E3)} function PostPreview(){var a="";a=forum_wysiwyg=="1"?$("#post_text").html():$("#post_text").val();if(a==""){DLEalert("\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u044f","\u041e\u0448\u0438\u0431\u043a\u0430");return false}ShowLoading();$.post(forum_ajax+"post.preview.php",{post_text:a,wysiwyg:forum_wysiwyg,skin:dle_skin},function(b){$("#post-preview").html(b)});HideLoading();return false} function uploadsform(a){ShowLoading();$("#uploads-form").remove();$("body").append("<div id='uploads-form' title='\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440' style='display:none'></div>");$.post(forum_ajax+"uploads.form.php",{open_url:a},function(b){$("#uploads-form").dialog({autoOpen:true,width:470,buttons:{"\u0417\u0430\u043a\u0440\u044b\u0442\u044c \u043e\u043a\u043d\u043e":function(){$(this).dialog("close"); $("#uploads-form").remove()}}});$("#uploads-form").html(b)});HideLoading();return false}function forum_ins(a){var b=document.getElementById("forum-post-form").post_text,c="";if(forum_wysiwyg!=="1")b.value+=dle_txt!=""?dle_txt:"[b]"+a+"[/b],\n";else{c=dle_txt!=""?dle_txt:"<b>"+a+"</b>,<br />";tinyMCE.execInstanceCommand("post_text","mceInsertContent",false,c,true)}}function CtrlEnter(a,b){if(a.ctrlKey&&(a.keyCode==10||a.keyCode==13))b.submit.click()};
