function manageCart(task,item,name,qty,cost) {
	
	var params = 'task=' + task + '&item=' + item + '&qty=' + qty + '&name=' + name+ '&cost=' + cost;
	
	new Ajax.Request('/includes/cart/cart_manage.php', {
		
		method: 'get',
		parameters: params,
		evalScripts: true,
		onSuccess: function() { 
			
			if ($('cart-link')) { new Ajax.Updater('cart-link', '/includes/cart/cart_link.php'); };
			if ($('cart-view')) { new Ajax.Updater('cart-view', '/includes/cart/cart_view.php'); };
			if ($('cart-status')) { $('cart-status').update('<a href="/products/cart_view.php" id="cart-status-message">This item has been added to your cart</a>'); new Effect.Highlight('cart-status-message',{ startcolor: '#FFFFFF', endcolor: '#FF6666', restorecolor: '#FF6666'} ); };
			if ($('btn_addToCart')) { $('btn_addToCart').value = 'Add to Cart' };
			if ($('btn_viewCart')) { $('btn_viewCart').show() };
			
		}
		
	});
	
}


function showNotice (theMessage, theElement) {
	
	var theElement = $(theElement);
	
	theElement.value = theMessage;
	
		//alert($(theElement).value);

}


function viewCart (argument) {
	
	if ($('cart-view')) { 
		
		$('cart-view').toggle();
		
 } else {
	 
	 window.location.href = "/products/cart_view.php";
	 
 }
	
}

function form_clear_shippingInfo () {
	
	$$('.shipping').each(function(s) { Field.clear(s); });
	
}

function form_submit (theForm,theAction) {
	
	if (theForm == 'form_cart_checkout') {
		
		if (!$('form_fields_shipto').visible()) {

			form_clear_shippingInfo();

		};
		
		$(theForm).action = theAction;
		$(theForm).submit();
		
		
	};
	
	if (theForm == 'form_cart_verify') {
		
	
		$(theForm).action = theAction;
		$(theForm).submit();
		
		
	};
	
}



