function addToCart(id, from)
{
	var amount = document.getElementById('amount' + id).value;

	if (amount == 0)
		alert('Bitte geben Sie eine Anzahl > 0 ein!');
	else
		document.location.href = 'basketcontroller.php5?__action__=add&id=' + id + '&amount=' + amount + '&from=' + from;
}

function alterAmount(id, from)
{
	var amount = document.getElementById('amount' + id).value;
	document.location.href = 'basketcontroller.php5?__action__=alter&id=' + id + '&amount=' + amount + '&from=' + from;
}

/**
 * @desc save form data
 * @param form form
 */
function do_save(form)
{
	form.__action__.value = 'save';
	form.submit();	
}


/**
 * @desc save form data and set action to go back afterwards
 * @param form form
 */
function do_saveback(form)
{
	form.__action__.value = 'saveback';
	form.submit();
}


/**
 * @desc abort changes
 * @param form form
 */
function do_abort(form)
{
	form.__action__.value = 'abort';
	form.submit();
}


/**
 * @desc execute delete
 * @param form form
 */
function do_delete(form)
{
	if (confirm('Sind sie sicher?'))
	{
		form.__action__.value = 'delete';
		form.submit();
	}
}