function aide_cuisson(pLabel)
{
    w = 420;
    h = 140;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=no, resizable';
    win = window.open("aide_cuisson.php?label="+pLabel, "aide_cuisson", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function montrer_aide_ingredient()
{
    w = 700;
    h = 570;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=no, resizable';
    win = window.open("aide_ingredient.html", "aide_ingredient", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function montrer_aide_recherche()
{
    w = 700;
    h = 690;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=no, resizable';
    win = window.open("aide_recherche.html", "aide_recherche", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function montrer_aide_redim()
{
    w = 600;
    h = 500;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=no, resizable';
    win = window.open("aide_redimensionner.html", "aide_redim", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function montrer_conversions()
{
    w = 320;
    h = 340;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=no, resizable';
    win = window.open("aide_conversion.html", "conversions", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function aide_categorie()
{
    w = 720;
    h = 200;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=no, resizable';
    win = window.open("aide_categorie.html", "aide_categorie", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function imprimer_recette(pRecetteId, pPortion, pColors, pImages)
{
    w = 800;
    h = 600;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=yes, resizable';
    win = window.open("imprimer.php?recette_id=" + pRecetteId +"&imprimer=true&couleurs=" + pColors+"&images=" + 
pImages+"&portion_calcul=" + pPortion, "imprimer_recette", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function montrer_photo(pRecetteId, pPhotoId, pNumPhoto)
{
    w = 920;
    h = 650;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=yes, resizable';
	win = window.open("photo.php?recette_id="+pRecetteId+"&photo_id="+pPhotoId+"&num_photo="+pNumPhoto, "montrer_photo", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function envoyer_recette(pRecetteId)
{
    w = 700;
    h = 400;
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2 - 50; // -50px for the taskbar
	
    winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars=yes, menubar=yes, resizable';
    win = window.open("envoyer.php?recette_id=" + pRecetteId, "envoyer_recette", winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function supprIngredient(pIngredientId, pRecetteId)
{
	document.form_recette.delete_ingredient_id.value = pIngredientId;
	document.form_recette.prev_action.value = "ingredient";
	document.form_recette.submit();
}

function inverserIngredient(pOrdrePrecedent, pOrdreSuivant, pRecetteId)
{
	document.form_recette.ordre_precedent_id.value = pOrdrePrecedent;
	document.form_recette.ordre_suivant_id.value = pOrdreSuivant;
	document.form_recette.prev_action.value = "ingredient";
	document.form_recette.submit();
}

function supprPhoto(pPhotoId, pRecetteId)
{
	document.form_recette.delete_photo_id.value = pPhotoId;
	document.form_recette.prev_action.value = "photo";
	document.form_recette.submit();
}

function inverserPhoto(pPhotoPrecedente, pPhotoSuivante, pRecetteId)
{
	document.form_recette.photo_precedente_id.value = pPhotoPrecedente;
	document.form_recette.photo_suivante_id.value = pPhotoSuivante;
	document.form_recette.prev_action.value = "photo";
	document.form_recette.submit();
}