function zobrazcenu(id) {
	if (window.ActiveXObject) {
		httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		httpRequest = new XMLHttpRequest();
	}
	var ind = document.getElementById('varianta_'+ id).value;
	httpRequest.open("GET", "/ajax_zobrazcenu.php?id="+ id +"&vara="+ ind, true);
	httpRequest.onreadystatechange= function () { zobrazcenuRequest(id); } ;
	httpRequest.send(null);
}
function zobrazcenuRequest(id) {
	if (httpRequest.readyState == 4) {
		if(httpRequest.status == 200) {
			var zobrazcenuZobrazeni = document.getElementById("cat_view_cena_"+ id);
			zobrazcenuZobrazeni.innerHTML = httpRequest.responseText;
		} else {
			alert("Chyba pri nacitani stanky"+ httpRequest.status +":"+ httpRequest.statusText);
		}
	}
}
function zobrazcenubez(id) {
	if (window.ActiveXObject) {
		httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		httpRequest = new XMLHttpRequest();
	}
	var ind = document.getElementById('varianta_'+ id).value;
	httpRequest.open("GET", "/ajax_zobrazcenubez.php?id="+ id +"&vara="+ ind, true);
	httpRequest.onreadystatechange= function () { zobrazcenuRequest(id); } ;
	httpRequest.send(null);
}
function hodnot(id) {
	var znamka = 1;
	if (window.ActiveXObject) {
		httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		httpRequest = new XMLHttpRequest();
	}
	httpRequest.open("GET", "ajax_soutez.php?hlasuj="+ id +"&znamka="+ znamka, true);
	httpRequest.onreadystatechange= function () {hodnotRequest(id); } ;
	httpRequest.send(null);
}
function hodnotRequest(cisloboxu) {
	if (httpRequest.readyState == 4) {
		if(httpRequest.status == 200) {
			var mistoZobrazeni = document.getElementById("hodnotbox"+ cisloboxu);
			mistoZobrazeni.innerHTML = httpRequest.responseText;
		} else {
			alert("Chyba pri nacitani stanky"+ httpRequest.status +":"+ httpRequest.statusText);
		}
	}
}
