var bccsCountsHelpers={commentCountUrl:function(){return BssoHelpers.profileServerUrl()+"/comment_counts.json"},canonicalDomain:function(){return typeof bccs_canonical_domain=="undefined"?window.location.host:bccs_canonical_domain},cleanUrl:function(a){var b=a.indexOf("#"),c=a.indexOf("?");return b!=-1?a=a.substring(0,b):c!=-1&&(a=a.substring(0,c)),a},normalizeUrl:function(a){var b=bccsCountsHelpers.cleanUrl(a);return bccsCountsHelpers.isFullUrl(b)?b:window.location.protocol+"//"+bccsCountsHelpers.canonicalDomain()+b},isFullUrl:function(a){return a.match(/http:\/\//)?!0:!1}},bccsCounts={initialize:function(){bccsCounts.commentableUrls().length>0&&bccsCounts.getCommentCounts()},commentableUrls:function(){var a=[];return $(".bccs-comments-link").each(function(){var b=bccsCountsHelpers.normalizeUrl($(this).attr("href"));a.push(b)}),a},getCommentCounts:function(){$.ajax({url:bccsCountsHelpers.commentCountUrl(),dataType:"jsonp",data:{commentable_urls:bccsCounts.commentableUrls().join(",")},success:function(a){$(".bccs-comments-link").each(function(){var b=bccsCountsHelpers.normalizeUrl($(this).attr("href")),c=a[b];$(this).prepend(c+" ")})}})}};$(document).ready(bccsCounts.initialize)
