"use strict";function Logout(){bootbox.confirm({size:"small",title:"Logout",message:"Are you sure you want to Logout?",callback:function(n){return LogoutConfirmed(n),!1}})}function LogoutConfirmed(n){n===!0?window.location.href=logoutUrl:bootbox.hideAll()}function ShowSuccessModal(n){$("#successModal .modal-body").html(n);$("#successModal").modal("show")}function ShowErrorModal(n){$("#errorModal .modal-body").html(n);$("#errorModal").modal("show")}function LogUsage(n,t,i,r){var f="Object: "+r.innerText+" | URL: "+encodeURIComponent(r.href),u,e="/LogUsage/LogUsage.aspx?Event=175&User="+i+"&Procedure="+t+"&Params="+f;u=isIE()&&isIE()<10?new window.XDomainRequest:new XMLHttpRequest;u.open("POST",e,!0);u.send()}function isIE(){var n=navigator.userAgent.toLowerCase();return n.indexOf("msie")!==-1?parseInt(n.split("msie")[1]):!1}function doRemittanceWindow(n,t,i,r){if(window.RemittanceWindow&&window.RemittanceWindow.closed===!1){window.RemittanceWindow.focus();return}n=n||"";t=t||"";i=i||getYesterdaysDate();r=r||"N";const u=425,f=430;var e=screen.availHeight/2-f/2,o=screen.availWidth/2-u/2,s=",left="+o+",top="+e;window.RemittanceWindow=window.open("/CISFBSYS/CarrierReporting/RemittanceCriteria.asp?CheckNo="+n+"&ACHNo="+t+"&Date="+i+"&QueryType="+r,"RemittanceWindow","width="+u+",height="+f+s+",scrollbars=yes")}function doRejectWindow(){if(window.RejectWindow&&window.RejectWindow.closed===!1){window.RejectWindow.focus();return}const n=375,t=550;var r=screen.availHeight/2-t/2,u=screen.availWidth/2-n/2,f=",left="+u+",top="+r,i=getYesterdaysDate();window.RejectWindow=window.open("/CISFBSYS/CarrierReporting/RejectCriteria.asp?FromDate="+i+"&ToDate="+i,"RejectWindow","width="+n+",height="+t+f)}function doProcessWindow(n){if(window.ProcessWindow&&window.ProcessWindow.closed===!1){window.ProcessWindow.focus();return}const t=375,i=270;var u=screen.availHeight/2-i/2,f=screen.availWidth/2-t/2,e=",left="+f+",top="+u,r=getYesterdaysDate();window.ProcessWindow=window.open("/CISFBSYS/CarrierReporting/ProcessSummaryCriteria.asp?FromDate="+r+"&ToDate="+r+"&ReportType="+n,"ProcessWindow","width="+t+",height="+i+e)}function doInvoiceRouteWindow(n){if(window.FBAWindow&&window.FBAWindow.closed===!1){window.FBAWindow.focus();return}const t=570,i=570;var u=screen.availHeight/2-i/2,f=screen.availWidth/2-t/2,r=",left="+f+",top="+u;window.FBAWindow=n.length>0?window.open("/CISFBSYS/FBA/Routing/RouteCriteria.asp?"+n,"RouteWindow","width="+t+",height="+i+r):window.open("/CISFBSYS/FBA/Routing/RouteCriteria.asp","RouteWindow","width="+t+",height="+i+r)}function doContactWindow(){if(window.Contact&&window.Contact.closed===!1){window.Contact.focus();return}window.Contact=window.open("http://www.cassinfo.com/en/Corporate/Contact-Us.aspx","Contact","width=1000,height=700,scrollbars=1,resizable=1",!0)}function doCassPortGuideWindow(n){if(window.CarrierGuide&&window.CarrierGuide.closed===!1){window.CarrierGuide.focus();return}window.CarrierGuide=n===1?window.open("/CISFBSYS/Login/Manuals/CassPortCarrierTraining, English edition.pdf","CarrierGuide","width=900,height=800,scrollbars=1,resizable=1",!0):window.open("/CISFBSYS/Login/Manuals/CassPortCarrierTraining,Spanish edition.pdf","CarrierGuide","width=900,height=800,scrollbars=1,resizable=1",!0)}function doClientManualsWindow(){if(window.ClientManualsWindow&&window.ClientManualsWindow.closed===!1){window.ClientManualsWindow.focus();return}const n=350,t=225;var i=screen.availHeight/2-t/2,r=screen.availWidth/2-n/2,u=",left="+r+",top="+i;window.ClientManualsWindow=window.open("/CISFBSYS/Metric/ClientManuals.asp","ClientManualsWindow","resizable=yes,scrollbars=yes,width="+n+",height="+t+u)}function doBillingGuidesWindow(){if(window.BillingGuideWindow&&window.BillingGuideWindow.closed===!1){window.BillingGuideWindow.focus();window.BillingGuideWindow.location="/CISFBSYS/BillingInstructions/BillingGuideSearch.asp";return}const n=200,t=400;var i=screen.availHeight/2-n/2,r=screen.availWidth/2-t/2,u=",left="+r+",top="+i;window.BillingGuideWindow=window.open("/CISFBSYS/BillingInstructions/BillingGuideSearch.asp","BillingGuideWindow","width="+t+",height="+n+u)}function doPerfMetricsWindow(){if(window.PerfMetricWindow&&window.PerfMetricWindow.closed===!1){window.PerfMetricWindow.focus();return}const n=375,t=430;var i=screen.availHeight/2-t/2,r=screen.availWidth/2-n/2,u=",left="+r+",top="+i;window.PerfMetricWindow=window.open("/CISFBSYS/ClientRelations/CLRReportingCriteria.asp?FromDate=&ToDate=","PerfMetricWindow","width="+n+",height="+t+u)}function getYesterdaysDate(){var n=new Date;n.setDate(n.getDate()-1);var t=n.getDate(),i=n.getMonth()+1,r=n.getFullYear();return i+"/"+t+"/"+r}const logoutUrl="/CassAuth/identity/logout";$(function(){Storage.prototype.setObject||(Storage.prototype.setObject=function(n,t){this.setItem(n,JSON.stringify(t))});Storage.prototype.getObject||(Storage.prototype.getObject=function(n){var t=this.getItem(n);return t&&JSON.parse(t)});$('[data-toggle="tooltip"]').tooltip();$('[data-toggle="popover"]').popover({trigger:"focus"});$(".dropdown-submenu > a").on("click",function(n){$(this).next("ul").toggle();n.stopPropagation();n.preventDefault()})});