function GetXmlHttpObject() {
	var objXMLHttp = null;

	if (window.XMLHttpRequest) {
		try {
			objXMLHttp = new XMLHttpRequest();
		} catch (e) {
			objXMLHttp = false;
		}
	} else if (window.createRequest) {
		try {
			objXMLHttp = new window.createRequest();
		} catch (e) {
			objXMLHttp = false;
		}
	} else if (window.ActiveXObject) {
		try {
			objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				objXMLHttp = false;
			}
		}
	}

	return objXMLHttp;
}

function chkAccount(theLocation) {
	xmlHttp = GetXmlHttpObject();
	var url = theLocation;
	document.getElementById("accountResponse").innerHTML = '<img src="/pix/loading-anim.gif" border=0>';
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
			document.getElementById("accountResponse").innerHTML = xmlHttp.responseText;
		}
	};
	xmlHttp.send(null);
}

function chkUser(theLocation) {
        xmlHttp = GetXmlHttpObject();
        var url = theLocation;
        document.getElementById("userResponse").innerHTML = '<img src="/pix/loading-anim.gif" border=0>';
        xmlHttp.open("GET", url, true);
        xmlHttp.onreadystatechange = function() {
                if (xmlHttp.readyState == 4) {
                        document.getElementById("userResponse").innerHTML = xmlHttp.responseText;
                }
        };
        xmlHttp.send(null);
}

function updateAmount(theQty, thePrice) {
        document.getElementById("total").value = theQty * thePrice;
        document.getElementById("cart_each").innerHTML = thePrice;
        document.getElementById("cart_qty").innerHTML = theQty;
        var totals = theQty * thePrice;
        document.getElementById("cart_total").innerHTML = "$" + totals.toFixed(2);

}
