
/*覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧|
|    _____                  _____               _____          _____          |
|   | PP  |                |  A  |       ___   | RR  |        |  CC |         |
|   | P P |_______________ | A A |____   des   | R R |_____ _ | C   |_______  |
|   | PP  |ersonnalisation | AAA |is馥 覧覧覧 | RR  |adios & | C   |heckbox  |
|   | P   |ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ | A A |ｯｯｯｯ boutons | R R |ｯｯｯｯｯ ｯ | C   |ｯｯｯｯｯｯｯ  |
|   | P   |                | A A |     ｯｯｯｯｯｯｯ | R R |        |  CC |         |
|    ｯｯｯｯｯ                  ｯｯｯｯｯ               ｯｯｯｯｯ          ｯｯｯｯｯ          |
|            _____________________________________________________            |
|             PARC  Septembre 20005 ｩ marcel.Bultez@Tiscali.fr             |
|            ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ             |
|      _____________                                                          |
|     | utilisation |                                                         |
|      ｯｯｯｯｯｯｯｯｯｯｯｯｯ                                                          |
|         <Script type="Text/JavaScript" src="PARC.js"></Script>             |
|          	  entre <head> et </head>                                         |
|           ________________                                                  |
|         | Initialisation |                                                 |
|           ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ                                                  |
|          var variable=PARC( name des boutons, type des boutons,             |
|              ｯｯｯｯｯｯｯｯ       Image si Coch, Image si non coch,             |
|                             Etat initial );                                 |
|                                                                             |
|          name des boutons   = le name [ pr馗馘 de celui du                 |
|          ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ     formulaire si n馗essaire ] du                 |
|                               ( ou des ) bouton(s)                          |
|          type des boutons   = C[heckbox] ou R[adio]                         |
|          ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ     "C" par d馭aut                                |
|          Image si coch     = nom d'un fichier image pour                   |
|          ｯｯｯｯｯｯｯｯｯｯｯｯｯｯ       un bouton coch                               |
|                               "CocheOui.gif" par d馭aut                     |
|          Image si non coch = nom d'un fichier image pour                   |
|          ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ   un bouton non coch                           |
|                               "CocheNon.gif" par d馭aut                     |
|          Etat initial       = non donn : on ne touchera  rien             |
|          ｯｯｯｯｯｯｯｯｯｯｯｯ         -1, on place les images, rien n'est coch     |
|                               nｰ, on place les images, la nｰ est coch馥     |
|           _______________________                                           |
|         | fonctions disponibles | retour=variable.fonction ( param鑼res )  |
|           ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ                                           |
|            .Click(this si type Radio, omis sinon)                           |
|             ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ                           |
|                   inverse l'騁at du bouton type Checkbox,                   |
|                   met l'騁at du bouton type Radio  coch et                |
|                       met "non coch" pour les autres                       |
|            .Test()                                                          |
|             ｯｯｯｯｯｯ                                                          |
|                   retourne l'騁at du bouton si type Checkbox,               |
|                            ( false ou true )                                |
|                   retourne le nｰ de bouton coch si type Radio              |
|                            ou -1 si rien n'est coch                        |
|            .Decoche()                                                       |
|             ｯｯｯｯｯｯｯｯｯ                                                       |
|                   met tout  non coch                                      |
|覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧*/

//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
function PARC (Nom,Typ,Oui,Non,Eta)	//覧 Initialisation 覧覧覧覧覧覧覧覧覧覧覧
//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
{
	this.Nom = Nom;							//覧 Valeurs par d馭aut 覧
	this.Typ = Typ ? Typ : "c";				//   ｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯｯ
	this.Oui = Oui ? Oui : "CocheOui.gif";
	this.Non = Non ? Non : "CocheNon.gif";
	tmp = Eta;
	if ( typeof(window["tmp"]) != "undefined" )  
	{	//覧 par d馭aut, on ne touche  rien 覧
		switch ( this.Typ.charAt(0).toLowerCase() )
		{	
			//覧覧覧覧覧覧覧覧覧覧覧覧覧
			case "c":	//覧 CheckBox 覧
			//覧覧覧覧覧覧覧覧覧覧覧覧覧
				switch (Eta)
				{
					case -1:					//覧 non coch馥 覧
						this.Nom.src=this.Non;	//   ｯｯｯｯｯｯｯｯｯｯ
						break;
					default:					//覧 coch馥 覧
						this.Nom.src=this.Oui;	//   ｯｯｯｯｯｯ
						break;
				}
				break;
			//覧覧覧覧覧覧覧覧覧覧覧
			case "r":	//覧 Radio 覧
			//覧覧覧覧覧覧覧覧覧覧覧
				for ( var n=0;n<this.Nom.length;n++)
				{								//覧 non coch馥s 覧
					this.Nom[n].src=this.Non;	//   ｯｯｯｯｯｯｯｯｯｯｯ
				}
				if ( Eta>=0 && Eta<this.Nom.length )
				{								//覧 coch馥 覧
					this.Nom[Eta].src=this.Oui;	//   ｯｯｯｯｯｯ
				}
				break;
		}
	}
	return true;
}
//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
PARC.prototype.Click = function (Num)	//覧 click sur un bouton 覧覧覧覧覧覧覧覧
//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
{
	var ret;
	switch ( this.Typ.charAt(0).toLowerCase() )
	{	
		//覧覧覧覧覧覧覧覧覧覧覧覧覧
		case "c":	//覧 CheckBox 覧
		//覧覧覧覧覧覧覧覧覧覧覧覧覧
            
			if ( 	this.Nom.src.substring(this.Nom.src.lastIndexOf("/")+1)
						==
					this.Oui.substring(this.Oui.lastIndexOf("/")+1) )
						{							//覧 non coch馥 覧
							this.Nom.src=this.Non;	//   ｯｯｯｯｯｯｯｯｯｯ
							ret=false;
						}
			else		{							//覧 coch馥 覧
							this.Nom.src=this.Oui;	//   ｯｯｯｯｯｯ
							ret=true;
						}
			break;
		//覧覧覧覧覧覧覧覧覧覧覧
		case "r":	//覧 Radio 覧
		//覧覧覧覧覧覧覧覧覧覧覧		
			for ( var n=0;n<this.Nom.length;n++)
			{								//覧 non coch馥 覧
				this.Nom[n].src=this.Non;	//   ｯｯｯｯｯｯｯｯｯｯ
			}
			Num.src=this.Oui;	//覧 coch馥 覧
			ret=true;			//   ｯｯｯｯｯｯ
			break;	
	}
	return ret;
}
//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
PARC.prototype.Test = function ()	//覧 Etat ? 覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
{
	switch ( this.Typ.charAt(0).toLowerCase() )
	{	
		//覧覧覧覧覧覧覧覧覧覧覧覧覧
		case "c":	//覧 CheckBox 覧
		//覧覧覧覧覧覧覧覧覧覧覧覧覧
			if ( 	this.Nom.src.substring(this.Nom.src.lastIndexOf("/")+1)
						==
					this.Oui.substring(this.Oui.lastIndexOf("/")+1) )
						{					//覧 coch馥 覧
							return true;	//   ｯｯｯｯｯｯ
						}
			else		{					//覧 non coch馥 覧
							return false;	//   ｯｯｯｯｯｯｯｯｯｯ
						}
			break;
		//覧覧覧覧覧覧覧覧覧覧覧
		case "r":	//覧 Radio 覧
		//覧覧覧覧覧覧覧覧覧覧覧
			var ret=-1;								//覧 non coch馥 覧
			for ( var n=0;n<this.Nom.length;n++)	//   ｯｯｯｯｯｯｯｯｯｯ
			{
				if ( 	this.Nom[n].src.substring(this.Nom[n].src.lastIndexOf("/")+1)
							==
						this.Oui.substring(this.Oui.lastIndexOf("/")+1) )
						{			//覧 coch馥 覧
							ret=n;	//   ｯｯｯｯｯｯ
							n=this.Nom.length;
						}
			}
			return ret;
			break;
	}
}
//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
PARC.prototype.Decoche = function ()	//覧 Tout D馗ocher 覧覧覧覧覧覧覧覧覧
//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
{
	switch ( this.Typ.charAt(0).toLowerCase() )
	{	
		//覧覧覧覧覧覧覧覧覧覧覧覧覧
		case "c":	//覧 CheckBox 覧
		//覧覧覧覧覧覧覧覧覧覧覧覧覧
			this.Nom.src=this.Non;	
			break;
		//覧覧覧覧覧覧覧覧覧覧覧
		case "r":	//覧 Radio 覧
		//覧覧覧覧覧覧覧覧覧覧覧
			for ( var n=0;n<this.Nom.length;n++)
			{							
				this.Nom[n].src=this.Non;
			}
			break;
	}
	return false;
}
/*覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧*/
