   /****************************************************************************************************
                                  						Trim
  ****************************************************************************************************/	
	function trim(str)
	{
		str += "";
		if(str.length < 1)
			return "";
		
		str = rTrim(str);
		str = lTrim(str);
		return str + "";
	} //Fin trim
  /****************************************************************************************************
                                  						Trim Right
  ****************************************************************************************************/
	function rTrim(str)
	{
		var w_space  = String.fromCharCode(32);
		var v_length = str.length;
		var strTemp  = "";
		if(v_length < 0)
			return "";
		
		var iTemp = v_length -1;
		while(iTemp > -1)
		{
			if(str.charAt(iTemp) != w_space)
			{
				strTemp = str.substring(0,iTemp +1);
				break;
			} //Fsi
			iTemp = iTemp-1;
		} //FTQ
		return strTemp + "";
	} //Fin rTrim
 

/***************************************************************************************************
           Affiche une fenêtre popup sur l'écran à la position x, y et avec un scroll ou non 
  ***************************************************************************************************/
  function popup_scroll(file, win_w, win_h, scroll,  xOffset, yOffset)
  {
    if (scroll==true)
	  window.open(file,'', 'status=no,scrollbars=yes,toolbar=no,width='+win_w+',height='+win_h+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
	else
      window.open(file,'', 'status=no,scrollbars=no,toolbar=no,width='+win_w+',height='+win_h+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
  } //Fin popup_scroll


 /****************************************************************************************************
                           Affiche une fenêtre popup centrée sur l'écran
  ***************************************************************************************************/
  function popup(file,win_w,win_h)
  {
    //--> Résolution de l'écran
    if (document.all)
	  var xMax = screen.width, yMax = screen.height;
    else
	  if (document.layers)
	    var xMax = window.outerWidth, yMax = window.outerHeight;
	  else
	    var xMax = 640, yMax=480;

    //---> Position par rapport à l'écran
    var xOffset = (xMax - win_w)/2, yOffset = (yMax - win_h)/2;
  
    //---> Ouverture de la fenêtre
	popup_scroll(file, win_w, win_h, false,  xOffset, yOffset);
  } //Fin popup
  
  /****************************************************************************************************
                                  						Trim Left
  ****************************************************************************************************/
	function lTrim(str)
	{
		var w_space  = String.fromCharCode(32);
		var v_length = str.length;
		var strTemp  = "";
		if(v_length < 0)
			return "";
		
		var iTemp = 0;
		while(iTemp > -1)
		{
			if(str.charAt(iTemp) != w_space)
			{
				strTemp = str.substring(iTemp,v_length);
				break;
			} //Fsi
			iTemp = iTemp+1;
		} //FTQ
		return strTemp + "";
	} //Fin lTrim