var JS=new function(){function f(n){return window.event?window.event.keyCode:n.keyCode?n.keyCode:n.which?n.which:n.charCode}var n,r,u,t;this.formatNetDate=function(n,t="yyyy-MM-dd"){function r(n){return n<10?"0"+n:n}function f(n){const t=n%12==0?12:n%12;return r(t)}function e(n){return n<12?"AM":"PM"}const u=parseInt(n.replace(/\/Date\((\d+)\)\//,"$1")),i=new Date(u);return t.replace(/yyyy|MM|dd|HH|mm|ss|hh|a/g,function(n){switch(n){case"yyyy":return i.getFullYear();case"MM":return r(i.getMonth()+1);case"dd":return r(i.getDate());case"HH":return r(i.getHours());case"mm":return r(i.getMinutes());case"ss":return r(i.getSeconds());case"hh":return f(i.getHours());case"a":return e(i.getHours());default:return n}})};this.stringFormat=function(n,...t){return n.replace(/{(\d+)}/g,(n,i)=>typeof t[i]!="undefined"?t[i]:n)};this.getDateFromAspNet=function(n){var t=/\/Date\((\d+)\)\//.exec(n);return t?new Date(parseInt(t[1])):null};this.getDateByNet=function(n){var t=/\/Date\((\d+)\)\//.exec(n);return t?new Date(parseInt(t[1])):null};this.getUniqueId=function(){return Math.floor(Math.random()*Date.now())};this.bindDDL=function(n,t,i,r){var e=document.getElementById(n),f,u;if(e==null)alert("Unable to find element id: "+n);else for(e.innerHTML="",u=0;u()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)};this.getQueryString=function(n,t){var i,u,r;return t==null&&(t=""),i=t,n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),u=new RegExp("[\\?&]"+n+"=([^&#]*)"),r=u.exec(window.location.href),r!=null&&(i=r[1]),i};this.getQueryStringAsInteger=function(n){var t=parseInt(this.getQueryString(n,0));return isNaN(t)&&(t=0),t};this.downloadCSV=function(n,t){this.saveToFile(n,t,"text/csv")};this.saveToFile=function(n,t,i){var u,r;i||(i="text/csv");u=new Blob([t],{type:i});window.navigator.msSaveOrOpenBlob?window.navigator.msSaveBlob(u,n):(r=window.document.createElement("a"),r.href=window.URL.createObjectURL(u),r.download=n,document.body.appendChild(r),r.click(),document.body.removeChild(r))};this.downloadText=function(n,t){var i=document.createElement("a"),r;i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t));i.setAttribute("download",n);document.createEvent?(r=document.createEvent("MouseEvents"),r.initEvent("click",!0,!0),i.dispatchEvent(r)):i.click()};this.downloadWSFile=function(n,t,i){for(var e,r,o,f=window.atob(n),s=new Uint8Array(f.length),u=0;u=0,r.checked=f);else alert("Not found: "+n)};this.setCheckBox=function(n,t){document.getElementById(n).checked=t};this.isChecked=function(n){return document.getElementById(n).checked};this.getIsChecked=function(n){return this.isChecked(n)};this.isEnterKeyPressed=function(n){var i=f(n),t=!1;return i==13&&(t=!0,n.preventDefault()),t};this.getTimeOffset=function(){var n=new Date;return-n.getTimezoneOffset()/60};this.newWin500=function(n,t){return this.newWin(n,500,500,t)};this.newWin800=function(n,t){return this.newWin(n,800,800,t)};this.newWin9x6=function(n,t){return this.newWin(n,900,600,t)};this.showWindow=function(n,t,i,r){return this.newWin(n,i,r,t)};this.newWin=function(n,t,i,r){var f=window.screenLeft!=undefined?window.screenLeft:screen.left,e=window.screenTop!=undefined?window.screenTop:screen.top;width=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width;height=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;t.toString().indexOf("%")>=0&&(t=Math.ceil(width*(parseInt(t.replace("%",""))/100)));i.toString().indexOf("%")>=0&&(i=Math.ceil(height*(parseInt(i.replace("%",""))/100)));var o=width/2-t/2+f,s=height/2-i/2+e,u=window.open(n,r,"scrollbars=yes, width="+t+", height="+i+", top="+s+", left="+o);return window.focus&&u.focus(),u};this.setCookie=function(n,t,i){var r=new Date,u;r.setDate(r.getDate()+i);u=escape(t)+(i==null?"":"; expires="+r.toUTCString());document.cookie=n+"="+u+";path=/"};this.deleteCookie=function(n){this.setCookie(n,"",-1)};this.getCookie=function(n,t){for(var u,f,r=document.cookie.split(";"),i=0;i<\/iframe>'),r=$('
'+t+"<\/div>"),a="",c={},f)for(l=0;l1?i:"0"+i,t=n.getDate().toString(),t=t.length>1?t:"0"+t,i+"/"+t+"/"+r};this.convertToNetDateFormat=function(n){var t=n.getTime();return"/Date("+t+")/"};this.processService=function(n,t,i,r,u,f){u||(u=function(){});f||(f="../ws.asmx/processService");$.ajax({type:"POST",url:f,data:JSON.stringify({map:{service:n,action:t,args:i}}),dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){var t=n.d,i=t.statusCode;if(i!=200){u(t.errorMessage);return}r(t.result)},error:function(n){u(n)}})};this.getYesNo=function(n){var t="No";return n=="true"&&(t="Yes"),t};this.initCSSTab=function(n,t,i,r){var o,f,c,u,h,s,e;if(i||(i="current"),o=JS.getUrl(),f=!1,o=o.replace(/^.*\/\/[^\/]+/,""),h=document.getElementById(n).getElementsByTagName("a"),r==null?r=0:f=!0,s=document.getElementById(n).getElementsByTagName("li"),!f)for(e=0;eProcessing... Please Wait.<\/b>");var t=n;this.showMessage(t,300,200)};this.hideLoading=function(){this.hideMessage()};t={show:function(){var i="black",r=.7,n=document.getElementById("doc_overlay");n?t.style(n,{background:i||"#000",display:"block"}):(n=document.createElement("div"),n.id="doc_overlay",t.style(n,{position:"absolute",top:0,left:0,width:"100%",height:t.getDocHeight()+"px",background:i,zIndex:1e3,opacity:r,filter:"alpha(opacity="+r*100+")"}),document.getElementsByTagName("body")[0].appendChild(n))},hide:function(){var n=document.getElementById("doc_overlay");n.style.display="none"},style:function(n,t){for(var i in t)n.style[i]=t[i]},getDocHeight:function(){var n,t;return self.innerHeight?n=self.innerHeight:document.documentElement&&document.documentElement.clientHeight&&(n=document.documentElement.clientHeight),document.body&&(t=document.body.clientHeight),t>n&&(n=t),n}}},Convert=new function(){this.ToInt32=function(n){return parseInt(n)};this.ToFloat=function(n){return parseFloat(n)}};Date.prototype.format=function(n){var r=this.getHours(),u="AM",t,i;n.indexOf("t")>-1&&r>12&&(r=r-12,u="PM");t={"M+":this.getMonth()+1,"d+":this.getDate(),"H+":r,"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds(),"t+":u};/(y+)/.test(n)&&(n=n.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(i in t)new RegExp("("+i+")").test(n)&&(n=n.replace(RegExp.$1,RegExp.$1.length==1?t[i]:("00"+t[i]).substr((""+t[i]).length)));return n};Date.prototype.addDays=function(n){return this.setTime(this.getTime()+n*864e5),this};String.prototype.endsWith||(String.prototype.endsWith=function(n,t){return(t===undefined||t>this.length)&&(t=this.length),this.substring(t-n.length,t)===n});typeof String.prototype.startsWith!="function"&&(String.prototype.startsWith=function(n){return this.indexOf(n)==0});String.prototype.trim=function(){var n="";return this!=null&&(n=this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")),n};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};String.prototype.fulltrim=function(){return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,"").replace(/\s+/g," ")};String.prototype.contains=function(n){return this.indexOf(n)!=-1};String.prototype.replaceAll=function(n,t,i){return this.replace(new RegExp(n.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g,"\\$&"),i?"gi":"g"),typeof t=="string"?t.replace(/\$/g,"$$$$"):t)}