// Check du Navigateur et redirection si
/***************************************
 *	Pour appeler la fonction :         *
 *                                     *
 *	dans le TAG <BODY>                 *
 *	onLoad="jsfCheckBrowser('m');"     *
 *  m = variante du nom de destination *
 *                                     *
 ***************************************/
function jsfCheckBrowser(dest)
	{
	var sys_expl = navigator.userAgent; // Identification du systeme d'exploitation
	sys_expl = sys_expl.toLowerCase();	// Mise en minuscules pour comparaison
	var result_sys = sys_expl.indexOf("mac"); // Test si systeme est mac

	if (result_sys >= 0)	// si le resultat est mac
		{
		window.location="http://www.padou.ch/index" + dest + ".html";
		}
	}


// Execution aléatoire
/************************************
 *	Pour appeler la fonction :      *
 *                                  *
 *	<SCRIPT type='text/javascript'> *
 *	msg.Aff();                      *
 *  </script>                       *
 *                                  *
 ************************************/

var msg=new InitMsg();
msg.Add("colomb.mid");
msg.Add("jamesbond.mid");
msg.Add("happy_days.mid");
msg.Add("mission.mid");
msg.Add("sister_act2.mid");
msg.Add("les_bronzes.mid");
msg.Add("walkdrun.mid");
msg.Add("grease_tell_me_more.mid");
msg.Add("grease_sandy.mid");
msg.Add("grease.mid");
msg.Add("grease_youre_the_one_that_i_want.mid");

function disp(txt)
	{document.write(txt)}

function InitMsg()
	{
	this.nb_item=0;
	this.Add=AddMsg;
	this.Aff=AffMsg;
	}

function AddMsg(txt)
	{
	var nb = this.nb_item;
	this[nb]=txt;
	this.nb_item++;
	}

function AffMsg()
	{
	var nb = this.nb_item;
	var no=Math.round(Math.random(1)*(nb-1));
	//alert (this[no]);
	disp("<EMBED src='sound/" +this[no]+ "' autostart='true'></EMBED>");
	}


// POPUP à la grandeur de l'image
/****************************************************
 *	Pour appeler la fonction :                      *
 *	                                                *
 *	<A href="javascript:PopupImage('popimg1.gif')"> *
 *                                                  *
 ****************************************************/
function PopupImage(img) {
		titre="Colliers - Sabine Gyger";
		w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes');
		w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
		w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+5,document.images[0].height+100); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
		w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
		w.document.write("<br><center><a href=\"javascript:close();\">-- Fermer cette fenêtre --</a></center>");
		w.document.write("</BODY></HTML>");
		w.document.close();
}

function chkFormContact()
	{	
	if(document.form_contact.strNomPrenom.value == "")
		{
		alert("Veuillez saisir votre nom et prénom!");
		document.form_contact.strNomPrenom.focus();
		return false;
		}
		
	if(document.form_contact.strAdresse.value == "")
		{
		alert("Veuillez saisir l'adresse!");
		document.form_contact.strAdresse.focus();
		return false;
		}
			
	if(document.form_contact.strNPA.value == "")
		{
		alert("Veuillez saisir le numéro postal, s.v.p.!");
		document.form_contact.strNPA.focus();
		return false;
		}
		
	if(document.form_contact.strLocalite.value == "")
		{
		alert("Veuillez saisir la localité, s.v.p.!");
		document.form_contact.strLocalite.focus();
		return false;
		}
			
	if(document.form_contact.strTel.value == "")
		{
		alert("Veuillez saisir votre No de téléphone, s.v.p.!");
		document.form_contact.strTel.focus();
		return false;
		}
		
	if(document.form_contact.strEmail.value == "")
		{
		alert("Veuillez saisir votre adresse e-mail, s.v.p.!");
		document.form_contact.strEmail.focus();
		return false;
		}

	document.form_contact.submit();
	}
	
function chkNPA()
	{
	
	}
	
function chkEmail(mail) 
	{
	if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0))
		{}
	else
		{
		alert("Mail invalide ! - Veuillez saisir votre adresse e-mail, s.v.p.!");
		document.form_contact.strEmail.focus();
		return false
		}
	}
