curPosition = 0;
sliding = false;
keep = false;
section = 'sport1';
last = 'sport1';

function slideTo(section)
{	
	if (section == 'accueil') { newPosition = 0; } // premiere page : # a gauche
	if (section == 'info') { newPosition = 1 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ; }
	if (section == 'horaire') { newPosition = 2 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ; }
	
	if (section == 'evenements') { newPosition = 3 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ; }
	if (section == 'sports') { newPosition = 4 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ; }
	if (section == 'parasports') { newPosition = 5 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ; }
	
	if (section == 'inscriptions') { newPosition = 6 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ; }
	if (section == 'commanditaires') { newPosition = 8 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ; }
	if (section == 'contact') { newPosition = 9 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ; }
	
	if (section == 'poursuivre')
		{ 
//		document.getElementById('poursuivre').style.display = 'none'; 
		newPosition = 7 * 1024 + ( 1024 - document.body.clientWidth ) / 2 ;
		
		}


//	if (section == 'inscriptions') { newPosition = document.body.clientWidth-6980-850 } // derniere section : # a droite

	off('evenement2');
	slideInterval = setInterval('slide(-newPosition)',20);
	return;
}


function off(element)
{
		document.getElementById(element).style.display = 'none';
//		document.getElementById(section).style.display = 'inline'; 

}


function on(element)
{
		off(last);
		document.getElementById(element).style.display = 'inline';
		last = element;
}

function hold(element)
{
		keep = true;
		section = element;
//		document.getElementById(element).style.zindex = 200; 

//		document.getElementById(element).style.display = 'none';
}



function slide(newPosition)
{
	speed = (newPosition - curPosition)*0.05;
	if (newPosition < curPosition) // deplacement vers la gauche
	{
		if (curPosition + speed - 1 <= newPosition)
		{
			clearInterval(slideInterval); sliding = false; return;
		}
	}
	
	
	else // deplacement a droite
	{
		if (curPosition + speed + 1 >= newPosition)
		{
			clearInterval(slideInterval); sliding = false; return;
		}	
	}
	
	curPosition += speed;
	document.getElementById('container2').style.left = curPosition +'px';
}

/*
function openPop(url,nombre,location,menubar,toolbar,status,resizable,scrollbars,top,left,width,height) {
	var hWndLinkExterno = window.open(url,nombre,"location="+location+",menubar="+menubar+",toolbar="+toolbar+",status="+status+",resizable="+resizable+",scrollbars="+scrollbars+",top="+top+",left="+left+",width="+width+",height="+height+"");
	if ((document.window != null) && (!hWndLinkExterno.opener))	hWndLinkExterno.opener = document.window;
}
*/