function attrShown(){$("#pop_upOptions .hasItems:visible").mouseover(function(){var n=Math.max(50,this.scrollHeight);$(this).height(n)}).mouseout(function(){sorted||within(this,getEvent())||$(this).removeAttr("style")});$("#pop_options:visible").sortable({items:"span[hash]",handle:"label",opacity:.7,ghosting:!0,start:function(){sorted=!0},update:function(n,t){t.item.html(t.item.html())}});setTimeout("$('#pop_newItem:visible').select().focus();",0);sorted=!1}function updateOrder(){var n,t;sorted&&(n=$("#pop_options:visible span[hash]"),n.length>0&&(t="",n.each(function(){t+=$(this).attr("hash")+"|"}),$("#__EVENTARGUMENT").val(t)))}function InitTable(){$("#upRpt").sortable({items:"> table.hr:not(.header)",handle:".h",helper:"clone",opacity:.7,ghosting:!0,update:function(){var n="",t;$("#upRpt table.hr:not(.header)").each(function(i){t=this.id.substr(2);n+=t+",0,"+i+"|"});$.post("ajax.aspx",{action:"saveLayout",layoutType:5,layout:n})}});$("table.hr:not(.header) tr").hover(function(){$(this).addClass("RowMouseOver")},function(){$(this).removeClass("RowMouseOver")}).dblclick(function(){var n=$(this).closest("table").attr("id").substr(2);return viewAttribu(n)}).attr("title","双击编辑字段");$("#upRpt .h").attr("title","拖动调整字段顺序");tryFitParent()}function chkEnter(){var n=getEvent(),i=n.srcElement||n.target,t=n.keyCode||n.which;return t!=13}function confirmChg(n){if($f("curFieldId").value!="0")if(confirm("修改字段的数据类型将有可能导致该字段的数据丢失或失效！\n确实要修改吗？如果是，请修改之后及时检查并修正该模板类型的所有记录中该字段的值。"))__doPostBack(n.id,"");else return!1;__doPostBack(n.id,"")}function viewAttribu(n){return $f("curFieldId").value=n,__doPostBack("btnAddItem",""),!1}function viewRefs(){return __doPostBack("btnAddItem","viewRefs"),!1}function toConfirm(n){var t=objCount>0&&!n?"删除前，请先查看并修改对该字段的引用。\n当前已有"+objCount+"条记录，该操作将删除这些记录中该字段的数据！\n\n确定要删除吗？":"确定要删除该字段吗？";return delConfirm(t)}function helperListChanged(n){var t=n.options[n.selectedIndex].value,i;t!=""&&("+-*/()".indexOf(t)==-1&&(t="["+t+"]"),i=$("#pop_formula"),i.focus().val(i.val()+t));n.selectedIndex=0}function SelectedDir(n){__doPostBack("pop$selectedDir",n)}function addCond(){var n=getEventSrc(),t=$(n).closest("fieldset");return t.find("div.hide:first").removeClass("hide"),$(n).hide(),!1}function cbCustomChanged(){var n=$("#pop_cbCustom");n.prevAll(":checkbox,select").prop("disabled",n.prop("checked"))}function setAcOptions(){var n=$("#pop_acOptions");n.length>0&&($("#pop_ddlTopn").val()!="1"&&$("#pop_rbResult1_Ac").is(":checked")?($("#pop_cbAutoFill,label[for='pop_cbAutoFill']").addClass("hide"),$("#pop_cbEnMutiItems,label[for='pop_cbEnMutiItems'],#pop_ddlChars").removeClass("hide"),setDisEdit()):($("#pop_cbAutoFill,label[for='pop_cbAutoFill']").removeClass("hide"),$("#pop_cbEnMutiItems,label[for='pop_cbEnMutiItems'],#pop_ddlChars").addClass("hide"),setDisEdit()),$("#pop_cbLimit,label[for='pop_cbLimit']").css("display",$("#pop_rbResult1_Ac").prop("checked")?"":"none"))}function setDisEdit(){$("#pop_cbAutoFill").is(":checked:visible")?$("#pop_cbDisEdit,label[for='pop_cbDisEdit']").removeClass("hide"):$("#pop_cbDisEdit,label[for='pop_cbDisEdit']").addClass("hide")}function checkCondMode(n){$("#pop_tr_query").attr("pop")=="1"&&$("option:selected",n).text().indexOf("包含")>-1&&(ToShowPopHelp("ContainMode"),$("#pop_tr_query").removeAttr("pop"));HideMsgPop()}function switchNo(){$("#divNo").css("display",$("#pop_cbRandom").is(":checked")?"none":"")}function chkPassword(){toPassword("该模板受保护，请输入密码：",validePassword);$("#_btnPwd").val("打开");$("#_btnqx").attr("onclick","back();")}function validePassword(n){return IsVoid(n)?!1:(PageMethods.CheckPassword(n,function(n){n?(HideDialog("popPwd"),location.reload(!0)):alert("密码不正确！")}),!1)}var sorted=!1;$(function(){var n=Sys.WebForms.PageRequestManager.getInstance();n.add_initializeRequest(showLoading);n.add_endRequest(hideLoading)})