function LookupAddress(n,t,i,r,u,f){var e={AddressID:t,CityID:i,StateID:r,ZipID:u,CountyID:f};ProcessAddressAutocomplete(n,e)}function ProcessAddressAutocomplete(n,t){$.get(n+"/API/AddressAutocomplete",{lookup:$("#"+t.AddressID).val()},function(i){if(i!=null){var r=[];$.each(i,function(){var n={value:this.PlaceID,label:this.Description,address:this.Address};r.push(n)});$("#"+t.AddressID).autocomplete({source:r,select:function(i,r){return $("#"+t.AddressID).val(r.item.address),ProcessAddressDetails(n,r.item.value,t),!1}})}})}function ProcessAddressDetails(n,t,i){$.get(n+"/API/AddressDetail",{placeID:t},function(n){n!=null&&($("#"+i.CityID).length&&$("#"+i.CityID).val(n.City).change(),$("#"+i.StateID).length&&$("#"+i.StateID).val(n.State).change(),$("#"+i.ZipID).length&&$("#"+i.ZipID).val(n.Zip).change(),$("#"+i.CountyID).length&&($("#"+i.CountyID+" option:contains('"+n.County+"')").length?$("#"+i.CountyID+" option:contains('"+n.County+"')").prop("selected",!0).change():$("#"+i.CountyID).val("").change()))})}function AjaxDelegate(n,t){this.url=n;this.callback=t;this.callbackArguments=arguments;this.Fetch=function(n){var t=this.callbackArguments,r=this.callback,u=this.url;n==null&&(n="html");$.ajax({url:u,success:function(n){var u=[];for(u[0]=n,i=2;i<t.length;i++)u[i-1]=t[i];r.apply(this,u)},dataType:n})};this.Post=function(n){var t=this.callbackArguments,r=this.callback,u=this.url;$.post(u,n,function(n){var u=[];for(u[0]=n,i=2;i<t.length;i++)u[i-1]=t[i];r.apply(this,u)})}}function AjaxDropDownController(n,t,r,u){function s(n){if(n!=null){var t=r+"?LookUpType="+f.lookupName;n!=undefined&&n!=""&&(t+="&InputID="+n);$.get(t,function(n){y(n)},"xml")}}function h(n){for(var r=e.length,i=!1,t=0;t<r;t++)if(e[t]==n){i=!0;break}i||(e[e.length]=n)}function o(){if(e.length>0){var filter="",oSelect=document.getElementById(f.controlClientId);for(oSelect!=null&&oSelect.selectedIndex!=-1&&(filter=oSelect.options[oSelect.selectedIndex].value),i=0;i<e.length;i++)eval(e[i]+".load(filter);")}}function c(n){this.getSource(n)}function l(){(oSelect=document.getElementById(f.controlClientId))&&((hidden=document.getElementById(f.hiddenId))||(hidden=document.createElement("input"),hidden.id=f.hiddenId,hidden.name=f.hiddenId,hidden.type="hidden",oSelect.form.appendChild(hidden)))}function a(){(oSelect=document.getElementById(f.controlClientId))&&(oSelect.options.length==0||oSelect.options.length==1&&oSelect.attributes.BlankText.value.length>0?this.load():this.persist(oSelect),oSelect.attachEvent?oSelect.attachEvent("onchange",o):oSelect.addEventListener?oSelect.addEventListener("change",o,!1):oSelect.onchange=o)}function v(n){for(var t="",i=0;i<n.options.length;i++)t+=n.options[i].text+f.delimiter+n.options[i].value+f.delimiter;t.substr(t.length-1,1)==f.delimiter&&(t=t.substr(0,t.length-1));(hidden=document.getElementById(f.hiddenId))&&(hidden.value=t)}function y(n){var i,u;if((oSelect=document.getElementById(f.controlClientId))&&oSelect!=null){for(i=oSelect.length-1;i>=0;i--)oSelect.options[i]=null;var r=0,t="",e=oSelect.attributes.BlankText.value,o=oSelect.attributes.BlankText.value;e.length>0&&(oSelect.options[0]=new Option(e,o,!1,!1),r=1);$(n).find("Item").each(function(){var n=$(this).attr("value"),i=$(this).text();oSelect.options[r]=f.initialValue!=null&&n==f.initialValue?new Option(i,n,!1,!0):new Option(i,n,!1,!1);t+=i+f.delimiter+n+f.delimiter;r++});t.substr(t.length-1,1)==f.delimiter&&(t=t.substr(0,t.length-1));(oHidden=document.getElementById(f.hiddenId))&&(oHidden.value=t);oSelect.selectedIndex>-1&&(oSelect.fireEvent?oSelect.fireEvent("onchange"):oSelect.dispatchEvent&&(u=document.createEvent("HTMLEvents"),u.initEvent("change",!0,!0),oSelect.dispatchEvent(u)))}}var f=this,e;this.controlClientId=n;this.hiddenId="__"+f.controlClientId;this.lookupName=t;this.baseUrl=r;this.delimiter="|";this.initialValue=u;e=[];this.getSource=s;this.addObserver=h;this.notify=o;this.load=c;this.initHidden=l;this.initData=a;this.persist=v}function StartTimer(){CheckAlerts();AlertTimer=window.setInterval("CheckAlerts()",2e4)}function StopTimer(){clearInterval(AlertTimer)}function AlertObject(n,t,i){this.ID=n;this.Type=t;this.Notified=i}function CheckAlerts(){var n=new AjaxDelegate("/Common/ajax/AlertLookup/AlertLookup.aspx",ProcessCheckAlertsResponse);n.Fetch("xml")}function ProcessCheckAlertsResponse(n){var t,i,r;NormalList=[];InteractiveList=[];t=!1;$(n).find("SessionTimeout").each(function(){return t=!0,StopTimer(),!1});t||(i=0,r=0,$(n).find("UserAlert").each(function(){var t=$(this).attr("ID"),n=$(this).attr("Type"),u=$(this).attr("Notified")=="True";n=="INT"?InteractiveList[i++]=new AlertObject(t,n,u):n=="NORM"&&(NormalList[r++]=new AlertObject(t,n,u))}),NormalList.length>0?ModifyAlertIcon("ON",NormalList.length):ModifyAlertIcon("OFF",0),DisplayInteractiveReminders())}function ModifyAlertIcon(n,t){var i=$("#AlertIcon i");i!=null&&i.length>0&&(n=="ON"?i.addClass("faa-wrench animated").css("color","#D03636").prop("title",t+" New "+(t>1?"Alerts":"Alert")):i.prop("title","No New Alerts"))}function DisplayInteractiveReminders(){var n,t,i;if(InteractiveList.length>0){for(n="",t=0;t<InteractiveList.length;t++)InteractiveList[t].Notified||(n.length>0&&(n+=","),n+=InteractiveList[t].ID);n.length>0&&(i=document.getElementById("AlertsSystem_ifr"),window.CmsPopup_divAlertsSystem_Display&&i!=null?(i.src="/Common/Ajax/AlertLookup/AlertViewer.aspx",CmsPopup_divAlertsSystem_Display(null)):alert("Alerts system display is not configured correctly."))}}function ForceDisplay(n,t){var i=document.getElementById("AlertsSystem_ifr");window.CmsPopup_divAlertsSystem_Display&&i!=null?(i.src="/Common/Ajax/AlertLookup/AlertViewer.aspx?RIDS="+n,CmsPopup_divAlertsSystem_Display(t)):alert("Alerts system display is not configured correctly.")}function ProcessButtonClick(n,t,i){var u,r;if(i==null&&(i="PLEASE WAIT ..."),t!=null)if(t.ValidateInput==null&&(document.forms[0].onsubmit!=null&&OriginalFormOnSubmit==null&&(OriginalFormOnSubmit=document.forms[0].onsubmit,document.forms[0].onsubmit=function(){return!0}),t.ValidateInput=OriginalFormOnSubmit!=null?OriginalFormOnSubmit:function(){return!0}),t.ValidateInput()){i.length>0&&(t.value=i);switch(n.toUpperCase()){case"SELF":t.disabled=!0;t.style.cursor="wait";break;case"ALL":case"DISABLEALL":for(u=0;u<document.forms[0].elements.length;u++)r=document.forms[0].elements[u],r!=null&&(r.type=="submit"||r.type=="button")&&(r.disabled=!0,r.id==t.id&&(r.style.cursor="wait"))}__doPostBack(t.name)}else return!1}function cbm_ToggleSelectAll(n){var r="",u=$("#"+n),t,i,f;if(u!=null){for(t=u.parent();r.length==0&&t!=null;){if(t.is("div")&&t.attr("id").length>0){r=t.attr("id");break}t=t.parent()}i=$("#"+r+" input[type=checkbox]");i!=null&&i.length>0&&(f=u.prop("checked")?!0:!1,i.prop("checked",f),i.each(function(n){n>0&&$(this).triggerHandler("click")}))}}function checkFormat(n,t,i){var r="",u;return(t.charAt(0)=="/"&&(t=new String(t.substr(1,t.length-2))),u=new RegExp(t),n.search(u)!=0&&(r=i),r.length>0)?r=="none"?!1:(alert(r),!1):!0}function DateRangeLookup(n,t,i,r){var u=n+"/Common/ajax/DateRangeLookup/DateRangeLookup.aspx?DRID="+t+"&DRPID="+i+"&HFID="+r;$.ajax({url:u,dataType:"jsonp"})}function ProcessDateRangeLookupResponse(data){var div,dte1,dte2,dte1val,dte2val;if(data.Invalid!="INVALID"){var dates=data.Dates,RangeID=data.RangeID,DateRangePanelID=data.PanelID,HiddenFieldID=data.HiddenID,hid=document.getElementById(HiddenFieldID);hid!=null&&(hid.value=RangeID);div=$("#"+DateRangePanelID);div.length>0&&(dte1=null,dte2=null,div.attr("DateObject1").length>0&&(dte1=$("#"+div.attr("DateObject1"))),div.attr("DateObject2").length>0&&(dte2=$("#"+div.attr("DateObject2"))),dte1val="",dte2val="",dates.length>0&&(dte1val=dates.substr(0,dates.indexOf("|")),dte2val=dates.substr(dates.indexOf("|")+1)),dte1!=null&&(dte1.val(dte1val),dte1.change()),dte2!=null&&(dte2.val(dte2val),dte2.change()));eval("CmsPopup_"+DateRangePanelID+"_Close()")}}function OpenRangePicker(n){var t=$("#"+n),i;t.length>0&&(i="",i=t.attr("DateObject1").length>0&&t.attr("DateObject2").length>0?"Insert Date Range":"Insert Date",OpenPopupObject(n,null,null))}function CellMouseOver(n){n!=null&&(n.className=n.className=="ListNormalAccent"?"ListNormal":"ListNormalAccent")}function DropDownController(n){function f(n){for(var u=t.length,r=!1,i=0;i<u;i++)if(t[i]==n){r=!0;break}r||(t[t.length]=n)}function r(){var filter="",oSelect=document.getElementById(u.controlClientId);for(oSelect!=null&&oSelect.selectedIndex!=-1&&(filter=oSelect.options[oSelect.selectedIndex].value),i=0;i<t.length;i++)eval(t[i]+".load(filter);")}var u=this,t=[];this.controlClientId=n;this.addObserver=f;this.notify=r;(oSelect=document.getElementById(u.controlClientId))&&(oSelect.attachEvent?oSelect.attachEvent("onchange",r):oSelect.addEventListener?oSelect.addEventListener("change",r,!1):oSelect.onchange=r)}function jsEditCheckBoxList(n,t,i){var u=!1,f=!1,s,h,e,c,o,r;if(i){if(n.childNodes.length>0&&(s=n.childNodes[0],s.rows.length>0))for(h=s.rows[0],e=0;e<h.cells.length&&!f;e++)for(c=h.cells[e],o=0;o<c.childNodes.length&&!f;o++)r=c.childNodes[o],r.type=="checkbox"&&r.checked?u=!0:r.type=="text"&&(r.value.length!=0||r.style.visibility!="visible"||r.disabled||(alert("Please fill out all required "+t+" information."),r.select(),r.focus(),u=!1,f=!0))}else u=!0;return u||f||alert("Please select a "+t+"."),u}function jsEditDate(n,t,i){if(i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1;if(mmddyyyy=n.search(/^\d{2}\/\d{2}\/\d{4}$/),mddyyyy=n.search(/^\d{1}\/\d{2}\/\d{4}$/),mmdyyyy=n.search(/^\d{2}\/\d{1}\/\d{4}$/),mdyyyy=n.search(/^\d{1}\/\d{1}\/\d{4}$/),mmddyyyy==-1&&mddyyyy==-1&&mmdyyyy==-1&&mdyyyy==-1)return alert(t+" must be mm/dd/yyyy; try again."),!1;if((slashInd=n.indexOf("/",0),testMonth=n.substring(0,slashInd),secondslashInd=n.indexOf("/",slashInd+1),testDay=n.substring(slashInd+1,secondslashInd),testYear=n.substring(secondslashInd+1,n.length),testMonth.length==1&&(testMonth="0"+testMonth),testDay.length==1&&(testDay="0"+testDay),ptestYear=parseFloat(testYear),ptestMonth=parseFloat(testMonth),ptestDay=parseFloat(testDay),ptestMonth<1||ptestMonth>12||ptestDay<1||ptestDay>31||ptestYear<1900||ptestYear>2100)||!isDate(ptestYear,ptestMonth,ptestDay))return alert(t+" is an invalid date; try again."),!1}else return!0;return!0}function jsEditSmallDate(n,t,i){if(i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1;if(mmyyyy=n.search(/^\d{2}\/\d{4}$/),myyyy=n.search(/^\d{1}\/\d{4}$/),mmyyyy==-1&&myyyy==-1)return alert(t+" must be mm/yyyy; try again."),!1;if((myyyy!=-1?(testYear=parseFloat(n.substring(2,6)),testMonth=parseFloat(n.substring(0,1))):mmyyyy!=-1&&(testYear=parseFloat(n.substring(3,7)),testMonth=parseFloat(n.substring(0,2))),testMonth<1||testMonth>12||testYear<1900||testYear>2100)||!isDate(testYear,testMonth,1))return alert("Please enter a valid Month/Year for "+t+"."),!1}else return!0;return!0}function jsEditAfterDate(n,t,i,r){if(i||n!=""){if(jsEditDate(n,t,i)==!1)return!1;var u=new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),f=new Date(n);if(r){if(f<u)return alert(t+" must be greater than or equal today's date."),!1}else if(f<=u)return alert(t+" must be greater than today's date."),!1}else return!0;return!0}function jsEditBeforeDate(n,t,i,r){if(i||n!=""){if(jsEditDate(n,t,i)==!1)return!1;var u=new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),f=new Date(n);if(r){if(f>u)return alert(t+" must be less than or equal today's date."),!1}else if(f>=u)return alert(t+" must be less than today's date."),!1}else return!0;return!0}function jsEditTime(n,t,i){var u,f,r;return i||n!=""?i&&n==""?(alert(t+" is a required field."),!1):(u=!0,f=/^\d{1,2}[:]\d{2}([:]\d{2})?( [AP][M])?$/i,f.test(n)||(u=!1),r=n.split(":"),(parseFloat(r[0])<1||parseFloat(r[0])>12)&&(u=!1),(parseFloat(r[1])<0||parseFloat(r[1])>59)&&(u=!1),r.length>2&&(parseFloat(r[2])<0||parseFloat(r[2])>59)&&(u=!1),!u)?(alert("Please enter a valid time for "+t+"."),!1):!0:!0}function jsEditDateTime(n,t,i,r){var f="",e="",u=!0;if(n.length==0&&!i)return!0;if(n.indexOf(" ")>=0)f=n.substr(0,n.indexOf(" ")),e=n.substr(n.indexOf(" ")+1);else return alert("Please enter a valid date and time for "+t+"."),!1;return u=r.toUpperCase()=="TRUE"?jsEditDate(f,t,i):jsEditSmallDate(f,t,i),u&&(u=jsEditTime(e,t,i)),u}function jsEditDateTimeForward(n,t,i,r){var f="",e="",u=!0;if(n.length==0&&!i)return!0;if(n.indexOf(" ")>=0)f=n.substr(0,n.indexOf(" ")),e=n.substr(n.indexOf(" ")+1);else return alert("Please enter a valid date and time for "+t+"."),!1;return u=r.toUpperCase()=="TRUE"?jsEditAfterDate(f,t,i,!0):jsEditSmallDate(f,t,i),u&&(u=jsEditTime(e,t,i)),u}function jsEditDateRangeYear(n,t,i,r){var f=!0,e=i.toString().replace("-",""),o=new Date(n),u=new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate());return u.setFullYear(u.getFullYear()+i),r=="PAST"&&o<u&&(alert(t+" must be within the past "+e+" years"),f=!1),r=="FUTURE"&&o>u&&(alert(t+" must be within the next "+e+" years"),f=!1),f}function jsValidateBeforeDate(n,t,i,r){var u=!0,f=$("#"+n).val(),e,o;return i||f!=""?jsEditDate(f,t,i)==!1?u=!1:(e=new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),o=new Date(f),r?o>e&&(alert(t+" must be less than or equal to today's date."),u=!1):o>=e&&(alert(t+" must be less than today's date."),u=!1)):u=!0,u}function jsValidateBeforeDateTooltip(n,t,i,r){var u=!0,f=$("#"+n).val(),e,o;return i||f!=""?jsEditDate(f,t,i)==!1?u=!1:(e=new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),o=new Date(f),r?o>e&&($("#"+n).attr("title",t+" must be less than or equal to today's date.").tooltip("fixTitle").tooltip("show"),u=!1):o>=e&&($("#"+n).attr("title",t+" must be less than today's date.").tooltip("fixTitle").tooltip("show"),u=!1)):u=!0,u}function jsValidateDateRange(n,t,i,r){var u=!0,f=new Date($("#"+n).val()),e=new Date($("#"+t).val());return f>e&&(alert(r+" cannot be set before the "+i+"."),u=!1),u}function jsValidateDateRangeTooltip(n,t,i,r){var u=!0,f=new Date($("#"+n).val()),e=new Date($("#"+t).val());return f>e&&($("#"+t).attr("title",r+" cannot be set before the "+i+".").tooltip("fixTitle").tooltip("show"),u=!1),u}function isDate(n,t,i){var r=makeArray(12);r[1]=31;r[2]=29;r[3]=31;r[4]=30;r[5]=31;r[6]=30;r[7]=31;r[8]=31;r[9]=30;r[10]=31;r[11]=30;r[12]=31;var e=parseFloat(n),u=parseFloat(t),f=parseFloat(i);return f>r[u]?!1:u==2&&f>daysInFebruary(e)?!1:!0}function daysInFebruary(n){return n%4==0&&(!(n%100==0)||n%400==0)?29:28}function makeArray(n){for(var i=new Array(n+1),t=1;t<=n;t++)i[t]=0;return i}function jsEditEmail(n,t,i){return i||n!=""?i&&n==""?(alert(t+" is a required field."),!1):(filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,filter.test(n)?!0:(alert(t+" does not appear to be a valid email address."),!1)):!0}function jsEditMemo(n,t,i){if(i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1}else return!0;return!0}function jsEditCurrency(n,t,i){return n=stripChar(n,"$"),jsEditNumber(n,t,i,2,0)}function jsEditNumber(n,t,i){return jsEditNumber(n,t,i,0)}function jsEditNumber(n,t,i,r,u,f){if(n=stripChar(n,","),i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1;var e="",o="";if(r>0?(e=n.search(/^\d*\.\d{2}$/),o="to "+r+" decimal places"):(e=n.search(/^[-|\d]\d*$/),o="with no decimal places"),e==-1)return alert(t+" must be a valid number "+o+"."),!1;if(u!=undefined&&!(parseFloat(n)>=u))return alert(t+" must be greater than or equal to "+u+"."),!1;if(f!=undefined&&!(parseFloat(n)<=f))return alert(t+" must be less than or equal to "+f+"."),!1}else return!0;return!0}function CheckPhoneNumber(n,t,i,r,u){var o=!0,f="",e="",s;return n.length>0?(isNaN(n)?(s=/\D/g,e=n.replace(s,"")):e=n,e.length<r&&r>0&&(f=t+" must be at least "+r+" digits."),e.length>u&&u>0&&(f=t+" must be less than "+u+" digits."),jsIsPhoneValid(n)||(f=t+" does not match requested format.")):i&&(f=t+" is a required field"),f.length>0&&(alert(f),o=!1),o}function jsEditPhone(n,t,i){return CheckPhoneNumber(n,t,i,10,0)}function jsEditText(n,t,i,r){if(i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1;if(n.length>r)return alert(t+" exceeds the maximum length ("+r+" characters)."),!1}else return!0;return!0}function jsEditText(n,t,i,r,u){if(i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1;if(n.length>r)return alert(t+" exceeds the maximum length ("+r+" characters)."),!1;if(n.length<u)return alert(t+" is less than the minimum length ("+u+" characters)."),!1}else return!0;return!0}function jsEditSSN(n,t,i){if(i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1;if(n.search(/^\d{3}-\d{2}-\d{4}$/)==-1)return alert(t+" must be a valid format (e.g., 123-45-6789)."),!1}else return!0;return!0}function jsEditTIN(n,t,i){if(i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1;if(n.search(/^\d{2}-\d{7}$/)==-1)return alert(t+" must be a valid format (e.g., 12-3456789)."),!1}else return!0;return!0}function jsEditECN(n,t,i){if(i||n!=""){if(i&&n=="")return alert(t+" is a required field."),!1;if(n.search(/^\d{1,15}$/)==-1)return alert(t+" must be a valid format (1-15 digits)."),!1}else return!0;return!0}function jsEditUserLookup(n,t,i){var u=!0,e=-1,f=$("#"+n.id),o=$("#"+n.id+"_val"),r;if(f.length==0)e=0,u=!1;else if(i&&f.val().length==0?(e=1,u=!1):f.val().length>0&&(o.length==0||o.length>0&&o.val().length==0)&&(e=2,u=!1),!u){r=t;switch(e){case 0:r+=": object not found.";break;case 1:r+=" is a required field.";break;case 2:r="The "+r+" field contains an invalid user."}alert(r);f.focus();f.select()}return u}function ShowFileDetail(n){$.ajax({url:"/Common/AjaxMethods.asmx/GetFileDetails",type:"POST",data:JSON.stringify({noteID:n}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(t){var r=$("#FileDetail-"+n),i=r.popover({title:"Associated Files",content:t.d,html:!0,trigger:"focus"}).popover("show");i.on("hidden.bs.popover",function(){i.popover("destroy")})}})}function ShowBoardActionFileDetails(n){$.ajax({url:"/Common/AjaxMethods.asmx/ShowBoardActionFileDetails",type:"POST",data:JSON.stringify({baID:n}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(t){var r=$("#FileDetail-"+n),i=r.popover({title:"Associated Files",content:t.d,html:!0,trigger:"focus"}).popover("show");i.on("hidden.bs.popover",function(){i.popover("destroy")})}})}function ProcessFlyout(n,t){var i=$("#"+t);i.length>0?i.css("display")=="none"?(i.css("width","500"),i.css("display","block"),i.css("position","absolute"),i.css("right",0),i.css("top",0)):i.css("display","none"):alert("object: "+t+" not found.")}function jsFormatDate(n){var u="",r="",f="",i="",t;return n=n.replace(/[^\d]/g,""),t=n.length,isNaN(n)||(t==7||t==8)&&(u=n.substring(t,t-4),f=n.substring(t-6,t-4),r=n.substring(0,t-6),i=(r.length==1?"0":"")+r+"/"+f+"/"+u),i.length==0&&(i=n),i}function jsFormatMonthYear(n){var u="",r="",i="",t;return n=n.replace(/[^\d]/g,""),t=n.length,isNaN(n)||(t==5||t==6)&&(u=n.substring(t,t-4),r=n.substring(0,t-4),i=(r.length==1?"0":"")+r+"/"+u),i.length==0&&(i=n),i}function jsFormatTime(n){var i="",r="",e="",f="",t=n.length,o="",u,s,h;for(ary=[" ",":"],u=0,u=0;u<ary.length;u++)while(n.indexOf(ary[u])>=0)n=n.substr(0,n.indexOf(ary[u]))+n.substr(n.indexOf(ary[u])+1);return t=n.length,s=n.substr(t-2).toUpperCase(),h=n.substr(t-1).toUpperCase(),s=="AM"||s=="PM"?(o=s,n=n.substr(0,t-2)):(h=="A"||h=="P")&&(o=h=="A"?"AM":"PM",n=n.substr(0,t-1)),t=n.length,isNaN(n)||(t==3||t==4?(r=n.substring(t,t-2),r>=60&&(r=59),i=n.substring(0,t-2),i>=12&&(i=12),f=i+":"+r):(t==5||t==6)&&(e=n.substring(t,t-2),e>=60&&(e=59),r=n.substring(t-2,t-4),r>=60&&(r=59),i=n.substring(0,t-4),i>=12&&(i=12),f=i+":"+r+":"+e),t>=3&&(f+=o.length>0?" "+o:i>6&&i<12?" AM":" PM")),f.length==0&&(f=n),f}function jsFormatDateTime(n,t){var i="",r="",u="";return n.indexOf(" ")>=0?(i=n.substr(0,n.indexOf(" ")),r=n.substr(n.indexOf(" ")+1)):i=n,u=t.toUpperCase()=="TRUE"?jsFormatDate(i):jsFormatMonthYear(i),r.length>0&&(u+=" "+jsFormatTime(r)),u}function jsFormatEmail(n){return(filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,n=="")?n:(filter.test(n)||alert("The email entered does not appear to be a valid email address."),n)}function jsFormatCurrency(n){return fmtVal=n,n.length>0&&(n=stripChar(n,"$"),n=stripChar(n,","),isNaN(n)||(decIndex=n.indexOf("."),fmtVal=decIndex>-1?"$"+n:"$"+n+".00")),fmtVal}function jsFormatPhone(n){var i=n,t="",r=n.length,f,e,o,u=!1;return n.length>0&&(n=n.replace(/[^0-9]/g,""),r=n.length,isNaN(n)||(r==10?(f=n.substring(0,3),e=n.substring(3,6),o=n.substring(6,r),t=f+"-"+e+"-"+o,u=!0):(i.match(/^\+(?:[0-9] ?){6,14}[0-9]$/)&&(u=!0),t=i)),u||alert('The phone number entered does not match expected formats.\n\n1. Ten digits for non-international numbers (e.g., 123-456-7890).\n2. International numbers must start with a "+" (e.g., +44 12345 6789).\n\nPlease confirm that you have entered the phone number correctly.')),t.length==0&&(t=i),t}function jsIsPhoneValid(n){var t=!1,i=n,r=n.replace(/[^0-9]/g,"");return r.length==10?t=!0:i.match(/^\+(?:[0-9] ?){6,14}[0-9]$/)&&(t=!0),t}function jsFormatSSN(n){var i="",r="",u="",t="",f=n.length;return isNaN(n)||f==9&&(i=n.substring(0,3),r=n.substring(3,5),u=n.substring(5,f),t=i+"-"+r+"-"+u),t.length==0&&(t=n),t}function jsFormatTIN(n){var i="",r="",t="",u=n.length;return isNaN(n)||u==9&&(i=n.substring(0,2),r=n.substring(2,u),t=i+"-"+r),t.length==0&&(t=n),t}function jsFormatZip(n){var t=new Array(4);t[0]=" ";t[1]="-";for(var e=n,i="",r=n.length,u=0,f=0,o,s,f=0;f<t.length;f++)for(u=n.indexOf(t[f]);u>=0;)r=n.length,n=n.substring(0,u)+n.substring(u+1,r),u=n.indexOf(t[f]);return r=n.length,isNaN(n)||(r==9?(o=n.substring(0,5),s=n.substring(5,r),i=o+"-"+s):i=e),i.length==0&&(i=e),i}function isValidZip(n,t,i){if(i&&n=="")return alert(t+" is a required field."),!1;if(n.length>0){var r=/(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$)/.test(n);if(!r)return alert(t+" does not appear to be valid."),!1}return!0}function GetAlert(n,t,i,r,u,f,e,o,s,h){window.parent.StopTimer();var c="/Common/ajax/AlertLookup/AlertLookup.aspx?rID="+n,l=new AjaxDelegate(c,DisplayAlert,t,i,r,u,f,e,o,s,h);l.Fetch("xml")}function DisplayAlert(n,t,i,r,u,f,e,o,s,h){var c="";$(n).find("UserAlert").each(function(){c+=$(this).find("ID").text();t.innerHTML=$(this).find("DateActive").text();i.innerHTML=$(this).find("MessageTitle").text();r.innerHTML=$(this).find("MessageText").text();u.innerHTML=$(this).find("Status").text();f.innerHTML=$(this).find("Type").text();e.innerHTML=$(this).find("DateViewed").text();o.innerHTML=$(this).find("DateCompleted").text();s.innerHTML=$(this).find("CreatedUser").text();h.innerHTML=$(this).find("CreatedDate").text();$(this).find("Type").text()=="Interactive"?$("#SaveNewLink").hide():$("#SaveNewLink").show()})}function ProcessClose(){window.parent.location.toString().toUpperCase().indexOf("/REMHOME.ASPX")>=0?window.parent.location=window.parent.location:window.parent.CmsPopup_divAlertsSystem_Close?(window.parent.StartTimer(),window.parent.CmsPopup_divAlertsSystem_Close()):alert("An error occurred while closing the active alert.")}function ReminderMarkComplete(n){var t="/Common/ajax/AlertLookup/AlertViewer.aspx?RIDS="+n+"&FUNCTION=CMP",i=new AjaxDelegate(t,EmptyFunction);i.Fetch()}function ReminderSaveAsNew(n){var t="/Common/ajax/AlertLookup/AlertViewer.aspx?RIDS="+n+"&FUNCTION=NEW",i=new AjaxDelegate(t,EmptyFunction);i.Fetch()}function EmptyFunction(n){n.length>0&&n=="COMPLETE"&&ProcessClose()}function GetElementTop(n){var t=0;return n!=null&&(t+=n.offsetTop,n.offsetParent!=null&&(t+=GetElementTop(n.offsetParent))),t}function GetElementLeft(n){var t=0;return n!=null&&(t+=n.offsetLeft,n.offsetParent!=null&&(t+=GetElementLeft(n.offsetParent))),t}function SetupAddFields(n){var t=document.title;t!=n&&(t.indexOf(" - "+n)>=0&&(t=t.substr(0,t.indexOf(" - "+n))),t.length>0&&$("#qlDesc").val(t));$("#qlURL").val(document.location)}function GetQuickLinks(n){$.ajax({url:"/Common/ajax/QuickLinks/GetQuickLinksByUser.aspx",datatype:"html",success:function(t){t!=null&&t.length>0&&(CreateQLDialog(t),SetupAddFields(n))}})}function CreateQLDialog(n){$(n).dialog({modal:!0,title:"Quick Links",width:"450",buttons:{Add:function(){AddQuickLink()}},close:function(){$(this).dialog("destroy")}})}function AddQuickLink(){$("#qlDesc").length>0&&($("#qlDesc").val().length>0?$.post("/Common/ajax/QuickLinks/AddQuickLink.aspx","QLDESC="+$("#qlDesc").val()+"&URL="+escape($("#qlURL").val()),function(n){n.length>0&&(n=="INVALID"?alert("The Quick Link you entered could not be added.  Please contact a system administrator."):$("#qlDesc").val(""),$(".ui-dialog-content").dialog("close"))}):(alert("Please enter a quick link description."),$("#qlDesc").focus()))}function DeleteQuickLink(n){$.post("/Common/ajax/QuickLinks/DeleteQuickLink.aspx","QLID="+n,function(n){n.length>0&&(n=="INVALID"&&alert("The Quick Link you selected could not be deleted.  Please contact a system administrator."),$(".ui-dialog-content").dialog("close"))})}function GetFilters(n,t){var i=[],r=[];$.ajax({type:"POST",url:"/Common/GridService.aspx/GetFilters",data:JSON.stringify({id:n}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(u){var f,e;$("#FilterList li").remove();f=$('<div id="divGvFilters"><ul id ="FilterList"><\/ul><\/div>');$.each(u.d,function(t,u){r.push(u.name);i.push('<li> <a id = "FilterDefaultLink'+u.id+'" style="float:left; padding-right:5px;" href = "javascript:Default('+u.id+",&#39"+n+"&#39 , "+u.isdefault+');" title ="'+(u.isdefault?"Make undefault":"Make default")+'"> <img src = "'+document.f1rst.ProfilePath+"/Common/images/"+(u.isdefault?'info_green.png"':'info_red.png"')+'> <\/a><a class = "goLeft" href = "javascript:Applyfilter('+u.id+", &#39"+n+'&#39);" >'+u.name+'<a id = "FilterDeleteLink'+u.id+'" class = "goRight" href = "javascript:Deletefilter('+u.id+');" title = "Delete Filter"> <i class="fa fa-times text-danger"><\/i> <\/a><\/li>')});f.find("#FilterList").append(i.join(""));f.append('<div style="clear: both;"><\/div>');f.append('<div><p>To save the current grid state enter a name below and press the Save New Filter button.<\/p><label for = "FilterName">New Filter Name<\/label><input id = "FilterName" type="text" maxlength="35"><\/div>');e=$("html").is(".lt-ie10")?null:{my:"right top",at:"left bottom",of:t};f.dialog({title:"Saved Filters",modal:!0,position:e,resizable:!1,buttons:{"Save New Filter":function(){SaveFilter(n,r)}},draggable:!1});window.gvipopup=f},error:function(n){alert(n.responseText)}})}function SaveFilter(n,t){var f=!0,r=$("#FilterName").val(),u;if(r.length>0){if(t.length>0)for(u=t,i=0;i<u.length;i++)u[i]==r&&(f=!1);f==!0?$.ajax({type:"POST",url:"/Common/GridService.aspx/SaveFilter",data:JSON.stringify({name:r,gvid2:n,isdefault:0}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(){window.gvipopup!=null&&(window.gvipopup.dialog("destroy").remove(),window.gvipopup=null)},error:function(n){alert(n.responseText)}}):alert("There is already a saved filter with this name.")}else alert("Please enter a filter name.")}function Default(n,t,i){$.ajax({type:"POST",url:"/Common/GridService.aspx/SaveDefault",data:JSON.stringify({id:n,gvid2:t,isdefault:i}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(){window.gvipopup!=null&&(window.gvipopup.dialog("close"),window.gvipopup=null)},error:function(n){alert(n.responseText)}})}function Applyfilter(n,t){$.ajax({type:"POST",url:"/Common/GridService.aspx/Applyfilter",data:JSON.stringify({id:n,gvid2:t}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(){window.location.reload()},error:function(n){alert(n.responseText)}})}function Deletefilter(n){var t=confirm("Are you sure you wish to delete this filter?");t==!0&&$.ajax({type:"POST",url:"/Common/GridService.aspx/Deletefilter",data:JSON.stringify({id:n}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(){$("#FilterDeleteLink"+n).parent().remove()},error:function(n){alert(n.responseText)}})}function gv_setprop(n){$.ajax({type:"POST",url:"/Common/GridService.aspx/SetInfo",data:JSON.stringify({src:n}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n!=null&&n.d&&window.location.reload()},error:function(n){alert(n.responseText)}})}function GetChecklistInfo(n,t){var i=$(t).siblings(".popover");i.length>0?i.popover("destroy"):$.ajax({type:"POST",url:"/common/AjaxMethods.asmx/LoadPendingChecklistItems",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({claimID:n}),success:function(n){var r,i,u;if(n!=null&&n.d!=null){r=$.parseJSON(n.d);i="";$.each(r,function(n,t){i+=t+"<br />"});r.length==0&&(i+="None");u=t.popover({title:"Pending Checklist Items",content:i,html:!0,trigger:"focus"}).popover("show");u.on("hidden.bs.popover",function(){u.popover("destroy")})}}})}function JumpToCertRequest(){var n=$("#jumpCert").val(),t=$("#jumpCertType").val(),i,r;n!=""&&t!=""?(i="/Common/ajax/JumpTo/JumpToCase.aspx?CERTID="+n+"&TYPEID="+t,r=new AjaxDelegate(i,ProcessJumpToResponse),r.Fetch()):alert("Please enter a valid Certification # and License Type.")}function JumpToSocialRequest(){var n=$("#jumpSocial").val(),t,i;n!=""?(t="/Common/ajax/JumpTo/JumpToCase.aspx?SOCIAL="+n,i=new AjaxDelegate(t,ProcessJumpToResponse),i.Fetch()):alert("Please enter a valid Social Security #.")}function JumpToConfRequest(){var n=$("#jumpConf").val(),t,i;n!=""?(t="/Common/ajax/JumpTo/JumpToCase.aspx?CONFIRM="+n,i=new AjaxDelegate(t,ProcessJumpToResponse),i.Fetch()):alert("Please enter a valid Confirmation #.")}function ProcessJumpToResponse(n){n.length>0&&(n=="ERROR"?alert("Error occurred - please contact a system administrator."):n=="INVALID - GENERIC"?alert("A match was not found for the values entered, please try again."):n=="INVALID - PERMISSIONS"?alert("You do not have permission to view this Record. Please contact a system administrator."):document.location=n)}function GetJumpTo(){$.ajax({url:"/Common/ajax/JumpTo/JumpTo.aspx",datatype:"html",success:function(n){n!=null&&n.length>0&&CreateJumpToDialog(n)}})}function CreateJumpToDialog(n){var t=$(n).dialog({appendTo:"#Form1",modal:!0,title:"Jump To",width:"500",close:function(){$(this).dialog("destroy")}})}function MenuItem(n,t,i,r,u,f,e,o,s,h,c){this.id=n;this.title=t;this.location=i;this.cssclass=r;this.moclass=u;this.linkclass=f;this.levelX=e;this.levelY=o;this.showbullet=s;this.SubItems=[];this.target=h;this.tooltip=c}function DisplayMenu(){MenuData!=null&&MenuData.Menu.length>0?DisplaySubMenu(MenuData.Menu,!1):alert("MenuMethods.DisplayMenu: MenuData not initialized correctly.")}function GenerateMenuItem(n){var t=null;return n!=null&&(t=$("<a>"+n.title+"<\/a>"),t.attr("id","LNK"+n.id),n.linkclass!=null&&t.addClass(n.linkclass),n.location.length>0?(t.attr("href",n.location),n.target=="POPUP"||(n.target.length>0&&t.attr("target",n.target),n.tooltip!=null&&n.tooltip.length>0&&t.attr("title",n.tooltip))):(t.attr("href","#"),t.addClass("nolink")),n.SubItems!=null&&n.SubItems.length>0&&t.addClass("flyout")),t}function DisplaySubMenu(n){var t,u,i,e,r,f;if(MenuData==null){alert("MenuMethods.DisplaySubMenu: MenuData not initialized correctly.");return}for(t=0;t<n.length;t++){if(u=$('<li id="'+n[t].id+'"><\/li>'),n[t].cssclass!=null&&u.addClass(n[t].cssclass),i=GenerateMenuItem(n[t]),i!=null&&u.append(i),n[t].SubItems!=null&&n[t].SubItems.length>0){for(e=$("<ul><\/ul>"),r=0;r<n[t].SubItems.length;r++)f=$("<li><\/li>"),n[t].SubItems[r].cssclass!=null&&f.addClass(n[t].SubItems[r].cssclass),i=GenerateMenuItem(n[t].SubItems[r]),i!=null&&(f.append(i),e.append(f));u.append(e)}$("#MenuOutput").append(u)}}function OpenPopupObject(n,t,i){var r=$("#"+n),u;if(r!=null){if(t!=null&&t=="mouse"&&i!=null){var f=r.dialog("option","width"),e=i.pageX||i.clientX,o=i.pageY||i.clientY;r.dialog("option","position",[e-f,o])}r.find("iframe").length>0&&(u=r.dialog("option","height"),u=="auto"&&r.find("iframe").css("height","400px"));r.dialog("open")}}function RegisterPopup(n,t,i,r,u,f){i==null&&(i=250);r==null&&(r=!0);$(function(){var e=$("#"+n).dialog({title:t,autoOpen:!1,resizable:!1,minHeight:80,width:i,modal:r});u!=null&&u==!1&&e.dialog({closeOnEscape:!1,open:function(){$(".ui-dialog-titlebar-close").hide()}});r&&e.dialog("widget").css("z-index",110);e.parent().appendTo($("form:first"));window["CmsPopup_"+n+"_Display"]=function(t){OpenPopupObject(n,f,t)};window["CmsPopup_"+n+"_Close"]=function(){$("#"+n).dialog("close")}})}function GetQuickSearch(objName,e){e||(e=window.event);eX=e.x;eY=e.y;var url="/Common/ajax/QuickSearch/QuickSearch.aspx",ajax=new AjaxDelegate(url,ProcessQuickSearchResponse,objName);ajax.Fetch();eval("CmsPopup_"+objName+"_Display(e)")}function ProcessQuickSearchResponse(n,t){n.length>0&&(n!="INVALID"?(document.getElementById(t).InitRun=!1,document.getElementById(t+"_ContentsCell").innerHTML=n):document.getElementById(t+"_ContentsCell").innerHTML="An error occurred retrieving the quick search.  Please contact a system administrator.")}function LoadSearchFields(n,t){var i="/Common/ajax/QuickSearch/QuickSearchFields.aspx?FORM="+t,r=new AjaxDelegate(i,ProcessSearchFields,n);r.Fetch()}function ProcessSearchFields(n,t){var i=document.getElementById(t),u,e,o,f,r;if(i!=null){for(u=i.length-1;u>=0;u--)i.options[u]=null;if(i.options[0]=new Option("Select a Field","",!1,!1),n.length>0&&n!="INVALID")for(e=n.split(","),o=1,f=0;f<e.length;f++)r=e[f].split(":"),r.length==3&&(i.options[o++]=new Option(r[1],r[0]+"_"+r[2],!1,!1));ProcessField(t)}}function ProcessField(n){var r=document.getElementById(n),t,i;r!=null&&(t=r.value,t.length>0?(i=t.split("_"),i.length==2&&ProcessRows(i[1])):ProcessRows("NOT_FOUND"))}function ProcessRows(n){var t=[],i,f,r,u;for(t[0]="srch_TEXT_Row",t[1]="srch_NUMBER_Row1",t[2]="srch_NUMBER_Row2",t[3]="srch_DATE_Row1",t[4]="srch_DATE_Row2",i=document.getElementById("srch_BUTTON_Row"),f=!1,r=0;r<t.length;r++)u=document.getElementById(t[r]),t[r].indexOf(n)>=0?(u.style.visibility="visible",u.style.display=$.browser.msie?"block":"table-row",f=!0):(u.style.visibility="hidden",u.style.display="none");f?(i.style.visibility="visible",i.style.display=$.browser.msie?"block":"table-row"):(i.style.visibility="hidden",i.style.display="none")}function SubmitSearch(){var s=new AjaxDelegate("/Common/ajax/QuickSearch/QuickSearch.aspx",ProcessSubmitResponse),t=document.getElementById("qsText"),i=document.getElementById("qsNumFrom"),r=document.getElementById("qsNumTo"),u=document.getElementById("qsDateFrom"),f=document.getElementById("qsDateTo"),e=document.getElementById("qsddlObjects"),o=document.getElementById("qsddlFields"),n="";e!=null&&(n+="srchObjects="+e.value);o!=null&&(n+="&srchFields="+o.value);t!=null&&(n+="&srchText="+escape(t.value));i!=null&&(n+="&srchNumFrom="+escape(i.value));r!=null&&(n+="&srchNumTo="+escape(r.value));u!=null&&(n+="&srchDateFrom="+escape(u.value));f!=null&&(n+="&srchDateTo="+escape(f.value));n.length>0?s.Post(n):alert("Error processing search form.  Please contact a system administrator.")}function ProcessSubmitResponse(n){n.length>0&&n!="INVALID"?document.location=n:alert("Error processing search redirect.  Please contact a system administrator.")}function RegisterComboBox(n,t,i,r){$(function(){var f=null,u=$("#"+n);u.autocomplete({minLength:i,source:function(n,i){var r=u.attr("SearchGroup");$.getJSON(t,{term:n.term,group:r},function(n){if(n!=null){f=n;var t=[];$.each(n,function(n,i){t.push(i.label)});i(t)}})},select:function(t,i){$.each(f,function(t,r){if(r.label==i.item.label)return $("#"+n+"_val").val(r.value),u.trigger("MarkValid"),u.change(),!1})},change:function(){var i=!0,f=u.attr("AllowCustomValues").toLowerCase();u.val().length>0?$.getJSON(t,{term:u.val(),group:u.attr("SearchGroup")},function(t){t!=null&&t!=null&&t.length>0&&($("#"+n+"_val").val(t[0].value),i=!1,u.trigger("MarkValid"));i&&(f=="false"||(r!=null?r.apply(u,[n]):alert("Must Specify Callback to Add Custom Value.")))}):($("#"+n+"_val").val(""),u.trigger("MarkValid"))}});u.click(function(){var n=u.autocomplete("option","minLength");return u.autocomplete("option","minLength",0),u.autocomplete("search",""),u.autocomplete("option","minLength",n),!1});u.bind("MarkValid",function(){u.css("background-color","");u.attr("title","")});u.bind("MarkInvalid",function(n,t){u.css("background-color","#ffaaaa");var i="This item is not valid";t!=null&&t.length>0&&(i+=" - "+t);i+=".";u.attr("title",i)})})}function AddGenericItem(){var r=this.attr("id"),n=this.val(),t=this.attr("SearchGroup"),i;n.length>0&&t.length>0&&(confirm('You are about to add a custom value of "'+n+'".\n\nPress OK to confirm the add.\nPress Cancel to exit without adding the value.')?(i="Group="+t+"&NewValue="+n,$.post("/Common/Controls/ComboBox/AddGenericItem.aspx",i,function(n){n.length>0&&$("#"+r+"_val").val(n)})):this.trigger("MarkInvalid",["value is not added to system"]))}function RegisterDatePicker(n,t){$(document).ready(function(){var i=$("#"+n);t=="DATE"?i.datepicker({changeMonth:!0,changeYear:!0,yearRange:"c-100:c+10"}):t=="BOTH"&&i.datetimepicker({changeMonth:!0,changeYear:!0,timeFormat:"hh:mm tt",yearRange:"c-100:c+10"});i.change(function(){AutoformatDate(i,t)})})}function AutoformatDate(n,t){var u,f,i,r;n.length>0&&(t=="DATE"?(u=/^\d{2}\/\d{2}\/\d{4}$/,u.test(n.val())||n.val(FormatDate(n.val()))):t=="BOTH"&&(f=/^\d{2}\/\d{2}\/\d{4} \d{1,2}:\d{2} ?([ap]m)?$/i,f.test(n.val())||(i=jQuery.trim(n.val()).split(" "),r="",i[0]!=null&&i[0].length>0&&(r=FormatDate(i[0])),i[1]!=null&&i[1].length>0&&(r+=" "+FormatTime(i[1])),n.val(r))))}function FormatDate(n){var f="",r="",e="",u="",t=n.replace(/[^\d]/g,""),i=t.length;return isNaN(t)||(t.length==7||t.length==8)&&(f=t.substring(i,i-4),e=t.substring(i-6,i-4),r=t.substring(0,i-6),u=(r.length==1?"0":"")+r+"/"+e+"/"+f),u.length>0?u:n}function FormatTime(n){var i="",r="",e="",f="",t=n.length,o="",u,s,h;for(ary=[" ",":"],u=0,u=0;u<ary.length;u++)while(n.indexOf(ary[u])>=0)n=n.substr(0,n.indexOf(ary[u]))+n.substr(n.indexOf(ary[u])+1);return t=n.length,s=n.substr(t-2).toUpperCase(),h=n.substr(t-1).toUpperCase(),s=="AM"||s=="PM"?(o=s,n=n.substr(0,t-2)):(h=="A"||h=="P")&&(o=h=="A"?"AM":"PM",n=n.substr(0,t-1)),t=n.length,isNaN(n)||(t==3||t==4?(r=n.substring(t,t-2),r>=60&&(r=59),i=n.substring(0,t-2),i>=12&&(i=12),f=i+":"+r):(t==5||t==6)&&(e=n.substring(t,t-2),e>=60&&(e=59),r=n.substring(t-2,t-4),r>=60&&(r=59),i=n.substring(0,t-4),i>=12&&(i=12),f=i+":"+r+":"+e),t>=3&&(f+=o.length>0?" "+o:i>6&&i<12?" AM":" PM")),f.length==0&&(f=n),f}function ToggleMenu(n){var t=document.getElementById("RightNavExpanded");t!=null&&(DisplayRightNav(t.style.visibility=="hidden"?"DOCKED":"UNDOCKED"),n!=null&&AjaxSaveToServer(n))}function DisplayRightNav(n){n=="DOCKED"&&$("ul#rnMenu li:not(:empty)").length<=1&&(n="UNDOCKED");n=="DOCKED"?($("td.RightNav .toggleable").show(),$("#rnFull").removeClass("toggled"),$("a.toggle-icon img").attr("src","/Common/images/pin-down.gif"),$("a.toggle-icon").attr("title","Hide your user dashboard.")):n=="UNDOCKED"&&($("td.RightNav .toggleable").hide(),$("#rnFull").addClass("toggled"),$("a.toggle-icon img").attr("src","/Common/images/pin-left.gif"),$("a.toggle-icon").attr("title","Show your user dashboard."))}function AjaxSaveToServer(n){var t=new AjaxDelegate("/Common/ajax/RightNav/SaveDockPreference.aspx",ProcessSaveResponse);t.Post("DockCommand="+n)}function ProcessSaveResponse(n){n.length>0&&alert(n)}function LoadSearchDetails(n,t){var i="/Common/ajax/SearchDetails/SearchDetails.aspx?CASEID="+n,r=new AjaxDelegate(i,ProcessSearchDetailsResponse,t);r.Fetch()}function ProcessSearchDetailsResponse(response,objName){if(response.length>0&&response!="INVALID"){var div=document.getElementById(objName);div!=null&&(div.innerHTML=response)}else alert("Invalid Response Received from Search Details Request."),eval("CmsPopup_"+objName+"_Close()")}function SetControlRequired(n,t,i,r,u,f,e){var s=null,o,v;t.VAL!=null&&t.VAL.length>0&&(s=document.getElementById(t.VAL));o=null;t.AssociatedLabel!=null&&t.AssociatedLabel.length>0&&(o=document.getElementById(t.AssociatedLabel));var h=!1,c=!1,a=i.split("||"),l=0;if(n.type=="checkbox")(n.checked&&!r||!n.checked&&r)&&(h=!0);else if(n.type=="text"||n.type=="textarea"||n.type=="file"||n.type=="hidden")if(i.length>0){while(l<a.length){if(a[l]==n.value){c=!0;break}l++}(c&&!r||!c&&r)&&(h=!0)}else(n.value.length>0&&!r||n.value.length==0&&r)&&(h=!0);else if(n.type=="select-one")if(v=n.options[n.selectedIndex].value,i.length>0){while(l<a.length){if(a[l]==v){c=!0;break}l++}(c&&!r||!c&&r)&&(h=!0)}else(v.length>0&&!r||v.length==0&&r)&&(h=!0);else alert("SetControlRequired.js: Object of type '"+n.type+"' is not accounted for.");var y="hidden",p="hidden",w=!1;if(h)p="visible",w=!1,t.className="InputRequired",s!=null&&(s.enabled=!0),y="visible";else if(p="hidden",w=!0,t.className="InputNotRequired",s!=null&&(s.enabled=!1),y="hidden",e)switch(t.type){case"text":case"textarea":t.value="";break;case"select-one":t.selectedIndex=0}o!=null&&(o.innerHTML=o.innerHTML.replace("style='visibility:hidden'"," "),o.innerHTML=o.innerHTML.replace("style='visibility:visible'"," "),o.innerHTML=o.innerHTML.replace("IMG","IMG style='visibility:"+y+"'"));u&&(t.style.visibility=p);f&&(t.disabled=w);s!=null&&ValidatorEnable(s,h)}function SetDropDownValue(n,t){for(i=0;i<n.options.length;i++)if(n.options[i].value==t){n.options[i].selected=!0;break}}function getText(n){var i=document.getElementById(checkElements[n]),t="";switch(i.tagName){case"INPUT":case"TEXTAREA":t=$("#"+checkElements[n]).val()}return t}function setText(n,t){var i=document.getElementById(checkElements[n]);switch(i.tagName){case"INPUT":case"TEXTAREA":$("#"+checkElements[n]).val(t)}}function checkSpellingById(n){checkElements=[];checkElements[checkElements.length]=n;openSpellChecker()}function openSpellChecker(){var n=document.getElementById("SpellCheckFrame");n!=null&&(n.src="/Common/SpellCheck/SpellCheckWindow.aspx",ISSPopup_divSpellCheck_Display())}function initialize(){iElementIndex=parseInt(document.getElementById("ElementIndex").value);window.parent&&(parentWindow=window.parent);var n=document.getElementById("SpellMode").value;switch(n){case"start":break;case"suggest":updateText();break;case"end":updateText();default:loadText()?document.SpellingForm.submit():endCheck()}}function loadText(){if(!parentWindow.document)return!1;for(++iElementIndex;iElementIndex<parentWindow.checkElements.length;iElementIndex++){var n=parentWindow.getText(iElementIndex);if(n.length>0)return updateSettings(n,0,iElementIndex,"start"),!0}return!1}function updateSettings(n,t,i,r){document.getElementById("CurrentText").value=n;document.getElementById("WordIndex").value=t;document.getElementById("ElementIndex").value=i;document.getElementById("SpellMode").value=r}function updateText(){if(!parentWindow.document)return!1;var n=document.getElementById("CurrentText").value;parentWindow.setText(iElementIndex,n)}function endCheck(){showCompleteAlert&&alert("Spell Check Complete");closeWindow()}function closeWindow(){window.parent&&window.parent.ISSPopup_divSpellCheck_Close()}function changeWord(n){var t=n.selectedIndex;n.form.ReplacementWord.value=n.options[t].value}function trimFieldL(n){if(n.length>0)while(n.charAt(0)==" ")n=n.substring(1);return n}function trimFieldR(n){if(n.length>0)while(n.charAt(n.length-1)==" ")n=n.substring(0,n.length-1);return n}function trimField(n){return trimFieldL(trimFieldR(stripField(n)))}function stripField(n){for(var r="",i,t=0;t<n.length;t++)i=n.charAt(t),"`~!#$%^&*()_+={[}]|:;'<,>?/".indexOf(i)==-1&&(r+=i);return r}function stripChar(n,t){for(var f=t,u="",r,i=0;i<n.length;i++)r=n.charAt(i),f.indexOf(r)==-1&&(u+=r);return u}function FindZipCode(n,t,i,r,u,f){var e=n+"/Common/ajax/ZipCodeLookup/ZipCodeLookup.aspx?ZIP="+t+"&CITY="+i+"&STATE="+r+"&COUNTRY="+u+"&ZIPCTRL="+f;$.ajax({url:e,dataType:"jsonp"})}function ProcessZipCodeResponse(n,t){var i,r,u;if(t.CountryControl.length>0&&(i=$("#"+t.CountryControl),i.length>0&&!(i.val()==""||i.val()=="US"||i.val()=="USA")))return!1;n.Invalid!="INVALID"?(t.CityControl.length>0&&(r=$("#"+t.CityControl),r.length>0&&(r.val(n.City),r.change())),t.StateControl.length>0&&(u=$("#"+t.StateControl),u.length>0&&(u.val(n.State),u.change())),RemoveValidateError(t.ZipControl)):(alert("The Zip Code you entered was not found in the database.\nPlease check your entry or manually enter a City and State."),AddValidateError(t.ZipControl))}var tspancms=tspancms||{},NormalList,InteractiveList,AlertTimer,OriginalFormOnSubmit,tagGroup,checkElements,iElementIndex,parentWindow,showCompleteAlert;tspancms.callservice=function(n,t,i){tspancms.callservice(n,t,i,!0)};tspancms.callservice=function(n,t,i,r){n.indexOf("/")==-1&&(n=window.location.pathname+"/"+n);t==null&&(t={});$.ajax({type:"POST",url:n,data:JSON.stringify(t),contentType:"application/json; charset=utf-8",dataType:"json",async:r,success:i,error:function(t){return alert(n+" Error: >>>>\n"+t.responseText),!1}})};NormalList=[];InteractiveList=[];OriginalFormOnSubmit=null;$(function(){$(document).on("keypress","#jumpCert",function(){if(event.keyCode=="13")event.preventDefault?event.preventDefault():event.returnValue=!1,JumpToCertRequest();else return!0});$(document).on("keypress","#jumpCertType",function(){if(event.keyCode=="13")event.preventDefault?event.preventDefault():event.returnValue=!1,JumpToCertRequest();else return!0});$(document).on("keypress","#jumpSocial",function(){if(event.keyCode=="13")event.preventDefault?event.preventDefault():event.returnValue=!1,JumpToSocialRequest();else return!0});$(document).on("keypress","#jumpConf",function(){if(event.keyCode=="13")event.preventDefault?event.preventDefault():event.returnValue=!1,JumpToConfRequest();else return!0});$(document).on("click","#btnGoToCert",function(){JumpToCertRequest()});$(document).on("click","#btnGoToSocial",function(){JumpToSocialRequest()});$(document).on("click","#btnGoToConf",function(){JumpToConfRequest()})});tagGroup=["INPUT","TEXTAREA"];checkElements=[];iElementIndex=-1;showCompleteAlert=!0