function visuelHome_init(){
	var tempsEntrePhoto = 12000;
	var tempsAnimation = 2000;
	var effet = 1.04; // Puisance de l'effet, une valeur de 1 ne fera aucun effet	
	var imgWidth, imgHeight ; // hauteur de l'image à l'écran
	var imgLst;
	var noImgSelect = 0; // le numéro de l'image séléctionée à partir de 0
	var img1, img2;
	var animNow = {width:imgWidth, height:imgHeight, pos:0}
	var tmpsTotalAnim = tempsEntrePhoto + tempsAnimation + 2000
	var isAnimation = false;	
	var n = 0;
	var lastLoadedIndex=0;
	
	var passFirstAnim = false; // definit si la première animation a été réalisée
	
	lstInfoImage =$('#listInfo li') ; // dragable sticker		
	
	img1 = $('#Img1');
	img2 = $('#Img2');	
	imgWidth = $('#visuel_home').width();
	imgHeight = $('#visuel_home').height();
	
	var nbImage = lstInfoImage.size();
	imgLst = new Array(nbImage);
	
	$('#lsn_preload_visuel_grand').append('<img src="' + lstInfoImage.eq(1).attr('title') + '" alt="" />');
	
	for (i = 0; i < nbImage; i++){		
		$('#pagination').append('<img class="imgPagination" border="0" alt="" src="images/cercleVide.png" />');	
		imgLst[i] = new Image();
//		imgLst[i].src = lstInfoImage.eq(i).attr('title');
		imgLst[i].alt = lstInfoImage.eq(i).text();	
	}
	$('#pagination').width(19 * nbImage); // définit la largeur pour centrer les petit ronds
	$('.imgPagination').first().attr('src', 'images/cerclePlein.png'); // selectionne le premier	
	$('.imgPagination').each(function(i){$(this).click(function(){ visuelHome_setImg(i); });});
		
	intervalVisu = setInterval(function(){
		if (++n > imgLst.length - 1) n = 0;
		visuelHome_setImg(n);
	}, tempsEntrePhoto ); 	

	
	img2.css({opacity: 0});	
	
	// premièrer animation		
	/*if($.browser.mozilla){
		img1.animate({asdf:0}, {
			duration: tmpsTotalAnim,
			easing : 'linear',
			step: function(now, fx){
				animNow.width = imgWidth * ((effet -1)* fx.pos +1)
				animNow.height = imgHeight * ((effet -1)* fx.pos +1)
				animNow.pos = fx.pos;
				img1.css({width: animNow.width, height:animNow.height});			
			}		
		});
	}*/
	
	function visuelHome_setImg(n){
		
		if (isAnimation) return; else isAnimation = true;
		img2.css({width:animNow.width, height:animNow.height});		
				
		img2.attr('src',img1.attr('src'));			
		img2.css({opacity: 1});

		newEndPourCent = (tmpsTotalAnim * animNow.pos + tempsAnimation) / tmpsTotalAnim 	
	/*	if($.browser.mozilla){
			w = imgWidth*((effet - 1) * newEndPourCent + 1);
			h = imgHeight*((effet - 1) * newEndPourCent + 1);
		}else{*/
			w = imgWidth
			h = imgHeight
		//}

		pass2 = false;
		
		img2.animate({width:w, height:h, opacity: 0}, {
			duration: tempsAnimation,
			step: function(now, fx){				
				if (fx.pos > 0.5  && pass2 == false ){
					pass = true;
					$('.imgPagination').eq(noImgSelect).attr('src', 'images/cercleVide.png'); // selectionne le premier
					noImgSelect = n;
					$('.imgPagination').eq(n).attr('src', 'images/cerclePlein.png'); // selectionne le premier
					$('#infoHautTxt').text(imgLst[n].alt);	
					$('#infoHautOmbre').text(imgLst[n].alt);				
				}
				
			},
			complete:function(){
				isAnimation = false;
				img2.attr('src',img1.attr('src'));			
			}			
		});
		
		pass = false;
		/*if($.browser.mozilla){
			img1.stop();
			img1.animate({asdf:0}, {
				duration: tmpsTotalAnim,
				easing : 'linear',
				step: function(now, fx){			
					if (pass == false){
						pass = true;
						//img1.attr('src',imgLst[n].src);
						if(lastLoadedIndex<nbImage-1)
						{							
							$('#lsn_preload_visuel_grand').append('<img src="' + lstInfoImage.eq(n+1).attr('title') + '" alt="" />');
							lastLoadedIndex++;
						}
						//$('#lsn_debug').append("displaying: " + lstInfoImage.eq(n).attr('title') + "<br/>");
						img1.attr('src',lstInfoImage.eq(n).attr('title'));						
						img1.css({width:imgWidth, height:imgHeight});						
					}
					animNow.width = imgWidth * ((effet -1)* fx.pos +1)
					animNow.height = imgHeight * ((effet -1)* fx.pos +1)
					animNow.pos = fx.pos;
					img1.css({width: animNow.width, height:animNow.height});			
				}
			})
		}else{*/
			//img1.attr('src',imgLst[n].src);
			
			if(lastLoadedIndex<nbImage-2)
			{				
				$('#lsn_preload_visuel_grand').append('<img src="' + lstInfoImage.eq(n+1).attr('title') + '" alt="" />');
				lastLoadedIndex++;
			}
			img1.attr('src',lstInfoImage.eq(n).attr('title'));	
			
			img1.css({width:imgWidth, height:imgHeight});	
		//}		
	}
}


