	
function isNumberKey(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode;

	if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46)
		return false;

	return true;
}

function ajax_update_purchase(Purchase_ID, Quantity)
{
	var xmlHttp;

	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}

	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		}

    catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			}

      catch (e)
			{
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}

	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			// do nothing, no feedback needed
		}
	}

 	The_URL = 'js_functions.js.php?page=shopping_cart/update_purchase&Purchase_ID=' + Purchase_ID + '&Quantity=' + Quantity; 

	xmlHttp.open('GET', The_URL, true);
	xmlHttp.send(null);
	
	Sub_Total = 0;
	Total_Lines = Number(document.Checkout_Form.Total_Lines.value);
	
	for (i = 1; i < Total_Lines; i++)
	{
		Amount = Number(document.forms[i].Display_Total.value);
		Sub_Total = Sub_Total + Amount;
	}

	Sub_Total = Sub_Total.toFixed(2);
	document.Total_Form.Sub_Total.value = Sub_Total;
}
