You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
37 KiB

var i18next="undefined"==typeof i18next?parent.top.i18next:i18next,g_db={SupportLocalStorage:function(){"use strict";return typeof localStorage!="undefined"},SetItem:function(n,t){"use strict";var i=!1;return this.SupportLocalStorage()&&(localStorage.setItem(n,t),i=!0),i},GetItem:function(n){"use strict";var t=null;return this.SupportLocalStorage()&&(t=localStorage.getItem(n)),t},RemoveItem:function(n){"use strict";var t=!1;return this.SupportLocalStorage()&&(localStorage.removeItem(n),t=!0),t},GetDic:function(n){"use strict";var i=null,t;return this.SupportLocalStorage()&&(t=localStorage.getItem(n),null!==t&&(i=JSON.parse(t))),i},SetDic:function(n,t){"use strict";var i=!1;return this.SupportLocalStorage()&&(localStorage.setItem(n,JSON.stringify(t)),i=!0),i}},g_gd={webapilonginurl:"/api/Service/GetLogin",webapiurl:"/api/Cmd/GetData",projectname:"Eurotran",projectver:"Origtek",relpath:"",debugmode:window.location.host==="192.168.1.105",debugcolor:"#732C6B",IsEDU:g_db.GetItem("isedu")==="true"},g_ul={GetToken:function(){"use strict";return g_db.GetItem("token")},SetToken:function(n){"use strict";g_db.SetItem("token",n)},GetSignature:function(){"use strict";return g_db.GetItem("signature")},SetSignature:function(n){"use strict";g_db.SetItem("signature",n)},SetLang:function(n){"use strict";g_db.SetItem("lang",n)},GetLang:function(){"use strict";return g_db.GetItem("lang")},SetLoginMethod:function(n){"use strict";g_db.SetItem("LoginMethod",n)},GetLoginMethod:function(){"use strict";return g_db.GetItem("LoginMethod")},IsEDU:function(){"use strict";return g_db.GetItem("isedu")},TraceStackDump:function(){var e={},t={},o=[],n=null,u=0,i=0,f=0,r=null,s=!1;n=arguments;do{if(t={},t.name=n.callee.name,t.parameters=[],f=n.length,f>0)if(r=n["0"],typeof r=="object"&&r.hasOwnProperty("currentTarget"))s=!0,t.buttonclick=r.currentTarget.id;else for(i=0;i<f;i++)r=n[i.toString()],t.parameters.push(n[i.toString()]);if(u>0&&o.push($.extend({},t)),n.callee.caller===null)break;n=n.callee.caller.arguments;u=u+1}while(s===!1);return e.stack=o,e}},g_api={ConnectLite:function(n,t,i,r,u,f,e){return window.IsWaiting=e,this.ConnectLiteWithoutToken(n,t,i,r,u,f)},ConnectService:function(n,t,i,r,u,f,e){return window.IsWaiting=e,this.ConnectWebLiteWithoutToken(n,t,i,r,u,f)},ConnectLiteWithoutToken:function(n,t,i,r,u,f){var o={},e={},s=g_ul.GetToken(),h=g_ul.GetLang(),c=g_ul.GetSignature();return e.ORIGID=g_db.GetItem("orgid"),e.USERID=g_db.GetItem("userid"),e.MODULE=n,e.TYPE=t,e.PROJECT=g_gd.projectname,e.PROJECTVER=g_gd.projectver,e.TRACEDUMP=null,i=i||{},g_db.GetItem("dblockDict")!==null&&(i.dblockDict=g_db.GetItem("dblockDict")),e.DATA=i,h!==null&&(e.LANG=h),s!==null&&(e.TOKEN=s),c!==null&&(e.SIGNATURE=c),e.CUSTOMDATA={},window.sProgramId&&(e.CUSTOMDATA.program_id=sProgramId),e.CUSTOMDATA.module_id="webapp",o.url=i.hasOwnProperty("url")?i.url:g_gd.webapiurl,o.successfunc=r,o.dicparameters=e,o.failfunc="function"==typeof u?u:function(n,t,i){alert("ConnectLite Fail jqXHR:"+n+" textStatus:"+t+" errorThrown:"+i)},o.useasync="boolean"==typeof f?f:!0,this.AjaxPost(o)},ConnectWebLiteWithoutToken:function(n,t,i,r,u,f){var o={},e={},s=g_ul.GetToken(),h=g_ul.GetLang(),c=g_ul.GetSignature();return e.ORIGID=g_db.GetItem("orgid"),e.USERID=g_db.GetItem("userid"),e.MODULE="",e.TYPE=t,e.PROJECT=g_gd.projectname,e.PROJECTVER=g_gd.projectver,e.TRACEDUMP=null,g_db.GetItem("dblockDict")!==null&&(i.dblockDict=g_db.GetItem("dblockDict")),e.DATA=i,h!==null&&(e.LANG=h),s!==null&&(e.TOKEN=s),c!==null&&(e.SIGNATURE=c),e.CUSTOMDATA={},window.sProgramId&&(e.CUSTOMDATA.program_id=sProgramId),e.CUSTOMDATA.module_id="webapp",o.url=getWebServiceUrl(n,t),o.successfunc=r,o.dicparameters=e,o.failfunc="function"==typeof u?u:function(n,t,i){alert("ConnectLite Fail jqXHR:"+n+" textStatus:"+t+" errorThrown:"+i)},o.useasync="boolean"==typeof f?f:!0,this.AjaxPost(o)},AjaxPost:function(n){"use strict";var t=$.extend({useasync:!0,successfunc:null,failfunc:null,alwaysfunc:null,url:null,dicparameters:null},n),i=function(n){n.RESULT===-1?layer.alert(i18next.t("message.TokenVerifyFailed"),{icon:0,title:i18next.t("common.Tips")},function(){window.top.location.href="/Page/login.html"}):t.successfunc&&t.successfunc(n)};return $.ajax({type:"POST",url:t.url,data:"="+btoa2(encodeURIComponent(JSON.stringify(t.dicparameters))),success:i,error:t.failfunc,beforeSend:function(n){var i=g_ul.GetToken(),r=$.now(),u=rndnum();n.setRequestHeader("orgid",t.dicparameters.ORIGID);n.setRequestHeader("userid",t.dicparameters.USERID);n.setRequestHeader("token",i);n.setRequestHeader("timestamp",r);n.setRequestHeader("nonce",u)},async:!0!==t.useasync?!1:!0}).always(t.alwaysfunc)}};(function(n,t,r){function o(){var n=location.origin+"/";return t.location.origin||(n=t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:"")),n}function s(n){var t="",r=g_db.GetDic("programList")||[],u=Enumerable.From(r).Where(function(t){return t.ModuleID===n}).First(),i=function(n){var r=e(n);r.ParentID?i(r.ParentID):t=r.ModuleID};return i(u.ParentID),t}function e(n){var t=g_db.GetDic("programList")||[];return Enumerable.From(t).Where(function(t){return t.ModuleID==n&&t.FilePath=="#"}).First()}function h(){showWaiting(typeof IsWaiting=="string"?IsWaiting:undefined)}function c(){closeWaiting();setTimeout(function(){IsWaiting=null},3e3)}if(t.gServerUrl=t.location.origin||o(),t.ComTmp={PageTitle:"/Page/Pop/PageTitle.html"},t.ComFn={W_Com:"comw",W_Web:"web",GetUserList:"GetUserList",GetArguments:"GetArguments",GetSysSet:"GetSysSet",GetSerial:"GetSerialNumber",GetUpdateOrder:"UpdateOrderByValue",SendMail:"SendMail",GetExcel:"CreateExcel",GetList:"QueryList",GetOne:"QueryOne",GetPage:"QueryPage",GetPagePrc:"QueryPageByPrc",GetAdd:"Add",GetUpd:"Update",GetDel:"Delete",GetTran:"UpdateTran",GetCount:"QueryCount",CheckInvoiceNum:"CheckInvoiceNumber"},t.Service={cotrl:"/Controller.ashx",comw:"ComWebService",web:"WebService",com:"Common",opm:"OpmCom",eip:"EipCom",sys:"SysCom",auth:"Authorize"},t.bRequestStorage=!1,t.bLeavePage=!1,t.QueryPageidx=1,t.IsWaiting=null,t.onerror=function(n,t,i,r){console.log(t+" line:"+i+" colno:"+r+" "+n);parent.top.SysSet&&parent.top.SysSet.IsOpenMail==="Y"&&g_api.ConnectLite("Log","ErrorMessage",{ErrorSource:t,Errorlineno:i,Errorcolno:r,ErrorMessage:n},function(){})},t.transLang=function(t){i18next="undefined"==typeof i18next?parent.top.i18next:i18next;var i=t===undefined?n("[data-i18n]"):t.find("[data-i18n]"),r=t===undefined?n("[placeholderid]"):t.find("[placeholderid]");i.each(function(t,i){var u=n(i).attr("data-i18n"),r;u&&(r=i18next.t(u),i.nodeName=="INPUT"&&i.type=="button"?n(i).val(r):n(i).html(r))});r.each(function(t,i){var r=n(i).attr("placeholderid"),u;r&&(u=i18next.t(r),u!==r&&n(i).attr("placeholder",u))})},t.refreshLang=function(n){if(n&&n.length===0)return!1;transLang(n)},t.setLang=function(t,i,r){t&&(g_ul.SetLang(t),i18next="undefined"==typeof i18next?parent.top.i18next:i18next,n.getJSON(gServerUrl+"/Scripts/lang/"+(parent.top.OrgID||"TE")+"/"+t+".json?v=20180801",function(n){var u={};u[t]={translation:n};i18next.init({lng:t,resources:u,useLocalStorage:!1,localStorageExpirationTime:864e5},function(n,t){transLang(i);typeof r=="function"&&r(t)})}))},t.getLanguagePack=function(n){var t=g_ul.GetLang()||"en";return i18next.getResourceBundle(t,"translation").sMsgKey||n},t.getWebServiceUrl=function(n,t){var i="";switch(n){case"aspx":i=t;break;case"cotrl":i="/Controller.ashx?"+t;break;default:i="/WS/"+Service[n]+".asmx/"+t}return i},t.CallAjax=function(i,r,u,f,e,o,s,h){return t.IsWaiting=o===undefined||o===!0?!0:o===!1?null:o,n.ajax({type:"POST",async:s==undefined?!0:!1,url:getWebServiceUrl(i,r),data:JSON.stringify(u),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n.d==="-1"||n.d===-1?layer.alert(i18next.t("message.TokenVerifyFailed"),{icon:0,title:i18next.t("common.Tips")},function(){t.top.location.href="/Page/login.html"}):f&&f(n)},beforeSend:function(n){var t=g_db.GetItem("orgid"),i=g_db.GetItem("userid"),r=g_ul.GetToken();n.setRequestHeader("orgid",t);n.setRequestHeader("userid",i);n.setRequestHeader("token",r)},error:e||function(){},global:o===!1?!1:!0}).always(h)},t.CallAjaxCross=function(t,i,r,u,f,e,o){return IsWaiting=e?e:null,n.ajax({type:"POST",async:o==undefined?!0:!1,jsonpCallback:"Callback",url:getWebServiceUrl(t,i),data:r,dataType:"jsonp",success:u||function(){},beforeSend:function(n){var t=g_db.GetItem("orgid"),i=g_db.GetItem("userid"),r=g_ul.GetToken();n.setRequestHeader("orgid",t);n.setRequestHeader("userid",i);n.setRequestHeader("token",r)},error:f||function(n,t,i){console.log(i)},global:e==undefined||e==null?!1:!0})},t.showWaiting=function(i){n.blockUI({message:n('<div id="Divshowwaiting"><img src="/images/ajax-loader.gif">'+(i||"Waiting...")+"<\/div>"),css:{"font-size":"36px",border:"0px","border-radius":"10px","background-color":"#FFF",padding:"15px 15px",opacity:.5,color:"orange",cursor:"wait","z-index":1000000001},baseZ:1e9});t.setTimeout(n.unblockUI,6e4)},t.closeWaiting=function(t){n(function(){t==undefined&&(t=100);setTimeout(n.unblockUI,t)})},t.Jsonremove=function(t,i,r){return n.grep(t,function(n){return n[i]!=r})},t.Jsonget=function(t,i,r){return n.grep(t,function(n){return n[i]==r})},t.Tostr=function(n){return JSON.stringify(n)},t.DownLoadFile=function(n,i){var r=gServerUrl+"/Controller.ashx";r+="?action=downfile&path="+n;i&&(r+="&filename="+i);t.location.href=r;closeWaiting()},t.EditFile=function(t,i){layer.open({type:1,title:i18next.t("common.EditFile"),shade:.75,maxmin:!0,area:["500px","350px"],content:'<div class="pop-box"> <div class="input-group input-append"> <input type="text" maxlength="30" id="FileName" name="FileName" class="form-control w100p"> <span class="input-group-addon add-on"> <\/span> <\/div><br/> <div class="input-group w100p"> <input type="text" maxlength="250" id="Link" name="Link" class="form-control w100p" placeholder="URL"> <\/div><br/> <div class="input-group"> <textarea name="FileDescription" id="FileDescription" class="form-control w100p" rows="5" cols="500"><\/textarea> <\/div> <\/div>',btn:[i18next.t("common.Confirm"),i18next.t("common.Cancel")],success:function(i){n(".pop-box .input-group-addon").text("."+t.subname);n("#FileName").val(t.filename);n("#Link").val(t.link);uniformInit(i)},yes:function(r){var f=n("#FileName").val(),u={FileName:f,Link:n("#Link").val(),Description:n("#FileDescription").val()};if(!u.FileName)return showMsg(i18next.t("message.FileName_Required")),!1;u.FileName+="."+t.subname;CallAjax(ComFn.W_Com,ComFn.GetUpd,{Params:{files:{values:u,keys:{FileID:t.fileid}}}},function(n){if(n.d>0){t.filename=f;t.link=u.Link;t.description=u.Description;var e=i.find(".jFiler-item-title>b"),o=i.find(".file-name li:first"),s=i.find(".jFiler-item-description span");e.length>0&&e.attr("title",u.FileName).text(u.FileName);o.length>0&&o.text(u.FileName);s.length>0&&s.text(u.Description);layer.close(r);showMsg(i18next.t("message.Modify_Success"),"success")}else showMsg(i18next.t("message.Modify_Failed"),"error")})}})},t.DelFile=function(t,i,r){return r=r===undefined||r===null?!0:r,t&&n.trim(t)?g_api.ConnectLite(Service.com,"DelFile",{FileID:t,IDType:i||""},function(n){n.RESULT?r&&(n.DATA.rel?showMsg(i18next.t("message.Delete_Success"),"success"):showMsg(i18next.t("message.Delete_Failed"),"error")):showMsg(i18next.t("message.Delete_Failed"),"error")}):n.Deferred().resolve().promise()},t.DelTask=function(n){return CallAjax(ComFn.W_Com,ComFn.GetDel,{Params:{task:{SourceID:n,OrgID:parent.top.OrgID}}})},t.reFreshInput=function(t){t.find("[disabled]").each(function(){n(this).attr("hasdisable",1).removeAttr("disabled")})},t.reSetInput=function(t){t.find("[hasdisable]").each(function(){n(this).removeAttr("hasdisable").prop("disabled",!0)})},t.disableInput=function(t,i,r){r=r===undefined||r===null?!0:r;t=t.find(":input,select-one,select,checkbox,radio,textarea");i&&(t=t.not(i));t.each(function(){n(this).prop("disabled",r)})},t.getFormSerialize=function(n,t){var i={};return reFreshInput(n),i=t?n.serializeJSON():n.serializeObject(),reSetInput(n),i},t.packParams=function(n,t){return n.ModifyUser=parent.top.UserInfo.MemberID,n.ModifyDate=(new Date).formate("yyyy/MM/dd HH:mm"),t||(n.CreateUser=n.ModifyUser,n.CreateDate=n.ModifyDate),n},t.removeNull=function(n){var i={},t;if(n instanceof Object)for(t in n)n[t]!==null&&(i[t]=n[t]);return i},t.getUrlParam=function(n){var r=new RegExp("(^|&)"+n+"=([^&]*)(&|$)"),i=t.location.search.substr(1).match(r);return i!=null?unescape(i[2]):null},t.encodeURL=function(n){return encodeURIComponent(n).replace(/\'/g,"%27").replace(/\!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29")},t.decodeURL=function(n){return decodeURIComponent(n)},t.optionListMove=function(t,i){var r=t.find("option").size(),u=t.find("option:selected").size();r>0&&u>0&&t.find("option:selected").each(function(){n(this).prependTo(i)})},t.optionListOrder=function(n,t){var f=n.find("option").size(),i=n.find("option:selected"),e=i.size(),r,u;f>0&&e>0&&(r=n.find("option:selected:first"),u=n.find("option:selected:last"),t?r.prev().length>0&&r.prev().before(i):u.next().length>0&&u.next().after(i))},t.optionListSearch=function(t,i,r){n("option",t).attr("title",function(){return this.innerHTML});n("option",i).attr("title",function(){return this.innerHTML});var f=t.html(),u="";n.each(t.find("option"),function(){n(this).val()+n(this).text()!="undefined"&&(u+=n(this).val()+"|"+n(this).text()+",")});r.off("keyup").on("keyup",function(){var r=this.value;t.empty();r!=""?n.each(u.split(","),function(n,i){if(i.toLowerCase().indexOf(r.toLowerCase())>=0){var u=i.split("|")[0],f=i.split("|")[1];t.append('<option value="'+u+'">'+f+"<\/option>")}}):t.html(f);i.html()!=""&&n.each(i.find("option"),function(){t.find("option[value="+n(this).val().replace(".","\\.")+"]").remove()})})},t.newDate=function(n,t,i){var r="";return n?(typeof n=="string"?(r=n.replace("T"," ").replaceAll("-","/"),r.indexOf(".")>-1&&(r=r.slice(0,r.indexOf(".")))):r=new Date(n),r=new Date(r)):i||(r=new Date),r===""?"":t?r.formate("yyyy/MM/dd"):r.formate("yyyy/MM/dd HH:mm")},t.getHtmlTmp=function(t){return n.ajax({async:!0,url:t,success:function(n){typeof callback=="function"&&callback(n)}})},t.guid=function(){var n=new Uint16Array(8),r=t.crypto||t.msCrypto,i=function(n){for(var t=n.toString(16);t.length<4;)t="0"+t;return t};return r.getRandomValues(n),i(n[0])+i(n[1])+"-"+i(n[2])+"-"+i(n[3])+"-"+i(n[4])+"-"+i(n[5])+i(n[6])+i(n[7])},rndnum=function(n){var i="",t;for(n=n||10,t=0;t<n;t++)i+=Math.floor(Math.random()*10);return i},t.addTips=function(t){t=t!==undefined?t:n("[title]");t.each(function(){var t=n(this);t.attr("title")&&t.attr("tooltips")!=="Y"&&t.attr("tooltips","Y").jBox("Tooltip")})},t.stopBubble=function(n){n&&n.stopPropagation?n.stopPropagation():t.event.cancelBubble=!0},t.stopDefault=function(n){return n&&n.preventDefault?n.preventDefault():t.event.returnValue=!1,!1},t.getAuthority=function(t,i,r,u){var e=s(t),f=getUrlParam("Action")===null?"add":getUrlParam("Action").toLowerCase();return g_api.ConnectLite("Authorize","GetAuthorize",{ProgramID:t,TopModuleID:e},function(t){var c,o,a;if(t.RESULT){var v=t.DATA.rel,s=[],e={},h=null,y=function(){n("#Toolbar").ToolBar({btns:s,fncallback:i||function(){}});transLang(n("#Toolbar"))},l=function(){n.fn.ToolBar?y():l()};n.each(v,function(t,i){if(i.AllowRight){var r=i.AllowRight.split("|");n.each(r,function(t,i){var r=n.trim(i);e[r.toLowerCase()]===undefined&&(e[r.toLowerCase()]=r)})}});e.upd||(delete e.save,delete e.readd);f==="upd"&&delete e.readd;f==="add"&&delete e.del;delete e.upd;delete e.view;for(c in e)if(o={},o.key=e[c],c==="leave")h=o,h.hotkey="ctrl + l";else{switch(c){case"qry":o.hotkey="enter";break;case"add":o.hotkey="ctrl + i";break;case"readd":o.hotkey="ctrl + r";break;case"save":o.hotkey="ctrl + s";break;case"del":o.hotkey="ctrl + d";break;case"clear":o.hotkey="ctrl + q"}s.push(o)}r&&s.push.apply(s,r);h&&s.push(h);l();if(u.PrgId.indexOf("_Upd")>-1||"InvoiceApplyForCustomer_View, InvoiceApplyForPersonal_View".indexOf(u.PrgId)>-1)f==="Upd".toLocaleLowerCase()&&parent.top.msgs.server.checkEdit(u.PrgId,sCheckId),n("#form_main").find(":input,select").not("[data-type=select2]").change(function(){n(this).attr("data-trigger")||(bRequestStorage=!0)}),setTimeout(function(){n("#form_main").find("[data-type=select2]").change(function(){n(this).attr("data-trigger")||(bRequestStorage=!0)})},3e3);else if(u.PrgId.indexOf("_Qry")>-1&&parent.top.msgs.server.removeEditPrg(u.PrgId.replace("_Qry","_Upd")),a=n("#Toolbar_Qry"),a.length>0){n("select").on("change",function(t,i){setTimeout(function(){i!=="clear"&&n("#Toolbar_Qry").click()},10)});n(':input[type="radio"],:input[type="checkbox"]').on("click",function(t,i){i!=="clear"&&n("#Toolbar_Qry").click()})}}})},t.createPageTitle=function(t,i){var c,o,r;if(t){i=i||n(".page-title");var u=g_db.GetItem("programList"),s="",f=[],h=function(n){var t=e(n);t.ModuleID&&f.unshift('<div class="ng-scope layout-row"> <a class="md-button" href="#"><span class="ng-binding ng-scope" data-i18n=common.'+t.ModuleID+'><\/span><\/a> <i class="fa fa-angle-right" aria-hidden="true"><\/i> <\/div>');t.ParentID&&h(t.ParentID)};if(u!=null&&u!=="")return(c=n.parseJSON(u),o=n.grep(c,function(n){return n.ModuleID===t}),o.length===0)?void 0:(r=o[0],!r.ParentID)?void 0:(h(r.ParentID),f.push('<div class="ng-scope layout-row"> <a class="md-button" href="#"><span class="ng-binding ng-scope" data-i18n=common.'+r.ModuleID+"><\/span><\/a> <\/div>"),s=f.join(""),n.get(ComTmp.PageTitle).done(function(t){n.templates({tmpl:t});i.html(n.render.tmpl({ProgramName:"common."+r.ModuleID,showTable:parent.top.SysSet.TbShowOrHide,MainTableName:r.MainTableName,ModTree:s}));transLang(i);navigator.userAgent.match(/mobile/i)&&n(".ismobile").hide()}))}},t.createOptions=function(t,i,r,u,f,e){var s,h,c,o,l;if(e==e||!0,t=t||[],s=[],h=[],typeof t=="number")for(c=t;t>0;)o=c-t+1,o=n.trim(o),s.push(n("<option />",{value:o,title:o,html:o})),t--;else s=[n("<option />",{value:"",html:"請選擇..."})],l=t.length,l>0&&n.each(t,function(t,o){if(e!==!1||h.indexOf(n.trim(o[i]))<0&&e===!1){var c=n("<option />",{value:n.trim(o[i]),title:n.trim(o[r]),html:(u?n.trim(o[i])+"-":"")+n.trim(o[r])});f&&c.attr(f,o[f]);s.push(c)}h.push(n.trim(o[i]))});return n("<div />").append(s).html()},t.createRadios=function(t,i,r,u,f,e,o){t=t||[];f=f||"";o=o===!1?!0:undefined;var s="",h=t.length;return h>0&&n.each(t,function(t,h){var c=u+"_"+f+"_"+t,l=n("<input />",{type:"radio",id:c,name:u,"data-trigger":o,value:n.trim(h[i])}).attr("val",n.trim(h[i]));s+='<label for="'+c+'">'+l[0].outerHTML+((e?n.trim(h[i])+"-":"")+n.trim(h[r]))+"<\/label>"}),s},t.createCheckList=function(t,i,r,u,f){t=t||[];var e="",o=t.length;return o>0&&n.each(t,function(t,s){var h=n("<input />",{type:"checkbox",id:i+(f===undefined?"":f)+"_"+t,name:u+"[]",value:n.trim(s[i]),"class":"input-mini"});e+="<label for='"+i+(f===undefined?"":f)+"_"+t+"' style='"+(o==t+1?"":"float:left;")+"padding-left: 10px'>"+h[0].outerHTML+n.trim(s[r])+"<\/label>"}),e},t.onresize=function(){var t=n("body").height();n("#main-wrapper").length&&n("#main-wrapper").css("min-height",t-88+"px");setContentHeight()},t.fnframesize=function(i){var u=null,f;r.getElementById?u=r.getElementById(i):eval("pTar = "+i+";");u&&!t.opera&&(u.style.display="block",u.contentDocument&&u.contentDocument.body.offsetHeight?(f=n(r.body).outerHeight(!0),u.height=f-125,u.width=u.contentDocument.body.scrollWidth+20):u.Document&&u.Document.body.scrollHeight&&(u.height=u.Document.body.scrollHeight,u.width=u.Document.body.scrollWidth))},t.setContentHeight=function(){var t=function(n){var i=r.getElementsByTagName("iframe"),t,u;if(i!=null)for(t=0;t<i.length;t++)u=i[t],u.id.indexOf("ueditor_")===-1&&(u.height=n)},u=n(".page-inner"),i=n(r.body).outerHeight(!0)-110;t(i)},t.getJsonVal=function(n,t){for(var i=n,u=t.split("_"),r=0;r<u.length;r++){if(!i[u[r]]){i="";break}i=i[u[r]]}return i},t.cacheQueryCondition=function(i){var f=i||n("#form_main"),r=t.sProgramId||getProgramId()||"",e={},o,u;if(t.bToFirstPage=!1,r)if(parent[r+"_query"]||(parent[r+"_query"]={}),typeof f=="number")parent[r+"_query"].pageidx=f;else{o=clone(parent[r+"_query"]);e=getFormSerialize(f);for(u in e)parent[r+"_query"][u]=e[u];for(u in o)if(u!=="pageidx"&&parent[r+"_query"][u]!==o[u]){t.bToFirstPage=!0;break}}},t.setFormVal=function(t,i){t.find("[name]").each(function(){var u=this.id,e=this.name?this.name.replace("[]",""):"",o=this.type,t=i[e]||getJsonVal(i,u)||"",r,f;if(t){switch(o){case"text":case"email":case"url":case"number":case"range":case"date":case"search":case"color":case"textarea":case"select-one":case"select":case"hidden":r=n(this).attr("data-type");r&&r=="pop"?(f=i[e+"Name"]||t,n(this).attr("data-value",t),f&&n(this).val(f)):(n(this).hasClass("date-picker")?t=newDate(t,"date"):(n(this).hasClass("date-picker")||n(this).hasClass("datetime-picker")||n(this).hasClass("date"))&&(t=newDate(t)),t&&n(this).val(t),n(this).data("old",t),r&&r=="int"&&t&&n(this).attr("data-value",t.toString().replace(/[^\d.]/g,"")));r==="select2"&&n(this).trigger("change","setval");break;case"checkbox":typeof t=="object"?t.indexOf(this.value)>-1&&(this.checked=t):this.checked=typeof t=="string"?t==this.value:t;n.uniform&&n.uniform.update(n(this).prop("checked",this.checked));break;case"radio":this.checked=this.value===t;n.uniform&&n.uniform.update(n(this).prop("checked",this.checked))}(u=="ModifyUser"||u=="CreateUser")&&"select-one".indexOf(this.type)===-1?n(this).text(t):(u=="ModifyDate"||u=="CreateDate")&&n(this).text(newDate(t))}})},t.Trim=function(n,t){var i;return i=n.replace(/(^\s+)|(\s+$)/g,""),t.toLowerCase()=="g"&&(i=i.replace(/\s/g,"")),i},t.setNameById=function(){var t=[];return n("[data-source]").each(function(){var i=this,f=n(i).attr("data-value")||n(i).data("value")||i.value||n(i).text(),r=n(this).data("source").split("."),u={},e={};r.length>2&&(e[r[1]]=f,u[r[0]]=e,u.OrgID=parent.top.OrgID,f&&t.push(CallAjax(ComFn.W_Com,ComFn.GetOne,{Type:"",Params:u},function(t){if(t.d){var u=n.parseJSON(t.d);i.type==="text"?n(i).val(u[r[2]]||u[r[3]]):n(i).text(u[r[2]]||u[r[3]])}})))}),n.whenArray(t)},t.moneyInput=function(t,i,r){if(t.length>0){var u=new FormatNumber;t.each(function(){for(var f=this.value,e="",t=0;t<f.length;t++)isNaN(f[t])||(e+=f[t]);this.value==e;u.init({trigger:n(this),decimal:i||0,minus:r||!1})})}},t.aryCurrentPageValueTmp=[],t.getPageVal=function(t){aryCurrentPageValueTmp=[];var i=t!==undefined?n("#"+t):n("#searchbar").length>0?n("#searchbar"):n(".page-inner");i.find(":input","textarea","select").each(function(){var t={};t.ID=this.id;t.Type=this.type;switch(this.type){case"text":case"email":case"url":case"number":case"range":case"date":case"search":case"color":case"password":case"hidden":case"textarea":t.Value=n(this).val();break;case"checkbox":case"radio":t.Checked=this.checked;break;case"select-multiple":case"select-one":case"select":t.Value=n(this).val()||"";t.Html=n(this).html()}aryCurrentPageValueTmp.push(t)})},t.clearPageVal=function(){for(var u=aryCurrentPageValueTmp,f=n("#Toolbar_Qry"),r=0;r<u.length;r++){var i=u[r],t=n("#"+i.ID),o=t.parent();try{switch(i.Type){case"text":case"email":case"url":case"number":case"range":case"date":case"search":case"color":case"password":case"hidden":case"textarea":t.val(i.Value);break;case"checkbox":case"radio":t[0].checked=i.Checked;n.uniform&&n.uniform.update(t.prop("checked",t[0].checked));break;case"select-multiple":case"select-one":case"select":i.Html&&t.html(i.Html);t.val(i.Value);t.attr("data-type")==="select2"&&t.trigger("change","clear")}}catch(e){alert(e)}}f.length>0&&n("#Toolbar_Qry").click()},t.cssReady=function(n,t){function o(){try{return t&&t[i]&&t[i][f]&&t[i][f][0]}catch(n){return!1}}var u=r.createStyleSheet,f=u?"rules":"cssRules",i=u?"styleSheet":"sheet",e=r.getElementsByTagName("link");t||(t=e[e.length-1]),function s(){o()&&setTimeout(n,0)||setTimeout(s,100)}()},t.clone=function(n){var i,t,r;if(typeof n!="object"||n===null)return n;if(n instanceof Array)for(i=[],t=0,r=n.length;t<r;t++)i[t]=typeof n[t]=="object"&&n[t]!=null?arguments.callee(n[t]):n[t];else{i={};for(t in n)i[t]=typeof n[t]=="object"&&n[t]!=null?arguments.callee(n[t]):n[t]}return i},t.commonInit=function(t){if(navigator.userAgent.match(/mobile/i)&&n(".ismobile").hide(),n("#tabs").length>0)n("#tabs").tabs().find("li").on("click",function(){var i=this;n("#tabs>ul>li").removeClass("active");n(this).addClass("active");t.tabClick&&t.tabClick(i)});if(setTimeout(function(){n.datepicker!==undefined&&(n.datepicker.regional["zh-TW"]={dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesMin:["日","一","二","三","四","五","六"],monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["01","02","03","04","05","06","07","08","09","10","11","12"],prevText:"上月",nextText:"次月",weekHeader:"週",showMonthAfterYear:!0,dateFormat:"yy/mm/dd"},n.datepicker.setDefaults(n.datepicker.regional["zh-TW"]));n(".date-picker").length>0&&n(".date-picker").datepicker({changeYear:!0,changeMonth:!0,altFormat:"yyyy/MM/dd",onSelect:function(n,i){if(typeof t.onSelect=="function")t.onSelect(n,i)},afterInject:function(){}});n(".datetime-picker").length>0&&n(".datetime-picker").each(function(){var i=(n(this).attr("hour")||9)*1,r=(n(this).attr("minute")||0)*1,u=(n(this).attr("stepminute")||15)*1;n(this).datetimepicker({changeYear:!0,changeMonth:!0,altFormat:"yyyy/MM/dd",timeFormat:"HH:mm",hour:i,minute:r,stepMinute:u,hourGrid:6,minuteGrid:15,onSelect:function(n,i){if(typeof t.onSelect=="function")t.onSelect(n,i)},afterInject:function(){}})});n(".time-picker").length>0&&n(".time-picker").each(function(){var i=(n(this).attr("hour")||9)*1,r=(n(this).attr("minute")||0)*1;n(this).timepicker({timeFormat:"HH:mm",hour:i,minute:r,minuteGrid:30,stepMinute:30,onSelect:function(n,i){if(typeof t.onSelect=="function")t.onSelect(n,i)}})})},1e3),n(".color-picker").length>0&&n(".color-picker").each(function(){var t=this;n(t).spectrum({color:"#000000",showInput:!0,className:"full-spectrum",showInitial:!0,showPalette:!0,showSelectionPalette:!0,maxPaletteSize:10,preferredFormat:"hex",hide:function(i){n(t).val(i.toHexString())},palette:[["rgb(0, 0, 0)","rgb(67, 67, 67)","rgb(102, 102, 102)","rgb(204, 204, 204)","rgb(217, 217, 217)","rgb(255, 255, 255)","rgb(152, 0, 0)","rgb(255, 0, 0)","rgb(255, 153, 0)","rgb(255, 255, 0)","rgb(0, 255, 0)"],["rgb(230, 184, 175)","rgb(244, 204, 204)","rgb(252, 229, 205)","rgb(255, 242, 204)","rgb(217, 234, 211)","rgb(208, 224, 227)","rgb(201, 218, 248)","rgb(207, 226, 243)","rgb(217, 210, 233)","rgb(234, 209, 220)","rgb(221, 126, 107)","rgb(234, 153, 153)","rgb(249, 203, 156)","rgb(255, 229, 153)","rgb(182, 215, 168)","rgb(162, 196, 201)","rgb(164, 194, 244)","rgb(159, 197, 232)","rgb(180, 167, 214)","rgb(213, 166, 189)","rgb(204, 65, 37)","rgb(224, 102, 102)","rgb(246, 178, 107)","rgb(255, 217, 102)","rgb(147, 196, 125)","rgb(118, 165, 175)","rgb(109, 158, 235)","rgb(111, 168, 220)","rgb(142, 124, 195)","rgb(194, 123, 160)","rgb(166, 28, 0)","rgb(204, 0, 0)","rgb(230, 145, 56)","rgb(241, 194, 50)","rgb(106, 168, 79)","rgb(69, 129, 142)","rgb(60, 120, 216)","rgb(61, 133, 198)","rgb(103, 78, 167)","rgb(166, 77, 121)","rgb(91, 15, 0)","rgb(102, 0, 0)","rgb(120, 63, 4)","rgb(127, 96, 0)","rgb(39, 78, 19)","rgb(12, 52, 61)","rgb(28, 69, 135)","rgb(7, 55, 99)","rgb(32, 18, 77)","rgb(76, 17, 48)","rgb(0, 255, 255)","rgb(74, 134, 232)","rgb(0, 0, 255)","rgb(153, 0, 255)","rgb(255, 0, 255)"]]})}),keyInput(),select2Init(),uniformInit(),t.GoTop&&goTop(),t.PrgId){var i=g_ul.GetLang()||"zh-TW";return setLang(i),getPageVal(),createPageTitle(t.PrgId).done(function(){if(t.SearchBar)var r=n("#searchbar").height(),u=n("<i>",{"class":"fa fa-arrow-up slide-box",click:function(){n(this).hasClass("fa-arrow-up")?(n(this).removeClass("fa-arrow-up").addClass("fa-arrow-down"),i.slideUp(),oGrid.height=oGrid.dfheight.replace("px","")*1+r+"px"):(n(this).removeClass("fa-arrow-down").addClass("fa-arrow-up"),i.slideDown(),oGrid.height=oGrid.dfheight);n("#jsGrid").jsGrid("refresh");var t=n(".jsgrid-grid-body.slimscroll");t.parent().css("height",t.css("height"))}}),f=n("<div>",{"class":"col-sm-12 up-down-go"}).append(u),i=n("#searchbar").after(f)}),reSetQueryPm(t.PrgId),getAuthority(t.PrgId,t.ButtonHandler,t.Buttons,t)}},t.select2Init=function(t){var i=t===undefined?n("select[data-type=select2]"):t.find("select[data-type=select2]");i.length>0&&i.each(function(){n(this).find("option").length>0&&!n(this).attr("data-hasselect2")&&(n(this).select2().attr("data-hasselect2",!0),n(this).next().after(n(this)))})},t.uniformInit=function(t){var i=n("input[type=radio]:not(.no-uniform)");t&&(i=t.find("input[type=radio]:not(.no-uniform)"));i.length>0&&i.each(function(){n(this).uniform()})},t.keyIntp=function(n,t,i){if(n.keyCode!=8&&n.keyCode!=37&&n.keyCode!=39&&n.keyCode!=46)t.value=t.value.replace(/[^\d.-]/g,""),t.value=t.value.replace(/\.{2,}/g,"."),t.value=t.value.replace(".","$#$").replace(/\./g,"").replace("$#$","."),t.value=t.value.replace({1:/^(\-)*(\d+)\.(\d).*$/,2:/^(\-)*(\d+)\.(\d\d).*$/,3:/^(\-)*(\d+)\.(\d\d\d).*$/}[i],"$1$2.$3"),t.value.indexOf(".")<0&&t.value!==""&&t.value!=="-"&&(t.value=t.value.indexOf("-")===0?0-parseFloat(t.value.replace("-","")):parseFloat(t.value))},t.pageLeave=function(){var t=function(){parent.top.openPageTab(sQueryPrgId);parent.top.msgs.server.removeEditPrg(sProgramId)};if(parent.bLockDataForm0430!==undefined&&t(),bRequestStorage)return layer.confirm(i18next.t("message.HasDataTosave"),{icon:3,title:i18next.t("common.Tips"),btn:[i18next.t("common.Yes"),i18next.t("common.No")]},function(t){layer.close(t);bLeavePage=!0;n("#Toolbar_Save").click()},function(){t()}),!1;t()},t.goToJys=function(t,i){n("html,body").animate({scrollTop:t.offset().top+(i||0)},500)},t.slimScroll=function(t,i){if(n.fn.slimScroll){var r={allowPageScroll:!0,color:"#ee7624",opacity:1};t&&(r.height=t);i&&(r.reduce=i);n(".slimscroll").slimscroll(r)}},t.goTop=function(){var t=n("<div>",{"class":"gotop",html:'<img src="../../images/gotop_1.png" />',click:function(){return n("body,html").animate({scrollTop:0},120),!1}});n("body").append(t.hide());n(r).on("scroll",function(){var i=(n(r).height(),n(this).scrollTop()),u=-45;i>0?t.fadeIn():t.fadeOut();i>35?(u=i-80,n("#Toolbar").addClass("toolbar-float").removeClass("toolbar-fix")):n("#Toolbar").removeClass("toolbar-float").addClass("toolbar-fix");n("#Toolbar").css("margin-top",u+"px")})},t.getExplorer=function(){var n="",i=t.navigator.userAgent;i.indexOf("MSIE")>=0?n="ie":i.indexOf("Firefox")>=0?n="firefox":i.indexOf("Chrome")>=0?n="chrome":i.indexOf("Opera")>=0?n="opera":i.indexOf("Safari")>=0&&(n="safari")},t.goToEdit=function(n,t){parent.top.layer.open({type:1,title:!1,area:["100px","70px"],shade:.75,shadeClose:!0,content:'<div class="pop-box"> <button type="button" data-i18n="common.Edit" id="RowEdit" class="btn-custom green">編輯<\/button> <\/div>',success:function(i,r){i.find("#RowEdit").click(function(){parent.top.openPageTab(n,t);parent.top.layer.close(r)})}})},t.reSetQueryPm=function(i){var r=parent[i+"_query"];r&&(setFormVal(n("#form_main"),r),r.pageidx&&(t.QueryPageidx=r.pageidx))},t.fMoney=function(n,t,r){var e=t>0&&t<=20?t:2;r&&r==="NTD"&&(n=Math.round(n));n=parseFloat(((n||0)+"").replace(/[^\d\.-]/g,"")).toFloat(e)+"";var u=n.split(".")[0].split("").reverse(),o=n.split(".")[1]||Array(t+1).join(0),f="";for(i=0;i<u.length;i++)f+=u[i]+((i+1)%3==0&&i+1!=u.length?",":"");return f.split("").reverse().join("")+(t===0?"":"."+o)},t.fnRound=function(n,t){let i=0;i=t&&t==="NTD"?0:2;return parseFloat(n.toFixed(i))},t.keyInput=function(){if(n("[data-keyint]").length>0)n("[data-keyint]").on("keyup blur",function(){this.value=this.value.replace(/\D/g,"")});if(n("[data-keyeng]").length>0)n("[data-keyeng]").on("keyup blur",function(){this.value=this.value.replace(/[^a-zA-Z]/g,"")});if(n("[data-keyeng]").length>0)n("[data-keyeng]").on("keyup blur",function(){this.value=this.value.replace(/[^\u4E00-\u9FA5]/g,"")});if(n("[data-keytelno]").length>0)n("[data-keytelno]").on("keyup blur",function(n){n.keyCode!=8&&n.keyCode!=37&&n.keyCode!=39&&n.keyCode!=46&&(this.value=this.value.replace(/[^0-9\-\+\#\ ]/g,""))});if(n("[data-keyintg]").length>0)n("[data-keyintg]").on("keyup blur",function(){this.value=this.value.replace(/[^0-9\-\+\#]/g,"")});if(n("[data-keyintp1]").length>0)n("[data-keyintp1]").on("keyup blur",function(n){keyIntp(n,this,1)});if(n("[data-keyintp2]").length>0)n("[data-keyintp2]").on("keyup blur",function(n){keyIntp(n,this,2)});if(n("[data-keyintp3]").length>0)n("[data-keyintp3]").on("keyup blur",function(n){keyIntp(n,this,3)});if(n("[data-keyeng]").length>0)n("[data-keyeng]").on("keyup blur",function(){this.value=this.value.replace(/[^\a-\z\A-\Z]/g,"")});if(n("[data-keyinteng]").length>0)n("[data-keyinteng]").on("keyup blur",function(){this.value=this.value.replace(/[^0-9\a-\z\A-\Z\_]/g,"")});if(n("[data-keycneng]").length>0)n("[data-keycneng]").on("keyup blur",function(){this.value=this.value.replace(/[/d]/g,"")});if(n("[data-keymemberid]").length>0)n("[data-keymemberid]").on("keyup blur",function(){this.value=this.value.replace(/[^\w\.\/]/ig,"")});n("[_maxlength]").length>0&&n("[_maxlength]").each(function(){var t=n(this).attr("_maxlength");if(t)n(this).on("input propertychange",function(){for(var i=this.value,u="",r=0,n=0;n<i.length;n++){if((i.charCodeAt(n)&65280)!=0&&r++,r++,r>t*1){this.value=u;break}u+=i[n]}})})},t.autoTextarea=function(n,i,u){var e;i=i||0;var h=!!r.getBoxObjectFor||"mozInnerScreenX"in t,c=!!t.opera&&!!t.opera.toString().indexOf("Opera"),o=function(t,i){n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent("on"+t,i)},f=n.currentStyle?function(t){var r=n.currentStyle[t],i;return t==="height"&&r.search(/px/i)!==1?(i=n.getBoundingClientRect(),i.bottom-i.top-parseFloat(f("paddingTop"))-parseFloat(f("paddingBottom"))+"px"):r}:function(t){return getComputedStyle(n,null)[t]},s=parseFloat(f("height"));n.style.resize="none";e=function(){var e,o,l=0,t=n.style;n._length!==n.value.length&&(n._length=n.value.length,h||c||(l=parseInt(f("paddingTop"))+parseInt(f("paddingBottom"))),e=r.body.scrollTop||r.documentElement.scrollTop,n.style.height=s+"px",n.scrollHeight>s&&(u&&n.scrollHeight>u?(o=u-l,t.overflowY="auto"):(o=n.scrollHeight-l,t.overflowY="hidden"),t.height=o+i+"px",e+=parseInt(t.height)-n.currHeight,r.body.scrollTop=e,r.documentElement.scrollTop=e,n.currHeight=parseInt(t.height)))};o("propertychange",e);o("input",e);o("focus",e);e()},t.isEmail=function(n){return/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(n)?!0:!1},t.inputChange=function(t,i){t.on("change",function(){var t=this,r=n(t).attr("data-id");i[r]=n(t).val()})},!t.browser){var f=navigator.userAgent.toLowerCase(),u;t.browser={};function i(){return"ActiveXObject"in t}u||(u=f.match(/chrome\/([\d.]+)/),u!=null&&(t.browser.name="chrome",t.browser.version=u[1]));u||(u=f.match(/firefox\/([\d.]+)/),u!=null&&(t.browser.name="firefox",t.browser.version=u[1]));u||(u=f.match(/opera.([\d.]+)/),u!=null&&(t.browser.name="opera",t.browser.version=u[1]));u||(u=f.match(/safari\/([\d.]+)/),u!=null&&(t.browser.name="safari",t.browser.version=u[1]));u||(f.match(/msie ([\d.]+)/)!=null?(u=f.match(/msie ([\d.]+)/),t.browser.name="ie",t.browser.version=u[1]):(i()&&!!r.attachEvent&&function(){"use strict";return!this}()&&(t.browser.name="ie",t.browser.version="10"),i()&&!r.attachEvent&&(t.browser.name="ie",t.browser.version="11")));n.isIE||n.extend({isIE:function(){return t.browser.name=="ie"}});n.isChrome||n.extend({isChrome:function(){return t.browser.name=="chrome"}});n.isFirefox||n.extend({isFirefox:function(){return t.browser.name=="firefox"}});n.isOpera||n.extend({isOpera:function(){return t.browser.name=="opera"}});n.isSafari||n.extend({isSafari:function(){return t.browser.name=="safari"}})}n(r).ajaxStart(h).ajaxStop(c)})(jQuery,window,document);Date.prototype.dateAdd=function(n,t){var r=this,i={y:"FullYear",q:"Month",m:"Month",w:"Date",d:"Date",h:"Hours",n:"Minutes",s:"Seconds",ms:"MilliSeconds"};return eval("r.set"+i[n]+"(r.get"+i[n]+"()+"+({q:3,w:7}[n]||1)*t+")"),r};Date.prototype.diff=function(n){return(this.getTime()-n.getTime())/864e5};Date.prototype.formate=function(n){var i={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours()%12==0?12:this.getHours()%12,"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()},t;/(y+)/.test(n)&&(n=n.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));/(E+)/.test(n)&&(n=n.replace(RegExp.$1,(RegExp.$1.length>1?RegExp.$1.length>2?"星期":"周":"")+{"0":"日","1":"一","2":"二","3":"三","4":"四","5":"五","6":"六"}[this.getDay()+""]));for(t in i)new RegExp("("+t+")").test(n)&&(n=n.replace(RegExp.$1,RegExp.$1.length==1?i[t]:("00"+i[t]).substr((""+i[t]).length)));return n};String.prototype.replaceAll=function(n,t){return this.replace(new RegExp(n,"gm"),t)};String.prototype.toMoney=Number.prototype.toMoney=function(){return this.toString().replace(/\d+?(?=(?:\d{3})+$)/g,function(n){return n+","})};String.prototype.toFloat=Number.prototype.toFloat=function(n){n=n?parseInt(n):0;var t=this;return n<=0?Math.round(t):Math.round(t*Math.pow(10,n))/Math.pow(10,n)};String.prototype.toPoint=function(){return this.replace("%","")/100};String.prototype.toPercent=Number.prototype.toPercent=function(){var n=Number(this*100).toFixed(1);return n+"%"};Array.prototype.clear=function(){for(var t=[],n=0;n<this.length;n++)this[n]&&t.push(this[n]);return t};Array.prototype.insert=function(n,t){this.splice(n,0,t)};Array.prototype.remove=function(n){var t=this.indexOf(n);t>-1&&this.splice(t,1)};jQuery.whenArray=function(n){return jQuery.when.apply(this,n)};