function submitemail() {
	var form = document.frontendForm;
	if (form.email.value == "" || form.youremail.value == "") {
		alert( '<?php echo addslashes( _EMAIL_ERR_NOINFO ); ?>' );
		return false;
	}

	xajax_doSubmitEmail(form.email.value, form.youremail.value, form.yourname.value, form.recipe_id.value, form.subject.value);
}

function addtoshoppinglist(recipeid,myid) {
	xajax_doAddRecipeToShoppingList(recipeid,myid);
}

function addtofavourites(recipeid,myid) {
	xajax_doAddToFavourites(recipeid,myid);
}

function submitvote() {
	var form = document.rr_vote;
	var vote;
	
	vote = rrgetCheckedValue(form.vote);
	if (vote == "" && form.comment.value == "") {
		alert( 'Please fill in the vote or the comment or both');
		return false;
	}

	xajax_doSubmitVoteComment(vote, form.comment.value, form.recipe_id.value);
}

function rrgetCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
