function addtocart(id) {
	return addtocart_spc("txt", id);
}
function addtocart_spc(prefix, id) {
	if (document.getElementById) {
		var text = document.getElementById(prefix + id);
		if (text != null) {
			var qty = Number(text.value);
			if (qty != NaN && qty > 0) {
				var ret = http_request("ajax/cartaction_ajax.aspx?action=add&ret=live&id=" + id + "&qty=" + qty, livecartchange_complete);
				
				if (self.updatecart) {
					updatecart();
				}
				
				return ret;
			} else
				alert("Indtast et gyldigt tal.");
				
			return false;
		}
	}
	return true;
}
function updatelivecart() {
	return http_request("ajax/cartaction_ajax.aspx?ret=live", livecartchange_complete);
}
function livecartchange_complete(http) {
	var content = http.responseText;
	
	var container = document.getElementById("livecart");
	
	if (container != null)
		container.innerHTML = content;
}