//config slidshow 
var ss_timeout  = 3000;

function getWindowHeight() {
	var h = 0;
	if(!window.innerHeight) {
		if(!(document.documentElement.clientWidth == 0)) h = document.documentElement.clientHeight;
		else h = document.body.clientHeight;
	} else h = window.innerHeight; 
	return h;
}

function slideshow(current, next) {
	Effect.Fade("slideshow_picture_"+current, {duration: 1});
	Effect.Appear("slideshow_picture_"+next, {duration: 1});
	
	if ($("slideshow_picture_"+(next+1))) {
		setTimeout("slideshow("+next+", "+(next+1)+")", ss_timeout);
	} else {
		setTimeout("slideshow("+next+", 0)", ss_timeout);
	}
}

function resize() {
	/* Reseting */
	$("column1").setStyle({ height: 'auto' });
	$("column2").setStyle({ height: 'auto' });
	if (!(Prototype.Browser.IE)) {
		$("content").setStyle({ height: 'auto' });
	} 
	
	/* Setting new height */
	var hHeader = $("header").getHeight();
	var hContent = $("content").getHeight();
	var hFooter = $("footer").getHeight();
	var hWindow = getWindowHeight();
	if (hContent<(hWindow-(hHeader+hFooter))) {
		$("content").setStyle({ height: hWindow-(hHeader+hFooter)+'px', paddingBottom: '0px' });	
		$("column1").setStyle({ height: hWindow-(hHeader+hFooter)+'px', paddingBottom: '0px' });
		$("column2").setStyle({ height: hWindow-(hHeader+hFooter)+'px', paddingBottom: '0px' });
	} else {
		$("column1").setStyle({ height: hContent+'px' });
		$("column2").setStyle({ height: hContent+'px' });
	}
}

function knowMore(id) {
	Effect.toggle("know_more_"+id+"_text", 'blind', {duration: 0.5});
	$("know_more_"+id+"_more").toggle();
	$("know_more_"+id+"_less").toggle();
}

window.onload = function() { 
	if ($("slideshow_picture_1")) setTimeout("slideshow(0, 1)", ss_timeout);
	/*resize();*/
}

window.onresize = function() {
//	resize();
}

/*********************************  Formations  *********************************/

function showMoreDetails(idForm){
	Effect.toggle(idForm, 'blind', { duration: 0.3 });
	
}

