"use strict";function ContextMenuEve(n){n&&n.preventDefault?n.preventDefault():window.event.returnValue=!1}function DispContextMenuEve(){event.cancelBubble=!0}function KeyDownEve(){var n=event.keyCode;if(event.shiftKey&&121==n||116==n||117==n)return void RemoveKey()}function RemoveKey(){event.keyCode=0,event.cancelBubble=!0,event.returnValue=!1}function SubmitEvent(){$("body").mask("正在处理中,请稍等...")}function MaskTime(){$("body").mask("正在处理中,请稍等..."),setTimeout("CloseMask()",5e3)}function CloseMask(){$("body").unmask()}function PostSubmit(n,t,e){var o=$("body");return o.mask("正在处理中,请稍等..."),$.post(n,t,function(n){-1==n.Code&&""!=n.ErrMsg?alert(n.ErrMsg):e(n),o.unmask()},"json"),!1}function InputPageNum(){if(!/[0-9]/.test(String.fromCharCode(event.keyCode)))return event.keyCode=0,!1}function ValidPage(){var n=$("input.pageNum");return!!/[0-9]/.test(n.val())||(alert("跳转页数不合法!"),n.focus(),!1)}function ConvToInt(n){return""!=n?parseInt(n):0}function ConvToFloat(n){return""!=n?parseFloat(n):0}function Round(n){return isNaN(n)?0:n.toFixed(2)}function InputCntInit(){var n=$(".content-box-content .txtcnt span"),t=$(".content-box-content .txtmax span");$(".content-box-content .txttotal").each(function(e,o){InputCnt(o.value,n[e],t[e]),o.onchange=function(){InputCnt(this.value,n[e],t[e])},o.onkeyup=function(){InputCnt(this.value,n[e],t[e])},o.onpaste=function(o){InputCnt(this.value,n[e],t[e])},o.oncontextmenu=DispContextMenuEve}),$(".content-box-content .txtarea").each(function(n,t){t.oncontextmenu=DispContextMenuEve})}function PasteEve(n){if(window.clipboardData){var t=window.clipboardData.getData("Text");window.clipboardData.setData("Text",t.replace(/\t/g," "))}else{if(-1!=n.originalEvent.clipboardData.getData("Text").indexOf("\t"))return alert("粘贴内容包含【Tab制表符】请删除!"),!1}return!0}function InputCnt(n,t,e){var o=GetCnLength(n);t.innerHTML=o;var i=e.getAttribute("data-max");e.innerHTML=ConvToInt(i)-o}function GetCnLength(n){for(var t=n.length,e=0;e255&&t++;return t}function AllReload(){window.top.location=window.top.location}function TopReload(){window.top.Top.location=window.top.Top.location}function GotoURL(n){return""!=n&&(window.location.href=n),!1}function OpenURL(n){return""!=n&&window.open(n),!1}function OpenLayer(n,t){return $.layer({type:2,title:n,area:["830px","460px"],offset:["100px",""],iframe:{src:t},close:function(n){document.getElementById("ImgCode").src="../Frame/CheckCode.aspx?t="+Math.random()}}),!1}function OpenAudit(n,t){return $.layer({type:2,title:n,area:["830px","460px"],offset:["100px",""],iframe:{src:t}}),!1}function CloseFrm(){var n=parent.layer.getFrameIndex(window.name),t=parent.document.getElementById("ImgCode");null!=t&&(t.src="../Frame/CheckCode.aspx?t="+Math.random()),parent.layer.close(n)}function CloseReFrm(){var n=parent.layer.getFrameIndex(window.name),t=parent.document.getElementById("btnQuery");null!=t&&t.click(),parent.layer.close(n)}function ReturnFrm(n){alert(n);var t=parent.layer.getFrameIndex(window.name),e=parent.document.getElementById("btnQuery");null!=e&&e.click(),parent.layer.close(t)}function LoginBtn(){$(".btnlogin input ").hover(function(){this.src=this.src.replace(".png","Hover.png")},function(){this.src=this.src.replace("Hover","")})}function IEVerify(){if(window.ActiveXObject){navigator.userAgent.toLowerCase().match(/msie ([\d.]+)/)[1]<11&&(alert("您的浏览器版本过低,本系统只支持IE11以上访问!"),window.location.href="http://www.shssp.org")}}function SysVis(n){window.location.href="Frame/SysLogin.aspx?model="+n}function MenuCss(){if(void 0!=window.top.Left){var n=$("#form1").attr("action");"function"==typeof window.top.Left.MenuSwitch&&window.top.Left.MenuSwitch(n)}}function SessionPg(){$.post("../Frame/SessionPage.aspx",{UserID:$("#lblUserID").html()}).success(function(n){switch(n.toString()){case"LoginError":ErrAlert();break;default:setTimeout("SessionPg()",6e4)}}).error(function(n){ErrAlert()})}function ErrAlert(){alert("系统与服务器通信中断,请重新登录或联系管理员,谢谢!"),window.top.location.href="/SysList.aspx"}function SysStep(){$(":input[name='step']").each(function(n,t){t.onclick=function(){onStep(this)}})}function onStep(n){if(onFromChange()){GotoURL(n.getAttribute("data-step"))}}function onFromChange(){return!$("form").data("changed")||confirm("表单内容有过修改【未保存】,是否放弃修改?")}function OptionInit(){var n=!0,t=$(".content-box-content img.opadd");$(".content-box-content .oplist").each(function(e,o){if(t[e].onclick=function(){onOption(this,e)},n){var i=$(o);""!=i.find(".text-input")[0].value?OpMoveImg(t[e],i):n=!1}})}function onOption(n,t){"opadd"==n.className?onOpAdd(n,t):onOpMove(n,t)}function onOpAdd(n,t){for(var e=$(".content-box-content .oplist"),o=0;o").prependTo(".objhide:last")),t.attr("src",n),!1}function ReviewOnLine(n){var t=$(window).resize(function(){$("embed").height($(window).height())}).height(),e="https://hk2-word-view.officeapps.live.com/wv/WordViewer/Document.pdf?WOPIsrc=http%3A%2F%2Fhk2%2Dview%2Dwopi%2Ewopi%2Elive%2Enet%3A808%2Foh%2Fwopi%2Ffiles%2F%40%2FwFileId%3FwFileId%3D"+n+"&type=accesspdf";return $("body").empty().append(""),!1}function ReviewInit(){$(".score").change(ReviewScore),$(".tscore").prop("readonly",!0),$(".input-long700").contextmenu(onDispContextMenu)}function ReviewScore(){var n=0;$(".score").each(function(){n+=ConvToFloat(this.value)}),$("#txt_Score").val(n.toFixed(1))}function BioPreRpt(){return confirm("通过打印预检参赛证,检查以下申报内容:\n 1.基本信息\n 2.1寸彩照\n\n请您在次确认是否正式提交申报???\n注:一旦正式提交,申报信息将无法修改!")}$(function(){var n=$("form");IEVerify(),MenuCss(),SysStep(),n.data("changed",!1);var t={change:function(){n.data("changed",!0)},paste:function(n){return PasteEve(n)}};n.on(t,":input"),n.submit(SubmitEvent),$(".loading[href]").click(SubmitEvent),null!=$.metadata&&$.metadata.setType("attr","data-val"),$("input.verify").click(function(){var t=n.validate({success:function(n){n.html(" ").addClass("valid")}});return!!n.valid()||(alert("您提交的数据有【"+t.numberOfInvalids()+"】个不合法,请修正后提交!"),!1)})}),document.onkeydown=KeyDownEve,document.oncontextmenu=ContextMenuEve;