
	setAddBoxToBasketAmount = function(field, increase) {
		amount = $(field).getValue();

		if (isNaN(amount) || amount == '') {
			amount = 1;
		}
		if (increase != 1 && increase != -1) {
			increase = 1;
		}

		newAmount = eval(parseInt(amount)+parseInt(increase));
		if (newAmount < 1) {
			newAmount = 1;
		}

		$(field).setValue(newAmount);
	}

	showAddBoxToBasketResult = function(box, amount) {

		$('addBoxToBasketLayer').hide();
		$('addBoxToBasketLayerText').innerHTML = '';

		new Ajax.Updater('addBoxToBasketLayerText', baseUrl + 'Store/Germany/add-box-to-basket/box/' + encodeURIComponent(box) + '/amount/' + encodeURIComponent(amount), {
			onComplete: function() {

				refreshBasketInfo();

				scrollOffsets = document.viewport.getScrollOffsets();

				$('addBoxToBasketLayer').setStyle({
					position: 'absolute',
					top: (((document.viewport.getHeight()-166)/2)+scrollOffsets[1]) + 'px',
					left: (((document.viewport.getWidth()-360)/2)+scrollOffsets[0]) + 'px',
					zIndex: 10
				});
				$('addBoxToBasketLayer').show();

			}
		});
	}

	keepOnShopping = function() {
		$('addBoxToBasketLayer').hide();
	}

	goToBasket = function() {
		$('addBoxToBasketLayer').hide();
		document.location.href = baseUrl + 'Store/Basket/'
	}

	refreshBasketInfo = function() {
		$('topNaviBasketInfo').update('loading...');
		new Ajax.Request(baseUrl + 'Store/Basket/show-info/', {
			method: 'get',
			onSuccess: function(transport) {
				$('topNaviBasketInfo').update(transport.responseText);
			}
		});
	}