function namosw_init_scrolltext()
{
  list = new Array();
  for (var i = 0, top = 0; i < namosw_init_scrolltext.arguments.length; i += 2) {
    obj = eval('document.'+namosw_init_scrolltext.arguments[i]);
    if (obj == null) continue;
    list[top++] = obj;
    for (str = '', j = 0; j < namosw_init_scrolltext.arguments[i+1]; j++)
      str += ' ';
    str += obj.value;
    obj.value = str;
  }
  if (top > 0) {
    document.namosw_scrolltext_list = list;
    setTimeout('namosw_scrolltext()', 100);
  }
}

function namosw_scrolltext()
{
  for (i = 0; i < document.namosw_scrolltext_list.length; i++) {
    obj   = document.namosw_scrolltext_list[i];
    str   = obj.value.substring(1, obj.value.length);
    str  += obj.value.substring(0, 1);
    obj.value = str;
  }
  setTimeout('namosw_scrolltext()', 100);
}

function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length-1; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function Initialise(){

  LeType=document.Choix.ChoixType.options[document.Choix.ChoixType.selectedIndex].value;

  document.Choix.TYPE.value=LeType;

  document.Choix.ARME.value=document.Choix.ChoixArme.options[document.Choix.ChoixArme.selectedIndex].value;

  document.Choix.CATAGE.value=document.Choix.ChoixCat.options[document.Choix.ChoixCat.selectedIndex].value;

 ChangeType(LeType);

}



function Alerter(x) {

  var LeMessage="Ce choix n'est pas encore opérationnel.\nEncore un peu de patience.";

  var LeChoix=x;

  if (LeChoix=='C'|LeChoix=='N'|LeChoix=='3'|LeChoix=='E'|LeChoix=='B'){

  	alert(LeMessage);}

}



function AlerteFita() {

  var Cat=document.Choix.ChoixCat.options[document.Choix.ChoixCat.selectedIndex].value;

  var Discipline=document.Choix.DISCIP.options[document.Choix.DISCIP.selectedIndex].value;

  if (Discipline=='S'|Discipline=='N'|Discipline=='3'|Discipline=='E'|Discipline=='B'){

	if (Cat=='SCRATCH'){

  	  alert('Ce choix ne concerne que le FITA et le Campagne.');

	}

  }

}



function ChangeType(x){

  LeType=x;

  if (LeType=='E') {

    document.Choix.ChoixArme.length=2;

	document.Choix.ChoixArme.options[0].text='Jeunes';

    document.Choix.ChoixArme.options[0].value='C';

	document.Choix.ChoixArme.options[1].text='Arc à poulies';

    document.Choix.ChoixArme.options[1].value='P';

	document.Choix.ChoixArme.options[2].text='Arc classique';

    document.Choix.ChoixArme.options[2].value='C';

	document.Choix.ChoixCat.disabled=true;	

  }else{

  	document.Choix.DISCIP.selectedindex; 

	RemplirArme(document.Choix.DISCIP.selectedIndex);

    document.Choix.ChoixCat.disabled=false;

  }

  document.Choix.ChoixArme.disabled=false;

  document.Choix.SEXE.disabled=false;

  return;

}



function ChangeCat(x){

  if (LeType=='E'){

	if (x=='C'){

	  document.Choix.ChoixCat.selectedIndex=3;

	}else{

	  document.Choix.ChoixCat.selectedIndex=4;

	}

  }

}



function RemplirArme(n) {

  if(n==0){

    document.Choix.ChoixArme.length=3;

	document.Choix.ChoixArme.options[0].text='Arc Classique';

    document.Choix.ChoixArme.options[0].value='C';

	document.Choix.ChoixArme.options[1].text='Arc à poulies';

    document.Choix.ChoixArme.options[1].value='P';

	document.Choix.ChoixArme.options[2].text='Bare Bow';

    document.Choix.ChoixArme.options[2].value='B';

    return;

  }

  if (n==1|n==5|n==6) {

	document.Choix.ChoixArme.length=2;

    document.Choix.ChoixArme.options[0].text='Arc Classique';

    document.Choix.ChoixArme.options[0].value='C';

	document.Choix.ChoixArme.options[1].text='Arc à poulies';

    document.Choix.ChoixArme.options[1].value='P';

    return;

  }

  

  if(n==2){

	document.Choix.ChoixArme.length=3;

	document.Choix.ChoixArme.options[0].text='Arc Classique';

    document.Choix.ChoixArme.options[0].value='C';

	document.Choix.ChoixArme.options[1].text='Arc à poulies';

    document.Choix.ChoixArme.options[1].value='P';

	document.Choix.ChoixArme.options[2].text='Arc nu';

    document.Choix.ChoixArme.options[2].value='B';

    return;

  } 

  if(n==3|n==4){

    document.Choix.ChoixArme.length=5;

	document.Choix.ChoixArme.options[0].text='Bare Bow';

    document.Choix.ChoixArme.options[0].value='C';

	document.Choix.ChoixArme.options[1].text='Arc à poulies nu';

    document.Choix.ChoixArme.options[1].value='P';

	document.Choix.ChoixArme.options[2].text='Arc Chasse';

    document.Choix.ChoixArme.options[2].value='H';

	document.Choix.ChoixArme.options[3].text='Arc droit';

    document.Choix.ChoixArme.options[3].value='D';

	document.Choix.ChoixArme.options[4].text='Arc Libre';

    document.Choix.ChoixArme.options[4].value='L';

    return;

  }  

}





function Soumettre(){

  if (document.Choix.ChoixType.options[document.Choix.ChoixType.selectedIndex].value=='E'){

  document.Choix.action='http://ffta-public.cvf.fr/servlet/ResAffichClassementEquipe';

  }

  document.Choix.TYPE.value=LeType;

  document.Choix.ARME.value=document.Choix.ChoixArme.options[document.Choix.ChoixArme.selectedIndex].value;

  document.Choix.CATAGE.value=document.Choix.ChoixCat.options[document.Choix.ChoixCat.selectedIndex].value;

  document.Choix.submit();

}
