function add2basket(product_id) {
	var count = prompt('Enter desired quantity:', '1');
	if (!count)
		return;

	var parsed = parseInt(count);

	if (isNaN(parsed) || parsed != count || count <= 0 || count > 10) {
		alert('You have to enter numer in the range of 1-10');
		return;
	}

	ajaxStart();
	Basket_obj.add2Basket(product_id, count,
		function(result) {
			if (result != null)
				alert(result);
		}
	);
}

function changebasket(product_id, count) {
	var parsed = parseInt(count);

	if (isNaN(parsed) || parsed != count || count <= 0 || count > 10) {
		alert('You have to enter numer in the range of 1-10');
		return;
	}

	ajaxStart();
	Basket_obj.changeBasket(product_id, count,
		function(result) {
			if (result != null)
				alert(result);
		}
	);
}

function deletebasket(product_id) {
	var elem = document.getElementsByName('basket_count_' + product_id);
	elem[0].value = 0;

	ajaxStart();
	Basket_obj.changeBasket(product_id, 0, function(result) {});
}
