var i;var j;var Init = false;// ROLLOVER SUR UNE IMAGEfunction RollOver(Cible,Image) {	document.getElementById(Cible).src = Image;}// TAILLE DE LA FENETREvar Fenetre_L;var Fenetre_H;var Gauche;function FenetreTaille() {	Fenetre_L = document.documentElement.clientWidth;	Fenetre_H = document.documentElement.clientHeight;	Gauche = Math.round((Fenetre_L - 840) / 2);	if (Gauche < 0) Gauche = 0;}// POSITIONNEMENT DES BLOCS DU DIAPORAMAvar Diaporama_On = 0;var Diaporama_X = new Array();var Diaporama_Auto = true;function Diaporama_Focus(Id) {	clearTimeout();	if (Id != Diaporama_On) {		Diaporama_On = Id;		Diaporama_Init(true);	}}// DEFINITION DE LA POSITION DE CHAQUE DIAPO, AINSI QUE DE LA BULLEfunction Diaporama_Init(Boucle) {	FenetreTaille();	// TEXTE DESCRIPTIF DE LA DIAPO POUR LES NEWS ET LE CATALOGUE	if (Diaporama_Id != "Fiche") {		if (Diaporama_Id == "News") {			if ((Diaporama_Titre[Diaporama_On]).length < 20) {				document.getElementById("bulle_news_titre").style.fontSize = "24px";				document.getElementById("bulle_news_titre").style.lineHeight = "27px";			} else if ((Diaporama_Titre[Diaporama_On]).length < 30) {				document.getElementById("bulle_news_titre").style.fontSize = "21px";				document.getElementById("bulle_news_titre").style.lineHeight = "24px";			} else {				document.getElementById("bulle_news_titre").style.fontSize = "19px";				document.getElementById("bulle_news_titre").style.lineHeight = "21px";			}			document.getElementById("bulle_news_titre").innerHTML = Diaporama_Titre[Diaporama_On];			document.getElementById("bulle_news_texte").innerHTML = Diaporama_Texte[Diaporama_On];			document.getElementById("bulle").style.left = (Gauche + (Diapo_L - 130)) + "px";			if (Diaporama_Lien[Diaporama_On] != "") {				document.getElementById("bulle_plus").style.visibility = "visible";			} else {				document.getElementById("bulle_plus").style.visibility = "hidden";			}		} else if (Diaporama_Id == "Catalogue") {			if ((Diaporama_Titre[Diaporama_On]).length < 20) {				document.getElementById("bulle_catalogue_titre").style.fontSize = "23px";				document.getElementById("bulle_catalogue_titre").style.lineHeight = "22px";			} else if ((Diaporama_Titre[Diaporama_On]).length < 30) {				document.getElementById("bulle_catalogue_titre").style.fontSize = "20px";				document.getElementById("bulle_catalogue_titre").style.lineHeight = "19px";			} else {				document.getElementById("bulle_catalogue_titre").style.fontSize = "17px";				document.getElementById("bulle_catalogue_titre").style.lineHeight = "16px";			}			document.getElementById("bulle_catalogue_titre").innerHTML = Diaporama_Titre[Diaporama_On];			document.getElementById("bulle_catalogue_texte").innerHTML = Diaporama_Texte[Diaporama_On];			document.getElementById("bulle").style.left = (Gauche + (Diapo_L - 26)) + "px";		}		Bulle_Type_Img();		document.getElementById("bulle").style.visibility = "visible";	}	// POSITIONNEMENT FINAL DES DIAPOS (QUI SERA ENSUITE APPLIQUE PAR LA BOUCLE)	for (i = 0; i < Diaporama_Liste.length; i++) {		if (Diaporama_Id != "Fiche") {			Diaporama_X[i] = (Gauche + (Diapo_L * (i - Diaporama_On)));			// AJOUT D'UN DECALAGE POUR LE CATALOGUE POUR LES DIAPOS SITUEES A DROITE DE LA BULLE CENTRALE			if ((Diaporama_Id == "Catalogue") && (i > Diaporama_On)) {				Diaporama_X[i] += 306;			}			if (i == Diaporama_On) {				document.getElementById("diaporama_image_" + i + "_on").style.visibility = "visible";				document.getElementById("diaporama_image_" + i + "_on").style.display = "block";				document.getElementById("diaporama_image_" + i + "_off").style.visibility = "hidden";				document.getElementById("diaporama_image_" + i + "_off").style.display = "none";				document.getElementById("puce_" + i).src = "img/diaporama_puce_on.gif";			} else {				document.getElementById("diaporama_image_" + i + "_on").style.visibility = "hidden";				document.getElementById("diaporama_image_" + i + "_on").style.display = "none";				document.getElementById("diaporama_image_" + i + "_off").style.visibility = "visible";				document.getElementById("diaporama_image_" + i + "_off").style.display = "block";				document.getElementById("puce_" + i).src = "img/diaporama_puce_off.gif";			}		}		// POUR LA FICHE ON CALCULE SIMPLEMENT LES POSITIONS SANS MISE EN AVANT ON/OFF = COULEUR/NOIR & BLANC		else {			Diaporama_X[i] = ((Diapo_L + 5) * (i - Diaporama_On));		}	}	Diaporama_Boucle(Boucle);	Init = true;}// CLIC MANUEL DANS UNE DIAPOfunction Diaporama_Clic(Id) {	// POUR LES NEWS ET LE CATALOGUE ON MET EN AVANT LA DIAPO CHOISIE OU SI ELLE L'EST DEJA ON OUVRE LE LIEN	if (Diaporama_Id != "Fiche") {		Diaporama_Auto = false;		if ((Id > -1) && (Id != Diaporama_On)) {			Diaporama_Focus(Id);		} else if (Diaporama_Lien[Diaporama_On] != "") {			top.location.href = Diaporama_Lien[Diaporama_On];		}	}	// POUR LES DIAPOS D'UNE FICHE ON OUVRE L'IMAGE EN GRAND (OU ON LA REFERME)	else {		if (Id > -1) {			var i = Diaporama_Texte[Id].indexOf("_");			document.getElementById("zoom_bloc").style.width = Diaporama_Texte[Id].substr(0,i) + "px";			document.getElementById("zoom_image").innerHTML = "<img src=\"" + Diaporama_Lien[Id] + "\" width=\"" + Diaporama_Texte[Id].substr(0,i) + "\" height=\"" + Diaporama_Texte[Id].substr(i+1,10) + "\" alt=\"" + Diaporama_Titre[Id] + "\">";			document.getElementById("zoom_titre").innerHTML = Diaporama_Titre[Id];			if (Diaporama_Titre[Id] != "") {				document.getElementById("zoom_titre").className = "zoom_titre";			} else {				document.getElementById("zoom_titre").className = "zoom_titre_vide";			}			document.getElementById("zoom").style.height = (document.body.offsetHeight - 234) + "px";			document.getElementById("zoom").style.visibility = "visible";			document.getElementById("zoom").style.display = "block";			document.getElementById("diaporama_fiche_video_frame").style.visibility = "hidden";		} else {			document.getElementById("zoom").style.visibility = "hidden";			document.getElementById("zoom").style.display = "none";			document.getElementById("diaporama_fiche_video_frame").style.visibility = "visible";			document.getElementById("diaporama_fiche_video_frame").style.display = "block";		}	}}// CLIC DANS UNE FLECHE POUR AFFICHER LA DIAPO PRECEDENTE OU SUIVANTEfunction Diaporama_Fleche(Sens) {	var Go = Diaporama_On + Sens;	if (Go < 0) Go = Diaporama_Liste.length - 1;	else if (Go > Diaporama_Liste.length - 1) Go = 0;	Diaporama_Clic(Go);}// CLIC DANS UNE PUCE POUR AFFICHER UNE DIAPO (SANS OUVRIR LA FICHE SI LA DIAPO EST DEJA AFFICHEE)function Diaporama_Puce(Id) {	if (Id != Diaporama_On) {		Diaporama_Clic(Id);	}}// ROLLOVER SUR UNE PUCE DE DIAPORAMAfunction Diaporama_Puce_Over(Id) {	if (Id != Diaporama_On) {		RollOver("puce_" + Id,"img/diaporama_puce_over.gif");	}}function Diaporama_Puce_Out(Id) {	if (Id != Diaporama_On) {		RollOver("puce_" + Id,"img/diaporama_puce_off.gif");	}}// BOUCLE DE TRANSITION D'UNE DIAPO A L'AUTRE (GLISSEMENT)var X;var Actuel;var Px;var Ok;function Diaporama_Boucle(Boucle) {	Ok = 0;	for (i = 0; i < Diaporama_Liste.length; i++) {		Actuel = document.getElementById("diaporama_image_" + i).style.left;		Px = Actuel.substr(0, Actuel.indexOf("px"));		if ((Px == Math.round(Px)) && Boucle && Init) {			Actuel = Math.round(Px);			if (Math.abs(Diaporama_X[i] - Actuel) < 1) {				X = Diaporama_X[i];				Ok++;			} else {				if (Diaporama_X[i] > Actuel) X = Math.ceil(Actuel + ((Diaporama_X[i] - Actuel) / 5));				else X = Math.floor(Actuel + ((Diaporama_X[i] - Actuel) / 5));			}		} else {			X = Diaporama_X[i];			Ok++;		}		document.getElementById("diaporama_image_" + i).style.left = X + "px";	}	if (Ok < Diaporama_Liste.length) {		setTimeout("Diaporama_Boucle(" + Boucle + ")",25);	} else {		if (Diaporama_Id != "Fiche") {			Bulle_Type_Img();		}		if (Diaporama_Auto && Boucle && ((Diaporama_Id != "Fiche") || (Diaporama_Liste.length > 3))) {			setTimeout("Diaporama_Suite()",4000);		}	}}// AFFICHAGE DE L'ICONE DU TYPE DE PRODUCTION (DOIT ETRE RAPPELE A LA FIN DU GLISSEMENT POUR CORRIGER UN BUG D'AFFICHAGE DANS SAFARI !)function Bulle_Type_Img() {	if (Diaporama_Type[Diaporama_On] != "") {		document.getElementById("bulle_type").innerHTML = "<img src=\"img/type_" + Diaporama_Type[Diaporama_On] + ".png\" height=\"13\" alt=\"" + Diaporama_Type[Diaporama_On] + "\">";	} else {		document.getElementById("bulle_type").innerHTML = "";	}}// ENCHAINEMENT AUTOMATIQUE D'UNE DIAPO A LA SUIVANTEfunction Diaporama_Suite() {	if (Diaporama_Auto) {		if (((Diaporama_Id != "Fiche") && (Diaporama_On < Diaporama_Liste.length - 1)) || ((Diaporama_Id == "Fiche") && (Diaporama_On < Diaporama_Liste.length - 3))) {			Diaporama_Focus(Diaporama_On + 1);		} else {			Diaporama_Focus(0);		}	}}
