var c_cache=[];
function RunAjaxJS(a,b){var c=new Date,d=!1,c=c.getTime(),e=/(.|[\r\n])*?<\/script>/ig,f=e.exec(b);if(null!=f){for(var g=Array(f.shift()),d=!0;f;)f=e.exec(b),null!=f&&g.push(f.shift());for(e=0;e')}$("#"+a).html(b);if(d){d=/((.|[\r\n])*?)<\/script>/ig;for(e=0;e",0)).split(" ");if(1'+b+"";e[1]=''+c+"";e[2]=''+d+"";return e}
function ajax_save_for_edit(a,b){var c={};"1"==quick_wysiwyg&&submit_all_data();$.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);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,dialogClass:"modalfixed",dragStart:function(){d=$(".modalfixed").css("box-shadow");$(".modalfixed").css("box-shadow",
"none")},dragStop:function(){$(".modalfixed").css("box-shadow",d)},close:function(){$(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"+a+",",oUtil.obj.focus(),oUtil.obj.insertHTML(c+"
"))}
function ShowOrHide(a){var b=$("#"+a),a=document.getElementById("image-"+a)?document.getElementById("image-"+a):null,c=1E3*(b.height()/200);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,dialogClass:"modalfixed",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});
$("#dlepopup").dialog("option","position",["0","0"])});b[dle_act_lang[0]]=function(){$(this).dialog("close");document.location=dle_root+"index.php?do=deletenews&id="+a+"&hash="+dle_login_hash};$("#dlepopup").remove();$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:500,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("");$("#dlepopup").dialog({autoOpen:!0,width:500,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,dialogClass:"modalfixed",buttons:c});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"])}
function DLEalert(a,b){$("#dlepopup").remove();$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:470,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("");$("#dlepopup").dialog({autoOpen:!0,width:500,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("");$("#dlepopup").dialog({autoOpen:!0,width:500,dialogClass:"modalfixed",buttons:f});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",["0","0"]);0');
$("#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[4]]=function(){document.getElementById("edituserframe").contentWindow.document.getElementById("saveuserform").submit()};$("#dleuserpopup").dialog({autoOpen:!0,show:"fade",width:560,height:500,dialogClass:"modalfixed",
buttons:a,open:function(){$("#dleuserpopup").html("")},beforeClose:function(){$("#dleuserpopup").html("")},close:function(){$("#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",buttons:c,width:450});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){a&&$("#loading-layer-text").html(a);var a=($(window).width()-$("#loading-layer").width())/2,b=($(window).height()-$("#loading-layer").height())/2;$("#loading-layer").css({left:a+"px",top:b+"px",position:"fixed",zIndex:"99"});$("#loading-layer").fadeTo("slow",0.6)}function HideLoading(){$("#loading-layer").fadeOut("slow")}
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",width:600,height:150});400<$("#dlevotespopupcontent").height()&&$("#dlevotespopupcontent").height(400);$("#dlevotespopup").dialog("option",
"height",$("#dlevotespopupcontent").height()+40);$("#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 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(b){"ok"==b?a.browser.mozilla?alert(dle_p_send_ok):DLEalert(dle_p_send_ok,dle_info):a.browser.mozilla?alert(b):DLEalert(b,dle_info)})}},a("#dlepopup").remove(),a("body").append(""),a("#dlepopup").dialog({autoOpen:!0,width:550,dialogClass:"modalfixed",buttons:b}),a(".modalfixed.ui-dialog").css({position:"fixed"}),a("#dlepopup").dialog("option","position",["0","0"])))}})});