function simpleAddToCart(product_id,displayid)
{
	$.ajax({
		type: "POST",
		url: "/web_modules/eshop/proxy/CartProxy.cfc?method=simpleAddToCart",
		data: "productId="+product_id,
		success: function(msg){
			document.getElementById(displayid).innerHTML = Math.abs(msg);
			$.msg({ content :eshop_msg_add_to_cart});
		}
	});
}

function updateCartItem(product_id,quantity)
{
	$.ajax({
		type: "POST",
		url: "/web_modules/eshop/proxy/CartProxy.cfc?method=updateCartItem",
		data: "productId="+product_id+"&quantity="+quantity,
		success: function(msg){
			$.msg({ content :eshop_msg_cart_updated,autoUnblock:false,clickUnblock : true});
			window.location.reload();
		}
	});
}

function deleteCartItem(product_id, displayid)
{
	$.ajax({
		type: "POST",
		url: "/web_modules/eshop/proxy/CartProxy.cfc?method=deleteCartItem",
		data: "productId="+product_id,
		success: function(msg){
			$.msg({ content :eshop_msg_cart_item_removed,autoUnblock:false,clickUnblock : true});
			window.location.reload();
		}
	});
}

function clearCart()
{
	$.ajax({
		type: "POST",
		url: "/web_modules/eshop/proxy/CartProxy.cfc?method=clearCart",
		success: function(msg){
			$.msg({ content :eshop_msg_cart_is_empty_now,autoUnblock:false,clickUnblock : true});
			window.location.reload();
		}
	});
}

function deleteCartObject()
{
	$.ajax({
		type: "POST",
		url: "/web_modules/eshop/proxy/CartProxy.cfc?method=deleteCartObject",
		success: function(msg){
			var cartmsg=eshop_msg_cart_removed_this_item+ msg;
			$.msg({ content :cartmsg});
		}
	});
}

function printThisPage(elementid){
	if(elementid)
		elementToPrint=elementid;
	else
		elementToPrint=document.getElementById('printid').value;
		
	window.open('/print.cfm?elementToPrint='+elementToPrint, 'newwindow', 'toolbar=no,status=no,scrollbars=yes,location=no,menubar=yes,directories=no,width=1000,height=1000,resizable=1');
}
