
	function MM_preloadImages() { 
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_swapImgRestore() { 
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_findObj(n, d) {
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_swapImage() { 
	  var i,j=0,x,a=MM_swapImage.arguments;
	  document.MM_sr=new Array;
	  
	  for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	//********************************************************************	
	//   fonction permettant d'ouvrir une fenetre fille de taille fixe   *
	//********************************************************************		
	function new_browserUpload(src,name,w,h)
	{
		size=",width="+w+",height="+h
		browser=window.open(src,name,"resizable=no,scrollbars=no,toolbar=no,status=no,menubar=no,location=0,directories=no"+size)
	}	
		
	function new_browserSuppr(src,name)
	{
		w = 330;
		h = 130;
		size=",width="+w+",height="+h
		browser=window.open(src,name,"resizable=no,scrollbars=no,toolbar=no,status=no,menubar=no,location=0,directories=no"+size)
	}			
		
	function fenetrefichier (monimage,repimages)
	{	
	//alert(monimage+"\n"+repimages);				

		//monURL = "../" + repimages +	"/" + eval ("document.formulaire."+monimage+".value")
		recupphoto = eval("window.document.formulaire." + monimage + ".value");
		if (recupphoto != "")
		{
			monURL = repimages + recupphoto ;
			browser=window.open(monURL,'fichier',"resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,location=0,directories=no,width=640,height=480")
		}
		else
			browser=window.open("CQ_aucunfichier.asp","fichier","resizable=no,scrollbars=no,toolbar=no,status=no,menubar=no,location=0,directories=no,width=200,height=200")			
	
	}
	
// SUPPRIME LA SELECTION D'UNE LISTBOX
function supprime_select(destination)
	{
		var destlen =	eval("document.formulaire."+destination+".length")-1
		for (a=destlen ; a>=0; a--)
			{			
				if ( eval("document.formulaire."+destination+".options[a].selected == true") ) 
				{					
					eval("document.formulaire."+destination+".options[a] = null");
				}
			}
	}
	
function decoche()
{
	document.formulaire.all.checked = false;
}
	
	function VideListBox(destination)
	{
		var destlen = eval("document.formulaire."+destination+".length") - 1		
		for (i=destlen ; i>=0; i--)	eval("document.formulaire."+destination+".options[i] = null");

	}	
	
function tout ()
{
	//ajoute toute la selectbox
	sources = 'Groupes'
	destination = 'TL_Groupes'
	
	var sourceslen = eval("document.formulaire."+sources+".length")
		for (i=0; i< sourceslen; i++)
		{
			var destlen =	eval("document.formulaire."+destination+".length")
			trouve = "faux"
			// verification si l'element est deja present
			for (j=0; j<destlen ; j++)
			{
				if (   eval("document.formulaire."+sources+".options[i].value")  ==   eval("document.formulaire."+destination+".options[j].value")  )
				{
					trouve = "vrai"
				}
			}
			// ajout de l'element s'il n'est pas deja present
			if (trouve == "faux")
			{
				opt = new Option(   eval("document.formulaire."+sources+".options[i].text")  );
				opt.value = eval("document.formulaire."+sources+".options[i].value") ;	
				eval("document.formulaire."+destination+".options[destlen] = opt") ;								
			}	
		}
		ordonne (sources,destination);	
}

	

// AJOUTE LA SELECTION D'UNE LISTBOX A UNE AUTRE LISTBOX
function ajoute_select(sources,destination)
	{	

		var sourceslen = eval("document.formulaire."+sources+".length")
		for (i=0; i< sourceslen; i++)
		{
			var destlen =	eval("document.formulaire."+destination+".length")
			if (  eval("document.formulaire."+sources+".options[i].selected == true") )
				{
					trouve = "faux"
					// verification si l'element est deja present
					for (j=0; j<destlen ; j++)
					{
						if (   eval("document.formulaire."+sources+".options[i].value")  ==   eval("document.formulaire."+destination+".options[j].value")  )
						{
							trouve = "vrai"
						}
					}
					// ajout de l'element s'il n'est pas deja present
					if (trouve == "faux")
					{
						opt = new Option(   eval("document.formulaire."+sources+".options[i].text")  );
						opt.value = eval("document.formulaire."+sources+".options[i].value") ;	

						
						eval("document.formulaire."+destination+".options[destlen] = opt") ;								
					}	
				}
		}
		ordonne (sources,destination);
	}


// reordonne la listbox
function ordonne (sources,destination)
	{	
		var taille  = eval("document.formulaire."+destination+".length")
		var sourceslen = eval("document.formulaire."+sources+".length")		
						
		// sauvegarde des valeurs dans 1 tableau
		valeur = new Array(taille);
		for (i=0; i < taille; i++) 
		{
			valeur[i] = eval("document.formulaire."+destination+".options[i].value");
		}
					
		//on vide la select
		for (i=(taille-1); i>=0; i--) eval("document.formulaire."+destination+".options[i] = null");

		//on rempli la select dans l'ordre
		for (i=0; i<sourceslen ; i++)
		{
			trouve = "faux"

			// verification si l'element est present
			for (j=0; j<taille ; j++)
				if (eval("document.formulaire."+sources+".options[i].value") == valeur[j]) trouve = "vrai";
					
			// ajout de l'element s'il est present
			if (trouve == "vrai")
			{
				opt = new Option(   eval("document.formulaire."+sources+".options[i].text")  );
				opt.value = eval("document.formulaire."+sources+".options[i].value") ;	
				
				var taille2 =  eval("document.formulaire."+destination+".length")
				
				eval("document.formulaire."+destination+".options[taille2] = opt");														
			}	
		}
	}
	
	
// SELECTIONNE TOUS LES ELEMENTS D'UNE LISTBOX (afin de soumettre le formulaire)
function select_all(obj)
{
	var k = eval("document.formulaire."+obj+".length") - 1
	for (i=k; i>=0; i--)
	{
		eval("document.formulaire."+obj+".options[i].selected = true");
	}
}	
