
function mover(who){
	if(who.className == ""){
		who.className = "selectMenu";
	}
}
function mout(who){
	if(who.id.indexOf(selectMenu) == -1)
		who.className = "";
}
function getDest(name,indice){
	document.location = name + ".aspx?ind=" + indice;
}
function getUrl(url){
	document.location = url;
}

function getURLParam(){
	var strReturn = "0";
	var strHref = window.location.href;  
	if ( strHref.indexOf("?") > -1 ){
		var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();	
		var aQueryString = strQueryString.split("=");
		strReturn = aQueryString[1];
	}
	return strReturn;
}
function setSelection(name){
	document.getElementById(name + getURLParam()).className = "selectsmenu";
}
function moversm(who){
		who.className = "selectsmenu";
}
function moutsm(who,ind){
	if(ind != getURLParam())
		who.className = "smenu";
}

/**
 *  Function:		rollImgSetup
 *
 *  Version History:	2001-04-02, Richard Coles, Initial Version
 *
 *  Description:	Use this function in a page body 'onLoad' event handler 
 *			to initialize variables rollover image processing via 'rollImg'.
 *			The document.images array is parsed.  Variables for image rollover
 *			are create for all images with names ending in '_on', '_off',
 *			'_at' and '_over' (Note: image name does not include the 
 *			file-type; e.g.: .gif, .jpg, etc).  Complementary images 
 *			(e.g.: an '_on' for each '_off') must exist in the same 
 *			source directory.
 *
 *  Syntax:		rollImgSetup()
 *
 *  Parameters:		none
 *
 *  Return:		none
 */

function rollImgSetup() {
  var boolArrayDefined;
  var i;
  var result;
  var strOnImgSrc;
  var strOffImgSrc;
  var strMsg = "";
  for (i = 0; (i < document.images.length); i++) {
    strOnImgSrc = "";
    strOffImgSrc = "";
    if (result = document.images[i].src.match(/(.+)_on\.(.+)$/i)) { // "on" image
      strOnImgSrc = document.images[i].src;
      strOffImgSrc = result[1] + "_off." + result[2];
    }
    else if (result = document.images[i].src.match(/(.+)_off\.(.+)$/i)) { // "off" image
      strOnImgSrc = result[1] + "_on." + result[2];
      strOffImgSrc = document.images[i].src;
    }
    else if (result = document.images[i].src.match(/(.+)_over\.(.+)$/i)) { // "over" image
      strOnImgSrc = document.images[i].src;
      strOffImgSrc = result[1] + "_at." + result[2];
    }
    else if (result = document.images[i].src.match(/(.+)_at\.(.+)$/i)) { // "at" image
      strOnImgSrc = result[1] + "_over." + result[2];
      strOffImgSrc = document.images[i].src;
    }
    if ((strOnImgSrc != "") && (strOffImgSrc != "") && (document.images[i].name != "")) {
      eval("((typeof " + document.images[i].name + "0) == \"object\") ? boolArrayDefined = 1 : boolArrayDefined = 0;");
      if (boolArrayDefined) continue;
      if ((document.images[i].height > 0) &&
	  (document.images[i].width > 0)) {
        eval(document.images[i].name + "0 = new Image(document.images[i].height,document.images[i].width);");
        eval(document.images[i].name + "1 = new Image(document.images[i].height,document.images[i].width);");
      }
      else {
	eval(document.images[i].name + "0 = new Image();");
	eval(document.images[i].name + "1 = new Image();");
      }
      eval(document.images[i].name + "0.src = strOffImgSrc;");
      eval(document.images[i].name + "1.src = strOnImgSrc;");
    }
  }
}



/**
 *  Function:		rollImg
 *
 *  Version History:	2001-04-02, Richard Coles, Initial Version
 *
 *  Description:	Use this function in an 'onMouseOver' or 'onMouseOut'
 *			event handler for rollover image processing.
 *
 *  Special Notes:	You must call 'imgRollSetup()' from the page body
 *			'onLoad' event for variable initialization.
 *
 *  Syntax:		rollImg(image-name, state)
 *
 *  Parameters:		image-name: (input) 'name' value from image tag
 *			state: (input) 1 for 'on'; 0 for 'off'
 *
 *  Returns:		void
 */

function rollImg(strImgName, intState) {
  var boolArrayDefined = 0;
  if (intState <= 0)
    intState = 0;
  else
    intState = 1;
  eval("((typeof " + strImgName + intState + ") == \"object\") ? boolArrayDefined = 1 : boolArrayDefined = 0;");
  if (!boolArrayDefined) return;
  eval("document.images." + strImgName + ".src = " + strImgName + intState + ".src;");
}

/**
 *   Défilement des images
 *
 */
 
var max = 0;                     // Nombre d'images
var ImageEnCours = 0 ;             // Image affichée
var timeout = 0 ;                  // Timer
var Vitesse = 800 ;                // Vitesse de défliement
var nom;

function ImageSuivante(name) {
	ImageEnCours++
	if (ImageEnCours > max ){
  		ImageEnCours = 1
  	}
  	/*alert(document.images.length);
  	alert(document.getElementById("lstimg"));*/
	document.images[0].src = "images/" + name + ImageEnCours + ".jpg";
}
function ImageContinu(name) {
	nom = name;
	if(max == 0)
		max = document.getElementById("photo" + name).innerText;
	ImageSuivante(name + getURLParam());
	if(max > 1)
		timeout = setTimeout("ImageContinu(nom)", Vitesse)
}