// JavaScript Document
function selectionner(id_masquer,id_afficher){
//creation d'un tableau pour les menus
var categorie = new Array('div11','div12','div13','div14','div15','div16','div17','div18','div19');
var categoriebis = new Array('div1','div2','div3','div4','div5','div6','div7','div8','div9');
var i;
//boucle pour masquer les menus
for (i=0;i<categorie.length;i++) {
	document.getElementById(categorie[i]).style.display='none'; 	
	document.getElementById(categoriebis[i]).style.display='block'; 	
	}
document.getElementById(id_masquer).style.display='none';
document.getElementById(id_afficher).style.display='block';
}

function afficher(id){
document.getElementById(id).style.display='block';
}


// AFFICHAGE D UN  TEXTE CONTENU DANS UNE DIV PLUS CHANGEMENT D IMAGE
function bloc(img,txt){
	// CHANGEMENT D IMAGE
	document.getElementById('big').src='images/diapo/big/'+img+'.jpg'; 
	//creation d'un tableau pour les menus
	var lien = new Array('diamant','lady','alcao','sirocco','camelia','ballotins','florentins','gamme','palets','chocolats','calissons','carolines','macarons','marrons','pieces');
	//boucle pour masquer les menus
	for (var i=0; i<lien.length; i++) {
//	alert (lien[i]);
	document.getElementById(lien[i]).style.display='none'; 	
	}
	document.getElementById(txt).style.display='block'; 	
}



// CHANGEMENT D IMAGE SELON TABLEAU VENETA
function veneta(id,u){
	var nb=9
	for (var i=0; i<nb; i++) {
	document.getElementById('Image'+[i]+'').src='images/carre_blanc'+i+'.jpg';
	}
var u;
document.getElementById(id).src='images/carre_rouge'+u+'.jpg';
}

function diapo_txt(nom,texte){
window.document.getElementById('photo').src="images/ref/"+nom+".jpg";
document.getElementById('nom_visuel').innerHTML=texte;
}

function diapo(nom,lid){
window.document.getElementById(lid).src="images/big/"+nom+".jpg";
}


// DIAPORAMA
<!--
// * Dependencies * 
// this function requires the following snippets:
// JavaScript/images/switchImage
//
// BODY Example:
// <body onLoad="mySlideShow1.play(); mySlideShow2.play();">
// <img src="originalImage1.gif" name="slide1">
// <img src="originalImage2.gif" name="slide2">
//
// SCRIPT Example:
// var mySlideList1 = ['image1.gif', 'image2.gif', 'image3.gif'];
// var mySlideShow1 = new SlideShow(mySlideList1, 'slide1', 3000, "mySlideShow1");
// var mySlideList2 = ['image4.gif', 'image5.gif', 'image6.gif'];
// var mySlideShow2 = new SlideShow(mySlideList2, 'slide2', 1000, "mySlideShow2");
<!--

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

function SlideShow(slideList, image, speed, name)          
{
  this.slideList = slideList;
  this.image = image;
  this.speed = speed;
  this.name = name;
  this.current = 0;
  this.timer = 0;
}

SlideShow.prototype.play = SlideShow_play;  
//TEXTE AJOUTER
SlideShow.prototype.arret = SlideShow_arret;  
SlideShow.prototype.fade = SlideShow_fade;  

function SlideShow_fade()
{
with(this)
	{
	new Effect.Fade(document.getElementById('photo'));
	}
}

function SlideShow_arret()       
{
with(this)
	{
    clearTimeout(timer);
    clearTimeout(Fade_Time);
	}
}

function SlideShow_play()       
{
  with(this)
  {
	if(current++ == slideList.length-1) current = 0;
    switchImage(image, slideList[current]);
    clearTimeout(timer);
	//TEXTE AJOUTER
	Fade_Time = setTimeout(name+'.fade()', speed-1000);
	
	timer = setTimeout(name+'.play()', speed);
	//TEXTE AJOUTER
	new Effect.Appear(document.getElementById('photo'));
	//TEXTE AJOUTER
//	new Effect.Fade(document.getElementById('photo'));

  }
}

// DECLARATION
/*
var mySlideList0 = ['images/carte/IMG_0156.jpg','images/carte/IMG_0185.jpg','images/carte/IMG_0191.jpg','images/carte/IMG_0197.jpg'];
var mySlideShow0 = new SlideShow(mySlideList0, 'slide0', 2000, "mySlideShow0");
*/