// JavaScript Document

/*////////////////////////////////////////////////////////////
/	function afficherEtats() (adapté par B. Lirette, 2007-11-07)
/	Fonction qui affiche les images de survol
/	strNomImage		=	nom de l'image à modifier					ie. btn_image_
/	strChemin		=	chemin vers l'image à afficher				ie. medias/images/
/	strEtat			=	nom de l'état à afficher					ie. rl, up
/	strFormat		=	nom de l'extension du fichier à afficher	ie. jpg, gif
////////////////////////////////////////////////////////////*/

function afficherEtats(strNomImage, strChemin, strEtat, strFormat)
	{
	// permet de gérer les mêmes occurrences se répétant dans la page
	strNomFichier = strNomImage.substring(0, strNomImage.length -1);

	// changement d'image
	document.images[strNomImage].src=strChemin+strNomFichier+strEtat+"."+strFormat;
	}

//
function gallerieImages(strNomImageCible, strCheminImageAfficher)
	{
	//alert(strChemin+strNomImage+strEtat+"."+strFormat);
	//document.images[strNomImage].src=strChemin+strNomImage+strEtat+"."+strFormat;
	
	//alert(strNomImageCible+" * "+strCheminImageAfficher);
	document.images[strNomImageCible].src=strCheminImageAfficher;
	}

//
function openpopup(urlnouv,intWidth,intHeight)
	{
	winpops = window.open(urlnouv,"","width="+intWidth+",height="+intHeight+",");
	}

//
function openpopupscroll(urlnouv,intWidth,intHeight)
	{
	winpops = window.open(urlnouv,"","width="+intWidth+",height="+intHeight+",resizable=1,scrollbars=1");
	}

/*////////////////////////////////////////////////////////////////////////////////////////////////////
// Foncion retournerValidationModification (créé par B Lirette, 2006-08-29)
// Fonction qui permet à l'utilisateur de confirmer la modification reçue en argument.
// strTypeMessage	=	argument déterminant le type de message énoncé à l'utilisateur
////////////////////////////////////////////////////////////////////////////////////////////////////*/
function retournerValidationModification(strTypeMessage)
	{
	var strMsgConfirmation = "";
	var blnConfirmation = "";
	
	switch(strTypeMessage)
		{
		case "delete":
			blnConfirmation = confirm("Êtes-vous certain(e) de vouloir supprimer l'enregistrement?");
			break;
		case "desinscrire":
			blnConfirmation = confirm("Êtes-vous certain(e) de vouloir désinscrire le client?");
			break;
		case "insert":
			blnConfirmation = confirm("Êtes-vous certain(e) de vouloir insérer l'enregistrement?");
			break;
		case "send":
			blnConfirmation = confirm("Êtes-vous certain(e) de vouloir envoyer le courriel?");
			break;
		case "undo":
			blnConfirmation = confirm("Êtes-vous certain(e) de vouloir annuler l'enregistrement?");
			break;
		case "duplicate":
			blnConfirmation = confirm("Êtes-vous certain(e) de vouloir dupliquer l'enregistrement?");
			break;
		case "update":
			//strMsgConfirmation = "Êtes-vous certain(e) de vouloir mettre à jour l'enregistrement?";
			blnConfirmation= true;
			break;
		}
	
	if (blnConfirmation)
		{
		return true
		}
		else
		{
		return false
		};
	}
