function setUpg(n,t,i){$("#"+t).css("display",n?"block":"none");$("#"+i).css("display",n?"none":"block")}function ajaxFileUpload(){var n=$("#fileToUpload").val();return/\.(zip|rar)$/i.test(n)?confirm("该操作将会丢失现有数据，建议先备份系统后再进行还原。\n确定要用该备份文件还原系统吗？")?($(document).ajaxStart(function(){setUpg(!0,"loading2","upBackup")}).ajaxComplete(function(){}),$.ajaxFileUpload({url:"get.aspx?action=upload",secureuri:!1,fileElementId:"fileToUpload",dataType:"json",success:function(n){var t=n.files,i=null;typeof t!="undefined"&&t!=null&&t.length>0&&(i=t[0]);i==null?alert("文件上传失败！"):PageMethods.SysRestore(i,Restore_callback)},error:function(n,t,i){alert(i)}}),!1):!1:showAndExit("无效的文件！")}function Restore_callback(n){if(n=eval("("+n+")"),n.complete==!0)if(winalert("系统还原成功！点击确定后返回首页。"),parent==self)location="default.aspx?tologin=true";else{var t=parent.location.href;t.indexOf("tologin=true")==-1&&(t+=t.indexOf("?")>-1?"&tologin=true":"?tologin=true");parent.location=t}else alert(n.msg),setUpg(!1,"loading2","upBackup")}function doClean(){return hasSelected("options")?(setUpg(!0,"loading1","options"),!0):(alert("请至少选择一个选项！"),!1)}function doCleanComplete(n){alert(n);setUpg(!1,"loading1","options")}function autoBackupToggled(){var n=$("#ab_cbAutoBackup").prop("checked");$(":text,select,#ab_cbKeep","#ab_Body").prop("disabled",!n)}function preSave(){if($("#ab_cbAutoBackup").prop("checked")){if($("#ab_tbTarget").val()=="")return showAndExit("必须输入备份文件的存储位置（服务器电脑上的路径，或网络共享文件夹路径）！");if($("#ab_tbFqcy").val()=="")return showAndExit("必须输入备份频率的时间量！")}return!0}function makeJsEditor(){CKEDITOR.replace("js_tbJs",{toolbar:"Compact",height:337,autoUpdateElement:!0,resize_enabled:!1,removePlugins:"autogrow,elementspath",startupMode:"source"})}LoadEditor();LoadDatePicker();var defTab=0;$(function(){$("#tabs").tabs({active:defTab,activate:function(){$("#ab_popup").is(":visible")&&HideDialog("ab_popup")}}).fadeIn(300);autoBackupToggled()})