

function getXMLHTTPRequest() 
{
	var request = false;
	try
	{
		request = new XMLHttpRequest(); // FIREFOX
	}
	catch (err1)
	{
		try
		{
			request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (err2)
		{
			try
			{
				request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (err3)
			{
				request = false;
			}
		}
	}
	if (!request) {
		alert('Cannot create XMLHTTP instance');
		return false;
	}
	return request;
}

var myRequest = getXMLHTTPRequest();

//
// SAVE PRODUCTS TO A SHOPPING LIST
//
function setShipping(shippingCost,shippingType)
{
	url = "cart_process.php?shippingCost="+shippingCost+"&shippingType="+shippingType;
	myRequest.open("GET", url, true);
	myRequest.send(null);
	document.getElementById('cart_total').innerHTML = "<span style='color:silver; font-size:9px'>updating...</span>";
	setTimeout("getShipping()", 1000);
}

function getShipping()
{
	document.getElementById('cart_total').innerHTML = "$" + myRequest.responseText;
}

