// ensemble de fonctions pour animer un calque , voir ci-dessous la declaration du calque et son init.//// <body onLoad="init('MyMovie' ,10, 200)">//<div id="MyMovie" style="position:absolute; left:10px; top:123px; width:104px; height:99px; z-index:1"><img src="../Ressources/blason.gif" width="70" height="82"></div>// -------------------------------------------var IE4 ;var IE5 ;var NS4; var NS6;var winwidth= 0;var winheight = 0;var xmin = 0, ymin = 0;var ar = 0, al = 0;var theanim;  // pointeur sur le calque ? animervar anim , anim2; // les calquesvar increment = 4; // increment de l'animvar nbpassage = 0, IDanim ;// recup des dimensions de la fenetre active// -----------------------------------------------------function get_window_dim(){	if(IE5)	{		winwidth  = document.body.clientWidth;		winheight = document.body.clientHeight;	}				if(NS6) {		winwidth  = window.innerWidth;		winheight = window.innerHeight;	}}// recherche du type de navigateur// -----------------------------------------function get_browser(){	IE5  =  (document.getElementById) ? true : false;	NS6 = 	((document.getElementById)&&(! document.all)) ? true : false;	IE4  =  ((document.all) && (! document.getElementById)) ? true : false;	NS4 =  (document.layers)  ? true : false;//document.write("<br> IE5 = " + IE5 + "<br> NS6 = " + NS6 + "<br> IE4 = " + IE4 + "<br> NS4 = " + NS4 );}// initialisation du calque et demarage de l'animation// ----------------------------------------------------------------function initmovie(calque, calque2, x, y ) {	get_browser();	get_window_dim();	if(IE5 || NS6) {		anim   = document.getElementById(calque).style; 		anim2 = document.getElementById(calque2).style; 	}	xmin = x;	ymin = y;  	anim.left = xmin;	anim.top = ymin;	anim2.left = winwidth + 100;	anim2.top = ymin ;	ar = 1; al = 0;	theanim = anim;	//theanim.left = -600;	theanim.left =winwidth + 100	animateit_Right();}// animation avec verif dim window pour recadrer si window modifiee// deplacement de droite a gauche// ------------------------------------------------------------------------------------function animateit_Right() {	get_window_dim();		if( ar >= 1) {		theanim = anim;			theanim.left =  parseInt(theanim.left) +  parseInt(increment);	}	else {		theanim = anim2;		theanim.left =  parseInt(theanim.left) - parseInt(increment)	}	// depassement a droite	 // ------------------------------	if ( parseInt(theanim.left) >= parseInt(winwidth) ) { 		ar = 0;	 	theanim.left = xmin ;		theanim = anim2;		nbpassage++;	}	// depassement a gauche	 // ------------------------------	 if ( parseInt(theanim.left) <= xmin) { 		ar = 1;		theanim.left = winwidth ;		theanim = anim;			nbpassage++;	}	 if(nbpassage >6) clearTimeout(IDanim);	 else  IDanim = setTimeout("animateit_Right()",30);}
