function  commafy(num){  
           num  =  num+"";  
           var  re=/(-?\d+)(\d{3})/  
           while(re.test(num)){  
                       num=num.replace(re,"$1,$2")  
           }  
           return  num;  
}  
<!--
var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
function getBlockName()
{
	 var url2 = "../gettotal2.asp";	
	  xmlHttp.open("GET", url2, true);
	  xmlHttp.onreadystatechange = updatePage22;
	  xmlHttp.send(null);
	
}
function updatePage22() {
  if (xmlHttp.readyState < 4) {
	document.getElementById("alltotal").innerHTML="loading...";
	document.getElementById("total").innerHTML="loading...";

  }
  if (xmlHttp.readyState == 4) {
  var response2 = xmlHttp.responseText;
   var aaaa=response2.split("|&&|");
   document.getElementById("alltotal").innerHTML=commafy(aaaa[1]);
   document.getElementById("total").innerHTML=commafy(aaaa[2]);
   
  }
 }


