var 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",orgid:"TE",userid:"EUROTRAN",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")},IsEDU:function(){"use strict";return g_db.GetItem("isedu")}},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_gd.orgid,e.USERID=g_gd.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="WebSite",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_gd.orgid,e.USERID=g_gd.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="WebSite",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||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(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b){var k=i18next.t("message.Tips")||'<\/span>',d;toastr.options={debug:l,newestOnTop:a,progressBar:v,positionClass:y||"toast-top-center",preventDuplicates:p,onclick:null};w&&(toastr.options.onclick=b);i&&(toastr.options.showDuration=i);r&&(toastr.options.hideDuration=r);u&&(toastr.options.timeOut=u);f&&(toastr.options.extendedTimeOut=f);e&&(toastr.options.showEasing=e);o&&(toastr.options.hideEasing=o);s&&(toastr.options.showMethod=s);h&&(toastr.options.hideMethod=h);c&&(toastr.options.tapToDismiss=!1);d=toastr[n](t,k)}function s(){var n=location.origin+"/";return window.location.origin||(gWebUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),n}function h(){showWaiting(typeof IsWaiting=="string"?IsWaiting:undefined)}function c(){closeWaiting();setTimeout(function(){IsWaiting=null},3e3)}if(t.gWebUrl=window.location.origin||s(),t.gServerUrl="http://localhost:3466","www.eurotran.com.tw|www.g-yi.com.cn".indexOf(window.location.hostname)>-1?t.gServerUrl="https://www.eurotran.com:9001":"www.origtek.com".indexOf(window.location.hostname)>-1?t.gServerUrl="https://www.origtek.com:8106":"192.168.1.105".indexOf(window.location.hostname)>-1&&(t.gServerUrl="https://192.168.1.105:9001"),window.location.pathname.indexOf("/TG/")>-1?g_gd.orgid="TG":window.location.pathname.indexOf("/SG/")>-1&&(g_gd.orgid="SG"),t.ComFn={GetOrgInfo:"GetOrgInfo",GetSysSet:"GetSysSet",GetArguments:"GetArguments",GetNewsCount:"GetNewsCount",GetNewsPage:"GetNewsPage",GetExhibitionPage:"GetExhibitionPage",GetNewsInfo:"GetNewsInfo",GetFileList:"GetUploadFiles"},t.Service={apiappcom:"Common",apite:"TEAPI",apitg:"TGAPI",apiwebcom:"Com"},t.onerror=function(n,t,i,r){console.log(t+" line:"+i+" colno:"+r+" "+n);parent.SysSet&&parent.SysSet.IsOpenMail==="Y"&&g_api.ConnectLite("Log","ErrorMessage",{ErrorSource:t,Errorlineno:i,Errorcolno:r,ErrorMessage:n},function(n){n.RESULT})},t.runByOrgInfo=function(n,t){t=t||!1;var i=g_db.GetDic("OrgInfo");!i||t?g_api.ConnectLite(Service.apiwebcom,ComFn.GetOrgInfo,{},function(t){t.RESULT&&(i=t.DATA.rel,g_db.SetDic("OrgInfo",i),typeof n=="function"&&n(i))}):typeof n=="function"&&n(i)},t.IsWaiting=null,t.transLang=function(t){i18next="undefined"==typeof i18next?parent.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.setLang=function(t,i,r){t&&(g_ul.SetLang(t),i18next="undefined"==typeof i18next?parent.i18next:i18next,n.getJSON(gServerUrl+"/Scripts/lang/"+(g_gd.orgid||"TE")+"/"+t+".json",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)})}).error(function(){g_api.ConnectLite("Language","CreateLangJson",{},function(n){n.RESULT&&setLang(t,i,r)})}))},t.showWaiting=function(i){n.blockUI({message:n('
'+(i||"Waiting...")+"<\/div>"),css:{"font-size":navigator.userAgent.match(/mobile/i)?"20px":"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,t){var i=gServerUrl+"/Controller.ashx";i+="?action=downfile&path="+n;t&&(i+="&filename="+t);window.location.href=i;closeWaiting()},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.getFormSerialize=function(n,t){var i={};return reFreshInput(n),i=t?n.serializeJSON():n.serializeObject(),reSetInput(n),i},t.getUrlParam=function(n){var i=new RegExp("(^|&)"+n+"=([^&]*)(&|$)"),t=window.location.search.substr(1).match(i);return t!=null?unescape(t[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.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.guid=function(){var n=new Uint16Array(8),i=window.crypto||window.msCrypto,t=function(n){for(var t=n.toString(16);t.length<4;)t="0"+t;return t};return i.getRandomValues(n),t(n[0])+t(n[1])+"-"+t(n[2])+"-"+t(n[3])+"-"+t(n[4])+"-"+t(n[5])+t(n[6])+t(n[7])},rndnum=function(n){var i="",t;for(n=n||10,t=0;t0;)o=c-t+1,o=n.trim(o),s.push(n("