var SiteLanguage = document.getElementsByTagName("html")[0].getAttribute('lang');
var prototypeFileUrl = "/ajax.php?language="+SiteLanguage

function refresh_product_num() {
	new Ajax.Request('/webshop/refreshProductsNum/',
		{
			onSuccess: function(transport){
				var price = transport.responseText.evalJSON();
				$('product_num').innerHTML = price.num;
			},
			onFailure: function(){ 
				showErrorMsg();
			}
		});
}

function add(id) {
	new Ajax.Request('/webshop/addProduct/id/'+id,
		{
			onSuccess: function(transport){
				refresh_product_num();
			},
			onFailure: function(){ 
				showErrorMsg();
			}
		});
}


function showErrorMsg() {
	alert("Hiba! Próbáld újra!");
}