
function AddChoice(str,nform,nele)
{
	var esp = " ";
	var tmp = "" + str;
	if (str.length > 0)
	{
		document.forms[nform].elements[nele].options[document.forms[nform].elements[nele].length]=new Option(esp,esp);
		document.forms[nform].elements[nele].options[document.forms[nform].elements[nele].length-1]=new Option(tmp,tmp);
		document.forms[nform].elements[nele].selectedIndex=document.forms[nform].elements[nele].length-1;
	}
}
function PlusChoix(nform,nele,typof)
{
	var option = "toolbar=no,menubar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=250,height=150";
	fen = window.open("","Choix",option);
	fen.creator=self;
	fen.focus();
	fen.document.open();
	fen.document.writeln("<html><head><title>Nouvelle option - 2004 </title></head><body><center><font face='Arial'>Nouveau texte (",typof,")</font><br>");
	fen.document.writeln("<form name='ch' method='post' action='javascript:opener.AddChoice(document.ch.nc.value,",nform,",",nele,");window.close();'><input type='text' name='nc' size='15'>");
	fen.document.writeln("<center><input type='button' name='ok' value='Valider' onclick='javascript:opener.AddChoice(document.ch.nc.value,",nform,",",nele,");window.close();'></form></center></body></html>");
	fen.document.close();
	fen.document.ch.nc.focus();
}


function DropChoice(toC, tab,tab2)
{
	toC.options.length = tab.length;
	for (i=0;i<tab.length;i++)
		toC.options[i] = new Option(tab[i],tab2[i]);
	toC.options[0].selected = true;
}
function choix(menu,valeur)
{
	for (i=0; i<menu.length;i++)
		if (menu.options[i].value == valeur) menu.options[i].selected = true;
}


function PlusChoixSimple(nform,nele,old,larg,haut,pm)
{
	var page = chemin + "scripts/choose_simple.asp?nform=" + nform + "&nele=" + nele + "&old=" + old + "&pm=" + pm;
	var option = "toolbar=no,menubar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,width=" + larg +",height="+haut;
	fen = window.open(page,"Choix",option);
	fen.creator=self;
	fen.focus();
}

function ChangeImag(nima,nform,nele,path_pere,gamme)
{
	var page = chemin + "maj/scripts/chooseimag.asp?nima=" + nima + "&nform=" + nform + "&nele=" + nele + "&path_pere=" + path_pere + gamme
	var option = "toolbar=no,menubar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=500,height=420";
	fen = window.open(page,"Photos",option);
	fen.creator=self;
	fen.focus();
}

