<!--

/* ==============================================================================
   Description : Librairie de fonctions utilitaires pour les 
					  différents fureteurs.
   Commentaire : Aucun
   Référence ..: Aucune
   ============================================================================== */

/* ===============================================================
	Permet de diriger le fureteur à une adresse spécifique.
	=============================================================== */
function GBL_Navigate(pstrURL) 
{
	if (document.all)				// IE
		window.navigate(pstrURL);
	else								// Netscape
		window.location.href = pstrURL;

	return;
} // function GBL_Navigate() 

/* ===============================================================
	Permet de mettre le focus sur un objet de contrôle.
	=============================================================== */
function GBL_SetFocus(pobjControl) 
{
	pobjControl.focus();
	pobjControl.select();			// highlight the contents of the control
	
	return;
}	// GBL_SetFocus


/* ==============================================================================
   Permet d'ouvrir une page dans une nouvelle instance d'un browser
   ============================================================================== */
function GBL_OpenWindow(pstrURL, pstrWindowName, pintWidth, pintHeight, pblnResizable, pblnScrollBars, pblnToolBar, pblnCentered, pblnTopRight, pblnFocus){
	var intPosLeft;
   var intPosTop;
   var strWindowProperties = "";
   var objWindow;
   
	if(pblnCentered)
	{
		intPosLeft = (screen.width - pintWidth)/2;
		intPosTop = (screen.height - pintHeight)/2;
   }

	if(pblnTopRight)
	{
		intPosLeft = (screen.width - pintWidth)/2 + 210;
		intPosTop = (screen.height - pintHeight)/2 - 200;
	}
	   
   if (pblnScrollBars)
		strWindowProperties += "scrollbars=yes,";

   if (pblnResizable)
		strWindowProperties += "resizable=yes,";

   if (pblnToolBar)
		strWindowProperties += "toolbar=yes,";
		
	objWindow = window.open(pstrURL, pstrWindowName, strWindowProperties + "width=" + pintWidth + ",height=" + pintHeight + ",left=" + intPosLeft + ",top=" + intPosTop); 
	
	if(pblnFocus)
		objWindow.focus();
	
	return;

} // GBL_OpenWindow

/* ===============================================================
	Permet de désactiver le clique droit de la souris.
	=============================================================== */
function DisableRightClick(e) 
{
	var strLanguage;

	strLanguage = GBL_GetLanguageFromURL(); 
	
	if (strLanguage == 'fr')
		strMessage = 'Clique droit désactivé, retour sur page non disponible.';
	else
		strMessage = 'Right click not activated, back function not available.';
	
	if (GBL_IsNetscape())
	{
		if(e.which==3){
			alert(strMessage);
			return false;
		}
	}
	else
	{
		if(event.button==2)
			alert(strMessage);
	}
		
} // DisableRightClick

/* ===============================================================
	Permet de valider si un addresse email est valide
	=============================================================== */
function GBL_IsEmail(pstrEmailAddress)
{
	var intAtCount;
	var intDotCount;
	var intLength;
	var intCounter;
	var strTemp;
	var blnReturnValue;

	// Initialiser les compteurs
	intAtCount=0;
	intDotCount=0;

	blnReturnValue=false;	// Default
	
	intLength=pstrEmailAddress.length;		// Get the length of the string passed

	if(intLength>0)
	{

		for(intCounter=0;intCounter<intLength;intCounter++)
		{
			strTemp=pstrEmailAddress.substr(intCounter,1);	// Get the current character
			if(strTemp=="@")				// Check the character to see if it's an @
			{
		      intAtCount=intAtCount + 1;		// If it is an @, add one to the value of atCount
			}
			
			if(strTemp==".")						// Check for a dot
			{
				intDotCount=intDotCount + 1;	// Add one to the value of perCount if it is
			}
		}	// On to the next character
//alert("at:"+intAtCount);
//alert("dot:"+intDotCount);

		if(intAtCount=1 && intDotCount>0)	// Check for 1 @ and at least 1 dot
		{
			blnReturnValue=true;	// Set the return value of the function to true
		}	
	}
	else
	{
		blnReturnValue=true;
	}
		
	return blnReturnValue;

}	// GBL_IsEmail

//-->


