/*!
 * accounting.js v0.4.2
 * Copyright 2014 Open Exchange Rates
 *
 * Freely distributable under the MIT license.
 * Portions of accounting.js are inspired or borrowed from underscore.js
 *
 * Full details and documentation:
 * http://openexchangerates.github.io/accounting.js/
 */
(function(n,t){function o(n){return!!(n===""||n&&n.charCodeAt&&n.substr)}function u(n){return a?a(n):v.call(n)==="[object Array]"}function s(n){return n&&v.call(n)==="[object Object]"}function h(n,t){var i;n=n||{};t=t||{};for(i in t)t.hasOwnProperty(i)&&n[i]==null&&(n[i]=t[i]);return n}function r(n,t,i){var u=[],r,f;if(!n)return u;if(l&&n.map===l)return n.map(t,i);for(r=0,f=n.length;r<f;r++)u[r]=t.call(i,n[r],r,n);return u}function f(n,t){return n=Math.round(Math.abs(n)),isNaN(n)?t:n}function y(n){var t=i.settings.currency.format;return(typeof n=="function"&&(n=n()),o(n)&&n.match("%v"))?{pos:n,neg:n.replace("-","").replace("%v","-%v"),zero:n}:!n||!n.pos||!n.pos.match("%v")?o(t)?i.settings.currency.format={pos:t,neg:t.replace("%v","-%v"),zero:t}:t:n}var i={};i.version="0.4.1";i.settings={currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}};var l=Array.prototype.map,a=Array.isArray,v=Object.prototype.toString;var e=i.unformat=i.parse=function(n,t){if(u(n))return r(n,function(n){return e(n,t)});if(n=n||0,typeof n=="number")return n;t=t||i.settings.number.decimal;var o=new RegExp("[^0-9-"+t+"]",["g"]),f=parseFloat((""+n).replace(/\((.*)\)/,"-$1").replace(o,"").replace(t,"."));return isNaN(f)?0:f},p=i.toFixed=function(n,t){t=f(t,i.settings.number.precision);var r=Math.pow(10,t);return(Math.round(i.unformat(n)*r)/r).toFixed(t)},c=i.formatNumber=i.format=function(n,t,o,l){if(u(n))return r(n,function(n){return c(n,t,o,l)});n=e(n);var a=h(s(t)?t:{precision:t,thousand:o,decimal:l},i.settings.number),y=f(a.precision),b=n<0?"-":"",v=parseInt(p(Math.abs(n||0),y),10)+"",w=v.length>3?v.length%3:0;return b+(w?v.substr(0,w)+a.thousand:"")+v.substr(w).replace(/(\d{3})(?=\d)/g,"$1"+a.thousand)+(y?a.decimal+p(Math.abs(n),y).split(".")[1]:"")},w=i.formatMoney=function(n,t,o,l,a,v){if(u(n))return r(n,function(n){return w(n,t,o,l,a,v)});n=e(n);var p=h(s(t)?t:{symbol:t,precision:o,thousand:l,decimal:a,format:v},i.settings.currency),b=y(p.format),k=n>0?b.pos:n<0?b.neg:b.zero;return k.replace("%s",p.symbol).replace("%v",c(Math.abs(n),f(p.precision),p.thousand,p.decimal))};i.formatColumn=function(n,t,l,a,v,p){if(!n)return[];var w=h(s(t)?t:{symbol:t,precision:l,thousand:a,decimal:v,format:p},i.settings.currency),b=y(w.format),d=b.pos.indexOf("%s")<b.pos.indexOf("%v")?!0:!1,k=0,g=r(n,function(n){if(u(n))return i.formatColumn(n,w);n=e(n);var r=n>0?b.pos:n<0?b.neg:b.zero,t=r.replace("%s",w.symbol).replace("%v",c(Math.abs(n),f(w.precision),w.thousand,w.decimal));return t.length>k&&(k=t.length),t});return r(g,function(n){return o(n)&&n.length<k?d?n.replace(w.symbol,w.symbol+new Array(k-n.length+1).join(" ")):new Array(k-n.length+1).join(" ")+n:n})};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=i),exports.accounting=i):typeof define=="function"&&define.amd?define([],function(){return i}):(i.noConflict=function(r){return function(){return n.accounting=r,i.noConflict=t,i}}(n.accounting),n.accounting=i)})(this);
function EndRequestHandler(){$(".event-image-wrapper").imagefill();$(".event-item-grid a").imagefill()}function BindRegisterOnlineEvents(){$(document).ready(function(){$(".regonline-ts-ticketouter .col-qty .qty-select").length&&updateTicketAmounts();$(".regonline-ts-ticketouter .col-qty .qty-select").on("change",updateTicketAmounts)})}function updateTicketAmounts(){var n=0;$(".regonline-ts-ticketouter .col-qty .qty-select").each(function(){var u=$(this).val(),f=$(this).parent().parent(),e,i,t,r;if(!isNaN(Number(u))){if(e=f.find(".ticketamount").text(),i=Number(e.replace(/[^0-9\.]+/g,"")),isNaN(i))return;t=u*i;r=f.parent().find(".tickettotalamount");t>0?r.text(accounting.formatMoney(t)):r.text(accounting.formatMoney(0));n+=t}});n>0?($("#total-amount span").text(accounting.formatMoney(n)),$(".no-ticket-warning").addClass("hidden")):$("#total-amount span").text(accounting.formatMoney(0))}function HighlightValidationInput(){typeof Page_ClientValidate!="undefined"&&(ValidatorUpdateDisplay=CustomValidatorUpdateDisplay)}function CustomValidatorUpdateDisplay(n){n.isvalid?($(n).fadeOut("slow"),$(n).parent().removeClass("has-error")):($(n).fadeIn("slow"),$(n).parent().addClass("has-error"))}window.onload=function(){$(".event-image-wrapper").imagefill();$(".event-item-grid a").imagefill();Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler)};$(document).ready(function(){$(".Registration-info").length&&($(".Registration-info a.riUp").attr("title","Increase").attr("aria-label","Spin Up").attr("href","javascript:void(1)"),$(".Registration-info a.riDown").attr("title","Decrease").attr("aria-label","Spin Down"));updateTicketAmounts();$(".regonline-ts-ticketouter .qty-select").on("change",updateTicketAmounts)});
$(".show-cats").on("click",function(){console.log("f");var n=$(this).find("span"),t=$(this).parent().find("ul");n&&($(n).text()=="Hide"?(t&&$(t).slideUp("slow"),$(n).text("Expand"),$(this).addClass("fa-plus-square").removeClass("fa-minus-square")):(t&&$(t).slideDown("slow"),$(n).text("Hide"),$(this).addClass("fa-minus-square").removeClass("fa-plus-square")))});$(document).ready(function(){$(".image-gallery a").imagefill();$("div.listing-category")&&($("div.listing-category").find(".RadComboBox input").attr("aria-label","Assign Listing Categories"),$("div.listing-category").find(".RadComboBox button").attr("aria-label","Category Select").attr("title","Select Category"))});
function OnClientFileUploaded(n,t){var r=t.get_fileInfo(),i,u;r.ErrorMessage!=null&&(i=t.get_row(),n._updateRowImage(i,"fail"),n._updateCancelButton(i),u='<div class="uploadError"><span class="error-text">'+r.ErrorMessage+'<\/span><span class="extra-message">Please remove the file and try again<\/span><\/div>',$(i).append(u))}function OnClientFileUploadFailed(n,t){t.set_handled(!0)}function OnClientValidationFailed(n,t){var u=t.get_fileName().substring(t.get_fileName().lastIndexOf("."),t.get_fileName().length),f=t.get_row(),i="",r;i=t.get_fileName().lastIndexOf(".")!=-1?n.get_allowedFileExtensions().split(",").indexOf(u)==-1?"The file you've selected is an invalid file extension. Please re-check your file's type against the allowed list.":"The file you've selected exceeds the Max File Size. Please re-check your file's size against the Max Size Limit.":"There was an issue uploading the selected file. If the error persists please contact a Website Administrator.";r='<div class="uploadError"><span class="error-text">'+i+'<\/span><span class="extra-message">Please remove the file and try again<\/span><\/div>';$(f).append(r)}
$(document).ready(function(){$(".meeting-types ul li").length>0&&$(".meeting-types ul li").matchHeight()});
function BindProfileSlideshow(){var n=$(".profile-manager-feed-wrapper .feed-carousel");n.owlCarousel({autoplay:!0,loop:!0,lazyLoad:!1,dots:!1,autoplayTimeout:8e3,autoplayHoverPause:!0,responsiveRefreshRate:500,autoplayHoverPause:!0,navText:["&#xf104;","&#xf105;"],responsive:{0:{items:1},768:{items:1},1200:{items:1},1800:{items:1}}});$(".feed-controls .next").click(function(){n.trigger("next.owl.carousel")});$(".feed-controls .prev").click(function(){n.trigger("prev.owl.carousel")})}$(window).on("load",function(){typeof $.fn.imagefill=="function"&&$(".profile-manager-item-image-wrapper").imagefill()});$(document).ready(function(){$(".profile-manager-name").matchHeight();$(".profile-manager-type").matchHeight();$(".profile-manager-details .inner").matchHeight();BindProfileSlideshow()});
function News_CalculateCharLimit(){var r;if($(".news-introduction textarea").length>0&&$(".news-introduction .char_limit").length>0){var i=$(".news-introduction textarea"),t=$(i).val().length,n=0;$(".news-introduction .char_limit").attr("data-charlimit")!==undefined&&(n=$(".news-introduction .char_limit").attr("data-charlimit"));t>0?$(".news-introduction .char_limit").html("<p><strong>Character Length:<\/strong> <span class='current-count'>"+t+"<\/span>"+(n!==0?" of <span class='max-count'>"+n+"<\/span>":"")):$(".news-introduction .char_limit").html("");n!==undefined&&(n>0&&t>=n?$(".news-introduction .char_limit").addClass("text-danger"):$(".news-introduction .char_limit").removeClass("text-danger"),n>0&&t>n&&(r=$(i).val().substr(0,n),$(i).val(r)))}}$(document).ready(function(){$(".news-introduction .char_limit").length>0&&$(".news-introduction .char_limit").attr("data-charlimit")!==undefined&&$(".news-introduction label").html("Introduction: <span class='charlimit-info'> (Max Character Length: "+$(".news-introduction .char_limit").attr("data-charlimit")+")<\/span>")});$(".news-introduction textarea").keyup(function(){News_CalculateCharLimit()});
function PN_CalculateCharLimit(){var r;if($(".notices-introduction textarea").length>0&&$(".notices-introduction .char_limit").length>0){var i=$(".notices-introduction textarea"),t=$(i).val().length,n=0;$(".notices-introduction .char_limit").attr("data-charlimit")!==undefined&&(n=$(".notices-introduction .char_limit").attr("data-charlimit"));t>0?$(".notices-introduction .char_limit").html("<p><strong>Character Length:<\/strong> <span class='current-count'>"+t+"<\/span>"+(n!==0?" of <span class='max-count'>"+n+"<\/span>":"")):$(".notices-introduction .char_limit").html("");n!==undefined&&(n>0&&t>=n?$(".notices-introduction .char_limit").addClass("text-danger"):$(".notices-introduction .char_limit").removeClass("text-danger"),n>0&&t>n&&(r=$(i).val().substr(0,n),$(i).val(r)))}}$(document).ready(function(){$(".notices-introduction .char_limit").length>0&&$(".notices-introduction .char_limit").attr("data-charlimit")!==undefined&&$(".notices-introduction label").html("Introduction: <span class='charlimit-info'> (Max Character Length: "+$(".notices-introduction .char_limit").attr("data-charlimit")+")<\/span>")});$(".notices-introduction textarea").keyup(function(){PN_CalculateCharLimit()});
function roadreport_wcagfixes(){var n,t,i;$(".table-report-container").length&&(addLinkDescription("table-report-container","Go to the first page","Road Report - First Page",1),addLinkDescription("table-report-container","Go to the previous page","Road Report - Previous Page",2),addLinkDescription("table-report-container","Go to the next page","Road Report - Next Page",3),addLinkDescription("table-report-container","Go to the last page","Road Report - Last Page",4),n="#grid",t=".k-grid-content table",$(n).find(t).attr("aria-label","Road Report Table").attr("title","Road Report Information"),$(n).find(t+" caption").remove(),$(n).find(t).prepend("<caption>Road Report Information<\/caption>"),$(n+" "+t+" thead").removeAttr("role"),$(n+" "+t+" tbody").removeAttr("role"),$(n+" "+t+" thead th").each(function(){$(this).removeAttr("role")}),i=".k-grid-header-wrap table",$(n).find(i).attr("aria-label","Road Report Header Table").attr("title","Road Report Data"),$(n+" "+i+" thead").removeAttr("role"),$(n+" "+i+" tbody").removeAttr("role"),$(n+" "+i+" thead th:first-of-type").attr("href","javascript:void(99);"),$(n+" "+i+" thead th").each(function(n){$(this).removeAttr("role").removeAttr("href");$(this).find("a").attr("href","javascript:void("+(n+1)*100+");")}),$(n).find(".k-grid-search input").attr("aria-label","Report Search"))}function addLinkDescription(n,t,i,r){var u=$("."+n).find('.k-grid-pager a[title="'+t+'"]');u!=undefined&&($(u).append("<span class='hidden'>"+t+"<\/span>"),$(u).attr("href","javascript:void("+r+");"),i!==""&&$(u).attr("aria-label",i))}$(document).ready(function(){roadreport_wcagfixes()});
$(document).ready(function () {
    $('.thumbnail').imagefill();

    //WCAG Fix
    $("div.consultation-item-data").each(function (i, obj) {
        var table = $(this).find("table.table");
        if (table !== undefined) {
            var title = $(this).find("div.page-header h2").text();
            if (window.location.href.indexOf("past") > -1) {
                $(table).attr("aria-label", 'Past ' + title + ' Consultations');
                $(table).attr("title", 'Past Consultations - ' + title);
            }
            else {
                $(table).attr("aria-label", title + ' Consultations');
                $(table).attr("title", 'Consultations - ' + title);
            }
        }
    });
});
function gridViewSort(){$(".gvTable").length>0&&$(".gvTable[data-client-sortable]").sortable({items:"tr:not(tr:first-child)",cursor:"pointer",axis:"y",dropOnEmpty:!1,placeholder:"sort-placeholder"})}function runOnPagePostback(){gridViewSort()}function matchHieghts(){$(".hr-contact-default").length>0&&$(window).width()>=1262&&($.fn.matchHeight._beforeUpdate=function(){},$(".hr-contact-default #hr-contact-list .hr-contact-item").matchHeight(),$.fn.matchHeight._afterUpdate=function(){$(".hr-contact-default .module-list .loading").fadeOut()})}$(".nav-tabs a").click(function(n){n.preventDefault();$(this).tab("show")});typeof $.fn.imagefill=="function";$(document).ready(function(){gridViewSort();matchHieghts()});Sys.WebForms.PageRequestManager.getInstance().add_endRequest(runOnPagePostback);$(".hr-contact-default .hr-contact-item").length&&($(".hr-contact-default .hr-contact-item .hr-item-header").matchHeight({remove:!0}),$(".hr-contact-default .hr-contact-item .hr-details-content").matchHeight({remove:!0}),$(".hr-contact-default .hr-contact-item .hr-item-department").matchHeight({remove:!0}),$(window).width()>1262&&($(".hr-contact-default .hr-contact-item .hr-item-header").matchHeight(),$(".hr-contact-default .hr-contact-item .hr-details-content").matchHeight(),$(".hr-contact-default .hr-contact-item .hr-item-department").matchHeight()));
