

/*  --------------------------------------------------------------------------------------------------------------	*
 *											FONCTION PRELOAD GLOBAL													*
 *																													*
 *	preload global des images >>>> onLoad="preloadcommun(); SwitchRub (rub);"										*	
 *  --------------------------------------------------------------------------------------------------------------	*/


	function preloadcommun()
	{
		// Chargement des images menu haut
		if ( jvsenable )
		{
				ImTmp = new Image ();
				ImTmp.src = "../img/menu_01_on.gif";  
				ImTmp2 = new Image ();                        
				ImTmp2.src = "../img/menu_02_on.gif"; 
				ImTmp3 = new Image ();                       
				ImTmp3.src = "../img/menu_03_on.gif";    
				ImTmp4 = new Image ();                       
				ImTmp4.src = "../img/menu_04_on.gif";
				ImTmp5 = new Image ();                       
				ImTmp5.src = "../img/menu_05_on.gif";
				ImTmp6 = new Image ();                       
				ImTmp6.src = "../img/menu_06_on.gif";
				ImTmp7 = new Image ();                       
				ImTmp7.src = "../img/menu_07_on.gif";
				ImTmp8 = new Image ();                       
				ImTmp8.src = "../img/p_logo_02_on.gif";
		}

	}

	function SwitchImg (im,sr)
	{
		if (jvsenable)
		{
			if ( document[im] != null ) document [im].src = sr;
		}
	}


	function SwitchRub (r)
	{
		SwitchImg ('menu_01'		,	'../img/menu_01.gif');
		SwitchImg ('menu_02'		,	'../img/menu_02.gif');
		SwitchImg ('menu_03'		,	'../img/menu_03.gif');
		SwitchImg ('menu_04'		,	'../img/menu_04.gif');
		SwitchImg ('menu_05'		,	'../img/menu_05.gif');
		SwitchImg ('menu_06'		,	'../img/menu_06.gif');
		SwitchImg ('menu_07'		,	'../img/menu_07.gif');
		SwitchImg ('menu_08'		,	'../img/p_logo_02.gif');
		

		if ( r == 'menu_01')
		{
			SwitchImg ('menu_01'		,	'../img/menu_01_on.gif');
		}
		
		if ( r == 'menu_02')
		{
			SwitchImg ('menu_02'		,	'../img/menu_02_on.gif');
		}

		if ( r == 'menu_03')
		{
			SwitchImg ('menu_03'		,	'../img/menu_03_on.gif');
		}
		
		if ( r == 'menu_04')
		{
			SwitchImg ('menu_04'		,	'../img/menu_04_on.gif');
		}
		
		if ( r == 'menu_05')
		{
			SwitchImg ('menu_05'		,	'../img/menu_05_on.gif');
		}
		
		if ( r == 'menu_06')
		{
			SwitchImg ('menu_06'		,	'../img/menu_06_on.gif');
		}
		
		if ( r == 'menu_07')
		{
			SwitchImg ('menu_07'		,	'../img/menu_07_on.gif');
		}
		
		if ( r == 'menu_08')
		{
			SwitchImg ('menu_08'		,	'../img/p_logo_02_on.gif');
		}
	}

	// appel la fonction d'activation de la rubrique
	//	SwitchRub (rub);

	// quand on resize netscape, il reclique le menu
		function resize (evnt)
		{
				SwitchRub (rub);
				return true;
		}

		window.onResize = resize;


	
/*  --------------------------------------------------------------------------------------------------------------	*
 *											FONCTION AFFICHE TITRE													*
 *																													*
 *		<A HREF="xxx.shtml"                                      													*
 *					onMouseOver = " SwitchImg ('menu_02',    '../img/menu_02_on.gif');   								*
 *									SwitchLeg ('TITRE RUBRIQUE','100px');" 											*
 *					onMouseOut  = " SwitchLeg ('','');																*
 *									if (rub != 'menu_02')															*
 *									SwitchImg ('menu_02',     '../img/menu_02.gif'); "> 								*
 *		<IMG SRC="img/menu_02.gif" NAME="menu_02" WIDTH=90 HEIGHT=31 BORDER="0" ALT="DESCRIPTION"></A>				*
 *																													*
 *																													*
 *		<TD ID="LEG">TITRE PAR DEFAUT</TD>																			*
 *																													*
 *  --------------------------------------------------------------------------------------------------------------	*/	

	// Variable par defaut et padding par defaut
    var LegDefaut = ""; 
	var PadDefaut = 0;
	
	// Fonction qui affiche le titre et le padding
	function SwitchLeg (info,pad)
	{
		var obj;
		obj = document.getElementById("LEG");
		if (obj)
			{
			if (LegDefaut == "") 
				{
				LegDefaut = obj.innerHTML;
				PadDefaut = obj.style.paddingLeft;
				}
				
			if (info != "")
				{
				obj.innerHTML = info;
				obj.style.paddingLeft = pad;
				}
			else
				{
				obj.innerHTML = LegDefaut;
				obj.style.paddingLeft = PadDefaut;
				}

			}
	}




/*  ----------------------------------------------------------------------------------------------------------	*
 *	Popup fenêtre javascript																					*
 *	<A HREF="xxxxx" onclick="PopupWin('xxxxx','Popupwin','yes','yes','550','370','200','200');return(false);">	*		    
 *  ----------------------------------------------------------------------------------------------------------	*/

	function PopupWin(URL,FRAME,SCROLLBARS,RESIZABLE,WIDTH,HEIGHT,TOP,LEFT)
	{
		var param = "menubar=no,location=no,directories=no,status=no,toolbar=no,scrollbars="+SCROLLBARS+",resizable="+RESIZABLE+",width="+WIDTH+",height="+HEIGHT+",top="+TOP+",left="+LEFT;
		window.open(URL,FRAME,param); 
	}



/*  --------------------------------------------------------------------------------------------------------------	*
 *	retaille fenetre																								*
 *	<body onload="window.focus(); RetaillerFenetre();">																*
 *	<a href="javascript:window.close();"><IMG SRC="xxx" name="i" border=0 alt="Cliquer pour fermer la fenêtre"></a>	*	
 *  --------------------------------------------------------------------------------------------------------------	*/
	
		function RetaillerFenetre()
			{
			if (iedetect == true)
				window.resizeTo(document.i.width+12,document.i.height+30);
			else
				window.resizeTo(document.i.width,document.i.height);

			window.focus();
			}



/*  ------------------------------------------------
 *  Kyxar Dhtml Lib                                *
 *    Librairie de manipulation d'objets DHTML     *
 *  [C] Kyxar / RS - 2001,2002,2003                *
 *  Contact, Info : http://www.kyxar.fr            *
 *                                                 *
 *  Basé sur Next Generation cross-browser DHTML   *
 *  de http://devedge.netscape.com                 *
 *  Compatibilité : IE5+ NS6+ Opera6+              *
 *  ---------------------------------------------- */

function positionner_layers()
{
var x,y;

    win_w=document.body.clientWidth;
	win_h=document.body.clientHeight;

	// Position de la signature
    oP2=document.getElementById('P2');
	if (oP2)
		{
	    oP2.style.left = win_w - 80;
		oP2.style.top  = win_h - 19;
        oP2.style.visibility = "Visible";
		}
}
		



/*  -----------------------------------------------------------------*
 *			    print	<a href="javascript:imprimer();">            *
 *  -----------------------------------------------------------------*/

	// fonction print

	function imprimer()
	{

		if (printenable)
		{
			window.print();
		}
		else
		{
			alert("Votre navigateur n'est pas compatible.\nCliquez sur ok, puis faire clic droit sur la souris\nenfin cliquez sur \"Imprimer\" dans menu contextuel.\nOu Appuyez sur les touches CTRL + P sur PC.")
		}

	}


	
/*  -----------------------------------------------------------------*
 *			    			test email  					         *
 *  -----------------------------------------------------------------*/

	function testmail(mail)
	{
		var cpt=0;
		if( mail.length==0)
			return false;
		
		var taille=mail.length;
		
		if(mail.charAt(taille-2)!='.')
			{
			//window.alert(mail.charAt(mail.length-1));
			var pos=0;	
			for( i=0; i<mail.length; i++)
				{
				var verif=mail.charAt(i);

				if(verif=='@' && i>=1)
					{
					cpt++;
					pos=i;
					}
				//window.alert(pos);
				if(pos<=i && pos!=0)
					{
					if(verif=='.') cpt++;
					}
				}
				
			}
				
		if (cpt<2)
			return false;

		return true;
	}




/*  -----------------------------------------------------------------*
 *			    			test formulaire 				         *
 *  -----------------------------------------------------------------*/


	function testform()
	{
		var erreur="";
		
		if(document.F.Nom.value.length<1)
		{
			erreur+="Veuillez remplir le champ Nom / Lastname \n\n";
		}
		
		if(document.F.Adresse.value.length<1)
		{
			erreur+="Veuillez remplir le champ Adresse / Address          \n\n";
		}
		
		if(document.F.CP.value.length<5)
		{
			erreur+="Veuillez remplir le champ Code postal / Zip \n\n";
		}
		
		if(document.F.Ville.value.length<1)
		{
			erreur+="Veuillez remplir le champ Ville / Town \n\n";
		}
		
		if(document.F.Pays.value.length<1)
		{
			erreur+="Veuillez remplir le champ Pays / Country \n\n";
		}
		

		if(erreur.length>0)
			{
			window.alert(erreur);
			return false;
			}

		return true;

	}
