


		//////////////////////////////////////////////////////////////////////////////////////////////////
	   //																							   //
	  //      <A HREF="JAVASCRIPT:PopupWin('popup.shtml','Popupwin','yes','390','300','200','200')">  //
	 //																								 //
	//////////////////////////////////////////////////////////////////////////////////////////////////
	   
	// popupwin
	// <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); 
	}
	
	// popupwin2
	// <A HREF="xxxxx" onclick="PopupWin2('xxxxx','Popupwin2','yes','550','370','200','200');return(false);">

	function PopupWin2(URL,FRAME,RESIZABLE,WIDTH,HEIGHT,TOP,LEFT)
	{
		var param = "menubar=no,location=no,directories=no,status=no,toolbar=no,scrollbars=yes,resizable="+RESIZABLE+",width="+WIDTH+",height="+HEIGHT+",top="+TOP+",left="+LEFT;
		window.open(URL,FRAME,param); 
	}
		  
	// popupall
	// se redimensione par raport a l'ecran
	// <A HREF="xxxxx" onclick="Popupall('popup.shtml','Popupall','yes');return(false);">

	function Popupall(URL,FRAME,RESIZABLE)
	{
		var param = "menubar=no,location=yes,directories=no,status=no,toolbar=yes,scrollbars=yes,resizable="+RESIZABLE+",width="+((screen.width)-150)+",height="+((screen.height)-150)+",top=20,left=100";
		window.open(URL,FRAME,param);
	}

	// popupfull
	// se redimensione par raport a l'ecran
	// <A HREF="xxxxx" onclick="popupfull('popup.shtml','popupfull','yes');return(false);">

	function Popupfull(URL,FRAME,RESIZABLE)
	{
		var param = "menubar=yes,location=no,directories=no,status=no,toolbar=yes,scrollbars=yes,resizable="+RESIZABLE+",width="+((screen.width)-10)+",height="+((screen.height)-140)+",top=0,left=0";
		window.open(URL,FRAME,param);
	}



		//////////////////////////////////////////////////////////////////////////////////////////////
	   //                                                                                          //
	  //									retaille fenetre									  //
	 //                                                                                          //
	//////////////////////////////////////////////////////////////////////////////////////////////

	// <body onload="window.focus();onLoad=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();
			}




		//////////////////////////////////////////////////////////////////////////////////////////////
	   //                                                                                          //
	  //						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.societe.value.length<3 && document.f.nom.value.length<3)
		{
			erreur+="Veuillez refgplir le champ société ou le champ nom (3 caractères minimum)\n\n";
		}
		
		if(document.f.ville.value.length<3)
		{
			erreur+="Veuillez refgplir le champ ville (3 caractères minimum)\n\n";
		}
		/*if(document.f.pays.value.length<2)
		{
			erreur+="Veuillez refgplir le champ pays (2 caractères minimum)\n\n";
		}*/
		if(!testmail(document.f.email.value))
		{
			erreur+="Veuillez refgplir l'adresse email\n\n";
		}

		if(erreur.length>0)
			{
			window.alert(erreur);
			return false;
			}

		return true;

	}
	
	
	
	

/*  -----------------------------------------------------------------*
 *			    			test formulaire 				         *
 *			    			Affiche le champ non remplie	         *
 *  -----------------------------------------------------------------*/
function checkInput(i,label)
{
    if (i.value=="")
        {
        i.style.border = '2px solid #E44000';
		i.style.paddingLeft = '3px';
		i.style.margin = '0px';
        return "  - " + label + "\n";
        }
    else
        i.style.border='';

    return "";
}

function reinitInput(i)
{
	i.style.border = '';
	i.style.paddingLeft = '';
	i.style.margin = '';
}


/* form 2 */
function checkFormContact(f)
{
var msg="";

	msg += checkInput(document.f.nom,"Nom");
	msg += checkInput(document.f.prenom,"Prénom");
	//msg += checkInput(document.f.adresse,"Téléphone");
	msg += checkInput(document.f.adresse,"Adresse");
	msg += checkInput(document.f.codepostal,"Code postal");
	msg += checkInput(document.f.ville,"Ville");
	msg += checkInput(document.f.email,"E-mail");
	


    if (msg != "")
    {
        alert("Merci de remplir les champs suivants \n"+msg);
        return false;
    }

    return true;
}
