function addPromoCode() {
	if ($('code_promo').getValue() == '') {	return;	}
	Element.setOpacity('boxContent', 0.2);
	showLoading();
	new Ajax.Request(ABS_PATH + '/www/e-shop/basket/add_promo_code.php', {
		parameters : { promo_code : $('code_promo').getValue() },
		onComplete : function(transport) {
			if (transport.responseText == 'LOGIN') {
				window.top.location.href=$('errorMustBeLogged').innerHTML;
				return;
			}		
			if (transport.responseText == 'OK') {
				window.top.location.href=window.top.location.href;
				return;
			}
			stopLoading();
			Element.setOpacity('boxContent', 1.0);
			showFormErrors('formCodePromo', transport.responseText);
		}
	});
}

function removePromoCode() {
	Element.setOpacity('boxContent', 0.2);
	showLoading();
	new Ajax.Request(ABS_PATH + '/www/e-shop/basket/remove_promo_code.php', { onComplete : function(transport) { window.top.location.href=window.top.location.href; }});
}

function addOneMoreItem(productRef, sizeId) {
	Element.setOpacity('basketListProducts', 0.2);
	showLoading();
	new Ajax.Request(ABS_PATH + '/www/e-shop/basket/add_product.php', {
		parameters : { ref : productRef, size : sizeId, nb_products : 1 },
		onComplete : function(transport) {
			if (transport.responseText == 'OK') {
				window.top.location.href=window.top.location.href;
			} else {
				stopLoading();
				Element.setOpacity('basketListProducts', 1.0);
				showFormErrors('boxContent', transport.responseText);
			}
		}
	});	
}

function removeOneItem(productRef, sizeId) {
	Element.setOpacity('basketListProducts', 0.2);
	showLoading();
	new Ajax.Request(ABS_PATH + '/www/e-shop/basket/remove_product.php', {
		parameters : { ref : productRef, size : sizeId },
		onComplete : function(transport) {
			if (transport.responseText == 'OK') {
				window.top.location.href=window.top.location.href;
			} else {
				stopLoading();
				Element.setOpacity('basketListProducts', 1.0);
				showFormErrors('boxContent', transport.responseText);
			}
		}
	});	
}