
// -------------------------------------------------------
// Afficher une image dans une pop up qui se retaille en 
// automatique en fonction de la taille de l'image
// -------------------------------------------------------

var popupImage;
var popupImage;
function ImageMax(chemin)
   {
   if ((popupImage) && (!popupImage.closed)){
	popupImage.close();
   }
   
   i1 = new Image;
   i1.src = chemin;
          
   html = '<html><head><title>Zoom sur image</title></head><body scroll="no" leftmargin="2" marginwidth="0" topmargin="2" marginheight="0"><table border="0" CELLPADDING=0 CELLSPACING=0 width="100%" height="100%"><tr><td background="../images/anim_charg.gif"><IMG src="'+chemin+'" BORDER=0 NAME=ImageMax onLoad="window.resizeTo(document.ImageMax.width+10,document.ImageMax.height+30)"></td></tr></table></body></html>';
   popupImage = window.open('','popupImage','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0, width=400, height=350, top=50, left=100');
   popupImage.document.open();
   popupImage.document.write(html);
   popupImage.document.close();
}


// -------------------------------------------------------
// Tests sur les champs du formulaire de Contact
// -------------------------------------------------------

function contact_test()
	{
	if (document.formcontact.prenom.value == "") {
		alert("Veuillez bien remplir le prénom !");						
		document.formcontact.prenom.focus();
		return false;		
		}
	if (document.formcontact.nom.value == "") {
		alert("Veuillez bien remplir le nom !");						
		document.formcontact.nom.focus();
		return false;		
		}	
	if (document.formcontact.email.value == "") {
		alert("Veuillez bien remplir l'email !");						
		document.formcontact.email.focus();
		return false;		
		}
	var email   = document.formcontact.email.value;
    var verif   = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,4}$/
    if (verif.exec(email) == null){
       	alert("Veuillez bien remplir l'email !");
        document.formcontact.email.focus();	
		return false;			
    }
	document.formcontact.submit();
	return;		
}
