//-- AJOUTER LA PAGE AUX FAVORIS
function f_favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
	{
	window.sidebar.addPanel(document.title,location.href,"");
	}
	else
	{
	window.external.AddFavorite(location.href,document.title);
	}
}



//-- IMPRESSION DE LA PAGE EN COURS
function f_imprimer(){
	window.print();
}


//-- Verif des champs du Formulaire de Contact
function f_verif_contact() {
	titre = getElt("titre").value;
	nom   = getElt("nom").value;
	prenom= getElt("prenom").value;
	email = getElt("email").value;
	pays  = getElt("pays").value;
	tel   = getElt("tel").value;
	mess  = getElt("message").value;
	
	Msg="Le formulaire ne peut pas être validé car il manque les informations suivantes :\n";
	
	var email2 = true;
	var verif = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/;
	if (verif.exec(email) == null)
		{
		email2 = false;
		}
		else
		{
		email2 = true;
		}
	
	if (!titre)
		Msg=Msg+"- Titre\n";
	if (!nom)
		Msg=Msg+"- Nom\n";
	if (!prenom)
		Msg=Msg+"- Prénom\n";

	if (!pays)
		Msg=Msg+"- Pays\n";
	if (!tel)
		Msg=Msg+"- Tel.\n";
	if (!email)
		{
		Msg=Msg+"- Email\n";
		}
		else
		{
		if(!email2)
			{
			Msg=Msg+"- Adresse Email incorrecte!\n";
			}
		}
	if (!mess)
		Msg=Msg+"- Message\n";

	
	if (!titre || !nom || !prenom || !email2 || !pays || !tel || !mess) {
		alert(Msg);
		return false;
		}
		else
		return true;
}


//-- Verif des champs du Formulaire ENVOYER A UN AMI
function f_verif_ami() {
	nom   = getElt("nom").value;
	email = getElt("destinataire").value;
	message=getElt("message").value;
	
	Msg="Le formulaire ne peut pas être validé car il manque les informations suivantes :\n";
	
	var email2 = true;
	var verif = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/;
	if (verif.exec(email) == null)
		{
		email2 = false;
		}
		else
		{
		email2 = true;
		}

	if (!nom)
		Msg=Msg+"- Nom\n";
	if (!email)
		{
		Msg=Msg+"- Email du destinataire\n";
		}
		else
		{
		if(!email2)
			{
			Msg=Msg+"- Adresse Email du destinataire incorrecte!\n";
			}
		}
	if (!message)
		Msg=Msg+"- Votre message\n";
	
	if (!nom || !email || !email2 || !message) {
		alert(Msg);
		return false;
		}
		else
		return true;
}



//----------------------------------------------------------
//--Fonction pour l'ouverture en POP-UP de la carte
function PopupCarte(x,y){ 
	window.open('popcarte.php?x='+x+'&y='+y,'popup','width=500,height=445,toolbar=false');
	//window.open('popcarte.php?x='+x+'&y='+y,'popup','width=450,height=350,toolbar=false,scrollbars=false,resizable=false');
}

//----------------------------------------------------------
//--Fonction pour l'ouverture en POP-UP de la VIDEO
function PopupVideo(){ 
	window.open('popvideo.php','popup','width=345,height=255,toolbar=false');
}

//------------------------
//--Fonction pour l'ouverture en POP-UP des images
//------------------------
function PopupImage(img) { 
w=open("",'image','width=800,height=800,menubar=no,toolbar=no,scrollbars=yes,resizable=no,status=no,directories=no,location=no'); 
w.document.write("<HTML>"); 
w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+50,document.images[0].height+80); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>"); 
w.document.write("<BODY onload='checksize()'  leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
w.document.write("<TD valign='middle' align='center'><IMG src='"+img+"' border=0>"); 
w.document.write("</TD></TR></TABLE>");
w.document.write("</BODY></HTML>"); 
w.document.close();
} 