//config slidshow 
var ss_timeout  = 3000;
var ss_projet_timeout  = 3000;

//slideshow
function slideshow(current, next) {
	
	$("slideshow_picture_"+next).setStyle({position: "absolute",left: "-405px",zIndex:0});
	$("slideshow_picture_"+current).setStyle({zIndex:20});
	//$("slideshow_picture_"+current).setStyle({zIndex: 20});
	new Effect.Parallel([
		new Effect.Move("slideshow_picture_"+next, { x: 0, y: 0, mode: 'absolute'}),
		new Effect.Move("slideshow_picture_"+current, { x: 405, y: 0, mode: 'absolute'})
	], { 
	  duration: 0.8,
	  delay: 0.0
	});
	
	if ($("slideshow_picture_"+(next+1))) {
		setTimeout("slideshow("+next+", "+(next+1)+")", ss_timeout);
	} else {
		setTimeout("slideshow("+next+", 0)", ss_timeout);
	}

}

function slideshow_projet(current, next) {
	Effect.Fade("slideshow_projet_picture_"+current, {duration: 1});
	Effect.Appear("slideshow_projet_picture_"+next, {duration: 1});
	
	if ($("slideshow_projet_picture_"+(next+1))) {
		setTimeout("slideshow_projet("+next+", "+(next+1)+")", ss_projet_timeout);
	} else {
		setTimeout("slideshow_projet("+next+", 0)", ss_projet_timeout);
	}
}
/**********************************************************************/


/*********************  PROJET  ***************************************/

function showDescProjet(){
	showDesc();
}

function initdescPan(){
	$('desc').observe('click',function(){hideDesc();} );
	$('desc').setStyle({opacity: "0.8"});
	$('desc_more').setStyle({opacity: "0.8"});
	
}

function showDesc(){
	new Effect.Parallel([
		new Effect.BlindDown('desc'),
		new Effect.Fade("desc_more", {from: 0.8, to: 0 })
	], { 
	  duration: 0.8,
	  delay: 0.0
	});
}

function hideDesc(){
	new Effect.Parallel([
		new Effect.BlindUp('desc')
	], { 
	  duration: 0.8,
	  delay: 0.0
	});
	window.setTimeout("Effect.Appear('desc_more', {from: 0, to: 0.8 })",900);
}


/************************************************************************/
window.onload = function() { 
	if ($("slideshow_picture_1")){
	 	setTimeout("slideshow(0, 1)", ss_timeout);
	}
	if ($("slideshow_projet_picture_1")){
	 	setTimeout("slideshow_projet(0, 1)", ss_timeout);
	}
	if ($("google_maps")) {initMap(); };
	if($('desc')){initdescPan();}


}

