var sSliderImgWidth			= 85;								// largeur img
var sSliderImgHeight		= 65;								// hauteur img
var nDeltaSliderImgWidth	= 4;								// delta sur image
var scrolling;

function shiftRight(sId){
	var oContainer = $(sId);
	//oContainer.scrollLeft=oContainer.scrollLeft + sSliderImgWidth ;
	oContainer.scrollLeft=oContainer.scrollLeft + 1 ;
	//new Effect.Move($(sId),{x : -10, y : 0, mode : 'relative'});
	scrolling = setTimeout(function() {shiftRight(sId);}, 1);
}

function StopScrolling()
{
	clearTimeout(scrolling);
}

function shiftLeft(sId){
	var oContainer = $(sId);
	oContainer.scrollLeft=oContainer.scrollLeft - 1 ;	
	scrolling = setTimeout(function() {shiftLeft(sId);}, 1);
}
/*
function unDisplayFullSize(){
	if($('rightPart'))
		$('rightPart').style.display="block";
	$('galeryVisu').style.display="none";
}
*/
function SwitchImg(sImgSrc)
{
	sContainerId = "divimg_present";
	sImgId = "img_present";
	
	var oImg = $(sImgId);
	oImg.src=sImgSrc;
	Effect.Appear(sContainerId);
	
}

function displayFullSize( sImgSrc ){
	sContainerFlash = "flash_intro";
	sContainerId = "divimg_present";
	sImgId = "img_present";
	
	if($(sContainerFlash).style.display != 'none'){
		$(sContainerFlash).style.display	=	'none';
		var oImg = $(sImgId);
		oImg.src=sImgSrc;
		$(sContainerId).style.display = 'block';
	}else{
		Effect.Fade(sContainerId);
		setTimeout("SwitchImg('"+sImgSrc+"');", 1000);
	}
	
}

function setSliderSize(){
	var aImg = document.getElementsByClassName('motionGallery_img');
	var nWidth = aImg.length * (sSliderImgWidth + nDeltaSliderImgWidth);
	$('motionGallery').style.width= nWidth + "px";
}

function loadSliderContent(){
	var oAjax = new Ajax.Updater(
		"motionGallery",
		"Feed/galery.html",{
			method:'get',
			evalScripts: true
		}
	);
}

Event.observe(window, 'load', function() {
  Event.observe('shiftLeft', 'mouseover', function(){shiftRight('motionContainer')});
  Event.observe('shiftLeft', 'mouseout', StopScrolling);
  
  Event.observe('shiftRight', 'mouseover', function(){shiftLeft('motionContainer')});
  Event.observe('shiftRight', 'mouseout', StopScrolling);
  
  Event.observe('accueil_link', 'click', function(e){Event.stop(e); var oAjax = new Ajax.Updater("rightPart", "news_"+LNG+".php",{method:'get', evalScripts: true, encoding: 'iso-8859-1'});});
  Event.observe('album_link', 'click', function(e){Event.stop(e); var oAjax = new Ajax.Updater("rightPart", "album_"+LNG+".php",{method:'get', evalScripts: true, encoding: 'iso-8859-1'});});
  Event.observe('reperoire_link', 'click', function(e){Event.stop(e); var oAjax = new Ajax.Updater("rightPart", "repertoire_"+LNG+".php",{method:'get', evalScripts: true, encoding: 'iso-8859-1'});});
  Event.observe('agenda_link', 'click', function(e){Event.stop(e); var oAjax = new Ajax.Updater("rightPart", "agenda_"+LNG+".php",{method:'get', evalScripts: true, encoding: 'iso-8859-1'});});
  Event.observe('contact_link', 'click', function(e){Event.stop(e); var oAjax = new Ajax.Updater("rightPart", "contact_"+LNG+".php",{method:'get', evalScripts: true, encoding: 'iso-8859-1'});});
  
  /*if($('formcontact')){*/
  	//Event.observe('formcontact', 'submit', function(){var oAjax = new Ajax.Updater("rightPart", "contact_"+LNG+".php",{method:'get', evalScripts: true});});
  /*}*/
  
  //loadPlayer("Feed/Player/sound_default.html");
  loadSliderContent();
});



