var ccount={'benfodoc':{c:438,u:429},'benfopdf':{c:441,u:431},'benfortf':{c:0,u:0},'benfo3panel_DOC':{c:159,u:158},'benfo3panel_TXT':{c:126,u:126},'benfo3panel_PDF':{c:175,u:168},'benfo3_lindsay_PDF':{c:160,u:160},'benfo3_sardi_PDF':{c:271,u:262},'benfo3_playlist':{c:583,u:574},'':{}}; function ccount_display(id) { document.write(ccount[id]['c'].formatThousands('US')); } function ccount_unique(id) { document.write(ccount[id]['u'].formatThousands('US')); } Number.prototype.formatThousands = function(notation) { var n = this, separator = ""; switch (notation) { case "US": separator = ","; break; case "UK": separator = "."; break; case "FR": separator = " "; break; default: return n; } n = parseInt(n) + ""; j = (j = n.length) > 3 ? j % 3 : 0; return (j ? n.substr(0, j) + separator : "") + n.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + separator); }