";e[1]=''+c+"";e[2]=''+d+"";return e}
function ajax_save_for_edit(a,b){var c={};"1"==quick_wysiwyg&&submit_all_data();"2"==quick_wysiwyg&&tinyMCE.triggerSave();$.each($("#ajaxnews"+a).serializeArray(),function(a,b){-1!=b.name.indexOf("xfield")&&(c[b.name]=b.value)});document.getElementById("allow_br_"+a).checked&&(c.allow_br=1);document.getElementById("approve_"+a).checked&&(c.approve=1);c.news_txt=$("#dleeditnews"+a).val();c.full_txt=$("#dleeditfullnews"+a).val();c.title=$("#edit-title-"+a).val();c.reason=$("#edit-reason-"+a).val();c.id=a;c.field=b;c.action="save";ShowLoading("");$.post(dle_root+"engine/ajax/editnews.php",c,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,b){for(var c=0,d=c_cache.length;c
');$("#modal-overlay").css({filter:"alpha(opacity=40)"}).fadeIn();var g={};g[dle_act_lang[3]]=function(){$(this).dialog("close")};g[dle_act_lang[4]]=function(){ajax_save_for_edit(a,b)};$("#dlepopup-news-edit").remove();$("body").prepend("");$(".dlepopupnewsedit").html("");$("#dlepopup-news-edit").dialog({autoOpen:!0,width:"800",height:500,buttons:g,resizable:!1,dialogClass:"modalfixed",dragStart:function(a,c){d=$(".modalfixed").css("box-shadow");$(".modalfixed").css("box-shadow","none")},dragStop:function(a,c){$(".modalfixed").css("box-shadow",d)},close:function(a,c){$(this).dialog("destroy");$("#modal-overlay").fadeOut(function(){$("#modal-overlay").remove()})}});830<$(window).width()&&530<$(window).height()&&($(".modalfixed.ui-dialog").css({position:"fixed"}),$("#dlepopup-news-edit").dialog("option","position",["0","0"]));RunAjaxJS("dlepopup-news-edit",c)});return!1}
function ajax_comm_edit(a,b){for(var c=0,d=c_cache.length;c"),d=d.replace(/&/g,"&");$("#ratig-layer-"+b).html(d);$("#vote-num-id-"+b).html(a.votenum)}},"json")}
function doCommentsRate(a,b){ShowLoading("");$.get(dle_root+"engine/ajax/ratingcomments.php",{go_rate:a,c_id:b,skin:dle_skin},function(a){HideLoading("");if(a.success){var d=a.rating,d=d.replace(/</g,"<"),d=d.replace(/>/g,">"),d=d.replace(/&/g,"&");$("#comments-ratig-layer-"+b).html(d);$("#comments-vote-num-id-"+b).html(a.votenum)}},"json")}
function doAddComments(){var a=document.getElementById("dle-comments-form");if("1"==dle_wysiwyg||"2"==dle_wysiwyg){"1"==dle_wysiwyg?submit_all_data():tinyMCE.triggerSave();var b="wysiwyg"}else b="";if(""==a.comments.value||""==a.name.value)return DLEalert(dle_req_field,dle_info),!1;var c=a.question_answer?a.question_answer.value:"",d=a.sec_code?a.sec_code.value:"";if(a.recaptcha_response_field)var e=Recaptcha.get_response(),f=Recaptcha.get_challenge();else f=e="";var g=a.allow_subscribe?1==a.allow_subscribe.checked?"1":"0":"0";ShowLoading("");$.post(dle_root+"engine/ajax/addcomments.php",{post_id:a.post_id.value,comments:a.comments.value,name:a.name.value,mail:a.mail.value,editor_mode:b,skin:dle_skin,sec_code:d,question_answer:c,recaptcha_response_field:e,recaptcha_challenge_field:f,allow_subscribe:g},function(b){a.sec_code&&(a.sec_code.value="",reload());HideLoading("");RunAjaxJS("dle-ajax-comments",b);"error"!=b&&document.getElementById("blind-animation")&&($("html,body").stop().animate({scrollTop:$("#dle-ajax-comments").offset().top-
70},1100),setTimeout(function(){$("#blind-animation").show("blind",{},1500)},1100))});return!1}function isHistoryApiAvailable(){return!(!window.history||!history.pushState)}
function CommentsPage(a,b,c){ShowLoading("");$.get(dle_root+"engine/ajax/comments.php",{cstart:a,news_id:b,skin:dle_skin},function(d){HideLoading("");isNaN(a)||isNaN(b)||($("#dle-comm-link").unbind("click"),$("#dle-comm-link").bind("click",function(){CommentsPage(a,b);return!1}));scroll(0,$("#dle-comments-list").offset().top-70);$("#dle-comments-list").html(d.comments);$(".dle-comments-navigation").html(d.navigation);isHistoryApiAvailable()&&window.history.pushState(null,null,c)},"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_ins(a){if(!document.getElementById("dle-comments-form"))return!1;var b=document.getElementById("dle-comments-form").comments,c="";""!=dle_txt?("0"==dle_wysiwyg?(b.value+=dle_txt+"\n",b.focus()):(c=dle_txt+" ","1"==dle_wysiwyg?(oUtil.obj.focus(),oUtil.obj.insertHTML(c)):tinyMCE.execCommand("mceInsertContent",!1,c)),setTimeout(function(){$("html,body").stop().animate({scrollTop:$("#dle-comments-form").offset().top-70},700)},100)):(ShowLoading(""),$.get(dle_root+"engine/ajax/quote.php",{id:a},function(a){HideLoading("");"0"==dle_wysiwyg?(b.value+=a+"\n",b.focus()):(c=a+" ","1"==dle_wysiwyg?(oUtil.obj.focus(),oUtil.obj.insertHTML(c)):tinyMCE.execCommand("mceInsertContent",!1,c));setTimeout(function(){$("html,body").stop().animate({scrollTop:$("#dle-comments-form").offset().top-70},700)},100)}));return!1}
function ShowOrHide(a){var b=$("#"+a);a=document.getElementById("image-"+a)?document.getElementById("image-"+a):null;var c=b.height()/200*1E3;3E3c&&(c=250);"none"==b.css("display")?(b.show("blind",{},c),a&&(a.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/message.php",{id:a,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",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function MenuNewsBuild(a,b){var c=[];c[0]="'+menu_short+"";""!=dle_admin&&(c[1]=''+menu_full+"");allow_dle_delete_news&&(c[2]="'+dle_notice+"",c[3]="'+dle_del_news+"");return c}
function sendNotice(a){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/message.php",{id:a,text:b,allowdelete:"no"},function(a){"ok"==a&&DLEalert(dle_p_send_ok,dle_info)})}};$("#dlepopup").remove();$("body").append("
"+
dle_p_text+"
");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function AddComplaint(a,b){var c={};c[dle_act_lang[3]]=function(){$(this).dialog("close")};c[dle_p_send]=function(){if(1>$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var c=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();$.post(dle_root+"engine/ajax/complaint.php",{id:a,text:c,action:b},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",buttons:c});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function DLEalert(a,b){$("#dlepopup").remove();$("body").append("
"+a+"
");$("#dlepopup").dialog({autoOpen:!0,width:470,resizable:!1,dialogClass:"modalfixed",buttons:{Ok:function(){$(this).dialog("close");$("#dlepopup").remove()}}});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function DLEconfirm(a,b,c){var d={};d[dle_act_lang[1]]=function(){$(this).dialog("close");$("#dlepopup").remove()};d[dle_act_lang[0]]=function(){$(this).dialog("close");$("#dlepopup").remove();c&&c()};$("#dlepopup").remove();$("body").append("
"+a+"
");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed",buttons:d});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function DLEprompt(a,b,c,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:560,resizable:!1,dialogClass:"modalfixed",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,buttons:c,width:500});return!1}
function ShowProfile(a,b,c){if(dle_user_profile==a&&document.getElementById("dleprofilepopup"))return $("#dleprofilepopup").dialog("open"),!1;dle_user_profile=a;dle_user_profile_link=b;ShowLoading("");$.get(dle_root+"engine/ajax/profile.php",{name:a,skin:dle_skin},function(a){HideLoading("");ShowPopupProfile(a,c)});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/search.php",{query:""+a+""},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 b=($(window).height()-$("#loading-layer").height())/2;$("#loading-layer").css({left:a+"px",top:b+"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/allvotes.php?dle_skin="+dle_skin,function(a){HideLoading("");$("#dlevotespopup").remove();$("body").append(a);$(".dlevotebutton").button();$("#dlevotespopup").dialog({autoOpen:!0,show:"fade",hide:"fade",resizable:!1,width:600,height:150});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 b=$("#vote_"+a+" input:radio[name=vote_check]:checked").val();ShowLoading("");$.get(dle_root+"engine/ajax/vote.php",{vote_id:a,vote_action:"vote",vote_mode:"fast_vote",vote_check:b,vote_skin:dle_skin},function(b){HideLoading("");$("#dle-vote_list-"+a).fadeOut(500,function(){$(this).html(b);$(this).fadeIn(500)})});return!1}
function AddIgnorePM(a,b){DLEconfirm(b,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/pm.php",{id:a,action:"add_ignore",skin:dle_skin},function(a){HideLoading("");DLEalert(a,dle_info);return!1})})}function DelIgnorePM(a,b){DLEconfirm(b,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/pm.php",{id:a,action:"del_ignore",skin:dle_skin},function(b){HideLoading("");$("#dle-ignore-list-"+a).html("");DLEalert(b,dle_info);return!1})})}
function media_upload(a,b,c,d){var e=(new Date).getTime(),f="none";$("#mediaupload").remove();$("body").append("");$("#mediaupload").dialog({autoOpen:!0,width:710,resizable:!1,dialogClass:"modalfixed",open:function(f,h){$("#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,b,c,d){window.event?event.cancelBubble=!0:b.stopPropagation&&b.stopPropagation();b=$("#dropmenudiv");if(b.is(":visible"))return clearhidemenu(),b.fadeOut("fast"),!1;b.remove();$("body").append('');b=$("#dropmenudiv");b.html(c.join(""));d&&b.width(d);c=$(document).width()-30;d=$(a).offset();c-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/complaint.php",{seltext:c,text:b,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("