/* - - - - - - - - - - - - - - - 
Fonctions liées au Top destinations
- - - - - - - - - - - - - - - */
function showDestination(InputId){
	var nbdestinations = document.getElementById('nbdestinations').value;
	for(i=0;i<=nbdestinations;i++){
	   document.getElementById('top'+i).style.display = (i == InputId) ? 'block' : 'none';
	}
}
function UnCheckDestinations(){
    var nbdestinations = document.getElementById('nbdestinations').value;
	for(i=1;i<=nbdestinations;i++){
	   document.getElementById('dest'+i).checked = false;
	}
}

/* - - - - - - - - - - - - - - - 
Fonctions liées au Tour du monde
- - - - - - - - - - - - - - - */
function showTDM(InputId){
	var nbtdm = document.getElementById('nbtdm').value;
	for(i=1;i<=nbtdm;i++){
	   if(i != InputId){
           document.getElementById('tdm'+i).style.display = 'none';
           document.getElementById('linktdm'+i).className = 'inactive';
	   }
	   else{
	       document.getElementById('tdm'+i).style.display = 'block';
	       document.getElementById('linktdm'+i).className = 'active';
	   } 
	}
}
/* - - - - - - - - - - - - - - - 
Fonctions liées au Diaporama
- - - - - - - - - - - - - - - */
            var duration = 7000;
            var imgs = new Array();
            var imgs_count = 8;
            var current_img = 0;
            var next_img = 1;

			function initDiapo(){
				for(i=0;i<imgs_count;i++){
					imgs[i] = 'imgId'+i;
				}
				if(imgs.length > 1) initTimer();
			}

			function initTimer(){
				self.setTimeout("fadeInOut()",duration);
			}

            function fadeInOut(){
               new Effect.Fade(imgs[current_img]);
               new Effect.Appear(imgs[next_img]);
               if(next_img == (imgs.length - 1)){
                  current_img = next_img;
                  next_img = 0;
               }
               else{
                  current_img = next_img;
                  next_img++;
               }
               initTimer();
            }

			initDiapo();
