<!--

var LimitTopText,LimitBottomText,LimitLeftText,LimitRightText;
var StepY = 2;
var StepImageY = 321;
var XYLayer_text = new Array();
var YLayer_img;
var Interval;
var time_interval = 10;
var Layer_Text_Height,Frame_Text_Height;
var Layer_images_Height,Frame_Image_Height;

var layer_texte_name = 'Layer_texte';
var layer_fenetre_texte_name = 'Layer_defil_texte';

var nb_lot_image;
var indice_lot_image;

var layer_images = 'Layer_list_img_mini';
var layer_defil_img  = 'Layer_defil_img';

var ns4 = (document.layers)? true:false;   			//NS 4
var ie4 = (document.all)? true:false;   				//IE 4 
var dom = (document.getElementById)? true:false;   //DOM
var PreloadFlag = false;


function Init()
	{

        Frame_Text_Height = getHeight(layer_fenetre_texte_name);
        Layer_Text_Height = getHeight(layer_texte_name);
	//	alert(Frame_Text_Height+" "+Layer_Text_Height);
	//Définition des limites
	LimitTopText = Frame_Text_Height - Layer_Text_Height;
        
	if(LimitTopText>=0)
	{
		LimitTopText = 0;
	}
	else
	{
		LimitTopText -= 40;
	}
	LimitBottomText = 0;
	LimitLeftText = 0;

	//Coordonnées de départ
	XYLayer_text[0] = LimitLeftText;
	XYLayer_text[1] = LimitBottomText;
         
	Hide(layer_texte_name);
	SetToXY(layer_texte_name,XYLayer_text);
 	Show(layer_texte_name);
	
		if(Layer_Text_Height>Frame_Text_Height)
		{
			Hide('Layer_fleche_1');
			Show('Layer_fleche_2');
		}
		else
		{
			Hide('Layer_fleche_1');
			Hide('Layer_fleche_2');
			
		}
   
	}
function Init_Image(page)
{

        NbLotImage = (Math.ceil(nb_image/9)-1);
		
	
        
        IndiceLotImage = page;
        YLayer_img = -(StepImageY * page);
        Hide(layer_images);
		
        SetToY(layer_images,YLayer_img);
		
       
		if(nb_image>9)
		{
		
			if(IndiceLotImage >= NbLotImage)
			{
			Hide('Layer_fleche_4');
			Show('Layer_fleche_3');
			}
			else
			{
				Show('Layer_fleche_4');
				if(IndiceLotImage==0) 
				{
					Hide('Layer_fleche_3');
				}
				else
				{
					Show('Layer_fleche_3');
				}
			}
		}
		
		 Show(layer_images);
		 
}
function Move_text_detail(increment)
	{

	XYLayer_text[1] += StepY * increment;

	if (XYLayer_text[1]>LimitBottomText)
	{
	XYLayer_text[1] = LimitBottomText;
	}
	
	if(XYLayer_text[1]<LimitTopText)
	{
	XYLayer_text[1] = LimitTopText;
	}
        SetToXY(layer_texte_name,XYLayer_text);
		
	if(XYLayer_text[1]<0)
	{
		Show('Layer_fleche_1');
		if(XYLayer_text[1]<=LimitTopText)
		{
			Hide('Layer_fleche_2');
		}
		else
		{
			Show('Layer_fleche_2');
		}
	}
	else
	{
		Hide('Layer_fleche_1');
	}
		
		
}

function Move_text(increment)
{

if(increment>0)
{
Interval = setInterval('Move_text_detail(1)',time_interval);
}
else
{
Interval = setInterval('Move_text_detail(-1)',time_interval);
}

}
function Stop_text()
{
clearInterval(Interval);
}

function Move_Image(increment)
{

    IndiceLotImage += increment;
	if (IndiceLotImage<0)
	{
	IndiceLotImage=0;
	}

	if(IndiceLotImage> NbLotImage)
	{
	IndiceLotImage = NbLotImage;
	}
    YLayer_img = -(StepImageY * IndiceLotImage);
    SetToY(layer_images,YLayer_img);
	if(IndiceLotImage >= NbLotImage)
	{
	Hide('Layer_fleche_4');
	Show('Layer_fleche_3');
	}
	else
	{
	Show('Layer_fleche_4');
	if(IndiceLotImage==0) 
	{Hide('Layer_fleche_3'); }
	else
	{Show('Layer_fleche_3'); }
	}
}





function getWindowSize()
/******************************************************
Cette fonction permet d'obtenir la taille de la fenêtre. 
On ne tient en compte que la partie affichage de la page 
HTML. On ne tient pas compte du menu ou de la barre d'état 
de la fenêtre.
Retourne un tableau à 2 dimensions (largeur,hauteur).
*******************************************************/
	{
		var MySize = new Array();
		if (window.innerWidth)
				MySize[0] = window.innerWidth;
		else
				MySize[0] = document.body.clientWidth;
		if (window.innerHeight)
				MySize[1] = window.innerHeight;
		else
				MySize[1] = document.body.clientHeight;
		return MySize;	
	}


function getLeft(MyObject)
/******************************************************
Fonction permettant de connaître la position d'un objet
par rapport au bord gauche de la page.
Cet objet peut être à l'intérieur d'un autre objet.
*******************************************************/
	{
	if (dom || ie4)
		{
	    if (MyObject.offsetParent)
	        return (MyObject.offsetLeft + getLeft(MyObject.offsetParent));
	    else 
	        return (MyObject.offsetLeft);
	    }
	if (ns4)
		{
		return (MyObject.x);
		}
	}


function getTop(MyObject)
/******************************************************
Fonction permettant de connaître la position d'un objet
par rapport au bord haut de la page.
Cet objet peut être à l'intérieur d'un autre objet.
*******************************************************/
	{
	if (dom || ie4)
		{
		if (MyObject.offsetParent)
			return (MyObject.offsetTop + getTop(MyObject.offsetParent));
		else
			return (MyObject.offsetTop);
		}
	if (ns4)
		{
		return (MyObject.y);
		}
	}


function getHeight(DivId)
/******************************************************
Fonction permettant de connaître la hauteur d'un DIV.
*******************************************************/
	{
	if (dom)
		return (document.getElementById(DivId).offsetHeight);
	if (ie4) 
		return (document.all[DivId].clientHeight);
	if (ns4)
		return (document.layers[DivId].clip.height);
	}


function getWidth(DivId)
/******************************************************
Fonction permettant de connaître la largeur d'un DIV.
*******************************************************/
	{
	if (dom)
		return (document.getElementById(DivId).offsetWidth);
	if (ie4) 
		return (document.all[DivId].clientWidth);
	if (ns4)
		return (document.layers[DivId].clip.width);
	}


function ExtractClip(MyString)
/************************************************
fonction faisant l'extraction des valeurs du clip
Paramètre :
	MyString	-> clip, exemple : rect(0px 50px 50px 0px)
*************************************************/
	{
	var MyClip = new Array();
	if (MyString == "")
		{
		MyClip[0] = 0;
		MyClip[1] = 0;
		MyClip[2] = 0;
		MyClip[3] = 0;
		}
	else
		{
   	MyClip = MyString.split("rect(")[1].split(" ");
   	for (var i=0;i<MyClip.length;i++)
   		{
     		MyClip[i] = parseInt(MyClip[i]);
   		}
		}
	return MyClip;
	}


function getClip(DivId)
/******************************************************
Fonction retournant les valeurs du clip d'un DIV :
	(top, right, bottom, left)
Paramètre :
	DivId	->	propriété ID du DIV
*******************************************************/
	{
	var MyClip = new Array();
	var MyString = "";
	if (dom)
		{
		MyString = document.getElementById(DivId).style.clip;
		MyClip = ExtractClip(MyString);
		}
	else if (ie4) 
		{
		MyString = document.all[DivId].style.clip;
		MyClip = ExtractClip(MyString);
		}
	else if (ns4)
		{
		MyClip[0] = document.layers[DivId].clip.top;
		MyClip[1] = document.layers[DivId].clip.right;
		MyClip[2] = document.layers[DivId].clip.bottom;
		MyClip[3] = document.layers[DivId].clip.left;
		}
	var MyVal = ""
	for (var i=0;i<MyClip.length;i++)
		{
  		MyVal = MyVal + " "  + MyClip[i];
		}
	return MyClip;
	}


function SetToXY(DivId,Coordinates)
/*********************************************
Fonction permettant de positionner un DIV.
Paramètres : 
			DivId 		->	propriété ID du <DIV>
			Coordinates	->	tableau (X,Y)
**********************************************/
    {
    if (dom)
        {
        document.getElementById(DivId).style.left = Coordinates[0];
        document.getElementById(DivId).style.top = Coordinates[1];
        }
    if (ie4) 
        {
        document.all[DivId].style.posLeft = Coordinates[0];
        document.all[DivId].style.posTop = Coordinates[1];
        }
    if (ns4)
        {
        document.layers[DivId].pageX = Coordinates[0];
        document.layers[DivId].pageY = Coordinates[1];
        }
    }
 function SetToX(DivId,XCoord)
    {
    if (dom)
        {
        document.getElementById(DivId).style.left = XCoord;
        }
    if (ie4) 
        {
        document.all[DivId].style.posLeft = XCoord;
        }
    if (ns4)
        {
        document.layers[DivId].pageX = XCoord;
        }
    }
 function SetToY(DivId,YCoord)
    {
    if (dom)
        {

        document.getElementById(DivId).style.top = YCoord;
        }
    if (ie4) 
        {

        document.all[DivId].style.posTop = YCoord;
        }
    if (ns4)
        {
        document.layers[DivId].pageY = YCoord;
        }
    }
function SetToAnchor(AnchorId,AnchorName,DivId)
/*********************************************
Fonction permettant de positionner un <DIV> 
à une position occupée par une ancre.
Paramètres : 
			AnchorId 	->	propriété ID de l'ancre
			AnchorName	->	propriété NAME de l'ancre
			DivId			-> propriété ID du <DIV>
La fonction retourne les coordonnées de l'ancre 
dans un tableau (X,Y).
**********************************************/
    {
	 var MyCoordinates = new Array();
	 var MyAnchor;
    if (dom)
        {
        MyAnchor = document.getElementById(AnchorId);
        }
    else if (ie4) 
        {
        MyAnchor = document.all[AnchorId];
        }
    else if (ns4)
        {
        MyAnchor = document.anchors[AnchorName];
      }
    MyCoordinates[0] = getLeft(MyAnchor);
    MyCoordinates[1] = getTop(MyAnchor);
    SetToXY(DivId,MyCoordinates);
    return MyCoordinates;
    }

function SetClip(DivId,MyClip)
/*********************************************************
Fonction permettant de fixer la propriété clip d'un <DIV>.
Paramètres : 
			DivId 	->	propriété ID du <DIV>
			MyClip	->	tableau contenant les valeurs
							du clip (top,right,bottom,left)
**********************************************************/
	{
	if (dom)
		{
		document.getElementById(DivId).style.clip = "rect("+MyClip[0]+"px "+
			MyClip[1]+"px "+
			MyClip[2]+"px "+
			MyClip[3]+"px)";
		}
	else if (ie4) 
		{
		document.all[DivId].style.clip = "rect("+MyClip[0]+"px "+
			MyClip[1]+"px "+
			MyClip[2]+"px "+
			MyClip[3]+"px)";
		}
	else if (ns4)
		{
		document.layers[DivId].clip.top = MyClip[0];
		document.layers[DivId].clip.right = MyClip[1];
		document.layers[DivId].clip.bottom = MyClip[2];
		document.layers[DivId].clip.left = MyClip[3];
		}	
	}


function Show(DivId)
/*********************************************
Fonction permettant de rendre visible un DIV.
Paramètres : 
			DivId 		->	propriété ID du <DIV>
**********************************************/
	{
	if (dom)
		{
		document.getElementById(DivId).style.display = "block";
		}
	else if (ie4) 
		{
		document.all[DivId].style.display = "block";
		}
	else if (ns4)
		{
		document.layers[DivId].display = "block";
		}
	}


function Hide(DivId)
/*********************************************
Fonction permettant de rendre invisible un DIV.
Paramètres : 
			DivId 		->	propriété ID du <DIV>
**********************************************/
	{
	if (dom)
		{
		document.getElementById(DivId).style.display  = "none";
		}
	else if (ie4) 
		{
		document.all[DivId].style.display  = "none";
		}
	else if (ns4)
		{
		document.layers[DivId].display = "none";
		}
	}
function Show2(DivId)
/*********************************************
Fonction permettant de rendre visible un DIV.
Paramètres : 
			DivId 		->	propriété ID du <DIV>
**********************************************/
	{
	if (dom)
		{
		document.getElementById(DivId).style.visibility = "visible";
		}
	else if (ie4) 
		{
		document.all[DivId].style.visibility = "visible";
		}
	else if (ns4)
		{
		document.layers[DivId].visibility = "show";
		}
	}


function Hide2(DivId)
/*********************************************
Fonction permettant de rendre invisible un DIV.
Paramètres : 
			DivId 		->	propriété ID du <DIV>
**********************************************/
	{
	if (dom)
		{
		document.getElementById(DivId).style.visibility = "hidden";
		}
	else if (ie4) 
		{
		document.all[DivId].style.visibility = "hidden";
		}
	else if (ns4)
		{
		document.layers[DivId].visibility = "hide";
		}
	}

function PreloadImages()
/*********************************************
Préchargement des images passées en paramètre,
pour rendre fluide les rollover
**********************************************/

	{
	var MyArguments = PreloadImages.arguments;
	var MyImages = new Array();
	if (document.images)
		{
		for(var i=0; i<MyArguments.length; i++)
			{
			MyImages[i]= new Image();
			MyImages[i].src = MyArguments[i];
			}
		PreloadFlag = true;
		}
	}


function ChangeImages()
/*********************************************
Change la source d'une image.
Paramètres :
	Premier argument	->	Attribut NAME de l'image
	Deuxième argument	->	nouvelle valeur de l'attribut SRC
**********************************************/
	{
	var MyArguments = ChangeImages.arguments;
	var ImgName;
	for(var i=0; i<MyArguments.length; i+=2)
		{
		ImgName = MyArguments[i];
		//alert(document.images[ImgName].src);
		document.images[ImgName].src = MyArguments[i+1];
		}
	}
//-->

