function countUp(c,a,b){if(c0){$(".post-preview").each(function(){var h=$(this).children("h1").children("a").attr("href");var g=countPV(h,d);g=(g==0?1:g);if(!b){$(this).find(".pageviews").text(g)}else{var f=parseInt($(this).find(".pageviews").text());if(g>f){countUp(f,g,$(this).find(".pageviews").attr("id"))}}})}else{if($(".post").length>0){var e=window.location.pathname;var c=countPV(e,d);c=(c==0?1:c);if(!b){$("#pv").text(c)}else{var a=parseInt($("#pv").text());if(c>a){countUp(a,c,"pv")}}}}}$(function(){if($(".pageviews").length>0){var a=false;$.getJSON("/assets/data/pageviews.json",function(b){displayPageviews(b.rows,a);a=true});$.getJSON("/assets/data/proxy.json",function(b){$.ajax({url:b.proxyUrl,dataType:"jsonp",timeout:2000,success:function(c){displayPageviews(c.rows,a)},error:function(e,c,d){console.log("Failed to load pageviews from proxy server.");e.abort();return}})})}});