// ****************************************************
// **** 'TOUT SELECTIONNER' ET 'VIDER LA SELECTION' ***
// ****         SELECTIONNE TOUT OU                 ***
// ****         DESELECTIONNE TOUT                  ***
// ****************************************************

function selectAll(bAll)
{	
	with( document.forms[0]['step2[]'] )
		for (var i = 0; i < options.length; i++) options[i].selected = bAll;
	return;
 }  
 
function Continuer()
{
	if(document.forms[0]['step2[]'].selectedIndex<0) 
				return alert ("Faites un choix.");
	document.forms[0].submit();
}

function changeStep1()
{

	if( typeof( document.forms[0]['step1'] ) == 'object' ) {
      if( document.forms[0]['step1'].options[document.forms[0]['step1'].selectedIndex].value=='4') {
         var oSpan = document.getElementById( 'matchInput' );
         oSpan.style.display='';
         document.getElementById( 'MatchNumber' ).focus();
         document.forms[0].action = 'javascript:void(0)';
         return true;
      } else {
         var i1 = location.search.indexOf('p=');
         var i2 = location.search.indexOf('&');
         i2 = (i2 < 0 ? 100 : i2 );
         
         var sParam = location.search.slice( i1, i2 );
         document.forms[0].action = 'index.php?'+sParam;
      }
  };

  //vide la selection si elle existe
	if( typeof( document.forms[0]['step2[]'] ) == 'object' ) selectAll( false );

  document.forms[0].submit();
}

function OpenMatch(NumMatch)
{
  var h=370;
	var w=380;
	var x = (new Number( window.screen.height )/2)-(h/2);
	var y = (new Number( window.screen.width )/2)-(w/2);
	window.open( "fr/ch_fm.php?no=" + NumMatch , "FM", "scrollbars=yes,top="+x+",left="+y+", height="+h+", width="+w )
}


