// JavaScript Document

var time = 3000;

var current_picture = 0;
var next_picture = 1;
var picture = new Array();
var timerID;

//Init the parameters
function init_slideshow(){
	if(document.getElementsByClassName("picture")){
		picture = document.getElementsByClassName("picture");
		for(i=1;i<picture.length;++i){
			picture[i].style.display = "none";
		}
	}
	if(picture.length > 1) slideshow();
}

function slideshow(){
	timerID = self.setTimeout("nextpicture()",time);
}

function nextpicture(){
	new Effect.Fade(picture[current_picture]);
	new Effect.Appear(picture[next_picture]);
	
	if(next_picture == (picture.length - 1)){
		current_picture = next_picture;
		next_picture = 0;
	}else{
		current_picture = next_picture;
		next_picture++;
	}
	slideshow();
}

function stop_slideshow(){
	clearTimeout(timerID);
}
/**
 * Fade In and Fade Out div
 *
 * @author      Remi De Oliveira
 * @author
 * @copyright   2007 Collectif Web
 * @license
 * @created     13th Sept 2007
 * @revised     13th Sept 2007 
 */
var fadeIn;
var fadeOut;

function fade(oElement,nbElement){
	var oDisplay = 0;
	
	for(var i=1;i<=nbElement;++i){
		if($('prestation'+i).getStyle('display') == 'block'){
			oDisplay = i;
		}
	}
	
	fadeIn = $(oElement);
	fadeOut = $('prestation'+oDisplay);
	
	if(fadeIn != fadeOut){
		//new Effect.Fade(fadeOut);
		//new Effect.Appear(fadeIn);
		fadeOut.style.display = 'none';
		fadeIn.style.display = 'block';
	}
}


function display(){
	new Effect.Appear('send_password');	
}

/**
 * Fade In and Out the loader
 *
 * @author      Remi De Oliveira
 * @author
 * @copyright   2008
 * @license
 * @created     1st March 2008
 * @revised     1st March 2008
 */
 function show_loader(){
	 var i_loader = $('loader');
	 new Effect.Appear(i_loader);
	 wait(5000);
 }
 
 function hide_loader(){
	var i_loader = $('loader');
	new Effect.Fade(i_loader);
	wait(5000);
 }

document.write('');
document.write('');
document.write('');
document.write('');
document.write('');
