//
// +----------------------------------------------------------------------+
// | PHP Version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 Lille Metropole Communaute Urbaine (LMCU)         |
// +----------------------------------------------------------------------+
// | This file is part of Tiny.                                           |
// |                                                                      |
// | Tiny is free software; you can redistribute it and/or modify         |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or    |
// | (at your option) any later version.                                  |
// |                                                                      |
// | Tiny is distributed in the hope that it will be useful,              |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with Tiny; if not, write to the Free Software Foundation,      |
// | Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA        |
// +----------------------------------------------------------------------+
// | Authors: Laurent Glock <lglock@cudl-lille.fr>                        |
// +----------------------------------------------------------------------+
//

function popupCentrer(sUrl, iWidth, iHeight)
{
  var sTb;
  var iTop=(screen.height-iHeight)/2-50;
  var iLeft=(screen.width-iWidth)/2;
  if (iWidth*iHeight == 0) {
    sTb = "status=yes,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,height=600,width=800,left=" + (screen.width-800)/2 + ",top=" + (screen.height-600)/2;
  } else {
    sTb = "status=yes,scrollbars=no,resizable=no,height=" + iHeight + ",width=" + iWidth + ",left=" + iLeft + ",top=" + iTop;
  }
  window.open(sUrl, "Popup", toolbar=sTb);
}

function popupCentrerClient(sUrl, iWidth, iHeight)
{
  var sTb;
  var iTop=(screen.height-iHeight)/2-50;
  var iLeft=(screen.width-iWidth)/2;
  if (iWidth*iHeight == 0) {
    sTb = "status=yes,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,height=600,width=800,left=" + (screen.width-800)/2 + ",top=" + (screen.height-600)/2;
  } else {
    sTb = "status=yes,scrollbars=no,resizable=no,height=" + iHeight + ",width=" + iWidth + ",left=" + iLeft + ",top=" + iTop;
  }
  window.open(sUrl, "Popup", toolbar=sTb);
}

//fonction de vérification des champs du formulaire
function VerifChamps()
{
	if(document.formulaire.Nom.value.length==0)
	{
		alert("Veuillez remplir le champ Nom! ")
		return false
	}
	if(document.formulaire.Prenom.value.length==0)
	{
		alert("Veuillez remplir le champ Prenom! ")
		return false
	}
	
	if(document.formulaire.Email.value.length==0)
	{
		alert("Veuillez remplir le champ Email! ")
		return false
	}
	
	//code pour l'envoie de l'email
	
	
	return true
}
//fin fonction
//fonction pour le diaporama sur l'écran
couv = new Array;
indice=0;
function CreationTableauImage(Lien)
{
	couv[indice]=Lien
	indice=indice+1;
}	

texte = new Array;
indiceTexte=0;
function CreationTableauTexte(Lien)
{
	texte[indiceTexte]=Lien
	indiceTexte=indiceTexte+1;
}

num=-1
var auto=true;
function ChangeImage()
{

	if (num == -1) 
	{ 
	  num = (couv.length-1);
	}
	  if(document.getElementById)
	  {
	 
		document.getElementById("zone").innerHTML ='<img src="'+ couv[num] + '" height=127 width=132/>';
		num = num-1 ;
    }

}

function ChangeImageZoom()
{
	if (num == -1) 
	{ 
	  num = (couv.length-1);
	}
	  if(document.getElementById)
	  {
	 
		document.getElementById("zone").innerHTML ='<img src="'+ couv[num] + '" border=0 />';
		num = num-1 ;
    }

}

function ChangeImageTexteAuto()
{
	if(document.getElementById){
		if (num == couv.length){ 
	  		num = 0;
		}
		document.getElementById("zone").innerHTML ='<img src="'+ couv[num] + '" border=0 />';
		var txt = '';
		txt += texte[num];
		document.getElementById("zoneTexte").innerHTML = txt;
		num++ ;
    }
	if (auto){
		setTimeout("ChangeImageTexteAuto()",4000);
	}
}

function PrecedentImageZoom(){
	auto=false;
	if(document.getElementById){
		num = num-1 ;
		if (num == -1){ 
	  		num = couv.length-1;
		}
		document.getElementById("zone").innerHTML ='<img src="'+ couv[num] + '" border=0 />';
		var txt = '';
		txt += texte[num];
		document.getElementById("zoneTexte").innerHTML = txt;
    }
}

function SuivanteImageZoom(){
	auto=false;
	if(document.getElementById){
		num = num+1 ;
		if (num == couv.length){ 
	  		num = 0;
		}
		document.getElementById("zone").innerHTML ='<img src="'+ couv[num] + '" border=0 />';
		var txt = '';
		txt += texte[num];
		document.getElementById("zoneTexte").innerHTML = txt;
    }
}

function ChangeImageAuto()
{
	if (num == -1) 
	{ 
	  num = (couv.length-1);
	}
	  if(document.getElementById)
	  {
	 
		document.getElementById("zone").innerHTML ='<img src="'+ couv[num] + '" height=127 width=132/>';
		num = num-1 ;
    }
	setTimeout("ChangeImageAuto()",3000);
}

function getVar (nomVariable)
{
	var infos = location.href.substring(location.href.indexOf("?")+1, location.href.length)+"&"
	if (infos.indexOf("#")!=-1)
		infos = infos.substring(0,infos.indexOf("#"))+"&"
	var variable=0
	{
		nomVariable = nomVariable + "="
		var taille = nomVariable.length
		if (infos.indexOf(nomVariable)!=-1)
			variable = infos.substring(infos.indexOf(nomVariable)+taille,infos.length).substring(0,infos.substring(infos.indexOf(nomVariable)+taille,infos.length).indexOf("&"))
	}
	return variable
}


