";e[1]=''+b+"";e[2]=''+d+"";return e}
function ajax_save_for_edit(a,c){var b={};"2"==quick_wysiwyg&&tinyMCE.triggerSave();$.each($("#ajaxnews"+a).serializeArray(),function(a,c){b[c.name]=c.value});b.id=a;b.field=c;b.action="save";b.user_hash=dle_login_hash;ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=editnews",b,function(a){HideLoading("");"ok"!=a?DLEalert(a,dle_info):($("#dlepopup-news-edit").dialog("close"),DLEconfirm(dle_save_ok,dle_confirm,function(){location.reload(!0)}))});return!1}
function ajax_prep_for_edit(a,c){for(var b=0,d=c_cache.length;b
');$("#modal-overlay").css({filter:"alpha(opacity=40)"}).fadeIn();var e={};e[dle_act_lang[3]]=function(){$(this).dialog("close")};e[dle_act_lang[4]]=function(){ajax_save_for_edit(a,c)};$("#dlepopup-news-edit").remove();$("body").prepend("");$(".dlepopupnewsedit").html("");var k=.9*$(window).height(),h=.9*$(window).width();1024");b=b.replace(/&/g,"&");$("#ratig-layer-"+c).html(b);$("#vote-num-id-"+c).html(a.votenum)}else a.error&&DLEalert(a.errorinfo,dle_info)},"json")}
function doCommentsRate(a,c){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=ratingcomments",{go_rate:a,c_id:c,skin:dle_skin,user_hash:dle_login_hash},function(a){HideLoading("");if(a.success){var b=a.rating;b=b.replace(/</g,"<");b=b.replace(/>/g,">");b=b.replace(/&/g,"&");$("#comments-ratig-layer-"+c).html(b);$("#comments-vote-num-id-"+c).html(a.votenum)}else a.error&&DLEalert(a.errorinfo,dle_info)},"json")}
function ajax_cancel_reply(){$("#dlefastreplycomments").hide("blind",{},1400)}
function ajax_fast_reply(a,c){var b=$("#comments"+a).val(),d=$("#name"+a).val(),e=$("#question_answer"+a).val(),f=$("#sec_code"+a).val(),g=$("#recaptcha"+a).val(),k=$("#subscribe"+a+":checked").val(),h=$("#postid"+a).val(),l="";if(""==d||""==b)return DLEalert(dle_req_field,dle_info),!1;g&&(l=grecaptcha.getResponse(recaptcha_widget));k||(k=0);f||(f="");e||(e="");ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=addcomments",{post_id:h,parent:a,indent:c,comments:b,name:d,mail:"",editor_mode:"",skin:dle_skin,sec_code:f,question_answer:e,g_recaptcha_response:l,allow_subscribe:k,user_hash:dle_login_hash},function(b){HideLoading("");$("#blind-animation"+a).remove();$("#dlefastreplyesponse").html(b);"error"!=b&&document.getElementById("blind-animation"+a)&&($("html,body").stop().animate({scrollTop:$("#dlefastreplyesponse").offset().top-100},600),setTimeout(function(){$("#blind-animation"+a).show("blind",{},700);$("#dlefastreplycomments").hide("blind",{},700)},600))},"html");return!1}
function DLESendPM(a){var c={};$("#dlesendpmpopup").remove();$("#dleprofilepopup").remove();c[dle_act_lang[3]]=function(){$(this).dialog("close")};c[dle_p_send]=function(){"2"==dle_wysiwyg&&tinyMCE.triggerSave();var a=$("#pm_subj").val(),c=$("#pm_text").val(),e=$("#pm_name").val(),f=$("#pm_question_answer").val(),g=$("#sec_code_pm").val(),k=$("#pm_recaptcha").val(),h=$("#outboxcopy:checked").val(),l="";if(""==e||""==c||""==a)return DLEalert(dle_req_field,dle_info),!1;k&&(l=grecaptcha.getResponse(recaptcha_widget));h||(h=0);g||(g="");f||(f="");ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=pm",{action:"send_pm",subj:a,comments:c,name:e,skin:dle_skin,sec_code:g,question_answer:f,g_recaptcha_response:l,outboxcopy:h,user_hash:dle_login_hash},function(a){HideLoading("");a.success?($("#dlesendpmpopup").remove(),DLEalert(a.success,dle_info)):a.error&&DLEalert(a.error,dle_info)},"json");return!1};ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=pm",{name:a,action:"show_send",skin:dle_skin,user_hash:dle_login_hash},function(a){HideLoading("");$("body").append(a);$("#dlesendpmpopup").dialog({autoOpen:!0,width:800,resizable:!1,dialogClass:"modalfixed dle-popup-sendpm",buttons:c});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlesendpmpopup").dialog("option","position",["0","0"])},"html");return!1}
function dle_reply(a,c,b){var d={},e="";$("#dlereplypopup").remove();"1"==b&&($("#dlefastreplycomments").remove(),$("#dlefastreplyesponse").remove());d[dle_act_lang[3]]=function(){$(this).dialog("close")};d[dle_p_send]=function(){if("1"==dle_wysiwyg||"2"==dle_wysiwyg)"2"==dle_wysiwyg&&tinyMCE.triggerSave(),e="wysiwyg";var b=$("#comments"+a).val(),d=$("#name"+a).val(),k=$("#mail"+a).val(),h=$("#question_answer"+a).val(),l=$("#sec_code"+a).val(),p=$("#recaptcha"+a).val(),m=$("#subscribe"+a+":checked").val(),q=$("#postid"+a).val(),n="";if(""==d||""==b)return DLEalert(dle_req_field,dle_info),!1;p&&(n=grecaptcha.getResponse(recaptcha_widget));m||(m=0);l||(l="");h||(h="");ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=addcomments",{post_id:q,parent:a,indent:c,comments:b,name:d,mail:k,editor_mode:e,skin:dle_skin,sec_code:l,question_answer:h,g_recaptcha_response:n,allow_subscribe:m,user_hash:dle_login_hash},function(b){HideLoading("");$("#blind-animation"+a).remove();$("#comments-tree-item-"+a).length?($("#comments-tree-item-"+a).append(b),"error"!=b&&document.getElementById("blind-animation"+a)&&($("#dlereplypopup").remove(),$("html,body").stop().animate({scrollTop:$("#comments-tree-item-"+a).offset().top+$("#comments-tree-item-"+a).height()-100},600),setTimeout(function(){$("#blind-animation"+a).show("blind",{},700)},600))):$("#comment-id-"+a).length&&($("#comment-id-"+a).append(b),"error"!=b&&document.getElementById("blind-animation"+a)&&($("#dlereplypopup").remove(),$("html,body").stop().animate({scrollTop:$("#comment-id-"+a).offset().top+$("#comment-id-"+a).height()-100},600),setTimeout(function(){$("#blind-animation"+a).show("blind",{},700)},600)))},"html");return!1};ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=replycomments",{id:a,indent:c,skin:dle_skin,user_hash:dle_login_hash},function(c){HideLoading("");"1"==b?($("#comment-id-"+a).append(""),$("#dlefastreplycomments").html(c),$("html,body").stop().animate({scrollTop:$("#comment-id-"+a).offset().top+$("#comment-id-"+a).height()-100},600),setTimeout(function(){$("#dlefastreplycomments").show("blind",{},700)},600)):($("body").append(""),$("#dlereplypopup").html(c),$("#dlereplypopup").dialog({autoOpen:!0,width:800,resizable:!1,dialogClass:"modalfixed dle-popup-replycomments",buttons:d}),$(".modalfixed.ui-dialog").css({position:"fixed"}),$("#dlereplypopup").dialog("option","position",["0","0"]))},"html");return!1}
function doAddComments(){var a=document.getElementById("dle-comments-form"),c="",b="",d="",e="",f="0",g="";if("1"==dle_wysiwyg||"2"==dle_wysiwyg)"2"==dle_wysiwyg&&tinyMCE.triggerSave(),c="wysiwyg";if(""==a.comments.value||""==a.name.value)return DLEalert(dle_req_field,dle_info),!1;a.question_answer&&(b=a.question_answer.value);a.sec_code&&(d=a.sec_code.value);"undefined"!=typeof grecaptcha&&(e=grecaptcha.getResponse());a.allow_subscribe&&1==a.allow_subscribe.checked&&(f="1");a.mail&&(g=a.mail.value);ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=addcomments",{post_id:a.post_id.value,comments:a.comments.value,name:a.name.value,mail:g,editor_mode:c,skin:dle_skin,sec_code:d,question_answer:b,g_recaptcha_response:e,allow_subscribe:f,user_hash:dle_login_hash},function(b){HideLoading("");$("#dle-ajax-comments").html(b);"error"!=b&&document.getElementById("blind-animation")&&($("html,body").stop().animate({scrollTop:$("#dle-ajax-comments").offset().top-100},600),setTimeout(function(){$("#blind-animation").show("blind",{},700)},600),a.sec_code&&(a.sec_code.value="",reload()),"undefined"!=typeof grecaptcha&&grecaptcha.reset())},"html");return!1}function isHistoryApiAvailable(){return!(!window.history||!history.pushState)}
function CommentsPage(a,c,b){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=comments",{cstart:a,news_id:c,skin:dle_skin},function(d){HideLoading("");isNaN(a)||isNaN(c)||($("#dle-comm-link").off("click"),$("#dle-comm-link").on("click",function(){CommentsPage(a,c);return!1}));scroll(0,$("#dle-comments-list").offset().top-100);$("#dle-comments-list").html(d.comments);$(".dle-comments-navigation").html(d.navigation);isHistoryApiAvailable()&&window.history.pushState(null,null,b)},"json");return!1}function dle_copy_quote(a){dle_txt="";window.getSelection?dle_txt=window.getSelection():document.selection&&(dle_txt=document.selection.createRange().text);""!=dle_txt&&(dle_txt="[quote="+a+"]"+dle_txt+"[/quote]")}
function dle_fastreply(a){if(!document.getElementById("dle-comments-form"))return!1;var c=document.getElementById("dle-comments-form").comments,b="";"0"==dle_wysiwyg||"-1"==dle_wysiwyg?(c.value="0"==dle_wysiwyg?c.value+("[b]"+a+"[/b],\n"):c.value+(a+",\n"),c.focus()):(b=""+a+", ","1"==dle_wysiwyg?($("#comments").froalaEditor("events.focus"),$("#comments").froalaEditor("html.insert",b,!0)):tinyMCE.execCommand("mceInsertContent",!1,b));setTimeout(function(){$("html,body").stop().animate({scrollTop:$("#dle-comments-form").offset().top-100},700)},100);return!1}
function dle_ins(a){if(!document.getElementById("dle-comments-form"))return!1;var c=document.getElementById("dle-comments-form").comments,b="";""!=dle_txt?("0"==dle_wysiwyg||"-1"==dle_wysiwyg?(c.value+=dle_txt+"\n",c.focus()):(b=dle_txt+" ","1"==dle_wysiwyg?($("#comments").froalaEditor("events.focus"),$("#comments").froalaEditor("html.insert",b,!0)):tinyMCE.execCommand("mceInsertContent",!1,b)),setTimeout(function(){$("html,body").stop().animate({scrollTop:$("#dle-comments-form").offset().top-100},700)},100)):(ShowLoading(""),$.get(dle_root+"engine/ajax/controller.php?mod=quote",{id:a,user_hash:dle_login_hash},function(a){HideLoading("");a=a.replace(/</g,"<");a=a.replace(/>/g,">");a=a.replace(/&/g,"&");a=a.replace(/"/g,'"');a=a.replace(/'/g,"'");a=a.replace(/'/g,"'");a=a.replace(/"/g,'"');"0"==dle_wysiwyg||"-1"==dle_wysiwyg?(c.value+=a+"\n",c.focus()):(b=a+" ","1"==dle_wysiwyg?($("#comments").froalaEditor("events.focus"),$("#comments").froalaEditor("html.insert",b,!0)):tinyMCE.execCommand("mceInsertContent",!1,b));setTimeout(function(){$("html,body").stop().animate({scrollTop:$("#dle-comments-form").offset().top-100},700)},100)}));return!1}
function ShowOrHide(a){var c=$("#"+a),b=null;document.getElementById("image-"+a)&&(b=document.getElementById("image-"+a));a=c.height()/200*1E3;3E3a&&(a=250);"none"==c.css("display")?(c.show("blind",{},a),b&&(b.src=dle_root+"templates/"+dle_skin+"/dleimages/spoiler-minus.gif")):(2E3$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var b=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();$.post(dle_root+"engine/ajax/controller.php?mod=message",{id:a,user_hash:dle_login_hash,text:b},function(b){"ok"==b?document.location=dle_root+"index.php?do=deletenews&id="+a+"&hash="+dle_login_hash:DLEalert("Send Error",dle_info)})}};$("#dlepopup").remove();$("body").append("
");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed dle-popup-sendmessage",buttons:c});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function AddComplaint(a,c){var b={};b[dle_act_lang[3]]=function(){$(this).dialog("close")};b[dle_p_send]=function(){if(1>$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var b=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();$.post(dle_root+"engine/ajax/controller.php?mod=complaint",{id:a,text:b,action:c,user_hash:dle_login_hash},function(a){"ok"==a?DLEalert(dle_p_send_ok,dle_info):DLEalert(a,dle_info)})}};$("#dlepopup").remove();$("body").append("
");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed dle-popup-complaint",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function DLEalert(a,c){$("#dlepopup").remove();$("body").append("
"+a+"
");$("#dlepopup").dialog({autoOpen:!0,width:470,resizable:!1,dialogClass:"modalfixed dle-popup-alert",buttons:{Ok:function(){$(this).dialog("close");$("#dlepopup").remove()}}});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function DLEconfirm(a,c,b){var d={};d[dle_act_lang[1]]=function(){$(this).dialog("close");$("#dlepopup").remove()};d[dle_act_lang[0]]=function(){$(this).dialog("close");$("#dlepopup").remove();b&&b()};$("#dlepopup").remove();$("body").append("
"+a+"
");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed dle-popup-confirm",buttons:d});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function DLEprompt(a,c,b,d,e){var f={};f[dle_act_lang[3]]=function(){$(this).dialog("close")};f[dle_act_lang[2]]=function(){if(!e&&1>$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var a=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();d&&d(a)}};$("#dlepopup").remove();$("body").append("
');$("#modal-overlay").css({filter:"alpha(opacity=40)"}).fadeIn("slow");$("#dleuserpopup").remove();$("body").append("");a[dle_act_lang[3]]=function(){$(this).dialog("close");$("#dleuserpopup").remove()};a[dle_act_lang[5]]=function(){window.frames.edituserframe.confirmDelete(dle_login_hash)};a[dle_act_lang[4]]=function(){document.getElementById("edituserframe").contentWindow.document.getElementById("saveuserform").submit()};$("#dleuserpopup").dialog({autoOpen:!0,show:"fade",width:700,resizable:!1,dialogClass:"modalfixed dle-popup-userprofileadmin",buttons:a,open:function(a,b){$("#dleuserpopup").html("")},beforeClose:function(a,b){$("#dleuserpopup").html("")},close:function(a,b){$("#modal-overlay").fadeOut("slow",function(){$("#modal-overlay").remove()})}});830<$(window).width()&&530<$(window).height()&&($(".modalfixed.ui-dialog").css({position:"fixed"}),$("#dleuserpopup").dialog("option","position",["0","0"]))});$("#dleprofilepopup").remove();$("body").append(a);$("#dleprofilepopup").dialog({autoOpen:!0,show:"fade",hide:"fade",resizable:!1,dialogClass:"dle-popup-userprofile",buttons:b,width:550});return!1}
function ShowProfile(a,c,b){if(dle_user_profile==a&&document.getElementById("dleprofilepopup"))return $("#dleprofilepopup").dialog("open"),!1;dle_user_profile=a;dle_user_profile_link=c;ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=profile",{name:a,skin:dle_skin,user_hash:dle_login_hash},function(a){HideLoading("");ShowPopupProfile(a,b)});return!1}
function FastSearch(){$("#story").attr("autocomplete","off");$("#story").blur(function(){$("#searchsuggestions").fadeOut()});$("#story").keyup(function(){var a=$(this).val();0==a.length?$("#searchsuggestions").fadeOut():dle_search_value!=a&&3");$.post(dle_root+"engine/ajax/controller.php?mod=search",{query:""+a,user_hash:dle_login_hash},function(a){$("#searchsuggestions").html(a).fadeIn().css({position:"absolute",top:0,left:0}).position({my:"left top",at:"left bottom",of:"#story",collision:"fit flip"})});dle_search_value=a}
function ShowLoading(a){$("#loading-layer").remove();$("body").append("");a?$("#loading-layer").html(a):$("#loading-layer").html(dle_act_lang[6]);a=($(window).width()-$("#loading-layer").width())/2;var c=($(window).height()-$("#loading-layer").height())/2;$("#loading-layer").css({left:a+"px",top:c+"px",position:"fixed",zIndex:"99"});$("#loading-layer").fadeTo("slow",.6)}
function HideLoading(a){$("#loading-layer").fadeOut("slow",function(){$("#loading-layer").remove()})}
function ShowAllVotes(){if(document.getElementById("dlevotespopup"))return $("#dlevotespopup").dialog("open"),!1;$.ajaxSetup({cache:!1});ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=allvotes&dle_skin="+dle_skin,function(a){HideLoading("");$("#dlevotespopup").remove();$("body").append(a);$(".dlevotebutton").button();$("#dlevotespopup").dialog({autoOpen:!0,show:"fade",hide:"fade",resizable:!1,dialogClass:"dle-popup-allvotes",width:600});400<$("#dlevotespopupcontent").height()&&$("#dlevotespopupcontent").height(400);$("#dlevotespopup").dialog("option","height",$("#dlevotespopupcontent").height()+60);$("#dlevotespopup").dialog("option","position","center")});return!1}
function fast_vote(a){var c=$("#vote_"+a+" input:radio[name=vote_check]:checked").val();if("undefined"==typeof c)return!1;ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=vote",{vote_id:a,vote_action:"vote",vote_mode:"fast_vote",vote_check:c,dle_skin:dle_skin,user_hash:dle_login_hash},function(b){HideLoading("");$("#dle-vote_list-"+a).fadeOut(500,function(){$(this).html(b);$(this).fadeIn(500)})});return!1}
function AddIgnorePM(a,c){DLEconfirm(c,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=pm",{id:a,action:"add_ignore",skin:dle_skin,user_hash:dle_login_hash},function(a){HideLoading("");DLEalert(a,dle_info);return!1})})}
function DelIgnorePM(a,c){DLEconfirm(c,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=pm",{id:a,action:"del_ignore",skin:dle_skin,user_hash:dle_login_hash},function(b){HideLoading("");$("#dle-ignore-list-"+a).html("");DLEalert(b,dle_info);return!1})})}
function subscribe(a){DLEconfirm(dle_sub_agree,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=commentssubscribe",{news_id:a,skin:dle_skin,user_hash:dle_login_hash},function(a){HideLoading("");a.success?DLEalert(a.info,dle_info):a.error&&DLEalert(a.errorinfo,dle_info)},"json")});return!1}
function media_upload(a,c,b,d){var e=(new Date).getTime(),f="none";$("#mediaupload").remove();$("body").append("");$("#mediaupload").dialog({autoOpen:!0,width:710,resizable:!1,dialogClass:"modalfixed dle-popup-upload",open:function(f,k){$("#mediaupload").html("");$(".ui-dialog").draggable("option","containment","")},dragStart:function(a,b){f=$(".modalfixed").css("box-shadow");$(".modalfixed").fadeTo(0,.6).css("box-shadow","none");$("#mediaupload").css("visibility","hidden")},dragStop:function(a,b){$(".modalfixed").fadeTo(0,1).css("box-shadow",f);$("#mediaupload").css("visibility","visible")},beforeClose:function(a,b){$("#mediaupload").html("")}});830<$(window).width()&&530<$(window).height()&&($(".modalfixed.ui-dialog").css({position:"fixed"}),$("#mediaupload").dialog("option","position",["0","0"]));return!1}
function dropdownmenu(a,c,b,d){window.event?event.cancelBubble=!0:c.stopPropagation&&c.stopPropagation();c=$("#dropmenudiv");if(c.is(":visible"))return clearhidemenu(),c.fadeOut("fast"),!1;c.remove();$("body").append('');c=$("#dropmenudiv");c.html(b.join(""));d&&c.width(d);b=$(document).width()-30;d=$(a).offset();b-d.lefta("#dle-promt-text").val().length)a("#dle-promt-text").addClass("ui-state-error");else{var b=a("#dle-promt-text").val(),c=a("#orfom").text();a(this).dialog("close");a("#dlepopup").remove();a.post(dle_root+"engine/ajax/controller.php?mod=complaint",{seltext:c,text:b,user_hash:dle_login_hash,action:"orfo",url:window.location.href},function(a){"ok"==a?DLEalert(dle_p_send_ok,dle_info):DLEalert(a,dle_info)})}};a("#dlepopup").remove();a("body").append("