function autoSubject(){var n=$("#tbSubject"),t=n.attr("auto");t&&n.val(t)}function preSubmit(){var n,t;if($("#cbMsg,#cbMail,#cbSms,#cbWeixin").filter(":checked").length==0)return showAndExit("请至少选择一种发送方式！");if(n=$("#mutiUser:visible").length>0,n){if($("#rbAssigned").prop("checked")&&$("#cbUser,#cbRole,#cbUnit,#cbRel").filter(":checked").length==0)return showAndExit("请指定接收人！")}else if($.trim($("#tbUser").val())=="")return showAndExit("请指定接收人！");return $.trim($("#tbSubject").val())==""&&$("#cbMsg,#cbMail,#cbWeixin").is(":checked")?showAndExit("请输入主题！"):(t=CKEDITOR.instances.ckContent.getData(),t=="")?showAndExit("请输入内容！"):$("#cbSms:checked").length>0&&$(t).text().length>200?showAndExit("当前内容超过了200字，不适合使用短信提醒方式！"):(UpdateEditorElement(),$("#__EVENTARGUMENT").val(n),!0)}function showMore(){if(!isPc){showUserTree("tbUser");return}$("#trSignle").hide();$("#mutiUser,#exclude").css("display","block");var n=$("#tbUser").val();n.length>0&&($("#tbUsers").val(n),$("#cbUser").prop("checked",!0));CKEDITOR.instances.ckContent.resize("100%",214);tryFitParent()}function sent(n,t){hideLoading();$("#resultArea").show();$("#mainArea").hide();$("#resultMsg").html(t.replace("\n","<br />"))}function toContinue(){$("#resultArea").hide();$("#mainArea").show();tryFitParent()}$(function(){$.browser.isMobile?MakeEditor("#ckContent",$(window).width()<=320?"Min":"Compact",305,!1,!1):MakeEditor("#ckContent","Lesser",305,!1,!1);$("#tbSubject,#tbUser").poshytip();$("#tbUsers,#tbRoles,#tbUnits,#tbNoUsers").focus(function(){$(this).prevAll(":checkbox:first").prop("checked",!0)});$("#related :checkbox,#ddlLevels").not("#cbRel").change(function(){$("#cbRel").prop("checked",!0);!$(this).is("#cbLevel")&&$(this).isIn("#spanLevels")&&$("#cbLevel").prop("checked",!0)});setTimeout(function(){AutoComplete($(":text[acfid],textarea[acfid]"));$("#tbUsers").val()==""?$("#tbUsers").focus():setTimeout(function(){CKEDITOR.instances.ckContent.focus()},300)},50)})