	function addCommas(nStr){
		nStr += '';
		x = nStr.split('.');
		x1 = x[0];
		x2 = x.length > 1 ? '.' + x[1] : '';
		var rgx = /(\d+)(\d{3})/;
		while (rgx.test(x1)) {
			x1 = x1.replace(rgx, '$1' + ',' + '$2');
		}
		return x1 + x2;
	}
	function showDescriptions(metric){
		if(metric=="uv"){
			$('one_metric').innerHTML = "Ranking + Unique Visitors";
			$('metric_desc').innerHTML = "The total number of unique visitors going to a site in the month.";
		}else if(metric=="sess"){
			$('one_metric').innerHTML = "Ranking + Visits";
			$('metric_desc').innerHTML = "The total number of times a site has been visited in the month.";
		}else if(metric=="pv"){
			$('one_metric').innerHTML = "Ranking + Page Views";
			$('metric_desc').innerHTML = "The total number of pages viewed by all visitors during the month.";
		}else if(metric=="time"){
			$('one_metric').innerHTML = "Ranking + Total Time Spent";
			$('metric_desc').innerHTML = "The total time spent on a domain by all visitors.";
		}else if(metric=="att"){
			$('one_metric').innerHTML = "Ranking + Monthly Attention";
			$('metric_desc').innerHTML = "The total time spent on a domain as a percentage of the total time spent online by all U.S. Internet users.";
		}
		Element.hide('data_desc');
		data = $('data_select').value;
		if(data=="all"){
			Element.show('data_desc');
		}
	}
	function openHelpPopup(metric, base_url){
	    window.open(base_url+"/help?metric="+metric,"help","width=550,height=425,left=300,top=100");
	}
	function openEmbedPopup(url){
	    window.open(url,"embed","width=500,height=540,left=300,top=100,scrollbars=yes,status=no");
	}