function confirmDeleteVote(recipe_id, user_id) {
  Check = confirm('Soll die Bewertung wirklich gelöscht werden?');
  if(Check) {
    deleteVote(recipe_id, user_id);
  }
}

function deleteVote(recipe_id, user_id) {
  xmlHttp = xmlhttp();
	if (xmlHttp) {
		xmlHttp.open('GET', 'includes/delete_vote.php?recipe_id='+recipe_id+'&vote_user_id='+user_id+'', true);
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			  location.reload();
			}
		}
	xmlHttp.send(null);
	}
}

function chVote(recipe_id, vote, login_id) {
  xmlHttp = xmlhttp();
	if (login_id == 0) {
	  alert("Sie müssen sich einloggen, um Rezepte zu bewerten!");
	}
	else {
	  if (xmlHttp) {
		  xmlHttp.open('GET', 'includes/recipe_chvote.php?drink_id='+recipe_id+'&voting='+vote+'&noredirect=1', true);
		  xmlHttp.onreadystatechange = function () {
			  if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			    location.reload();
			  }
		  }
	    xmlHttp.send(null);
	  }
	}
}