if(!window.largeur && document.body && document.body.offsetWidth)
  {
   window.onresize = reconstruction;
   var largeur;
   largeur = largeur_fenetre(); 
   
  }
  
  function largeur_fenetre()
{
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;
 
}




function reconstruction()
{
 if (largeur != largeur_fenetre())
 window.history.go(0);
}

posL = 510; // (largeur / 2) + 60  // 76


if(posL < 446){posL = 446;}  //462

pt =  new Array();
pt[0] = 0
pt[1] = 0
pt[2] = posL



var pos = 0;
var refr = 50; 
var coef = 100; 
var comptephoto = 0;

var Vit = 700

function chrono(lay)
{


	pos++;	
	tptot = 0;
	boucle = 0;
	document.getElementById(lay).style.left = pt[pos];		
	
	document.getElementById(lay).style.visibility = "visible";
	for (compt=1; compt<pt.length; compt++){
		
			Suivant(lay, Vit);			
		
		pos++;
	}
}

function Suivant(lay, Vit){	
	
	D = pt[pos] - pt[pos - 1];	
	temps = (1000*D / Vit);
	temps2 = (1000*D / Vit);		
	Mouvement(lay, pt[pos-1], pt[pos-1], pt[pos], pt[pos], temps, boucle, Vit);	
	boucle += temps2;
	
}

function Mouvement(lay, depX ,depY , arrX, arrY, interv, boucle, Vit){
	
	mouve = interv / refr;	
	tptotpk = tptot;
	for (i=1; i<mouve; i++) {		
		x = depX + i * (arrX - depX) / mouve;
	
		Di = pt[pos] - pt[pos - 1];
		D = pt[pos - 1] + i*Di / mouve;
		
		time = i * refr;				
		tptotpk += Di/mouve	;				
		setTimeout("Positionnement('"+ lay +"', " + x +");", boucle + time);
	}		
		Di = pt[pos] - pt[pos - 1];		
		tptot += Di	
		 setTimeout("Positionnement('"+ lay +"', " + arrX +");", boucle + interv);
			
}

function Positionnement(lay,x){	
	newX = x ;	
	document.getElementById(lay).style.left= newX + "px";
	
	
}

function Fermerpop(lay){
document.getElementById(lay).style.visibility = "hidden";
document.getElementById(lay).style.left = -100;		
}

