   function onkeyPressNumbers(e)
	{
		//alert("haha");
		var key = window.event ? e.keyCode : e.which;
		if (key != 0 && key != 8)
		{
			var keyChars = String.fromCharCode(key);
			reg = /^\d{1}$|^\d{2}$/;
			return reg.test(keyChars);
		}
		else
		{
			return true;
		}		
	}



function createXMLHttpRequest() {
	if (window.ActiveXObject) {
			try {
					g_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e1) {
					g_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
			}
			else if (window.XMLHttpRequest) {
				g_xmlhttp = new XMLHttpRequest();
			}
}createXMLHttpRequest();




function ChangeCount(ID,Count)
{   	
	var per_priceid="per_price"+ID;
	var numid="num"+ID;
	var totalcount=document.getElementById("totalcount"); 
	var priceid=document.getElementById(""+per_priceid); 
	var numid=document.getElementById(""+numid);
	numid.innerHTML=Count;
	var productnameid="productname"+ID;
	var productnameid=document.getElementById(""+productnameid);
    productnameid.innerHTML=Count;
	now = new Date();
	g_xmlhttp.open("Get","ajaxcart.php?act=update&productid="+ID+"&count=" +Count+"&time="+now.toTimeString(),true);
	g_xmlhttp.onreadystatechange = ajax_recv;
	g_xmlhttp.send(null);


}
	
function ajax_recv(){
	if (g_xmlhttp.readyState == 4){	
		document.getElementById("totalcount").innerHTML= g_xmlhttp.responseText;
		document.getElementById("totalprice").innerHTML= g_xmlhttp.responseText;
	}
}