/**
 * @author lbesset
 */
 
 
 function scrollPageEsprit(){

	var topmin=0;
	var topmax=400;
/*** MODIF EL090722 old ratio:0.3 ***/
	var ratio=0.2;
	var hauteurMin=Math.round(Math.pow(topmin*1200*1200/ratio,0.33));
	var hauteurMax=Math.round(Math.pow(topmax*1200*1200/ratio,0.33));
	var hauteurEcran=getViewPortDimensions().height;
	//alert(hauteurMin+" "+hauteurEcran+" "+hauteurMax);
	if(hauteurEcran>hauteurMin && hauteurEcran<hauteurMax){
		//$('histoireInner').style.top=hauteurEcran*3/10+"px";
		$('leconsDiapo1').style.top=ratio*hauteurEcran*hauteurEcran*hauteurEcran/1200/1200+"px";
		$('leconsDiapo2').style.top=((ratio*hauteurEcran*hauteurEcran*hauteurEcran/1200/1200)-20)+"px";
		$('leconsDiapo3').style.top=ratio*hauteurEcran*hauteurEcran*hauteurEcran/1200/1200+"px";  
	}else if(hauteurEcran<=hauteurMin){
		$('leconsDiapo1').style.top=topmin+"px";
		$('leconsDiapo2').style.top=(topmin-20) +"px";
		$('leconsDiapo3').style.top=topmin+"px";		
	}else if(hauteurEcran>=hauteurMax){
		$('leconsDiapo1').style.top=topmax+"px";
		$('leconsDiapo2').style.top=(topmax-20)+"px";
		$('leconsDiapo3').style.top=topmax+"px";		
	}
/*** MODIF EL090722 old variant:250 ***/
	if (hauteurEcran < hauteurMax) {
		$('leconsLien').style.top = hauteurEcran - 320 + "px";
	}else{
		$('leconsLien').style.top = hauteurMax - 320 + "px";
	}
	
}
Event.observe(window, 'load', scrollPageEsprit, false);
Event.observe(window, 'resize', scrollPageEsprit, false);
 
 
 /** MODIF MB090731 **/
 
/*function scrollPageEsprit(){
	//new Effect.Scale('espritDiapo',60,{scaleX: true, scaleY: true});
	
	var topmin=100;
	var topmax=700;
	var ratio=0.5;
	var hauteurMin=Math.round(Math.pow(topmin*1200*1200/ratio,0.33));
	var hauteurMax=Math.round(Math.pow(topmax*1200*1200/ratio,0.33));
	var hauteurEcran=getViewPortDimensions().height;
	//alert(hauteurMin+" "+hauteurEcran+" "+hauteurMax);
	if(hauteurEcran>hauteurMin && hauteurEcran<hauteurMax){
		//$('histoireInner').style.top=hauteurEcran*3/10+"px";
		$('leconsDiapo1').style.top=ratio*hauteurEcran*hauteurEcran*hauteurEcran/1200/1200+"px";
		$('leconsDiapo2').style.top=ratio*hauteurEcran*hauteurEcran*hauteurEcran/1200/1200+"px";
		$('leconsDiapo3').style.top=ratio*hauteurEcran*hauteurEcran*hauteurEcran/1200/1200+"px";
	}else if(hauteurEcran<=hauteurMin){
		$('leconsDiapo1').style.top=topmin+"px";
		$('leconsDiapo2').style.top=topmin+"px";
		$('leconsDiapo3').style.top=topmin+"px";
	}else if(hauteurEcran>=hauteurMax){
		$('leconsDiapo1').style.top=topmax+"px";
		$('leconsDiapo2').style.top=topmax+"px";
		$('leconsDiapo3').style.top=topmax+"px";
	}
	if (hauteurEcran < hauteurMax) {
		$('leconsLien1').style.top = hauteurEcran - 185 + "px";
		$('leconsLien2').style.top = hauteurEcran - 185 + "px";
		$('leconsLien3').style.top = hauteurEcran - 185 + "px";
	}else{
		$('leconsLien1').style.top = hauteurMax - 185 + "px";
		$('leconsLien2').style.top = hauteurMax - 185 + "px";
		$('leconsLien3').style.top = hauteurMax - 185 + "px";
	}
	var h=getViewPortDimensions().height;
	var w=getViewPortDimensions().width;
	if((h/w) > (850/1280)){
		//$('backgroundImage').style.height = h + 'px';
		//$('backgroundImage').style.width = Math.round(h*1280/850) + 'px';
		$('backImage').style.height = h + 'px';
		$('backImage').style.width = Math.round(h*1280/850) + 'px';
		$('backImage').style.marginLeft = Math.round(w-Math.round(h*1280/850))/2+'px';
		$('backImage').style.marginTop = 0+'px'
	}else if((h/w) <= (850/1280)){
		//$('backgroundImage').style.height = Math.round(w*850/1280) + 'px';
		//$('backgroundImage').style.width = w + 'px';
		$('backImage').style.height = Math.round(w*850/1280) + 'px';
		$('backImage').style.width = w + 'px';
		$('backImage').style.marginLeft = 0+'px';
		$('backImage').style.marginTop = 0+'px'
		//$('backImage').style.marginTop = Math.round(h-Math.round(w*850/1280))/2+'px';
	}
}
//Event.observe(window, 'load', scrollPageEsprit, false);
Event.observe(window, 'resize', scrollPageEsprit, false);*/