function $$(id) {
 	return document.getElementById(id);
}
function updatecount() {
 
	sales_count = $$('sales_count');
	newvalue = parseInt(sales_count.innerHTML.replace(/\D+/g,'')) + Math.floor(1 + Math.random()*8);
	sales_count.innerHTML = '$' + addCommas(newvalue);
}
function bridge_updated() {
 
	prod_count = $$('sales_count2');
	newvalue = parseInt(prod_count.innerHTML.replace(/\D+/g,'')) + Math.floor(1 + Math.random()*4);
	prod_count.innerHTML = addCommas(newvalue);
}

 
function addCommas(nStr) {
	try{
	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');
	}
	}catch(e){
	alert(e); 	
	}
	return x1 + x2;
}
