function recipes_do_vote(recipe_id, rating, text)
{
	// switch the specs
	//el_new_id('fiche_specs', 'fiche_specs_log');
	
	// hide vote selector
	el_hide('fiche_evaluate');
	
	// update personnal quote text
	el_update('rating_text', text);
	
	// update rating image
	img_src('rating_img', 'images/etoiles_' + rating + '.gif');
	
	// send vote
	makePostRequest('recipes.php?action=vote', 'id=' + recipe_id + '&rating=' + rating, 'recipes_vote_callback');
}

function recipes_vote_callback() { }

function recipes_do_book_vote(recipe_id, rating)
{
	$('current_rating_' + recipe_id).style['width'] = (rating * 15) + 'px';
	
	// send vote
	makePostRequest('recipes.php?action=vote', 'id=' + recipe_id + '&rating=' + rating, 'recipes_vote_book_callback');	
}

function recipes_vote_book_callback() { }

function printer_friendly(recipe_id, lang)
{
	var win = pop_window('recipes.php?action=print&lang=' + lang + '&id=' + recipe_id, 'recipeprint', '620', '600', 'scrollbars=yes');
}

function add_to_book(recipe_id)
{
	el_hide('not_in_book');
	
	el_show('in_book');
	
	makePostRequest('recipes.php?action=addtobook', 'id=' + recipe_id, 'add_to_book_callback');
}

function add_to_book_callback() { }

function flash_recipes_next()
{
	if ((recipe_list.length - 1) == current_recipe)
	{
		current_recipe = 0;
	}
	else
	{
		current_recipe++;
	}
	
	el_update('flash_recipe_link', '<a href="recipes.php?lang=' + lang + '&id=' + recipe_list[current_recipe][0] + '">' + recipe_list[current_recipe][1] + '</a>');
	
	var el_image = $('flash_recipe_image');
	el_image.src = recipe_list[current_recipe][2];	
	el_image.onclick = function()
	{
		document.location = 'recipes.php?lang=' + lang + '&id=' + recipe_list[current_recipe][0];
	}
}

function flash_recipes_previous()
{
	if ((current_recipe - 1) < 0)
	{
		current_recipe = (recipe_list.length - 1);
	}
	else
	{
		current_recipe--;
	}
	
	var el_image = $('flash_recipe_image');
	var el_link = $('flash_recipe_link');

	el_update('flash_recipe_link', '<a href="recipes.php?lang=' + lang + '&id=' + recipe_list[current_recipe][0] + '">' + recipe_list[current_recipe][1] + '</a>');
	//img_src('flash_recipe_image', recipe_list[current_recipe][2]);
	el_image.src = recipe_list[current_recipe][2];
	
}

function captcha_validator(valid)
{
	if (valid == true)
	{
		document.frm.submit();
	}
	else
	{
		document.frm.captcha.className = 'inscript_login_input_error';
	}
}

function captcha_reload(newhash)
{
	img_src('captcha_img', 'lost.password.php?security=' + newhash);
	document.frm['captcha_hash'].value = newhash;
}