// Nicolas - 01/23/2002 16:38:16 - V1.0.0

/*************** Script functions in this file **************
Filename: detect.js; as of 09/24/2001
  FUNCTION:                                               LINE:
  Fl_DetectFlash()                                         72   
  Fl_DetectFlashVb()                                       61   
************ (end Script functions in this file) ***********/

// Determine Versions
var agent=navigator.userAgent.toLowerCase();
var browser=navigator.appName.toLowerCase();
var versMajor = parseInt(navigator.appVersion);
var versMinor = parseFloat(navigator.appVersion);

// Determine browser.
var isNS = (browser.indexOf("netscape") >= 0);
var isIE = (browser.indexOf("internet explorer") >= 0); // (agent.indexOf("msie") != -1);
var isOpera = (agent.indexOf('opera') != -1);
var isAOL = (agent.indexOf("aol") != -1);
var isWebTV = (agent.indexOf("webtv") != -1);

// NS
var isNS2 = (isNS && (versMajor == 2));
var isNS3 = (isNS && (versMajor == 3));
var isNS4 = (isNS && (versMajor == 4));
var isNS5 = (isNS && (versMajor == 5));
var isNS6 = (isNS && document.getElementById != null);
var isMinNS6 = isNS6;
var isMinNS4 = (isNS && (versMajor >= 4)) && ! isMinNS6;
var isMinNS5 = (isNS && (versMajor >= 5));

// IE
var isIE3 = (isIE && (versMajor < 4));
var isIE4  = (isIE && (versMajor == 4) && (agent.indexOf("msie 5.")==-1) && (agent.indexOf("msie 6.")==-1));
var isIE5  = (isIE && (versMajor == 4) && (agent.indexOf("msie 6.")==-1) && (agent.indexOf("msie 5.")!=-1));
var isIE55 = (isIE5 && (navigator.appVersion.indexOf("5.5") >= 0));
var isIE6 = (navigator.appVersion.indexOf("6.") >= 0);
var isMinIE4 = (isIE && versMajor >= 4);
var isMinIE6 = isIE6;
var isMinIE5 = (isMinIE4 && (navigator.appVersion.indexOf("5.") >= 0) || isMinIE6);
var isMinIE55 = (isMinIE4 && (navigator.appVersion.indexOf("5.5") >= 0));

var isIENS6 = isIE || isMinNS6 ;

// AOL
var isAOL3  = (isAOL && isIE3);
var isAOL4  = (isAOL && isIE4);

// Determine OS
var isMac = (navigator.appVersion.indexOf("Mac") >= 0);
var isWin = (navigator.appVersion.indexOf("Win") >= 0);
var isLinux = (navigator.appVersion.indexOf("Linux") >= 0);

// Versions
if (isNS2)
	browserVersion = "2";
if (isIE3 || isNS3)
	browserVersion = "3";
if (isIE4 || isNS4)
	browserVersion = "4";
if (isIE5)
	browserVersion = "5";
if (isMinIE55)
	browserVersion = "5.5";
if (isNS6)
	browserVersion = "6";

// Determine Flash
// ********************************** FALSH DETECT
var Fl_requiredVersion = 4;			// version the user needs to view site (max is 5, min is 2)
var Fl_flash2Installed = false;		// boolean. true if flash 2 is installed
var Fl_flash3Installed = false;		// boolean. true if flash 3 is installed
var Fl_flash4Installed = false;		// boolean. true if flash 4 is installed
var Fl_flash5Installed = false;		// boolean. true if flash 5 is installed
var Fl_maxVersion = 5;					// highest version we can actually detect
var Fl_actualVersion = 0;				// version the user really has
var Fl_hasRightVersion = false;		// boolean. true if it's safe to embed the flash movie in the page
var Fl_isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		// true if we're on ie
var Fl_isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows
function Fl_DetectFlashVb() {
  if(Fl_isIE && Fl_isWin){ // don't write vbscript tags on anything but ie win
  	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  	document.write('on error resume next \n');
  	document.write('Fl_flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  	document.write('Fl_flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  	document.write('Fl_flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  	document.write('Fl_flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
  	document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
  }
}
function Fl_DetectFlash() {
  if (navigator.plugins){								// does navigator.plugins exist?
    if (navigator.plugins["Shockwave Flash 2.0"] 	// yes>> then is Flash 2 
    || navigator.plugins["Shockwave Flash"]){		// or flash 3+ installed?
    	var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
    	var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
    	var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
    	Fl_flash2Installed = flashVersion == 2;		
    	Fl_flash3Installed = flashVersion == 3;
    	Fl_flash4Installed = flashVersion == 4;
    	Fl_flash5Installed = flashVersion == 5;
    }
  }
  for (var i = 2; i <= Fl_maxVersion; i++) {	
  	if (eval("Fl_flash" + i + "Installed") == true) Fl_actualVersion = i;
  }
  if(navigator.userAgent.indexOf("WebTV") != -1) Fl_actualVersion = 2;	
  if (Fl_actualVersion >= Fl_requiredVersion) { 		// user has a new enough version
  	Fl_hasRightVersion = true;						// flag: it's okay to write out the object/embed tags later
    return true;
  }
  return false;
}  

// --------------------------------
// Plugin Detection
// --------------------------------

/*
Plugin Detector()

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: webmonkey@giantant.com
*/

// this is where we write out the VBScript for MSIE Windows
var WM_startTagFix = '</';
var msie_windows = 0;
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)){
  msie_windows = 1;
  document.writeln('<script language="VBscript">');
  document.writeln('\'This will scan for plugins for all versions of Internet Explorer that have a VBscript engine version 2 or greater.');
  document.writeln('\'This includes all versions of IE4 and beyond and some versions of IE 3.');
  document.writeln('Dim WM_detect_through_vb');
  document.writeln('WM_detect_through_vb = 0');
  document.writeln('If ScriptEngineMajorVersion >= 2 then');
  document.writeln('  WM_detect_through_vb = 1');
  document.writeln('End If');
  document.writeln('Function WM_activeXDetect(activeXname)');
  document.writeln('  on error resume next');
  document.writeln('  If ScriptEngineMajorVersion >= 2 then');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('     WM_activeXDetect = IsObject(CreateObject(activeXname))');
  document.writeln('     If (err) then');
  document.writeln('        WM_activeXDetect = False');
  document.writeln('     End If');
  document.writeln('   Else');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('   End If');
  document.writeln('End Function');
  document.writeln(WM_startTagFix+'script>');
}

function WM_pluginDetect(plugindescription, pluginxtension, pluginmime, activeXname){
  //This script block will test all user agents that have a real plug-in array
  //(i.e. Netscape) and set the variables, otherwise it directs the routine
  // to WM_activeXDetect to detect the activeX control.

  // First define some variables
  var i,plugin_undetectable=0,detected=0, daPlugin=new Object();
  plugin_undetectable = (msie_windows && WM_detect_through_vb)?0:1;

  // If it has a real plugins or mimetypes array, we look there for the plugin first
  if (navigator.plugins) {
    numPlugins = navigator.plugins.length;
    if (numPlugins > 1) {
	    if (navigator.mimeTypes && navigator.mimeTypes[pluginmime] && navigator.mimeTypes[pluginmime].enabledPlugin && (navigator.mimeTypes[pluginmime].suffixes.indexOf(pluginxtension) != -1)) { // seems like we have it, let's just make sure and check the version (if specified)
	      if ((navigator.appName == 'Netscape') && (navigator.appVersion.indexOf('4.0') != -1)) { // stupid, stupid Netscape can't handle the references to navigator.plugins by number, sooo...
    		  for(i in navigator.plugins) {
		        if ((navigator.plugins[i].description.indexOf(plugindescription) != -1) || (i.indexOf(plugindescription) != -1)) { // some versions of quicktime have no description. feh!
    			   detected=1;
		         break;
		        }
		      }
	      } else {
		      for (i = 0; i < numPlugins; i++) {
		        daPlugin = navigator.plugins[i];
		        if ((daPlugin.description.indexOf(plugindescription) != -1) || (daPlugin.name.indexOf(plugindescription) != -1)) {
			        detected=1;
			        break;
		        }
		      }
	      }

  	    // Mac weirdness
        if (navigator.mimeTypes[pluginmime] == null) {
    		  detected = 0;
  	    }
	    }
	    return detected;
      } else if((msie_windows == 1) && !plugin_undetectable){
	      return WM_activeXDetect(activeXname);
      } else { 		
	      return 0;
      }
    } else {
      return 0;
  }
}

// this next function just makes it easy to detect the common plugins
function WM_easyDetect(whichPlugin) {
  // this function just makes it easy to do basic plug-in detection without
  // knowing all the mimetypes and activeX names and such
  var isItThere = 0;
  if( (whichPlugin == 'flash') || (whichPlugin == 'Flash') ) {
    isItThere = WM_pluginDetect('Flash', 'swf', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash');
  } else if( (whichPlugin == 'director') || (whichPlugin == 'Director') ) {
    isItThere = WM_pluginDetect('Shockwave', 'dcr', 'application/x-director', 'SWCtl.SWCtl.1');
  } else if( (whichPlugin == 'quicktime') || (whichPlugin == 'Quicktime') || (whichPlugin == 'QuickTime') ) {
    isItThere = WM_pluginDetect('QuickTime', 'mov', 'video/quicktime', 'QuickTimeCheckObject.QuickTimeCheck.1');
  } else if( (whichPlugin == 'realaudio') || (whichPlugin == 'Realaudio') || (whichPlugin == 'RealAudio') ) {
    isItThere = (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin', 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','rmocx.RealPlayer G2 Control')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealVideo.RealVideo(tm) ActiveX Control (32-bit)'))
  } else {
    alert('You need to tell me which plug-in to look for, like so:\n\n' + '          WM_easyDetect(\'flash\')\n\n' + '          WM_easyDetect(\'director\')\n\n' + '          WM_easyDetect(\'quicktime\')\n\n' + '          WM_easyDetect(\'realaudio\')');
  }
  return isItThere;
}
// Nicolas - 2002-10-30 15:13:25 - V1.0.18
// Nicolas - 2002-10-08 19:33:23 - V1.0.17
// Nicolas - 2002-09-10 13:01:17 - V1.0.16
// Nicolas - 2002-07-01 16:59:48 - V1.0.15
// Nicolas - 2002-06-19 13:00:44 - V1.0.14
// lepine - 2002-06-12 13:41:35 - V1.0.13
// lepine - 2002-06-06 11:26:08 - V1.0.12
// Nicolas - 2002-05-23 14:25:14 - V1.0.11 -- modifs moveLayerTo (bInScreen, dx, dy)
// Reno - 2002-05-15 13:55:06 - V1.0.10
// Reno - 2002-05-06 18:45:32 - V1.0.9
// Nicolas - 2002-05-02 14:30:08 - V1.0.8
// Nicolas - 2002-04-30 10:53:44 - V1.0.7
// Nicolas - 2002-04-26 18:35:21 - V1.0.6
// Reno - 2002-02-08 16:18:09 - V1.0.5
// Nicolas - 01/30/2002 18:50:00 - V1.0.4
// lepine - 01/25/2002 11:45:04 - V1.0.3
// Nicolas - 01/23/2002 17:42:11 - V1.0.2

/******************************************************************************
* dhtmllib.js                                                                 *
*                                                                             *
* Copyright 1999 by Mike Hall.                                                *
* Web address: http://www.brainjar.com                                        *
* Last update: February 26, 2000.                                             *
*                                                                             *
* Provides basic functions for DHTML positioned elements which will work on   *
* both Netscape Communicator and Internet Explorer browsers (version 4.0 and  *
* up).                                                                        *
******************************************************************************/

// requiert detect.js
// Compatible NS6 - Nicolas - last modified : 10/12/01 
//-----------------------------------------------------------------------------
// Global var
//-----------------------------------------------------------------------------
var bDHTMLDebug = false;	// show debug (object not found)

//-----------------------------------------------------------------------------
// Common function
//-----------------------------------------------------------------------------
function isNullLayer(layer,strFunc)
{
	if (strFunc == null) strFunc = "";

	if (layer == null)
	{
  	if (bDHTMLDebug) alert(strFunc+" : layer is null");
		return true;
	}
	return false;
}


//-----------------------------------------------------------------------------
// Layer visibility.
//-----------------------------------------------------------------------------
function hideLayer(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"hide")) return;
	if (isMinNS4) layer.visibility = "hide";
  if (isIENS6) layer.style.visibility = "hidden";
	return;
}

function showLayer(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"show")) return;

  if (isMinNS4) layer.visibility = "show";
  if (isIENS6) layer.style.visibility = "visible";
	return;
}

function inheritLayer(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"inherit")) return;
  if (isMinNS4) layer.visibility = "inherit";
  if (isIENS6) layer.style.visibility = "inherit";
  return;
}

function getVisibility(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"visibility")) return;

  if (isMinNS4) {
    if (layer.visibility == "show") return "visible";
    if (layer.visibility == "hide")  return "hidden";
    return layer.visibility;
  }
  if (isIENS6) return layer.style.visibility;
  return;
}

//-----------------------------------------------------------------------------
// Layer content modification.
//-----------------------------------------------------------------------------
function writeLayer(layer,txt) 
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"write")) return;

  if (isMinNS4) 
	{
		layer.document.close();
	  layer.document.write(txt);
		layer.document.close();
	}
  if (isIENS6) 
    if (layer.innerHTML != null)layer.innerHTML = txt;
    else if (layer.document) layer.document.body.innerHTML = txt;
	return;
}

// keep for compatibility
function writeILayer(layer,txt){  
  if (typeof(layer) == "string") layer = getLayer(layer);
  writeLayer(layer,txt);
  return;
}

function writeILayerOuter(layer,txt)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"writeILayer")) return;
  if (isMinNS4)	writeLayer(layer,txt); // pas supporté par NS4
  if (isIENS6) layer.document.body.outerHTML = txt;
  return;
}

//-----------------------------------------------------------------------------
// visibility + positionning.
//-----------------------------------------------------------------------------
function SetOff() {
  var a=SetOff.arguments;
  for (i = 0; i < a.length; i++) {
    hideLayer(a[i]);
  }
}
function SetLayer(IdOn, IdOff, cx, cy) {
  if (IdOn) {
    if (isMinNS4) { cx-=0; cy-=0; }
//    if (isIENS6) {
      cx += getPageScrollX(); 
      cy += getPageScrollY(); 
//    }
  	moveLayerTo(IdOn, cx, cy);
    showLayer(IdOn);
  }
  if (IdOff){
    hideLayer(IdOff);
  }
}

var SL_pull_Int = false;
var SL_pull_To = 30;
var SL_pull_Pad = 15;
var SL_pull_IdOn = false;
var SL_pull_Cy = 0;
function SetLayer_pullengine(IdOn, cy){
  pObj = IdOn;
  if (getClipHeight(pObj) < cy) {
    clipLayer(pObj, 0, 0, getClipRight(pObj), getClipBottom(pObj)+SL_pull_Pad);
  } else {
    clearInterval(SL_pull_Int);
    SL_pull_Int = false;
    SL_pull_IdOn = false;
  }
}

function SetLayer_pull(IdOn, IdOff, cx, cy, bNotPull) {
  if (SL_pull_IdOn) {
    if (SL_pull_Int) clearInterval(SL_pull_Int);
    objOn = getLayer(SL_pull_IdOn);
    clipLayer(objOn, 0, 0, getWidth(objOn)+10, SL_pull_Cy);
  }
  if (bNotPull) return SetLayer(IdOn, IdOff, cx, cy);
  if (IdOff){
    objOff = getLayer(IdOff);
    hideLayer(objOff);
  }
  if (IdOn) {
    SL_pull_IdOn = IdOn;
    objOn = getLayer(IdOn);
    if (isMinNS4) { cx-=0; cy-=0; }
  	moveLayerTo(objOn, cx, cy);
    SL_pull_Cy = getHeight(objOn);
    clipLayer(objOn, 0, 0, getWidth(objOn)+10, 15);
    showLayer(objOn);
    SL_pull_Int = setInterval("SetLayer_pullengine('"+IdOn+"', "+SL_pull_Cy+")", SL_pull_To);
  }
}

//-----------------------------------------------------------------------------
// Layer properties.
//-----------------------------------------------------------------------------
function getLeft(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"left")) return;
  if (isMinNS4) return layer.left;
  if (isIENS6) return layer.style.pixelLeft;
  return;
}

function getTop(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"top")) return;
  if (isMinNS4) return layer.top;
  if (isIENS6) return layer.style.pixelTop;
  return;
}

function getRight(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"right")) return;
  if (isIENS6) return getLeft(layer) + getWidth(layer);
  return;
}

function getBottom(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"bottom")) return;
  if (isIENS6) return getTop(layer) + getHeight(layer);
  return;
}

function getPageLeft(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"left")) return;
  if (isMinNS4) return layer.pageX;
  if (isIENS6) {
    x = 0;
    while (layer.offsetParent != null) {
      x += layer.offsetLeft;
      layer = layer.offsetParent;
  }
    x += layer.offsetLeft;
    return x;
  }
  return;
}

function getPageRight(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"right")) return;
	return getPageLeft(layer)+getWidth(layer);
}

function getPageTop(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"top")) return;
  if (isMinNS4) return layer.pageY;
  if (isIENS6) 
	{
    y = 0;
    while (layer.offsetParent != null) 
		{
      y += layer.offsetTop;
      layer = layer.offsetParent;
    }
    y += layer.offsetTop;
    return y;
  }
  return;
}

function getPageBottom(layer) 
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"bottom")) return;
	return getPageTop(layer)+getHeight(layer);
}

function getWidth(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"width")) return;

  if (isMinNS4) 
	{
    if (layer.document.width) return layer.document.width;
    else return layer.clip.right - layer.clip.left;
  }
  if (isMinNS6) return parseInt(layer.offsetWidth);
  if (isMinIE4) 
    if (layer.style.pixelWidth) return layer.style.pixelWidth;
    else return layer.clientWidth;
  return;
}

function setWidth(layer,iWidth) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"width")) return;
  if (isMinNS4) 
	{
    if (layer.document.width) layer.document.width = iWidth;
  }
  if (isMinNS6) {
    layer.offsetWidth = iWidth;
  }
  if (isMinIE4) 
	{
    if (layer.style.pixelWidth) layer.style.pixelWidth = iWidth;
    else layer.clientWidth = iWidth;
  }
  return iWidth;
}

function getHeight(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"height")) return;
  if (isMinNS4) 
	{
    if (layer.document.height) return layer.document.height;
    else return layer.clip.bottom - layer.clip.top;
  }
  if (isMinNS6) {
    return parseInt(layer.offsetHeight);
  }
  if (isMinIE4) 
	{
    if (layer.style.pixelHeight) return layer.style.pixelHeight;
    else return layer.clientHeight;
  }
  return;
}

function setHeight(layer,iHeight) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"height")) return;
  if (isMinNS4)
	{
    if (layer.document.height) layer.document.height = iHeight;
  }
  if (isMinNS6) {
    layer.offsetHeight = iHeight;
  }
  if (isMinIE4) 
	{
    if (layer.style.pixelHeight) layer.style.pixelHeight = iHeight;
    else layer.clientHeight = iHeight;
  }
  return iHeight;
}

function getContentHeight(layer) { 
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"height")) return;
  if (isMinNS4) {
    if (layer.document.height) return layer.document.height;
    else return layer.clip.bottom - layer.clip.top;
  }
  if (isIENS6) return parseInt(layer.scrollHeight);
  return;
}

function getContentWidth(layer) { 
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"width")) return;
  if (isMinNS4) {
    if (layer.document.width) return layer.document.width;
    else return layer.clip.right - layer.clip.left;
  }
  if (isIENS6) return parseInt(layer.scrollWidth);
  return;
}

function resizeLayerTo(layer, pWidth, pHeight)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isMinNS4)
	{
		layer.height = pHeight;
		layer.width = pWidth;
	}
  if (isIENS6)
  {
  	layer.style.width = pWidth;
  	layer.style.height = pHeight;
  }
  return;
}

//-----------------------------------------------------------------------------
// Move Layer
//-----------------------------------------------------------------------------
function moveLayerTo(layer, x, y, bInScreen) {
  if (bInScreen) return moveLayerToInScreen(layer, x, y);
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"moveto ")) return;
  if (isMinNS4) layer.moveTo(parseInt(x), parseInt(y));
  if (isMinIE4) {
    layer.style.pixelLeft = x;
    layer.style.pixelTop  = y;
  }
  if (isMinNS6) {
    layer.style.left = x+"px";
    layer.style.top = y+"px";
	}
  return;
}

// Bouge le layer en le laissant dans l'ecran
function moveLayerToInScreen(layer, x, y, dx, dy) {
  if (typeof(layer) == "string") layer = getLayer(layer);

  if (x == null) x = getPageLeft(layer);
  if (y == null) y = getPageTop(layer);
  if (dx == null) dx = 0;
  if (dy == null) dy = 0;
  
  iLeft = x+dx ;
  iRight = iLeft + getWidth(layer);
  iTop = y+dy;
  iBottom = iTop + getHeight(layer);
  
  iLeftwin = getPageScrollX();
  iRightwin = iLeftwin+getWindowWidth();
  iTopwin = getPageScrollY();
  iBottomwin = iRightwin+getWindowHeight();
  
	ix = (iRight > iRightwin)?iRightwin - getWidth(layer):iLeft;
	iy = (iBottom > iBottomwin)?iBottomwin - getHeight(layer):iTop;
	
	if (ix < iLeftwin) ix = iLeftwin;
	if (iy < iTopwin) iy = iTopwin;
	
  return moveLayerTo(layer, ix, iy, 0);
}

function setLayerTop(layer,y)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"moveto")) return;
  if (isMinNS4) layer.moveTo(getLeft(layer), parseInt(y));
  if (isMinIE4) {
    layer.style.pixelTop  = y;
  }
  if (isMinNS6) {
    layer.style.top = y+"px";
	}
  return;
}

function setLayerLeft(layer,x)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"moveto")) return;
  if (isMinNS4) layer.moveTo(parseInt(x), getTop(layer));
  if (isMinIE4) {
    layer.style.pixelLeft  = x;
  }
  if (isMinNS6) {
    layer.style.left = x+"px";
	}
  return;
}


function moveLayerBy(layer, dx, dy) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"moveby")) return;
  if (isMinNS4) layer.moveBy(dx, dy);
  if (isMinIE4)
  {
    layer.style.pixelLeft += dx;
    layer.style.pixelTop  += dy;
  }
  if (isMinNS6) {
    layer.style.left = parseInt(layer.style.left) + dx+"px";
    layer.style.top  = parseInt(layer.style.top) + dy+"px";
  }
  return;
}

function moveLayerToLayer(layer, ilayer, dx , dy, bInScreen)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
  if (typeof(ilayer) == "string") ilayer = getLayer(ilayer);
  if (dx == null) dx = 0;
  if (dy == null) dy = 0;
	if (isNullLayer(layer, "movelayertolayer : layer") || isNullLayer(ilayer,"movelayertolayer :ilayer")) return;
  moveLayerTo(layer, getPageLeft(ilayer)+dx, getPageTop(ilayer)+dy, bInScreen);
  return;
}

function moveLayerToEvent(layer, e, dx , dy, bInScreen)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer, "movelayertoevent : "+layer)) return;
  if (dx == null) dx = 0;
  if (dy == null) dy = 0;
  moveLayerTo(layer, getPageX(e)+dx, getPageY(e)+dy, bInScreen);
  return;
}

function moveLayerToLayerMv(player,pilayer,distx,disty)
{
  if (typeof(player) == "string") player = getLayer(player);
  if (typeof(pilayer) == "string") pilayer = getLayer(pilayer);

	if (isNullLayer(layer,"movelayertolayer : layer") || isNullLayer(ilayer,"movelayertolayer :ilayer")) return;

	if (!distx && !disty)
	{
		distx = getPageLeft(ilayer) - getPageLeft(layer);
		disty = getPageTop(ilayer) - getPageTop(layer);
	}
	if (distx == 0)	signex = 1;
	else signex = parseInt(Math.abs(distx)/distx);
	if (disty == 0)	signey = 1;
	else signey = parseInt(Math.abs(disty)/disty);
	jx=parseInt(signex*Math.abs(distx)/50);
	jy=parseInt(signey*Math.abs(disty)/50);
	
	while (Math.abs(getPageLeft(layer) - getPageLeft(ilayer)) > Math.abs(jx) ||  Math.abs(getPageTop(layer)- getPageTop(ilayer)) > Math.abs(jy))
	{
		if (Math.abs(getPageLeft(layer) - getPageLeft(ilayer)) <  Math.abs(jx)) jx = 0;
		if (Math.abs(getPageTop(layer) - getPageTop(ilayer)) <  Math.abs(jy)) jy = 0;
		moveLayerBy(layer, jx, jy);
		setTimeout("moveLayerToLayerMv(\""+player+"\",\""+pilayer+"\","+distx+","+disty+")",1);
		return;
	}	
	moveLayerToLayer(player,pilayer);
	return;
}

function centerLayerW(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"centerw")) return;
	var x = (getPageWidth()-getWidth(layer)) / 2;
	moveLayerTo(layer,x,0);
  return;
}

function centerLayerH(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"centerh")) return;
	var y = (getPageHeight()-getHeight(layer)) / 2;
	moveLayerTo(layer,0,y);
  return;
}

function centerLayer(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"center")) return;
	var x = (getPageWidth()-getWidth(layer)) / 2;
	var y = (getPageHeight()-getHeight(layer)) / 2;
	moveLayerTo(layer,x,y);
  return;
}

//-----------------------------------------------------------------------------
// Z-Index
//-----------------------------------------------------------------------------
function getzIndex(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"z-index")) return;
	if (isMinNS4) return layer.zIndex;
  if (isMinIE4  || isMinNS6) return layer.style.zIndex;
  return;
}

function setzIndex(layer, z) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"z-index")) return;
  if (isMinNS4) layer.zIndex = z;
  if (isIENS6) layer.style.zIndex = z;
  return;
}

function moveAbove(layer,win)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	var max=0;
	if (!win) win =window;
  if (isIE) tab = win.document.all.tags("DIV");
  else tab = document.layers;
  
  if (tab)
  {
  	for (i=0;i<tab.length;i++)
  		if (getzIndex(tab[i]) > max) max = getzIndex(tab[i]);
  }
  	
  if (isNS6) layer.moveAbove();  
	else setzIndex(layer, max+1)
  return;
}

function moveBelow(layer,win)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	var min=0;
	if (!win) win =window;
	if (isIE) tab = win.document.all.tags("DIV");
  else tab = document.layers;
	for (i=0;i<tab.length;i++)
		if (getzIndex(tab[i]) < min) min = getzIndex(tab[i]);
	
	if (isNS6) layer.moveAbove();  
  else setzIndex(layer, min-1)
  return;
}


//-----------------------------------------------------------------------------
// Layer clipping.
//-----------------------------------------------------------------------------
function clipLayer(layer, clipleft, cliptop, clipright, clipbottom) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"clip")) return;

  if (isMinNS4) {
    layer.clip.left   = clipleft;
    layer.clip.top    = cliptop;
    layer.clip.right  = clipright;
    layer.clip.bottom = clipbottom;
  }
  if (isIENS6)
    layer.style.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';
  return;
}

function getClipLeft(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"clipleft")) return;

  if (isMinNS4)
    return layer.clip.left;
  if (isIENS6) {
    var str =  layer.style.clip;
    if (!str)
      return 0;
    var clip = getIEClipValues(layer.style.clip);
    return(clip[3]);
  }
  return;
}

function getClipTop(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"cliptop")) return;

  if (isMinNS4)
    return layer.clip.top;
  if (isIENS6) {
    var str =  layer.style.clip;
    if (!str)
      return 0;
    var clip = getIEClipValues(layer.style.clip);
    return clip[0];
  }
  return;
}

function getClipRight(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"clipright")) return;

  if (isMinNS4)
    return layer.clip.right;
  if (isIENS6) {
    var str =  layer.style.clip;
    if (!str)
      return layer.style.pixelWidth;
    var clip = getIEClipValues(layer.style.clip);
    return clip[1];
  }
  return;
}

function getClipBottom(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"clipbottom")) return;

  if (isMinNS4)
    return layer.clip.bottom;
  if (isIENS6) {
    var str =  layer.style.clip;
    if (!str)
      return layer.style.pixelHeight;
    var clip = getIEClipValues(layer.style.clip);
    return clip[2];
  }
  return;
}

function getClipWidth(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"clipwidth")) return;

  if (isMinNS4)
    return layer.clip.width;
  if (isIENS6) {
    var str = layer.style.clip;
    if (!str)
      return layer.style.pixelWidth;
    var clip = getIEClipValues(layer.style.clip);
    return clip[1] - clip[3];
  }
  return;
}

function getClipHeight(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"clipheight")) return;

  if (isMinNS4) return layer.clip.height;
  if (isIENS6) {
    var str =  layer.style.clip;
    if (!str)
      return layer.style.pixelHeight;
    var clip = getIEClipValues(layer.style.clip);
    return clip[2] - clip[0];
  }
  return;
}

function getIEClipValues(str) {
  var clip = new Array();
  var i;

  // Parse out the clipping values for IE layers.

  i = str.indexOf("(");
  clip[0] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[1] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[2] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[3] = parseInt(str.substring(i + 1, str.length), 10);
  return clip;
}

//-----------------------------------------------------------------------------
// Layer scrolling.
//-----------------------------------------------------------------------------
function scrollLayerTo(layer, x, y, bound) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"scroll")) return;

  var dx = getClipLeft(layer) - x;
  var dy = getClipTop(layer) - y;

  scrollLayerBy(layer, -dx, -dy, bound);
  return;
}

function scrollLayerBy(layer, dx, dy, bound) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"scrollby")) return;

  var cl = getClipLeft(layer);
  var ct = getClipTop(layer);
  var cr = getClipRight(layer);
  var cb = getClipBottom(layer);

  if (bound) {
    if (cl + dx < 0)
      dx = -cl;
    else if (cr + dx > getWidth(layer))
      dx = getWidth(layer) - cr;
    if (ct + dy < 0)
      dy = -ct;
    else if (cb + dy > getHeight(layer))
      dy = getHeight(layer) - cb;
  }
	
	if (getClipHeight(layer) >= layer.document.height)
		dy = 0;
	if (getClipWidth(layer) >= layer.document.width)
		dx = 0;

  clipLayer(layer, cl + dx, ct + dy, cr + dx, cb + dy);
  moveLayerBy(layer, -dx, -dy);
  return;
}

//-----------------------------------------------------------------------------
// Layer background.
//-----------------------------------------------------------------------------
function getBgColor(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"bgcolor")) return;
  if (isMinNS4)  return layer.bgColor;
  if (isIENS6) return layer.style.backgroundColor;
}

function getForeColor(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"color")) return;
  if (isMinNS4) return layer.color;
  if (isIENS6)	return layer.style.color;
}

function getBorderColor(layer) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"bordercolor")) return;
  if (isMinNS4) return layer.bordercolor;
 	if (isIENS6) return layer.style.borderColor;
}

function setBgColor(layer, color) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"bgcolor")) return;
  if (isMinNS4) layer.bgColor = color;
  if (isIENS6) layer.style.backgroundColor = color;
  return;
}

function setForeColor(layer, color) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"color")) return;
  if (isMinNS4) layer.color = color;
	if (isIENS6) layer.style.color = color;
  return;
}

function setBorderColor(layer,color)
{
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"bordercolor")) return;
  if (isMinNS4) layer.bordercolor = color;
	if (isIENS6) layer.style.borderColor = color;
  return;
}

function setBgImage(layer, src) {
  if (typeof(layer) == "string") layer = getLayer(layer);
	if (isNullLayer(layer,"bgimage")) return;
  if (isMinNS4) layer.background.src = src;
  if (isIENS6) layer.style.backgroundImage = "url(" + src + ")";
}

//-----------------------------------------------------------------------------
// Layer creation.
//-----------------------------------------------------------------------------
// Compatible IE & NS
function createLayer(p_name,p_style,p_action,p_src)
{
	if (!p_style) p_style="";
	if (!p_action) p_action="";
	if (!p_src)	p_src="#";
	
	if (isMinNS4 || isMinNS6)
	{
		if (p_style) p_style = styleToNS(p_style);
		document.write("<layer "+p_style+" name=\""+p_name+"\" id=\""+p_name+"\" "+p_action+">"+p_src+"</layer>");
	}
	
  if (isMinIE4)	document.write("<div name=\""+p_name+"\" id=\""+p_name+"\" style='"+p_style+"' "+p_action+" >"+p_src+"</div>");

	l_lay = getLayer(p_name);
	if (isMinNS4)	l_lay.innerHTML = p_src;

	return l_lay;
}

function styleToNS(p_style)
{
	aTab=p_style.split(";");
	for (i=0;i<aTab.length;i++)
		aTab[i]=aTab[i].replace(/:/g,"='")+"'";

	p_style = aTab.toString();
	p_style = p_style.replace(/,/g," ");
	p_style = p_style.replace(/background-color/g,"bgcolor");
	p_style = p_style.replace(/border='[^']*'/,"border=1");
	return p_style;
}

function createILayer(p_name,p_style,p_action,p_src)
{
	if (!p_style) p_style="";
	if (!p_src) p_src="#";
	if (!p_action) p_action="";	

	if (isMinNS4 || isMinNS6) 
	{
		if (p_style) p_style = styleToNS(p_style);		
		document.write("<ilayer src=\""+p_src+"\" "+p_style+" name=\""+p_name+"\" id=\""+p_name+"\" "+p_action+"></ilayer>");
	}
  if (isMinIE4){
		document.write("<iframe style='"+p_style+"' name=\""+p_name+"\" id=\""+p_name+"\" "+p_action+" src=\""+p_src+"\"></iframe>");
	}
	return;
}


//-----------------------------------------------------------------------------
// Find Layer
//-----------------------------------------------------------------------------
function getFrame(p_name, win) {

	if (win == null) win = window;
	if (isMinNS4) return findLayer(p_name, win.document);
  if (isMinIE4) return win.document.frames(p_name);
  return;
}

function getLayer(p_name, win) {
	if (win == null) win = window;
  if (typeof(p_name) == "object") return p_name ;
	if (isMinNS4)  return findLayer(p_name, win.document);
  if (isMinIE5 || isMinNS6)	return (win.document.getElementById(p_name));
	if (isMinIE4) return win.document.all(p_name);
  return;
}

function findLayer(p_name, doc) {
  var i, layer;
  for (i = 0; i < doc.layers.length; i++) {
    layer = doc.layers[i];
    if (layer.name == p_name || layer.id == p_name) return layer;
    if (layer.document.layers.length > 0)
      if ((layer = findLayer(p_name, layer.document)) != null) return layer;
  }
  return null;
}

//-----------------------------------------------------------------------------
// Page & Window properties.
//-----------------------------------------------------------------------------
function getWindowWidth(win) {
	if (!win) win=window;
  if (isMinNS4) return win.innerWidth;
  if (isMinIE4) return win.document.body.clientWidth;
  return -1;
}

function getWindowHeight(win) {
	if (!win) win=window;
  if (isMinNS4) return win.innerHeight;
  if (isMinIE4) return win.document.body.clientHeight;
  return -1;
}

function getPageWidth(win) {
  if (!win) win=window;
  var h = 0 ;
  if ((win.document.width)&&(h<win.document.width)) h=win.document.width ;
  if (win.document.body)
  {
    if ((win.document.body.offsetWidth)&&(h<win.document.body.offsetWidth)) h=win.document.body.offsetWidth ;
    if ((win.document.body.scrollWidth)&&(h<win.document.body.scrollWidth)) h=win.document.body.scrollWidth ; 
  }
  return h;
}

function getPageHeight(win) {
  if (!win) win=window;
  var h = 0 ;
  if ((win.document.height)&&(h<win.document.height)) h=win.document.height ;
  if (win.document.body)
  {
    if ((win.document.body.offsetHeight)&&(h<win.document.body.offsetHeight)) h=win.document.body.offsetHeight ;
    if ((win.document.body.scrollHeight)&&(h<win.document.body.scrollHeight)) h=win.document.body.scrollHeight ;
  }
  return h;
}

function getPageScrollX(win) {
	if (!win) win=window;
  if (isNS) return win.pageXOffset;
  if (isMinIE4) return win.document.body.scrollLeft;
  return;
}

function getPageScrollY(win) {
	if (!win) win=window;
  if (isNS) return win.pageYOffset;
  if (isMinIE4) return win.document.body.scrollTop;
  return;
}

//-----------------------------------------------------------------------------
// Event properties.
//-----------------------------------------------------------------------------
function getPageX(e,win) 
{
  if (isMinNS4 || isMinNS6) return e.pageX;
  if (isMinIE4) return e.clientX + getPageScrollX(win);
  return;
}

function getPageY(e,win) 
{
  if (isMinNS4 || isMinNS6) return e.pageY;
  if (isMinIE4) return e.clientY + getPageScrollY(win);
  return;
}

function getElement(sObj)
{
  if (document.all) return document.all(sObj);
  if (document.getElementById) return document.getElementById(sObj);
  return eval("document."+sObj);
}

function getPageVisibleHeight() {
  if (isNS)
    return window.innerHeight;
  if (isMinIE4)
    return document.body.clientHeight;
  return -1;
}

function getPageVisibleWidth() {
  if (isNS)
    return window.innerWidth;
  if (isMinIE4)
    return document.body.clientWidth;
  return -1;
}
// Reno - 2002-09-04 16:38:13 - V1.0.4
// Nicolas - 2002-06-05 11:29:24 - V1.0.3
// Nicolas - 2002-05-16 16:39:17 - V1.0.2
// Nicolas - 2002-05-03 17:39:05 - V1.0.1
// Nicolas - 01/23/2002 11:51:35 - V1.0.0
// Window Properties
function getWindowWidth(win) 
{
	if (! win) win = window;
  if (isMinNS4)  return win.innerWidth;
  if (isMinIE4) return win.document.body.clientWidth;
  return -1;
}
	
function getWindowHeight(win) 
{
	if (! win) win = window;
  if (isMinNS4) return win.innerHeight;
  if (isMinIE4) return win.document.body.clientHeight;
  return -1;
}

// centre la fenetre sur l'ecran
function center(win){
	if (!win) win = window;
		
	win.moveTo((screen.availWidth-getWindowWidth(win))/2,(screen.availHeight-getWindowHeight(win))/2);
  win.focus();
	return win;
}

// Test l'existence d'une fenetre
function ExistsWin(pWin)
{
	if (pWin && pWin.open && !pWin.closed)
		return pWin;
	else
		return false;
}

function Pop2Print(strUrl, strName, isizeX, isizeY) {
  var iPop2Print = null;
  iPop2Print = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=yes,left=15,top=15,resizable=yes,personalbar=no,locationbar=no');
  if (iPop2Print) iPop2Print.focus();
  if (! isMinIE4) iPop2Print.print();
}

function PopWindow(strUrl, strName) {
  var iPopWindow = null;
  iPopWindow = window.open(strUrl, strName);
  if (iPopWindow) iPopWindow.focus();
}

function Pop2Show(strUrl, strName, isizeX, isizeY) {
  var iPop2Show = null;
  iPop2Show = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=no,menubar=no,left=15,top=15,resizable=yes,personalbar=no,locationbar=no');
  if (iPop2Show) iPop2Show.focus();
}

function Pop2ShowSta(strUrl, strName, isizeX, isizeY) { // avec status
  var P2S = null;
  P2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=yes,menubar=no,left=15,top=15,resizable=yes,personalbar=no,locationbar=no');
  if (P2S) P2S.focus();
}

function Pop2ShowR(strUrl, strName, isizeX, isizeY) { // non resizable
  var P2S = null;
  P2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=no,menubar=no,left=15,top=15,resizable=no,personalbar=no,locationbar=no');
  if (P2S) P2S.focus();
}

function Pop2ShowS(strUrl, strName, isizeX, isizeY) { // avec scroll
  var P2S = null;
  P2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=no,left=15,top=15,resizable=no,personalbar=no,locationbar=no');
  if (P2S) P2S.focus();
}

function Pop2ShowSR(strUrl, strName, isizeX, isizeY) { // avec scroll + resizable
  var P2S = null;
  P2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=no,left=15,top=15,resizable=yes,personalbar=no,locationbar=no');
  if (P2S) P2S.focus();
}

function Pop2ShowC(strUrl, strName, isizeX, isizeY, bScroll) {
  cxx = (screen.width / 2) - (isizeX / 2);
  cyy = (screen.height / 2) - (isizeY / 2);
  var Pop2Show = null;
  if (bScroll)
    Pop2Show = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=yes,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no');
  else 
    Pop2Show = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=no,menubar=yes,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no');
  if (Pop2Show) Pop2Show.focus();
}

function Pop2ShowCNM(strUrl, strName, isizeX, isizeY, bScroll, bFocus) {
  cxx = (screen.width / 2) - (isizeX / 2);
  cyy = (screen.height / 2) - (isizeY / 2);
  var Pop2S = null;
  if (bScroll)
    Pop2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=no,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no');
  else 
    Pop2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=no,menubar=no,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no');
  if (bFocus && Pop2S) Pop2S.focus();
}

function PopImg(fic, x, y, sTitle, bScroll, bInTable) {
  var PopImg = null;
  var cxx = (screen.width / 2) - (x / 2);
  var cyy = (screen.height / 2) - (y / 2);
  var sScr = (bScroll) ? "yes" : "no";
  PopImg=window.open('','pop','width='+x+',height='+y+',toolbar=no,scrollbars='+sScr+',statusbar=no,titlebar=no,menubar=no,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no');
  if (bInTable)
    PopImg.document.write('<html><head><title>'+sTitle+'</title></head><body onBlur="javascript:self.close();" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"><table width="100%" height="100%" align="center" valign="middle" border="0" vspace="0" hspace="0"><tr><td valign="top" align="left"><a href="javascript:self.close();"><img src="'+fic+'" border="0" alt="Cliquez pour fermer la fen&ecirc;tre" vspace="0" hspace="0"></a></td></tr></table></body></html>');
  else
    PopImg.document.write('<html><head><title>'+sTitle+'</title></head><body onBlur="javascript:self.close();" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" style="background:url('+fic+');background-repeat : no-repeat"><table width="100%" height="100%" align="center" valign="middle" border="0" vspace="0" hspace="0"><tr><td valign="top" align="left"><a href="javascript:self.close();"><img src="/images/im_shim.gif" border="0" width="'+x+'" height="'+y+'" alt="Cliquez pour fermer la fen&ecirc;tre" vspace="0" hspace="0"></a></td></tr></table></body></html>');
  PopImg.focus();
}

function FullEcran(strUrl) {
  var Fen_imprim = null;
  Fenl=screen.width-50;
  FenL=screen.height-100;
  Fen_imprim = window.open(strUrl,'Pleinecran','width='+Fenl+',height='+FenL+',top=0,left=0,resizable=yes,toolbar=yes,scrollbars=yes,menubar=yes,statusbar=no');
  Fen_imprim.focus();
}

// Fenetre sans barre du haut ! IE seulement
var splashWin, autoCloseTimeoutHandle, ontopIntervalHandle;
function Pop2ShowNoBar(sUrl, sName, width, height, left, top, autoCloseTime) {

	var w = window.screen.width;
	var h = window.screen.height;
	var l = (left != null) ? left : (w-width)/2;
	var t = (top != null) ? top : (h-height)/2;
	
	splashWin = window.open(sUrl, sName, 'fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');

	splashWin.blur();	// Hide while updating
	window.focus();
	
	splashWin.resizeTo(width,height);
	splashWin.moveTo(l, t);

	splashWin.focus();
	
	ontopIntervalHandle = splashWin.setInterval("window.opener.splashWin.focus();", 50);
	splashWin.document.body.onbeforeunload = function() {
		// Splash is being closed. no need to close it again
		window.clearInterval(autoCloseTimeoutHandle);
		window.onbeforeunload = null;
	};
	
	splashWin.document.body.onload = function() {splashWin.setInterval("window.opener.splashWin.focus();", 50);};
	
	window.clearTimeout(autoCloseTimeoutHandle);	// in case some one calls this twice	
	if (autoCloseTime != null && autoCloseTime > 0) {
		autoCloseTimeoutHandle = window.setTimeout("splashWin.close()", autoCloseTime);
	}
	
	window.onbeforeunload = function() {splashWin.close();};	// Close splash when this page is unloaded
}// Reno - 2002-05-06 15:37:24 - V1.0.1
// Nicolas - 01/23/2002 16:39:33 - V1.0.0

// utils.js
// ********************************** PRINT +
// The code by Captain <cerebrum@iname.com>
// Mead & Company, http://www.meadroid.com/wpm/
// fake print() for IE4.x
function printFrame(frame, onfinish) {
  if ( !frame ) frame = window;
//  if ( frame.document.readyState != "complete" &&
//       !confirm("Le document a imprimer n'est pas encore completement telecharge! Continuer l'impression?") )
//  {
//    if ( onfinish ) onfinish();
//    return;
//  }
  isMinIE4 = (document.all) ? 1 : 0;
  if (!isMinIE4) {
    frame.print();
    return;
  }
  if (printIsNativeSupport() ) {
    /* focus handling for this scope is IE5Beta workaround,
       should be gone with IE5 RTM.
    */
    var focused = document.activeElement; 
    frame.focus();
    frame.self.print();
    if ( onfinish ) onfinish();
    if ( focused && !focused.disabled ) focused.focus();
    return;
  }
  var eventScope = printGetEventScope(frame);
  var focused = document.activeElement;
  window.printHelper = function() {
    execScript("on error resume next: printWB.ExecWB 6, 1", "VBScript");
    printFireEvent(frame, eventScope, "onafterprint");
    printWB.outerHTML = "";
    if ( onfinish ) onfinish();
    if ( focused && !focused.disabled ) focused.focus();
    window.printHelper = null;
  }
  document.body.insertAdjacentHTML("beforeEnd",
    "<object id=\"printWB\" width=0 height=0 \
    classid=\"clsid:8856F961-340A-11D0-A96B-00C04FD705A2\"></object>");
  printFireEvent(frame, eventScope, "onbeforeprint");
  frame.focus();
  window.printHelper = printHelper;
  setTimeout("window.printHelper()", 0);
}
// helpers
function printIsNativeSupport() {
  var agent = window.navigator.userAgent;
  var i = agent.indexOf("MSIE ")+5;
  return parseInt(agent.substr(i)) >= 5 && agent.indexOf("5.0b1") < 0;
}
function printFireEvent(frame, obj, name) {
  var handler = obj[name];
  switch ( typeof(handler) ) {
    case "string": frame.execScript(handler); break;
    case "function": handler();
  }
}
function printGetEventScope(frame) {
  var frameset = frame.document.all.tags("FRAMESET");
  if ( frameset.length ) return frameset[0];
  return frame.document.body;
}
// ********************************** PRINT -

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function animages(iCollection,iFreq) {
	var i = 0;
	var max = iCollection.length-1;
	for (i = 0 ; i < max ; i++) {
		if (i == iTemoin) {
			obj = iCollection[i];
			obj.src = "images/" + iCollection[i+1]+".gif";
			i = i + 2;
			if (i < max) continue;
		}
		if (i != iTemoin) {
			obj = iCollection[i];
			obj.src = "images/" + iCollection[i+2]+".gif";
			i = i + 2;
			if (i < max) continue;
		}
	}
	iTemoin = iTemoin + 3;
	if ( iTemoin> (max - 1) ) iTemoin = 0;
	strTimer=iCollection;
	timer=window.setTimeout("animages(strTimer,iFreq)",iFreq);
}

// Get var of an object 
function getProperties(obj) 
{   
  var result = "";
  for (var i in obj)      
    result += i + ": " + obj[i] + "\n";
  return result;
}
// Reno - 2002-02-08 09:38:27 - V1.0.1
// Nicolas - 01/23/2002 16:39:14 - V1.0.0

//-----------------------------------------------------------------------------
// Image utilities.
//-----------------------------------------------------------------------------
function getImage(name) {
 if (isMinNS4)  return findImage(name, document);
 if (isMinNS6) return document.images[name];
 if (isMinIE5 && !isMac)	return (document.getElementById(name));
 if (isMinIE4) return document.all(name);
 return;
}

function findImage(name, doc) {
  var i, img;
	
  if (doc == null) doc = window.document;
	
  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}

function getImagePageLeft(img) {
  var x, obj;

  if (isMinNS4) {
    if (img.container != null)
      return img.container.pageX + img.x;
    else
      return img.x;
  }
  if (isMinIE4) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function getImagePageTop(img) {
  var y, obj;

  if (isMinNS4) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (isMinIE4) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}

function MM_findObj(n, d) { //v3.0
  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); return x;
}

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_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];}
}

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];
			}
	}
}// Damien - 2002-03-08 19:21:21 - V1.0.2
// Reno - 2002-03-05 19:28:15 - V1.0.1
// Nicolas - 01/23/2002 16:38:07 - V1.0.0

function tableau() {
  this.length = tableau.arguments.length
  for (var i = 0; i < this.length; i++)
  this[i+1] = tableau.arguments[i]
}

var tablJour = new tableau("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
var tablMois = new tableau("Janvier","F&eacute;vrier","Mars","Avril","Mai","Juin","Juillet","Ao&ucirc;t","Septembre","Octobre","Novembre","D&eacute;cembre");
var DateJour = new Date();

function date() {
  document.write(tablJour[(DateJour.getDay()+1)]," ",DateJour.getDate()," ");
  document.write(tablMois[(DateJour.getMonth()+1)]," ");
  if (!document.all) {
    document.write((DateJour.getFullYear()));
  } else {
    document.write(DateJour.getFullYear());
  }
}

function dateShort() {
  document.write(tablJour[(DateJour.getDay()+1)]," ",DateJour.getDate()," ");
  document.write(tablMois[(DateJour.getMonth()+1)]);
}

function time() {
  document.write(DateJour.getHours(),":",DateJour.getMinutes());
}

function TestTime(strTime)
{
// format testé 00:00:00
  re = /^(\d{1,2}):(\d{1,2}):?(\d{1,2})?$/;
  MyArray = re.exec(strTime);
  if (!MyArray) return false;
  iHou = MyArray[1];
  iMin = MyArray[2];
  if (MyArray.length > 3) {
    iSec = MyArray[3];
    if (iSec < 0 && iSec > 59) return false;
  }
  if (iHou < 0 || iHou > 23) return false;
  if (iMin < 0 && iMin > 59) return false;
  return true;
}

function checkDate(iDay, iMonth, iYear) {
  if (iMonth < 1 || iMonth > 12) return false;
  if (iMonth == 2 && iDay > 28) {
    if (iYear%4 != 0) return false;
    if (iDay > 29) return false;
  } else
  if ((iMonth == 4 || iMonth == 6 || iMonth == 9 || iMonth == 11) && iDay > 30) {
    return false;
  } else 
  if (iDay > 31) return false;
  return true;
}

function TestDate(strDate)
{
 // format testé AAAA-MM-JJ HH:MM:SS
  re = /^(\d{4})-(\d{2})-(\d{2})\s?(\d{1,2}:\d{1,2}:\d{1,2})?$/;
  MyArray = re.exec(strDate);
  if (MyArray) {
    iDay = Number(MyArray[3]);
    iMonth = Number(MyArray[2]);
    iYear = Number(MyArray[1]);
    if (!checkDate(iDay, iMonth, iYear)) return false;
    if (MyArray[4]) if (!TestTime(MyArray[4])) return false;
    return true;
  }
// format testé JJ/MM/AAAA
  re1 = /^(\d{1,2})[- \/](\d{1,2})[- \/](\d{2}|\d{4})$/;
  MyArray = re1.exec(strDate);
  if (MyArray) {
    iDay = Number(MyArray[1]);
    iMonth = Number(MyArray[2]);
    iYear = Number(MyArray[3]);
    if (!checkDate(iDay, iMonth, iYear)) return false;
    return true;
  }
  return false;
}

function SetDateToSql(strDate) {
  if (!TestDate(strDate)) return false;
  sDate = strDate;
  re1 = /^(\d{1,2})[- \/](\d{1,2})[- \/](\d{2}|\d{4})$/;
  MyArray = re1.exec(strDate);
  if (MyArray) {
    iYear = Number(MyArray[3]);
    if (iYear < 100) iYear+=2000;
    iMonth = Number(MyArray[2]);
    sMonth = (iMonth < 10) ? "0"+iMonth : String(iMonth);
    iDay = Number(MyArray[1]);
    sDay = (iDay < 10) ? "0"+iDay : String(iDay);
    sDate = String(iYear)+"-"+sMonth+"-"+sDay;
  }
  return sDate;
}

function TestDateFR(strDate)
{ // format testé : date francaise JJ/MM/AAAA
  re1 = /^(\d{1,2})[- \/](\d{1,2})[- \/](\d{2}|\d{4})$/;
  MyArray = re1.exec(strDate);
  if (MyArray) {
    iDay = Number(MyArray[1]);
    iMonth = Number(MyArray[2]);
    iYear = Number(MyArray[3]);
    if (!checkDate(iDay, iMonth, iYear)) return false;
    return true;
  }
  return false;
}

function SetFRDateToSql(strDate) {
//Passe une date francaise 28/04/1977 en date 1977-04-28 - Modif Dam accepte JJMMAA(AA)
  //if (!TestDateFR(strDate)) return strDate;
  sDate = strDate;
  re1 = /^(\d{1,2})[- \/](\d{1,2})[- \/](\d{2}|\d{4})$/;
  MyArray = re1.exec(strDate);
  bFormatOK = false;
  if (MyArray) {
    iYear = Number(MyArray[3]);
    iMonth = Number(MyArray[2]);
    iDay = Number(MyArray[1]);
    bFormatOK = true;
  } else {
    re1 = /^(\d{2})(\d{2})(\d{2}|\d{4})$/;
    MyArray = re1.exec(strDate);
    if (MyArray) {
      iYear = Number(MyArray[3]);
      iMonth = Number(MyArray[2]);
      iDay = Number(MyArray[1]);
      bFormatOK = true;
    }
  }
  if (!bFormatOK) return strDate;
  if (!checkDate(iDay, iMonth, iYear)) return strDate;
  if (iYear < 100) iYear+=2000;
  sMonth = (iMonth < 10) ? "0"+iMonth : String(iMonth);
  sDay = (iDay < 10) ? "0"+iDay : String(iDay);
  sDate = String(iYear)+"-"+sMonth+"-"+sDay;
  return sDate;
}

function SetSqlDateToFrDat(strDate) {
//Passe une date sql courte 1977-04-28 en date francaise courte 28/04/1977
  if (!TestDate(strDate)) return strDate;
  sDate = strDate;
  re1 = /^(\d{4})[- \/](\d{1,2})[- \/](\d{2}|\d{1,2})$/;
  MyArray = re1.exec(strDate);
  if (MyArray) {
    iYear = Number(MyArray[1]);
    if (iYear < 100) iYear+=2000;
    iMonth = Number(MyArray[2]);
    sMonth = (iMonth < 10) ? "0"+iMonth : String(iMonth);
    iDay = Number(MyArray[3]);
    sDay = (iDay < 10) ? "0"+iDay : String(iDay);
    sDate = sDay+"/"+sMonth+"/"+String(iYear);
  }
  return sDate;
}

function SetFullSqlDateToFrDat(strDate) {
//Passe une date sql longue 1977-04-28 00:00:00 en date francaise courte 28/04/1977
  if (!TestDate(strDate)) return strDate;
  sDate = strDate;
  adat = (strDate.split(" "))[0];
  strDate=adat;  
  re1 = /^(\d{4})[- \/](\d{1,2})[- \/](\d{2}|\d{1,2})$/;
  MyArray = re1.exec(strDate);
  if (MyArray) {
    iYear = Number(MyArray[1]);
    if (iYear < 100) iYear+=2000;
    iMonth = Number(MyArray[2]);
    sMonth = (iMonth < 10) ? "0"+iMonth : String(iMonth);
    iDay = Number(MyArray[3]);
    sDay = (iDay < 10) ? "0"+iDay : String(iDay);
    sDate = sDay+"/"+sMonth+"/"+String(iYear);
  }
  return sDate;
}

function SetFullSqlDateToFullFrDat(strDate) {
//Passe une date sql longue 1977-04-28 00:00:00 en date francaise  28/04/1977 00:00:00
  if (!TestDate(strDate)) return strDate;
  sDate = strDate;
  adat = (strDate.split(" "))[0];
    aheure = (strDate.split(" "))[1];
  strDate=adat;  
  re1 = /^(\d{4})[- \/](\d{1,2})[- \/](\d{2}|\d{1,2})$/;
  MyArray = re1.exec(strDate);
  if (MyArray) {
    iYear = Number(MyArray[1]);
    if (iYear < 100) iYear+=2000;
    iMonth = Number(MyArray[2]);
    sMonth = (iMonth < 10) ? "0"+iMonth : String(iMonth);
    iDay = Number(MyArray[3]);
    sDay = (iDay < 10) ? "0"+iDay : String(iDay);
    sDate = sDay+"/"+sMonth+"/"+String(iYear)+" "+aheure;
  }
  return sDate;
}

function GetSqlDat(strDate){
//date sql -> Date sql sans l'heure
  adat = (strDate.split(" "))[0];
  return adat;
}

function GetSqlHeure(strDate){
//date sql (2000-28-04 09:12:25) -> heure (09:12:25)
  adat = (strDate.split(" "))[1];
  return adat;
}

function GetTime(strDate){
//date -> heure
  adat = (strDate.split(" "))[1];
  return adat;
}

function GetCurDate() {
//Date courante
  d = new Date();
  iYear = Number(d.getYear()); if (iYear < 100) iYear+=2000;
  iMonth = Number(d.getMonth())+1; sMonth = (iMonth < 10) ? "0"+iMonth : String(iMonth);
  iDay = Number(d.getDate());  sDay = (iDay < 10) ? "0"+iDay : String(iDay);
  iHour = Number(d.getHours());  sHour = (iHour < 10) ? "0"+iHour : String(iHour);
  iMn = Number(d.getMinutes());  sMn = (iMn < 10) ? "0"+iMn : String(iMn);
  iSec = Number(d.getSeconds());  sSec = (iSec < 10) ? "0"+iSec : String(iSec);
  df = String(iYear)+"-"+sMonth+"-"+sDay+" "+sHour+":"+sMn+":"+sSec;
  return df;
}

function AddTimeToDate(addTime) {
//addTime est une valeur en semaines
  dat = new Date();
  dateInMs = dat.getTime();
  dateInMs += (addTime*7*24*3600*1000) ;
  d = new Date(dateInMs)
  iYear = Number(d.getYear()); if (iYear < 100) iYear+=2000;
  iMonth = Number(d.getMonth())+1; sMonth = (iMonth < 10) ? "0"+iMonth : String(iMonth);
  iDay = Number(d.getDate());  sDay = (iDay < 10) ? "0"+iDay : String(iDay);
  iHour = Number(d.getHours());  sHour = (iHour < 10) ? "0"+iHour : String(iHour);
  iMn = Number(d.getMinutes());  sMn = (iMn < 10) ? "0"+iMn : String(iMn);
  iSec = Number(d.getSeconds());  sSec = (iSec < 10) ? "0"+iSec : String(iSec);
  df = String(iYear)+"-"+sMonth+"-"+sDay+" "+sHour+":"+sMn+":"+sSec;
  return df;
}// Reno - 2002-11-15 11:03:40 - V1.0.6
// Nicolas - 2002-07-12 16:37:01 - V1.0.5
// Nicolas - 2002-05-13 14:25:18 - V1.0.4
// Nicolas - 2002-04-30 11:11:44 - V1.0.3
// Nicolas - 2002-03-28 12:25:23 - V1.0.2 -- ajout m_UCopySelect et m_USetSelectByValue
// Reno - 2002-02-12 00:56:42 - V1.0.1
// Nicolas - 01/24/2002 11:39:55 - V1.0.0

// +/+ Tests Formulaire ----------------------------------------------------------
function TestCpFrance(strCp, bShort)
{
  var iDpt = 0; 
  var iVil = 0; 
  var iSiz = (bShort) ? 2 : 5;
  if (strCp.length < iSiz) return false;
  iDpt = parseInt(strCp.substr(0,2));
  if (isNaN(iDpt)) return false;
  if (!bShort) {
    iVil = parseInt(strCp.substr(3,3));
    if (isNaN(iVil)) return false;
  }
  if (iDpt < 1 || iDpt > 95) {
    if (iDpt != 97 && iDpt != 98) return false;
  }
  return true;
}

function isValidMail(Email) {
  var strTmp = Email;
  re1 = /^www\./i;
  MyArray = re1.exec(strTmp);
  if (MyArray) return false;
  re1 = /^[a-z0-9][-_a-z0-9.]+@[a-z0-9][-a-z0-9]+\.[a-z]+$/i;
  MyArray = re1.exec(strTmp);
  if (!MyArray) return false;
  return true;
}

function isValidTelephone(strTel, bMobile, bFrance) {
  if (bFrance) re1 = (bMobile) ? /^\+?\(?(\+?33)?\)?[-\.\s]*06([-\.\s]*\d\d){4}/ : /^\+?\(?(\+?33)?\)?[-\.\s]*([-\.\s]*\d\d){5}/;
  else re1 = /^[0-9][-\.0-9\s]+/;
  MyArray = re1.exec(strTel);
  if (!MyArray) return false;
  return true;
}
// -/- Tests Formulaire ----------------------------------------------------------


// +/+ Manipulation objet form ----------------------------------------------------------
function GetRadioValue(pRadioButton) {
  var checkedButton = "";
  if (!pRadioButton.length) {
    if (pRadioButton.checked == true) {
      checkedButton = pRadioButton.value;
    }
  } else {
    for (i = 0; i < pRadioButton.length; i++) {
      if (pRadioButton[i].checked == true) {
        checkedButton = pRadioButton[i].value;
      }
    }
  }
  return checkedButton;
}

function m_UGetElement(strNam, pForm) {
  var i0;
  for (i0 = 0; i0 < pForm.elements.length; i0++)
    if (pForm.elements[i0].name == strNam) return pForm.elements[i0];
  return false;
}

function AddElement(s_select, s_value, s_text, selected, doc) {
	if (!doc) doc = document;
	if (document.all){ // explorer
  	newOpt = doc.createElement("OPTION") ; 
		newOpt.text = s_text ;
		newOpt.value = s_value ;
		s_select.options.add(newOpt, s_select.length, false, selected) ;
	}
	else { // netscape
		var newOpt = new Option(s_text,s_value, false, selected);
		s_select.options[s_select.length]	= newOpt ;
	}
}

function m_UGetSelect(strObj, pForm) {
  var pSel = m_UGetElement(strObj, pForm);
  if (!pSel) return 0;
  return (pSel.length > 0 && pSel.selectedIndex >= 0) ? parseInt(pSel.options[pSel.selectedIndex].value) : 0;
}

function m_UcleanSelect(strObj, pForm) {
  var pSel = m_UGetElement(strObj, pForm);
  if (!pSel) return ;
  while (pSel.length > 0) pSel.options[0] = null;
}

function m_UAddSelect(strObj, strTxt, strVal, pForm, bSelected) {
  var pSel = m_UGetElement(strObj, pForm);
  if (!pSel) return ;
  sel=(bSelected)?true:false;
  AddElement(pSel, strVal, strTxt, sel);
}
function m_USetSelect(strObj, iNum, pForm) {
  var pSel = m_UGetElement(strObj, pForm);
  if (!pSel || pSel.length <= 0) return ;
  pSel.options[iNum].selected = true;
}

function m_UCopySelect(pSelSrc, pSelDest, strValue)
{
  if (pSelSrc.name == pSelDest.name) return ; // evite de boucler
  for (i=0;i<pSelSrc.options.length;i++)
  {
    AddElement(pSelDest, pSelSrc.options[i].value, pSelSrc.options[i].text, false);
    if (pSelSrc.options[i].value == strValue) pSelDest.options[i].selected = true;
  }
}

function m_USetSelectByValue(strObj, strValue, pForm)
{
  var pSel = m_UGetElement(strObj, pForm);
  for (i=0;i<pSel.options.length;i++)
    if (pSel.options[i].value == strValue) m_USetSelect(strObj, i, pForm);
}

// -/- Manipulation select ----------------------------------------------------------// Nicolas - 2002-11-26 19:20:50 - V1.0.5
// Nicolas - 2002-10-23 18:28:07 - V1.0.4
// Nicolas - 2002-06-24 15:15:12 - V1.0.3
// Reno - 2002-06-02 12:07:44 - V1.0.2
// Reno - 2002-02-27 17:03:17 - V1.0.1
// Nicolas - 01/23/2002 16:39:01 - V1.0.0

//************************************************ GESTION DES FRAME AVEC SOURCES ET SCROLL COMPATIBLE NETSCAPE 4.0 *******
// (c) 2001 Operationnelle Interactive - Groupe Operationnelle - JlR/NG
// V.2.01 23/09/01
//************************************************ ---------------------------------------------------------------- *******
//************************************************ Variables
var Gfs_RessourceUrl = "http://admn.vtech.fr";
// debug 
var Gfs_DbgSet = false;
var Gfs_DbgFormName = "F1";
var Gfs_DbgTextAreaName = "DBG";
// Interval
var Gfs_Down;
var Gfs_Up;
var Gfs_Right;
var Gfs_Left;
// Ensemble de pointeurs sur les objets Accroche
var Gfs_Tab = new Array(); //Tableau qui contient l'ensemble des FrameGfs
var Gfs_iNum, Gfs_iTypeCurs;

var Gfs_DateJour = new Date();
//************************************************ Utilitaires
function Gfs_max(a,b) { return (a>b) ? a : b;}
function Gfs_Debug ( strDbg ) {
  if (!Gfs_DbgSet) return;
  pZone = eval("document."+Gfs_DbgFormName+"."+Gfs_DbgTextAreaName);
  if (pZone) 
	{
    strVal = pZone.value;
    pZone.value = Gfs_DateJour.getHours()+":"+Gfs_DateJour.getMinutes()+":"+Gfs_DateJour.getSeconds()+" ";
    pZone.value += strDbg + "\n" + strVal;
  }  
}
// scroll Up & down
function Gfs_StartMoveUp(iNum) { Gfs_Tab[iNum].bIsScrolling = true; Gfs_Up = setInterval("Gfs_Tab["+iNum+"].MoveUp();", 10); }
function Gfs_StartMoveDown(iNum) {Gfs_Tab[iNum].bIsScrolling = true; Gfs_Down = setInterval("Gfs_Tab["+iNum+"].MoveDown();", 10); }
function Gfs_StartMoveLeft(iNum) { Gfs_Tab[iNum].bIsScrolling = true; Gfs_Left = setInterval("Gfs_Tab["+iNum+"].MoveLeft();", 10); }
function Gfs_StartMoveRight(iNum) { Gfs_Tab[iNum].bIsScrolling = true; Gfs_Right = setInterval("Gfs_Tab["+iNum+"].MoveRight();", 10); }
function Gfs_EndMove(iNum)
{
  if (Gfs_Tab[iNum].bIsToBeRedraw && Gfs_Tab[iNum].bIsScrolling )
	{
	  hideLayer(Gfs_Tab[iNum].pageLay);
    setTimeout('showLayer(Gfs_Tab['+iNum+'].pageLay)', 100);
  }  
  Gfs_Tab[iNum].IsScrolling = false;
}
// end scroll
function Gfs_EndMoveUp(iNum) { clearInterval(Gfs_Up); Gfs_EndMove(iNum) }
function Gfs_EndMoveDown(iNum) { clearInterval(Gfs_Down); Gfs_EndMove(iNum) }
function Gfs_EndMoveLeft(iNum) { clearInterval(Gfs_Left); Gfs_EndMove(iNum) }
function Gfs_EndMoveRight(iNum) { clearInterval(Gfs_Right); Gfs_EndMove(iNum) }

// scroll cursor by Click
function Gfs_SetClickOn(event, iNum, iTypeCurs) { 
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown = Gfs_SetClick;
  Gfs_iNum = iNum; 
  Gfs_iTypeCurs = iTypeCurs;
}
function Gfs_SetClickOff(event, iNum, iTypeCurs) { 
	document.releaseEvents(Event.MOUSEDOWN);
  document.onmousedown = null;
  Gfs_iNum = 0; 
  Gfs_iTypeCurs = 0;
}
function Gfs_SetClick(e) {
  layCurs = (Gfs_iTypeCurs == 1) ? Gfs_Tab[Gfs_iNum].CursH.Id : Gfs_Tab[Gfs_iNum].CursV.Id;
  curX = getPageX(e);	
	curY = getPageY(e);	
  bIsIn = (Gfs_iTypeCurs == 1) ? ((curX > getPageLeft(layCurs)) && (curX < getPageRight(layCurs))) : ((curY > getPageTop(layCurs)) && (curY < getPageBottom(layCurs)));
  if (bIsIn) return Gfs_SetDragOn(e, Gfs_iNum, Gfs_iTypeCurs);
  Gfs_SetDrag(e, Gfs_iNum, Gfs_iTypeCurs, true);
  Gfs_SetDragOff(e, Gfs_iNum, Gfs_iTypeCurs);
}
// scroll cursor by Move
function Gfs_SetDragOn(event, iNum, iTypeCurs) { 
  pCurs = (iTypeCurs == 1) ? Gfs_Tab[iNum].CursH : Gfs_Tab[iNum].CursV;  
  if (pCurs.bDrag) return;
	pCurs.curX = getPageX(event);	
	pCurs.curY = getPageY(event);	
	pCurs.bDrag = true;
  document.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
  document.onmouseup = Gfs_SetDragOff;
  document.onmousemove = Gfs_SetDrag;
  document.onmousedown = Gfs_SetDragOff;
  Gfs_iNum = iNum; 
  Gfs_iTypeCurs = iTypeCurs;
}
function Gfs_SetDragOff(event, iNum, iTypeCurs) { 
  isDrag = false;
  if (iTypeCurs == null) { iNum = Gfs_iNum; iTypeCurs = Gfs_iTypeCurs; }
  if (iTypeCurs != null) {
    pCurs = (iTypeCurs == 1) ? Gfs_Tab[iNum].CursH : Gfs_Tab[iNum].CursV;  
    isDrag = pCurs.bDrag;  
  }
  if (!isDrag) return;  
  pCurs.bDrag = false;
  document.onmousedown = Gfs_SetClick;
	document.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
  document.onmouseup = null;
  document.onmousemove = null;
  if (Gfs_Tab[iNum].bIsToBeRedraw) {
    hideLayer(Gfs_Tab[iNum].mainLay);
    setTimeout('showLayer(Gfs_Tab['+iNum+'].mainLay)', 100);
  }  
}
function Gfs_SetDrag(event, iNum, iTypeCurs, isClick) {
  if (event.type != "mousemove" && !isClick) return;
  if (iTypeCurs == null) { iNum = Gfs_iNum; iTypeCurs = Gfs_iTypeCurs; }
  isDrag = (iTypeCurs == 1) ? Gfs_Tab[iNum].CursH.bDrag : Gfs_Tab[iNum].CursV.bDrag; 
	if (!isDrag && !isClick) return;
	layCurs = (iTypeCurs == 1) ? Gfs_Tab[iNum].CursH.Id : Gfs_Tab[iNum].CursV.Id;
	layScroll = (iTypeCurs == 1) ? Gfs_Tab[iNum].scrZHLay : Gfs_Tab[iNum].scrZVLay; 	
	if (iTypeCurs == 1)	{
	  if (Gfs_Tab[iNum].CursH.curX == getPageX(event)) return;	
	  iPosE = getPageX(event) - (Gfs_Tab[iNum].CursH.Img.width/2) ;
		if (iPosE < getPageLeft(layScroll)) iPosE = getPageLeft(layScroll) ;
		if (iPosE + getWidth(layCurs) <= getPageRight(layScroll))
			moveLayerBy(layCurs, iPosE-getPageLeft(layCurs) ,0);
	}	else {
	  if (Gfs_Tab[iNum].CursV.curY == getPageY(event)) return;	
	  iPosE = getPageY(event) - (Gfs_Tab[iNum].CursV.Img.height/2) ;
		if (iPosE < getPageTop(layScroll)) iPosE = getPageTop(layScroll) ;
		if (iPosE + getHeight(layCurs) <= getPageBottom(layScroll))
			moveLayerBy(layCurs, 0, iPosE-getPageTop(layCurs));
	}
  Gfs_Tab[iNum].MoveLay(iTypeCurs);
  return false;
}
//************************************************ functions Objets
function Gfs_ChangeSrc(pstrSrc, piNum, iScroll) { // iScroll = 0 -> nada, 1 to top, 2 to bottom
  var pObj = (piNum != null && piNum != -1) ? Gfs_Tab[piNum] : this ;
  pObj.pageLay = (isIENS6) ? getLayer(pObj.strId) : getLayer("LS"+pObj.strId);
  pObj.pageLay.src = pstrSrc;
  if (iScroll && (isMinNS4)) {
    switch (parseInt(iScroll)) {
      case 1 : setTimeout('Gfs_ScrollLayToTop('+pObj.Num+')', 800); break;
      case 2 : setTimeout('Gfs_ScrollLayToBottom('+pObj.Num+')', 800); break;
    }
  }
  this.strSrc = pstrSrc;
}

function Gfs_MoveLeft() { this.ScrollLay(-1,0); this.MoveCurs(1); }
function Gfs_MoveRight(){ this.ScrollLay(1,0); this.MoveCurs(1); }
function Gfs_MoveUp(){ this.ScrollLay(0,-1); this.MoveCurs(2); }
function Gfs_MoveDown(){ this.ScrollLay(0,1); this.MoveCurs(2); }
// synchro parent fils
function Gfs_Move(paddX, paddY) {
  moveLayerBy(this.mainLay, paddX ,paddY);
  iX = (getPageLeft(this.mainLay))-(getPageLeft(this.IdParent.pageLay)+getClipLeft(this.IdParent.pageLay));
  iY = (getPageTop(this.mainLay))-(getPageTop(this.IdParent.pageLay)+getClipTop(this.IdParent.pageLay));
  if (iX < 0 || iY < 0) {
    iX = (iX < 0) ? -iX : getClipLeft(this.mainLay);
    iY = (iY < 0) ? -iY : getClipTop(this.mainLay);
    clipLayer(this.mainLay, iX, iY, getClipRight(this.mainLay), getClipBottom(this.mainLay));
  } else {
    clipLayer(this.mainLay, 0, 0, getClipRight(this.mainLay), getClipBottom(this.mainLay));
  }  
}
// synchro lay - cursor
function Gfs_MoveCurs(iTypeCurs) {
  var layCurs = (iTypeCurs == 1) ? this.CursH.Id : this.CursV.Id; 	
	var layScroll = (iTypeCurs == 1) ? this.scrZHLay : this.scrZVLay; 	
  var iX = (iTypeCurs == 1) ? Math.round((( (getWidth(layScroll)-this.CursH.Img.width) * getClipLeft(this.pageLay) ) / ( getWidth(this.pageLay) - this.iWidth))) : 0;
  var iY = (iTypeCurs == 1) ? 0 : Math.round((( (getHeight(layScroll)-this.CursV.Img.height) * getClipTop(this.pageLay) ) / ( getHeight(this.pageLay) - this.iHeight)));
	moveLayerTo(layCurs, iX ,iY);
}
function Gfs_MoveLay(iTypeCurs) {
	var layScroll = (iTypeCurs == 1) ? this.scrZHLay : this.scrZVLay; 	
  var layCurs = (iTypeCurs == 1) ? this.CursH.Id : this.CursV.Id; 	
  var iX = (iTypeCurs == 1) ? Math.round(( ((getWidth(this.pageLay) - this.iWidth) * (getLeft(layCurs))) / (getWidth(layScroll)-this.CursH.Img.width) )) - getClipLeft(this.pageLay) : 0;
  var iY = (iTypeCurs == 1) ? 0 : Math.round((((getHeight(this.pageLay) - this.iHeight) * (getTop(layCurs))) / (getHeight(layScroll)-this.CursV.Img.height) )) - getClipTop(this.pageLay);
  this.ScrollLay(iX, iY);
}
// scrolling lay
function Gfs_ScrollLay(paddX, paddY) {
  var iX = getLeft(this.pageLay);
  var iY = getTop(this.pageLay);
	// Clip plus grand que taille du doc
	if (getClipHeight(this.pageLay) > this.pageLay.document.height) paddY = 0;
	if (getClipWidth(this.pageLay) > this.pageLay.document.width) paddX = 0;
	scrollLayerBy(this.pageLay, paddX, paddY, true);
  if (iX != getLeft(this.pageLay) || iY != getTop(this.pageLay)) 
    for (i=0; i<this.aIdFils.length; i++) this.aIdFils[i].Move(-paddX, -paddY);
}
function Gfs_ScrollLayToBottom(piNum) {
  var pObj = (piNum && piNum != -1) ? Gfs_Tab[piNum] : this ;
  iY = getHeight(pObj.pageLay);
  pObj.ScrollLay(0, iY);
  pObj.MoveCurs(2);
}
function Gfs_ScrollLayToTop(piNum) {
  var pObj = (piNum && piNum != -1) ? Gfs_Tab[piNum] : this ;
  iY = getTop(pObj.pageLay);
  pObj.ScrollLay(0, -iY);
  if (isMinNS4) pObj.MoveCurs(2);
}
function Gfs_Attach(pObj) { this.aIdFils[this.aIdFils.length] = pObj; }

function Gfs_SetFrameHide(piNum) { // uniquement si bAbsolute a ete sete a true
  var pObj = (piNum && piNum != -1) ? Gfs_Tab[piNum] : this ;
  hideLayer(pObj.mainLay);
}

function Gfs_SetFrameShow(piNum) { // uniquement si bAbsolute a ete sete a true
  var pObj = (piNum && piNum != -1) ? Gfs_Tab[piNum] : this ;
  showLayer(pObj.mainLay);
}

function Gfs_SetFramePos(iCx, iCy, pWidth, pHeight, piNum) { // uniquement si bAbsolute a ete sete a true
  var pObj = (piNum && piNum != -1) ? Gfs_Tab[piNum] : this ;
//  this.iPosY = (isIENS6) ? getPageTop(this.mainLay) : getPageTop(this.mainLay);
//  this.iPosX = (isIENS6) ? getPageLeft(this.mainLay) : getPageLeft(this.mainLay);
//  alert(this.mainLay+" PosX="+this.iPosX+"->"+iCx+" PosY="+this.iPosY+"->"+iCy);
  if (!iCy) iCy = 0;
  if (!iCx) iCx = 0;
  moveLayerTo(pObj.mainLay, iCx, iCy);
//  alert(this.mainLay+" PosX="+getPageLeft(this.mainLay)+" PosY="+getPageTop(this.mainLay));
  if (pWidth && pWidth != 0 && pHeight && pHeight != 0) {
    resizeLayerTo(pObj.mainLay, pWidth, pHeight);
    clipLayer(pObj.mainLay, 0, 0, pWidth, pHeight);
    if (isMinNS4) {
    	iWidth = (pObj.bScrollV) ? pWidth-pObj.iSizeZoneScrollV : pWidth;
  	  iHeight = (pObj.bScrollH) ? pHeight-pObj.iSizeZoneScrollH : pHeight;
      resizeLayerTo(pObj.pageLay, iWidth, iHeight);
      clipLayer(pObj.pageLay, 0, 0, iWidth, iHeight);
    }
  }
//  alert(this.mainLay+" W="+getWidth(this.mainLay)+" H="+getHeight(this.mainLay));
}

function Gfs_SetFrameAdjust(piNum) { // uniquement si bAbsolute a ete sete a true
  var pObj = (piNum && piNum != -1) ? Gfs_Tab[piNum] : this ;
//  alert(this.mainLay+" W="+getWidth(this.mainLay)+" H="+this.mainLay.document.body.scrollHeight);
//  alert(pObj.mainLay+" X="+getContentWidth(pObj.mainLay)+" Y="+getContentHeight(pObj.mainLay));
  resizeLayerTo(pObj.mainLay, getContentWidth(pObj.pageLay), getContentHeight(pObj.pageLay));
  clipLayer(pObj.pageLay, 0, 0, pWidth, pHeight);
//  alert(this.mainLay+" W="+this.mainLay.height+" H="+this.mainLay.width);
}

function Gfs_SetFrame(IdParent, bDown) { // bDown aligne sur le bas
  this.IdParent = IdParent;
	this.posLay = getLayer(this.strId+"p");
  this.iPosY = (isIENS6) ? getPageTop(this.posLay)+2 : getPageTop(this.posLay);
  this.iPosX = (isIENS6) ? getPageLeft(this.posLay)+2 : getPageLeft(this.posLay);
	if (isIENS6) {
		document.write('<IFRAME id="'+this.strId+'" name="'+this.strId+'" src="'+this.strSrc+'" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="'+this.scroll+'" style="position:absolute; visibility:hidden; '+this.sBorder+' width:'+this.iWidth+';height:'+this.iHeight+'">');
    document.write('</IFRAME>');
  	this.mainLay = getLayer(this.strId);
    moveLayerTo(this.mainLay, this.iPosX, this.iPosY);
  	clipLayer(this.mainLay, 0, 0, this.iWidth, this.iHeight);
    this.pageLay = this.mainLay;
    showLayer(this.mainLay);
  } else {
  	var ilWidth = (this.bScrollV) ? this.iWidth-this.iSizeZoneScrollV : this.iWidth;
	  var ilHeight = (this.bScrollH) ? this.iHeight-this.iSizeZoneScrollH : this.iHeight;
    if (!this.bIsToBeReload) {
      document.write('<LAYER id="'+this.strId+'" width="'+this.iWidth+'" height="'+this.iHeight+'" clip="0 0 '+this.iWidth+' '+this.iHeight+'" visibility="hide" >');
      document.write('<LAYER bgcolor="#'+this.strBg+'" id="LS'+this.strId+'" src="'+this.strSrc+'" top=0 left=0 width='+ilWidth+' height='+ilHeight+' clip="0 0 '+ilWidth+' '+ilHeight+'" ></LAYER>');
    }  
  	if (this.bScrollV) {
      document.write('<LAYER id="SV'+this.strId+'" top=0 left='+ilWidth+' width='+this.iSizeZoneScrollV+' height='+ilHeight+' clip="0 0 '+this.iSizeZoneScrollV+' '+ilHeight+'" visibility="hide">');
      document.write("<layer top=0 left="+((this.iSizeZoneScrollV/2)-(this.imgUp.width/2))+" width="+this.imgUp.width+" height="+this.imgUp.height+">");
      document.write("<a href='javascript:;' OnMouseDown='Gfs_StartMoveUp("+this.Num+");' OnMouseUp='Gfs_EndMoveUp("+this.Num+");' onmouseout='Gfs_EndMoveUp("+this.Num+");'>");
      document.write("<img src='"+this.imgUp.src+"' width="+this.imgUp.width+" height="+this.imgUp.height+" border=0></a></layer>");
      document.write("<layer id='ZSV"+this.strId+"' bgcolor='Silver' top="+this.imgUp.height+" left="+((this.iSizeZoneScrollV/2)-(this.imgCenterV.width/2))+" width="+this.imgCenterV.width+" height="+(ilHeight-(this.imgDown.height+this.imgUp.height)));		
  		document.write(" OnMouseOver='Gfs_SetClickOn(event, "+this.Num+", 2)' OnMouseOut='Gfs_SetClickOff(event, "+this.Num+", 2);'>");
      this.CursV = new Gfs_Curseur(this, 2, this.strId+"CursV", this.imgCenterV);
      document.write('</layer>');
      document.write("<layer top="+(ilHeight-this.imgDown.height)+" left="+((this.iSizeZoneScrollV/2)-(this.imgDown.width/2))+" width="+this.imgDown.width+" height="+this.imgDown.height+">");
      document.write(" <a href='javascript:;' OnMouseDown='Gfs_StartMoveDown("+this.Num+");' OnMouseUp='Gfs_EndMoveDown("+this.Num+");' onmouseout='Gfs_EndMoveDown("+this.Num+");'>");
      document.write("<img src='"+this.imgDown.src+"' width="+this.imgDown.width+" height="+this.imgDown.height+" border=0></a></layer>");
      document.write('</LAYER>');
  	}
  	if (this.bScrollH) {
      document.write('<LAYER id="SH'+this.strId+'" top='+ilHeight+' left=0 width='+ilWidth+' height='+this.iSizeZoneScrollH+' clip="0 0 '+ilWidth+' '+this.iSizeZoneScrollH+'" visibility="hide">');
      document.write("<layer top="+((this.iSizeZoneScrollH/2)-(this.imgLeft.height/2))+" left=0 width="+this.imgLeft.width+" height="+this.imgLeft.height+">");
      document.write("<a href='javascript:;' OnMouseDown='Gfs_StartMoveLeft("+this.Num+");' OnMouseUp='Gfs_EndMoveLeft("+this.Num+");' onmouseout='Gfs_EndMoveLeft("+this.Num+");'>");
      document.write("<img src='"+this.imgLeft.src+"' width="+this.imgLeft.width+" height="+this.imgLeft.height+" border=0></a></layer>");
      document.write("<layer id='ZSH"+this.strId+"' bgcolor='Silver' top="+((this.iSizeZoneScrollH/2)-(this.imgCenterH.height/2))+" left="+this.imgLeft.width+" width="+(ilWidth-(this.imgRight.width+this.imgLeft.width))+" height="+this.imgCenterH.height);		
  		document.write(" OnMouseOver='Gfs_SetClickOn(event, "+this.Num+", 2)' OnMouseOut='Gfs_SetClickOff(event, "+this.Num+", 2);'>");
      this.CursH = new Gfs_Curseur(this, 1, this.strId+"CursH", this.imgCenterH);
      document.write('</layer>');
      document.write("<layer top="+((this.iSizeZoneScrollH/2)-(this.imgRight.height/2))+" left="+(ilWidth-this.imgRight.width)+" width="+this.imgRight.width+" height="+this.imgRight.height+">");
      document.write(" <a href='javascript:;' OnMouseDown='Gfs_StartMoveRight("+this.Num+");' OnMouseUp='Gfs_EndMoveRight("+this.Num+");' onmouseout='Gfs_EndMoveRight("+this.Num+");'>");
      document.write("<img src='"+this.imgRight.src+"' width="+this.imgRight.width+" height="+this.imgRight.height+" border=0></a></layer>");
      document.write('</LAYER>');
  	}
    if (this.bIsToBeReload) {
      document.write('<LAYER id="LS'+this.strId+'" width='+ilWidth+' height='+ilHeight+' clip="0 0 '+ilWidth+' '+ilHeight+'" visibility="hide" ></LAYER>');
    } else document.write('</LAYER>');
    this.pageLay = getLayer("LS"+this.strId);
    if (this.bScrollV) {
      this.scrVLay = getLayer("SV"+this.strId);
      this.scrZVLay = getLayer("ZSV"+this.strId);
    }  
    if (this.bScrollH) {
      this.scrHLay = getLayer("SH"+this.strId);
      this.scrZHLay = getLayer("ZSH"+this.strId);
    }  
    if (this.IdParent && !this.bIsToBeReload) this.IdParent.Attach(this);
    if (this.bIsToBeReload) {
    	this.mainLay = this.pageLay;
      this.pageLay.moveToAbsolute(this.iPosX, this.iPosY);
      if (this.bScrollV) {
        moveLayerTo(this.scrVLay, this.iPosX+getWidth(this.pageLay), this.iPosY);
        showLayer(this.scrVLay);
      }  
      if (this.bScrollH) {
        moveLayerTo(this.scrHLay, this.iPosX, this.iPosY+getHeight(this.pageLay));
        showLayer(this.scrHLay);
      }  
      
      sAction = "Gfs_ChangeSrc('"+this.strSrc+"', "+this.Num+")";
      setTimeout(sAction, 3000);
      showLayer(this.mainLay);
    } else {
    	this.mainLay = getLayer(this.strId);
      moveLayerTo(this.mainLay, this.iPosX, this.iPosY);
    	clipLayer(this.mainLay, 0, 0, this.iWidth, this.iHeight);
      if (this.bScrollV) showLayer(this.scrVLay);
      if (this.bScrollH) showLayer(this.scrHLay);
      showLayer(this.mainLay);
    }  
    if (bDown) setTimeout("Gfs_ScrollLayToBottom("+this.Num+")", 200);
  }  
}
//************************************************ Objets
function Gfs_Curseur(pIdFrame, iTypCurs, strId, pImg) {
	this.strId = strId;
	this.IdFrame = pIdFrame; // Frame pere
  this.Img = pImg;
	this.bDrag = false;
  this.curX = 0;
  this.curY = 0;
  document.write("<LAYER name='"+this.strId+"' id='"+this.strId+"' visibility=show top=0 left=0 width="+pImg.width+" height="+pImg.height+">");
  document.write("<a href='javascript:;' OnMouseDown='Gfs_SetDragOn(event, "+this.IdFrame.Num+", "+iTypCurs+")' OnMouseUp='Gfs_SetDragOff(event, "+this.IdFrame.Num+", "+iTypCurs+")'>");
  document.write("<img name='Img"+this.strId+"' src='"+pImg.src+"' width="+pImg.width+" height="+pImg.height+" border=0></a></LAYER>");
  this.Id = getLayer(this.strId);
}

function Gfs_Frame(pstrId, pstrSrc, pstrBg, pbBorder, piCx, piCy, piScrollV, piScrollH, pstrScroll) {
//pstrId : nom de la GfsFrame
//pstrSrc : source de -------
//pstrBg : couleur de fond
//pbBorder : booleen : bordure visible ou non
//piCx , PiCy taille de la barre de navigation
//piScrollV, piScrollH quantité de déplacement dans la frame gfs en X,Y
//pParam si il y a des parametres apres l'url (ex:TOTO=1)
	this.Num = Gfs_Tab.length + 1;
  //on ajoute cette frame a GfsTab
 	Gfs_Tab[this.Num] = this;
 	// Variables
	this.strId = pstrId;  // name
	this.strBg = (pstrBg != "") ? pstrBg : "FFFFFF";  // background color
  arrayOfWords = pstrSrc.split("?");
	this.strSrc = arrayOfWords[0]+"?BG="+this.strBg;  // source de la frame
  if (arrayOfWords.length > 1) this.strSrc += "&"+arrayOfWords[1];
  this.sBorder = (pbBorder && isIENS6) ? "border: 1px #000000 solid;" : "";
	this.iPosX = 0; 
	this.iPosY = 0; 
	this.iWidth = piCx;
	this.iHeight = piCy;
	this.IdParent = null;
	this.aIdFils = new Array();
  // functions
  this.Attach = Gfs_Attach;
  this.SetFrame = Gfs_SetFrame;
  this.SetFramePos = Gfs_SetFramePos;
  this.SetFrameAdjust = Gfs_SetFrameAdjust;
  this.SetFrameHide = Gfs_SetFrameHide;
  this.SetFrameShow = Gfs_SetFrameShow;

  this.MoveLay = Gfs_MoveLay;
  this.ScrollLay = Gfs_ScrollLay;
  this.ScrollLayToBottom = Gfs_ScrollLayToBottom;
  this.ScrollLayToTop = Gfs_ScrollLayToTop;
  this.MoveCurs = Gfs_MoveCurs;
  this.Move = Gfs_Move;
  this.MoveLeft = Gfs_MoveLeft;
  this.MoveRight= Gfs_MoveRight;
  this.MoveUp = Gfs_MoveUp;
  this.MoveDown = Gfs_MoveDown;
  this.ChangeSrc = Gfs_ChangeSrc;
  // layers
  this.posLay = null;
  this.mainLay = null;
  this.pageLay = null;
  this.scrHLay = null;
  this.scrZHLay = null;
  this.scrVLay = null;
  this.scrZVLay = null;
  //scrolls
  this.bIsToBeReload = false;
  //Permet un reload de la frame Gfs
  //mettre bIsToBeReload à vrai pour activer les scrollings et les changeSrc
  this.bIsToBeRedraw = false;
  this.bIsScrolling = false;
	this.paddX=1;
	this.paddY=1;
	this.bScrollH = (piScrollH != 0 && piScrollH != null);
	this.iSizeZoneScrollH = piScrollH;
  this.CursH = null;
	this.bScrollV = (piScrollV != 0 && piScrollV != null);
	this.iSizeZoneScrollV = piScrollV;
  this.CursV = null;
	this.scroll = (pstrScroll) ? pstrScroll : "no";
  if (isIENS6 && (this.bScrollH || this.bScrollV) ) {
  	this.bScrollH=false;
	  this.bScrollV=false;
    this.scroll="auto";
	}	
	// Images
  if (piScrollV || piScrollH) {
  	this.imgUp = new Image();
  	this.imgUp.src = Gfs_RessourceUrl+"/images/im_scrollup0.gif";
  	this.imgDown = new Image();
  	this.imgDown.src = Gfs_RessourceUrl+"/images/im_scrolldown0.gif";
  	this.imgLeft = new Image();
  	this.imgLeft.src = Gfs_RessourceUrl+"/images/im_scrollleft0.gif";
  	this.imgRight = new Image();
  	this.imgRight.src = Gfs_RessourceUrl+"/images/im_scrollright0.gif";
  	this.imgCenterV = new Image();
  	this.imgCenterV.src = Gfs_RessourceUrl+"/images/im_scrollcurv.gif";
  	this.imgCenterH = new Image();
  	this.imgCenterH.src = Gfs_RessourceUrl+"/images/im_scrollcurh.gif";
  }
	if (isIENS6){
		document.write("<div id='"+this.strId+"p' style='visibility:hidden;height:"+this.iHeight+";width:"+this.iWidth+";'></div>");
	} else {
		document.write("<ilayer id='"+this.strId+"p' visibility='hide' height='"+this.iHeight+"' width='"+this.iWidth+" margin='0 0 0 0''></ilayer>");
  }
}
