//images
function preload(p_Img){
	p_Img = new Image();
	p_Img.src = 'images/'+p_Img;
}

function change_image(img_nom,img_src) { 
	document[img_nom].src = img_src;
}

function agrandissementImage(chemin){ 
	html = '<HTML> <BODY onBlur="top.close()" TOPMARGIN="0" LEFTMARGIN="0"> <IMG SRC="' + chemin + '" BORDER="0" NAME="img" onLoad="window.resizeTo(document.img.width + 12, document.img.height + 60)"> </BODY></HTML>'; 
   	popupImage =    window.open('','_blank','toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=1'); 
   	popupImage.document.open(); 
   	popupImage.document.write(html); 
   	popupImage.document.close() 
} 

function agrandissement(image,titre,width,height) {
	var fenetre_param='left='+(screen.width/2-width/2)+',top='+(screen.height/2-height/2)+',directories=no,status=no,scrollbars=no,resizable=no,menubar=no,';
	fenetre_param+='width='+width+',height='+height;
	fenetre_photo = window.open('','',fenetre_param);
	fenetre_photo.document.open();
	fenetre_photo.document.writeln('<HTML><HEAD><TITLE>' + titre + '</TITLE>');
	fenetre_photo.document.writeln('<LINK HREF="fichiers/_styles_photos.css" REL="stylesheet" TYPE="text/css"></HEAD>');
	fenetre_photo.document.writeln('<BODY><CENTER><P><IMG SRC="images/' + image + '"></P><P>' + titre + '</P>');
	fenetre_photo.document.writeln('<P><A HREF="javascript:this.window.close()"><SMALL>Fermer cette fen&ecirc;tre</SMALL></A></P>');
	fenetre_photo.document.writeln('</CENTER></BODY></HTML>');
	fenetre_photo.document.close();
	fenetre_photo.focus();
}

// Fonction ouvrant une popup
function popup(page,width,height) {
	window.open (page, '', 'directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,width=' + width + ',height=' + height);
}

// formulaire
function verifform(){
	if(document.formulaire.nom.value == ""){
		alert("Veuillez entrer votre nom !");
		document.formulaire.nom.focus();
		return false;
	}
	if(document.formulaire.prenom.value == ""){
		alert("Veuillez entrer votre prénom !");
		document.formulaire.prenom.focus();
		return false;
    	}
	if(document.formulaire.telephone.value == ""){
		alert("Veuillez entrer le numéro de téléphone !");
		document.formulaire.telephone.focus();
		return false;
	}
	if(document.formulaire.email.value == "" || document.formulaire.email.value.indexOf('@') == -1 || document.formulaire.email.value.indexOf('.') == -1){
		alert("Veuillez entrer une adresse e-mail correcte !");
		document.formulaire.email.focus();
		return false;
	}
	if(document.formulaire.codepostal.value == ""){
		alert("Veuillez entrer le code postal !");
		document.formulaire.codepostal.focus();
		return false;
	}
	if(document.formulaire.ville.value == ""){
		alert("Veuillez entrer la ville !");
		document.formulaire.ville.focus();
		return false;
	}
}