function processChange(e){var jqthis=$(this),options=jqthis.data("jsAjaxLinkOptions"),data=jqthis.data("jsAjaxLinkData");options.data=data?eval(data):jqthis.serialize();e.target&&(options.data.length>0&&(options.data+="&"),options.data+="jsTargetName="+e.target.name);processAjax(options)}function processAjax(n){var c={type:n.data?"POST":"GET",cache:!1,data:"",error:function(){},success:function(){},large:!1,lock:!1,block:!1,blockOptions:{header:myMeter.globalization.getGlobalizedText("JS_Processing_Please_Wait"),message:myMeter.globalization.getGlobalizedText("JS_This_might_take_a_while")},async:!0},i,r,u,t,f,e,s,o,h;if(n=$.extend({},c,n),i=function(){blockingRelease();globalLock[n.url]=!1},n.loadingContainer&&($.loadingOverlay(n.loadingContainer,n.large),r=function(){$.removeOverlay(n.loadingContainer)},u=function(){$("input, textarea").placeholder({customClass:"custom-placeholder"})},n.complete?$.isArray(n.complete)?(n.complete.push(r),n.complete.push(u)):n.complete=[r,n.complete,u]:n.complete=[r,u]),typeof n.preload!="undefined"&&(n.preload.start(),n.complete?$.isArray(n.complete)?n.complete.push(n.preload.stop):n.complete=[n.preload.stop,n.complete]:n.complete=[n.preload.stop]),window._gaq&&typeof ga=="function"&&(t=n.url.split("/").filter(function(n){return n!==""}),f=t[0],t.splice(0,1),e="",t.length>0&&(e=t.join("")),s={Service:["NextServiceSteps","PrevServiceSteps"]},s[f]==null||$.inArray(e,s[f])===-1))for(o=0;o<window._gaq.length;o++)ga("u"+o+".send","event",f,e);if(n.lock&&(n.complete?$.isArray(n.complete)?n.complete.push(i):n.complete=[i,n.complete]:n.complete=[i]),typeof n.url!="undefined"){if(globalLock[n.url]&&DeepCompare(globalLock[n.url],n)){for(h in n.complete)n.complete[h]();return!1}n.lock&&(globalLock[n.url]=n,n.block&&blockingEngage(n.blockOptions))}typeof n.data!="undefined"&&$('input[name="__RequestVerificationToken"]')!==null&&(typeof n.data=="string"||n.data.hasOwnProperty("__RequestVerificationToken")?typeof n.data=="string"&&n.data.indexOf("__RequestVerificationToken")===-1&&n.data.length!==0&&(n.data+="&__RequestVerificationToken="+$('input[name="__RequestVerificationToken"]').first().val()):n.data.__RequestVerificationToken=$('input[name="__RequestVerificationToken"]').first().val());$.ajax({type:n.type,dataType:"text",data:n.data,cache:n.cache,url:(window.appPath?window.appPath:"")+n.url,success:function(json){eval(json);n.success()},error:function(t,i,r){n.messageContainer&&ParseErrorMessage(t,function(t){myMeter.utility.applyGlobalMessage(n.messageContainer,"danger",t)});n.error(t,i,r)},complete:n.complete,async:n.async})}function ParseErrorMessage(n,t){try{var i=JSON.parse(n.responseText);i.detail!=null&&t(i.detail)}catch(r){}}function universalCallback(json){for(var ajaxResult,orig,i=0;i<json.length;i++){ajaxResult=json[i];switch(ajaxResult.Action){case"Append":$(ajaxResult.Identifier).append(ajaxResult.Value);break;case"Prepend":$(ajaxResult.Identifier).prepend(ajaxResult.Value);break;case"Before":$(ajaxResult.Identifier).before(ajaxResult.Value);break;case"After":$(ajaxResult.Identifier).after(ajaxResult.Value);break;case"Alert":alert(ajaxResult.Value);break;case"Replace":$(ajaxResult.Identifier).html(ajaxResult.Value);break;case"AddClass":$(ajaxResult.Identifier).addClass(ajaxResult.Value);break;case"RemoveClass":$(ajaxResult.Identifier).removeClass(ajaxResult.Value);break;case"ToggleClass":$(ajaxResult.Identifier).toggleClass(ajaxResult.Value);break;case"ReloadPage":return location.reload();case"Redirect":return window.location.href=(window.appPath&&!myMeter.utility.HasAppDomain(ajaxResult.Value,window.appPath)&&!myMeter.utility.IsAbsoluteUrl(ajaxResult.Value)?window.appPath:"")+ajaxResult.Value;case"ReplaceElement":orig=$(ajaxResult.Identifier);orig.after(ajaxResult.Value);orig.remove();break;case"RemoveElement":$(ajaxResult.Identifier).remove();break;case"Eval":eval(ajaxResult.Value);break;case"ShowElement":$(ajaxResult.Identifier).show();break;case"HideElement":$(ajaxResult.Identifier).hide();break;case"InsertAfterElement":$(ajaxResult.Value).insertAfter(ajaxResult.Identifier)}}}function debugHelper(){console&&console.log&&console.log(arguments)}function blockingEngage(n){var t={header:myMeter.globalization.getGlobalizedText("JS_Processing_Please_Wait"),message:myMeter.globalization.getGlobalizedText("JS_This_might_take_some_time"),content:null,zindex:1060};n=$.extend({},t,n);n.content?$("#globalProcessModal .modal-content").html(content):($("#globalProcessModal .modal-content").html('<span class="h2">'+n.header+'<\/span><br/><span class="h4">'+n.message+"<\/span>"),$("#globalProcessModal .modal-content").css("padding","5px"));$("#globalProcessModal").css("z-index",n.zindex);$("#globalProcessModal").modal("show")}function blockingRelease(){$("#globalProcessModal").modal("hide");$("#globalProcessModal .modal-content").html("")}function setCookie(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}function getCookie(n){var i,t,r;for(n+="=",i=document.cookie.split(/;\s*/),t=0;t<i.length;t++)if(r=i[t],r.indexOf(n)==0)return r.substring(n.length);return null}function DeepCompare(){function r(t,i){var u,f;if(Object.keys(t).length!=Object.keys(i).length)return!1;for(u in t)if(n(u).localeCompare("lock")!==0&&n(u).localeCompare("block")!==0&&n(u).localeCompare("blockOptions")!==0&&typeof t[u]!="undefined"){if(typeof i[u]=="undefined"||typeof t[u]!=typeof i[u])return!1;if(Array.isArray(t[u])){if(t[u].length!=i[u].length)return!1;for(f=0;f<t[u].length;f++)if(!r(t[u][f],i[u][f]))return!1}if(typeof t[u]=="object"&&!r(t[u],i[u])||typeof t[u]=="string"&&n(t[u]).localeCompare(n(i[u]))!=0||typeof t[u]=="number"&&t[u]!=i[u]||typeof t[u]=="function"&&n(t[u].toString()).localeCompare(n(i[u].toString())))return!1}return!0}function n(n){var t=new RegExp("\\s|\\n|\\t|\\v","g");return n.replace(t,"")}var t,i,u;if(arguments.length<1)return!0;for(t=0,u=arguments.length;t<u;t++)for(i=t+1;i<u;i++)if(!r(arguments[t],arguments[i]))return!1;return!0}var globalLock,myMeter;(function(n){n.extend({showAjaxError:function(n){return n!=null&&alert("Ajax Error:  "+n.url),!1},showError:function(n){return n!=null&&alert("Error:  "+n.errorMessage),!1},showMethodReflectionError:function(n){return n!=null&&alert("Method Reflection Error:  "+n.namespace+"."+n.method),!1},leftPadToLength:function(n,t){for(n=n.toString();n.length<t;)n="0"+n;return n},loadingOverlay:function(t,i){i?(n(t).append("<div id='loadSpinner'><h5>"+myMeter.globalization.getGlobalizedText("JS_Just_A_Moment")+"<\/h5><span class='ir'>"+myMeter.globalization.getGlobalizedText("JS_Loading")+"<\/span><p>"+myMeter.globalization.getGlobalizedText("JS_We_are_retrieving_your_data")+"<\/p><\/div>"),n(t).wrap("<div class='loading-overlay overlay large'><\/div>")):(n(t).append("<span class='loadingGif'><\/span>"),n(t).wrap("<div class='loading-overlay overlay'><\/div>"));n(t).each(function(){n(this).closest(".loading-overlay").children().find("input").attr("readonly","readonly").css("background-color","lightgrey");n(this).closest(".loading-overlay").children().find("a, button").prop("disabled",!0);n(this).closest(".loading-overlay").children().find("select").selectReadonly(!0)})},removeOverlay:function(t){n(" .overlay > "+t+" > .loadingGif").remove();n(" .overlay > "+t+" > #loadSpinner").remove();n(" .overlay > "+t).unwrap();n(t).each(function(){n(this).find("a, button").prop("disabled",!1);n(this).find("input:not(.disabled)").removeAttr("readonly").css("background-color","");n(this).find("select:not(.disabled)").selectReadonly(!1)})}})})(jQuery);$(document).ready(function(){$(document).on("click",".jsAjaxLink",function(e){e.preventDefault();var options=$(this).data("jsAjaxLinkOptions"),data=$(this).data("jsAjaxLinkData");data&&(options.data=eval(data));processAjax(options)});$(document).on("change",".jsAjaxSelectChange",function(e){var options,target,dataToSend;if(e.preventDefault(),options=$(this).data("js-ajax-link-options"),target=$(this).data("js-ajax-link-target"),$(this).val()==0){$(target).empty();return}dataToSend=eval({value:$(this).val()});typeof dataToSend!="undefined"&&($('input[name="__RequestVerificationToken"]')===null||typeof dataToSend=="string"||dataToSend.hasOwnProperty("__RequestVerificationToken")||(dataToSend.__RequestVerificationToken=$('input[name="__RequestVerificationToken"]').first().val()),$.ajax({type:"POST",dataType:"json",data:dataToSend,cache:!1,url:(window.appPath?window.appPath:"")+options.url,success:function(n){$(target).empty();$.each(n,function(n,t){$(target).append("<option value="+n+">"+t+"<\/option>")})},error:function(jqXHR,textStatus,errorThrown){eval(options.error(jqXHR,textStatus,errorThrown))},complete:options.complete}))});$(document).on("change",".jsAjaxChange",function(n){n.preventDefault();processChange.call(this,n)});$(document).on("change",".jsAjaxChangeStopPropagation",function(n){n.stopPropagation();processChange.call(this,n)});$(document).on("mouseenter",".jsTooltipTrigger",function(){var r=$($(this).find(".tooltip")).show(),n=$(this).closest(".jsTooltipContainer"),u=$(this),i,t;n.length>0&&(i=u.outerWidth(),t=$(n).offset(),r.each(function(){$(this).css({left:i+"px"});var r=$(this).outerHeight(),u=$(this).outerWidth(),f=$(this).offset().top-t.top,e=$(this).offset().left-t.left,o=$(n).width(),s=$(n).height();f<0?$(this).css({top:"25px"}):r+f>s&&$(this).css({top:-1*r-25+"px"});u+e>o&&$(this).css({left:-1*u-15+"px"})}))});$(document).on("mouseleave",".jsTooltipTrigger",function(){$($(this).find(".tooltip")).hide()})});globalLock={};$.fn.extend({toggleAttr:function(n){return this.attr(n)?this.removeAttr(n):this.attr(n,n),this},initializePopup:function(n){var t=$(this).detach();$("body").append(t);t.popUpWindowAutoResize(n)},popUpWindowAutoResize:function(n){var t=$(this);$(window).on("resize",function(){t.resizePopup(n)});t.resizePopup(n)},resizePopup:function(n){var t=$(this),i=$(window).width(),r=$(window).height();t.css({left:i<=n?0:(i-t.outerWidth())/2,top:r<=n?0:(r-n)/2})}}),function(n){n.fn.verticalScrollbarVisible=function(){var n=this.get(0);return typeof n!="undefined"&&n.scrollHeight>n.clientHeight?!0:!1};n.fn.verticalScrollbarWidth=function(){var n=this.get(0);return n.offsetWidth-n.clientWidth};n.fn.horizontalScrollbarVisible=function(){var n=this.get(0);return typeof n!="undefined"&&n.scrollWidth>n.clientWidth?!0:!1};n.fn.horizontalScrollbarHeight=function(){var n=this.get(0);return n.offsetHeight-n.clientHeight}}(jQuery);$(document).on("click","#choosePropertyBtn",function(){return $("#propertyInfo").toggleClass("open"),!1});$(document).on("click",function(){$("#propertyInfo.open").removeClass("open")});jQuery.fn.resetValidation=function(){var t,i,n;$(this).removeData("validator");$(this).removeData("unobtrusiveValidation");$.validator.unobtrusive.parse($(this));t=$(".FocusValidationDisabled").data("validator");typeof t!="undefined"&&(t.settings.onfocusout=!1);i=function(){var n=document.createElement("input");return n.setAttribute("type","date"),n.type==="date"}();i||($.validator.addMethod("formattedDate",function(n,t){var i=$(t).isValidFormattedDate();return i||$(t).data("error",myMeter.globalization.getGlobalizedText("JS_Utility_Please_enter_a_valid_date")),i},function(n,t){return $(t).data("error")}),$.validator.addMethod("validMinDate",function(n,t){var i=!0,r;return typeof $(t).data("minDate")!="undefined"&&Date.parse($(t).data("minDate"))&&$(t).isValidFormattedDate()&&(i=new Date($(t).data("minDate"))<new Date($(t).val()),i||(r=jQuery.fn.getFormattedDate($(t).data("minDate")),$(t).data("error",myMeter.globalization.getGlobalizedText("JS_Utility_Please_enter_a_date_greater_than").replace("{0}",r)))),i},function(n,t){return $(t).data("error")}),$.validator.addMethod("validMaxDate",function(n,t){var i=!0,r;return typeof $(t).data("maxDate")!="undefined"&&Date.parse($(t).data("maxDate"))&&$(t).isValidFormattedDate()&&(i=new Date($(t).data("maxDate"))>new Date($(t).val()),i||(r=jQuery.fn.getFormattedDate($(t).data("maxDate")),$(t).data("error",myMeter.globalization.getGlobalizedText("JS_Utility_Please_enter_a_date_less_than").replace("{0}",r)))),i},function(n,t){return $(t).data("error")}),typeof $(this).data("validator")=="undefined"&&$(this).validate(),n=$(this).data("validator"),$(this).find('input[type="date"]').each(function(){typeof n.settings.rules[$(this).attr("name")]=="undefined"&&(n.settings.rules[$(this).attr("name")]={});n.settings.rules[$(this).attr("name")].formattedDate=!0;$(this).attr("min")!==""&&(n.settings.rules[$(this).attr("name")].validMinDate=!0,$(this).data("minDate",$(this).attr("min")),$(this).removeAttr("min"));$(this).attr("max")!==""&&(n.settings.rules[$(this).attr("name")].validMaxDate=!0,$(this).data("maxDate",$(this).attr("max")),$(this).removeAttr("max"))}))};jQuery.fn.selectReadonly=function(n){$(this).each(function(){if(typeof n=="undefined"||n){if(!$(this).is(":disabled")){var t=document.createElement("input");t.type="hidden";t.name=$(this).attr("name");t.value=$(this).val();$(this).after(t);$(this).attr("disabled","disabled");$(this).css("background-color","lightgrey");$(this).off("change.updateValue").on("change.updateValue",function(){$(this).next('input[name="'+$(this).attr("name")+'"]').val($(this).val())})}}else $(this).next('input[name="'+$(this).attr("name")+'"]').remove(),$(this).removeAttr("disabled").css("background-color","")})};jQuery.fn.toggleReadonly=function(n,t){$(this).each(function(){if(typeof n=="undefined"||n){if(!$(this).is(":disabled")){var i=typeof t!="undefined"&&typeof t.defaultValue!="undefined"?t.defaultValue:$(this).val();$(this).prop("checked",i);$(this).attr("disabled","disabled");$(this).closest(".modernSwitch").css("cursor","not-allowed").css("background-color","lightgrey");$(this).closest(".modernSwitch").next('input[name="'+$(this).attr("name")+'"]').val(i)}}else $(this).closest(".modernSwitch").next('input[name="'+$(this).attr("name")+'"]').val(!1),$(this).removeAttr("disabled"),$(this).closest("label").css("cursor","pointer").css("background-color","")})};jQuery.fn.configureDateValidation=function(){var t=function(){var n=document.createElement("input");return n.setAttribute("type","date"),n.type==="date"}(),n;t||(n=this[0],$(n).keydown(function(t){$(n).restrictDateFieldInput(t)}),$(n).val()!==""&&$(n).getFormattedDate())};jQuery.fn.isValidDate=function(){var n=this[0],t=$(n).val();return Date.parse(t)?!0:!1};jQuery.fn.isValidFormattedDate=function(){var r=this[0],u=$(r).val(),n=!0,t=u.match(/^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/),i;return t===null?n=!1:(month=t[1],day=t[3],year=t[5],(month<1||month>12)&&(n=!1),(day<1||day>31)&&(n=!1),(month===4||month===6||month===9||month===11)&&day===31&&(n=!1),month===2&&(i=year%4==0&&(year%100!=0||year%400==0),(day>29||day===29&&!i)&&(n=!1))),n};jQuery.fn.getFormattedDate=function(n){var o=function(){var n=document.createElement("input");return n.setAttribute("type","date"),n.type==="date"}(),f,u,r,t,i,e;if(!o)return(f=this[0],(typeof n=="undefined"||n==="")&&(n=$(f).val()),!Date.parse(n))?!1:(u=new Date(n),r=u.getUTCFullYear(),r<1970&&(r=r+100),t=(1+u.getUTCMonth()).toString(),t=t.length>1?t:"0"+t,i=u.getUTCDate().toString(),i=i.length>1?i:"0"+i,e=t+"/"+i+"/"+r,$(f).val(e),e)};jQuery.fn.restrictDateFieldInput=function(n){var t=n||window.event,r=Array(8,9,32,37,39,46,109,111,189,191),i;$.inArray(t.keyCode,r)!==-1?(t.key==="?"&&(t.preventDefault(),t.returnValue=!1),t.returnValue=!0):(i=/[0-9]|\./,i.test(t.key)||(t.returnValue=!1,t.preventDefault()))};jQuery.fn.configureTimeValidation=function(){var t=function(){var n=document.createElement("input");return n.setAttribute("type","time"),n.type==="time"}(),n;t||(n=this[0],$(n).attr("placeholder",myMeter.globalization.getGlobalizedText("JS_Utility_Time_Placeholder")),$(n).attr("maxlength",11),$(n).keydown(function(t){$(n).restrictTimeFieldInput(t)}))};jQuery.fn.restrictTimeFieldInput=function(n){var t=n||window.event,r=Array(8,9,32,37,39,46,65,77,80,186),i;$.inArray(t.keyCode,r)!==-1?(t.key===";"&&(t.preventDefault(),t.returnValue=!1),t.returnValue=!0):(i=/[0-9]|\./,i.test(t.key)||(t.returnValue=!1,t.preventDefault()))};myMeter=myMeter||{};myMeter.utility=function(n,t){return n.IsAbsoluteUrl=function(n){return new RegExp("^(?:[a-z]+:)?//","i").test(n)},n.HasAppDomain=function(n,t){if(String.prototype.startsWith){if(typeof n=="string")return n.startsWith(t)}else{if(typeof n!="string"||typeof t!="string")return!1;for(var r=t.length,i=-1;++i<r;)if(n.charCodeAt(i)!==t.charCodeAt(i))return!1;return!0}return!1},n.regExSearch=function(n){var r,t,i;if(n=n.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),t=n.split(" "),t=t.filter(function(n){return/\S/.test(n)}),t.length>=1){for(r="^(?=.*",i=0;i<t.length;i++)!t[i].indexOf("\\")==0&&(t[i]="\\b"+t[i]),r+=i==0?t[i]+")":"(?=.*"+t[i]+")";r+=".*$"}else r="^(?=.*\\b)";return RegExp(r,"i")},n.hideElementOnOutsideClick=function(n){t(document).mouseup(function(i){var r=t(n);r.is(i.target)||r.has(i.target).length!==0||r.hasClass("hidden")||r.hide()})},n.hidePopoverOnOutsideClick=function(n){t(document).mouseup(function(i){var r=t(n);r.is(i.target)||r.has(i.target).length!==0||r.hasClass("hidden")||r.popover("hide")})},n.hideTooltipOnOutsideClick=function(n){t(document).mouseup(function(i){var r=t(n);r.is(i.target)||r.has(i.target).length!==0||r.hasClass("hidden")||r.tooltip("hide")})},n.initializeTablesorter=function(){t.extend(t.tablesorter.themes.bootstrap,{table:"table",caption:"caption",header:"bootstrap-header",icons:"icon-white",sortNone:"bootstrap-icon-unsorted",sortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",sortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down"});t(".tablesorter").tablesorter({theme:"bootstrap",widthFixed:!0,headerTemplate:"{content} {icon}",widgets:["uitheme"]})},n.getUrlParameter=function(n){var t=window.location.search.substring(1),f=t.substring(0,t.indexOf("=")),e=t.indexOf("&")!=-1?t.substring(t.indexOf("=")+1,t.indexOf("&")):t.substring(t.indexOf("=")+1,t.length),r,i,u;if(f===n)return e;for(r=t.split("&"),i=0;i<r.length;i++)if(u=r[i].split("="),u[0]===n)return u[1];return!1},n.launchCustomModal=function(n){var i=typeof n.action!="undefined"&&n.action!==""?n.action:"/Base/RenderCustomModal",u=typeof n.modalSettings!="undefined"?n.modalSettings:"show",f=typeof n.container!="undefined"?n.container:"#CustomModalContent",r=n.id;if(i==="/Base/RenderCustomModal"&&r===-1)return!1;processAjax({url:i,data:{id:r,container:f},success:function(){myMeter.master.launchCustomModal(u)},error:function(n){typeof t(this).data("error-container")!="undefined"&&ParseErrorMessage(n,function(n){myMeter.utility.applyGlobalMessage(this.data("error-container"),"danger",n)})}})},n.initializeCustomModalLinks=function(){t(".custom-modal-link").unbind();t(".custom-modal-link").on("click",function(){var n={action:t(this).data("action"),id:t(this).data("id"),container:t(this).data("containter")};myMeter.utility.launchCustomModal(n)})},n.initializeSelectionLists=function(){t(".ul-select").each(function(){var n=t(this),i=n.data("controlId");if(i!==null){t("li",n).unbind();t("li:not(.selected)",n).on("click",function(){t("#"+i).val(t(this).data("value"))})}})},n.ordinal=function(n){var t=["th","st","nd","rd"],i=n%100;return n+(t[(i-20)%10]||t[i]||t[0])},n.applyGlobalMessage=function(n,i,r){var u="GlobalAlertContainer-"+Math.floor(Math.random()*1e3),f='<div id="'+u+'" class="alert alert-'+i+' alert-dismissible fade in" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;<\/span><span class="sr-only">Close<\/span><\/button>'+r+"<\/div>";t(n).html(f);setTimeout(function(){t("#"+u).alert("close")},1e4)},n.applyGlobalConfirm=function(n,i,r,u,f,e){var o="GlobalConfirmContainer-"+Math.floor(Math.random()*1e3),s='<div id="'+o+'" class="modal fade confirm" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-body"><p>'+i+'<\/p><\/div><div class="modal-footer confirm-footer"><button type="button" class="btn btn-default no" data-dismiss="modal">'+myMeter.globalization.getGlobalizedText("JS_Utility_No")+'<\/button><button type="button" class="btn btn-primary yes">'+myMeter.globalization.getGlobalizedText("JS_Utility_Yes")+"<\/button><\/div><\/div><\/div><\/div>";t(n).html(s);t(".confirm .yes").on("click",function(){t(this).off("click");t("#"+o).modal("hide");r(u)});t(".confirm .no").on("click",function(){t(this).off("click");t("#"+o).modal("hide");f(e)});t("#"+o).modal({show:!0,backdrop:"static"})},n.initializeTableSort=function(i){t("th.sort").off("click").on("click",function(){var f;t(this).parent().find("span").removeClass("glyphicon glyphicon-sort-by-attributes glyphicon-sort-by-attributes-alt").addClass("glyphicon glyphicon-sort");var r=t(this).closest("th"),o=r.data("sort"),e=t(this).closest("table").find("td."+o),u=[];r.hasClass("descending")?(u=e.sort(n.ascendingSort),r.removeClass("descending"),r.find("span").removeClass("glyphicon glyphicon-sort"),r.find("span").removeClass("glyphicon glyphicon-sort-by-attributes-alt"),r.find("span").addClass("glyphicon glyphicon-sort-by-attributes")):(u=e.sort(n.descendingSort),r.addClass("descending"),r.find("span").removeClass("glyphicon glyphicon-sort"),r.find("span").removeClass("glyphicon glyphicon-sort-by-attributes"),r.find("span").addClass("glyphicon glyphicon-sort-by-attributes-alt"));f=[];u.each(function(){f.push(t(this).closest("tr"))});t(this).closest("table").find("tbody").empty();t(this).closest("table").find("tbody").append(f);i()})},n.sortTable=function(n,i,r){var h=t(n).data("type"),c=t(i).data("type"),u,f,o,s;if(typeof h!="undefined"&&typeof c!="undefined"&&h!==c)return 1;var l=new Date(t(n).closest("tr").find(".billing-history-date").text()),a=new Date(t(i).closest("tr").find(".billing-history-date").text()),e=r==="ascending"?1:-1;switch(h){case"date":if(u=0,t(n).children().length>0?(u=Date.parse(t(n).children().first().text()),u=isNaN(u)?0:u):(u=Date.parse(t(n).text()),u=isNaN(u)?0:u),f=0,t(i).children().length>0?(f=Date.parse(t(i).children().first().text()),f=isNaN(f)?0:f):(f=Date.parse(t(i).text()),f=isNaN(f)?0:f),f<u)return e;if(f>u)return-1*e;break;case"double":if(o=0,s=0,t(n).text().replace(/[\n\r]+/g,"").trim().split(" ").forEach(function(n){o+=Number(n.replace("(","-").replace(" ","0").replace(/[^0-9.-]+/g,""))}),t(i).text().replace(/[\n\r]+/g,"").trim().split(" ").forEach(function(n){s+=Number(n.replace("(","-").replace(" ","0").replace(/[^0-9.-]+/g,""))}),o<s)return e;if(o>s)return-1*e;break;default:if(t(i).text()<t(n).text())return e;if(t(i).text()>t(n).text())return-1*e}return l.getTime()<a.getTime()?1:-1},n.ascendingSort=function(t,i){return n.sortTable(t,i,"ascending")},n.descendingSort=function(t,i){return n.sortTable(t,i,"descending")},n}(myMeter.utility||{},jQuery);myMeter=myMeter||{};myMeter.globalization=function(n){var t;return n.initialize=function(n){t=n},n.getGlobalizedText=function(n){return t[n]},n}(myMeter.globalization||{},jQuery)