function BindRequest(n){n.add_endRequest(function(){disableEles("#btnSubmit",!1)})}function setBaseString(){UpdateEditorElement();oriFormHash=getHash("#form1")}function IsDirty(){return UpdateEditorElement(),oriFormHash!=getHash("#form1")}function confirmExit(n){if(!window.submiting&&IsDirty()&&!inIframe()){var t=document.activeElement;if(t&&$(t).is("[href^='javascript:'],:submit"))return!0;n.returnValue="当前页面尚未保存！"}}function PreSubmit(){if(hasUploading())return showAndExit("文件上传中，请稍候…");UpdateEditorElement();var n="";return($("#tbTitle").val()==""&&(n="必须输入标题！"),CKEDITOR.instances.ckContent.getData()==""&&(n+=(n==""?"":"<br />")+"必须输入内容！"),n)?showAndExit(n):($("#__EVENTARGUMENT").val(getUploaderValue("#uploader")),disableEles("#btnSubmit",!0),window.submiting=!0,!0)}function makeSummary(){var t=CKEDITOR.instances.ckContent.getData(),n;return t?(n=$(t).text().replace(/\s+/g," "),n.length>200&&(n=n.substr(0,175)+"…"),$("#tbOverview").val(n),!1):showAndExit("请先输入正文，才能自动生成摘要。")}function grow(){var n=$("#cke_1_contents");n.find("> .CodeMirror").addBack().animate({height:n.height()+300})}var oriFormHash=0;$(function(){if(MakeEditor("#ckContent",$.browser.isMobile?"Compact":"Normal",300,!1,!1),getUrlParam("id")){var n=CKEDITOR.instances.ckContent;n.on("instanceReady",function(){if(n.window.$.document.body.clientHeight>300){var t=$("#cke_1_contents");t.find("> .CodeMirror").addBack().animate({height:600})}})}InitUploader("#files");$("#selectTags,#tbTags,#ddlTypes[title]").poshytip();AutoWidth("#trCat select");AutoComplete("#tbTags");setBaseString();$("#tbTitle").focus()})