// 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>                       *
 *                                  *
 ************************************/

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="Image";
		w=open("",'image','width=300,height=300,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+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"script>");
		w.document.write("<body onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><img src='images/"+img+"' border=0>");
		w.document.write("");
		w.document.write("</body></html>");
		w.document.close();
}

function chkFormulaire()
	{
	if(document.sondage.realname.value == "")
		{
		alert("Veuillez saisir votre nom et prénom!");
		document.sondage.realname.focus();
		return false;
		}
			
	if(document.sondage.adresse.value == "")
		{
		alert("Veuillez saisir l'adresse!");
		document.sondage.adresse.focus();
		return false;
		}
			
	if(document.sondage.NPA.value == "")
		{
		alert("Veuillez saisir le numéro postal, s.v.p.!");
		document.sondage.NPA.focus();
		return false;
		}
		
	if(document.sondage.localite.value == "")
		{
		alert("Veuillez saisir la localité, s.v.p.!");
		document.sondage.localite.focus();
		return false;
		}
			
	if(document.sondage.tel.value == "")
		{
		alert("Veuillez saisir votre No de téléphone, s.v.p.!");
		document.sondage.tel.focus();
		return false;
		}
/*		
	if(document.sondage.email.value == "")
		{
		alert("Veuillez saisir votre adresse e-mail, s.v.p.!");
		document.sondage.email.focus();
		return false;
		}
*/
	document.sondage.submit();
	}

// -- Définition de la date série ---
<!-- Begin	
var moisFin
var jourFin
var anFin
var dtSerie
Stamp = new Date();
moisFin = Stamp.getMonth() + 1;
if (moisFin < 10)
	{moisFin = "0" + moisFin}
jourFin = Stamp.getDate();
if (jourFin < 10)
	{jourFin = "0" + jourFin}
anFin = Stamp.getYear();
dtSerie = anFin +""+ moisFin +""+ jourFin;
// End -->	


function PopupCentrer(page,largeur,hauteur)
{
	var top=(screen.height-400)/2;
	var left=(screen.width-500)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
}