/*////////////////////////////////////////////////////////////
/	function afficherEtats() (adaptée 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;
	}

//////////////////////////////////////////////////////////////////////////////////////////////////////
// Foncion changerImage(créé par B Lirette le 9 juin 2005)											//
// Fonction qui modifie une image dont le nom a été reçu en argument.								//
//////////////////////////////////////////////////////////////////////////////////////////////////////
function changerImage(strCheminURL, strNomImage, strSuffixe, strExtension)
	{
	//alert("strCheminURL: "+strCheminURL+", "+"strNomImage: "+strNomImage+", "+"strSuffixe: "+strSuffixe+", "+"strExtension: "+strExtension+", "+"strCurseur: "+strCurseur+" total:"+strCheminURL+strNomImage+strSuffixe+strExtension);
	document.images[strNomImage].src=strCheminURL+strNomImage+strSuffixe+strExtension;
	}

//
function prechargement(intNbImages) 
	{
	// compteur
	var i = 0;
	
	// créer l'objet
	objImages = new Image();
	
	// liste des images à précharger
	aImages = new Array();
	aImages[0]="btn_commercial_rl.gif"
	aImages[1]="btn_historique_rl.gif"
	aImages[2]="btn_industriel_rl.gif"
	aImages[3]="btn_produits_rl.gif"
	aImages[4]="btn_residentiel_rl.gif"
	aImages[5]="btn_territoires_rl.gif"
	aImages[6]="btn_videocom_rl.gif"
	aImages[7]="btn_english_rl.gif"

	// commencer le préchargement
	for(intCompteur = 0; intCompteur <= intNbImages-1; intCompteur++) 
		{
		objImages.src = aImages[intCompteur];
		};
	}

//
function openpopup(urlnouv,intWidth,intHeight)
	{
	winpops = window.open(urlnouv,"","width="+intWidth+",height="+intHeight+",");
	}

//
function MM_swapImgRestore()
	{ //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

//
function MM_preloadImages()
	{ //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

//
function MM_findObj(n, d)
	{ //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

//
function MM_swapImage()
	{ //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

/*////////////////////////////////////////////////////////////////////////////////////////////////////
// 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 "submit":
			blnConfirmation = confirm("Are you sure you want to submit the form?");
			break;
		case "soumettre":
			blnConfirmation = confirm("Êtes-vous certain(e) de vouloir envoyer le formulaire?");
			break;
		}
	
	if (blnConfirmation)
		{
		return true
		}
		else
		{
		return false
		};
	}