

//var current = 1; // initialisé sur index.php pour début différent selon les pages
var maximg = 3;


		function changePic(){
			current++;
			if(current>maximg)current=1;
			document.getElementById('animation_1').style.backgroundImage= 'url('+(document.getElementById('animation_2').src)+')';
			animation('animation_2',current);
		}
		
	//
	////animation Jquery pour les chargement
	//
		function animation(id,img){
			var newsrc ='medias/images/design/banner/banner_'+img+'.jpg';
			var idD = '#'+id;
			$(idD).fadeOut(800, function(){
				$(this).attr('src',newsrc);
				if (this.complete) $(this).fadeIn(800);
			});
		}
		
	//Compteur a interval régulier pour le changement des images
		var SMB_timer = setInterval(changePic,4000);





/*var next= 2;
var nextmax=6;
function changeIMG(){
	  var newsrc ="medias/images/design/banners/home_b"+next+".jpg";
	  $('#image_bg').fadeOut(400, function(){
			$(this).attr('src',newsrc);
			if (this.complete) $(this).fadeIn(400);
	   });
	  next++;
	  if(next>nextmax)next=1;
}
var mytimer = setInterval("changeIMG()",8000);*/
