// 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=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+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.kontakt.name_vorname.value == "")
		{
		alert("Erfassen Sie bitte ihren Namen und Vorname!");
		document.kontakt.name_vorname.focus();
		return false;
		}
			
	if(document.kontakt.adresse.value == "")
		{
		alert("Erfassen Sie bitte die Adresse!");
		document.kontakt.adresse.focus();
		return false;
		}
			
	if(document.kontakt.zip.value == "")
		{
		alert("Erfassen Sie bitte die Postnummer!");
		document.kontakt.zip.focus();
		return false;
		}
		
	if(document.kontakt.ort.value == "")
		{
		alert("Erfassen Sie bitte die Örtlichkeit!");
		document.kontakt.ort.focus();
		return false;
		}
			
	if(document.kontakt.tel.value == "")
		{
		alert("Erfassen Sie bitte ihr Nr. Telefons!");
		document.kontakt.tel.focus();
		return false;
		}
		
	if(document.kontakt.email.value == "")
		{
		alert("Erfassen Sie bitte ihre E-Mail Adress!");
		document.kontakt.email.focus();
		return false;
		}
		
	document.kontakt.submit();
	}
	
function chkFormBestellung()
	{
	if(document.bestellung.name_vorname.value == "")
		{
		alert("Erfassen Sie bitte ihren Namen und Vorname!");
		document.bestellung.name_vorname.focus();
		return false;
		}
			
	if(document.bestellung.adresse.value == "")
		{
		alert("Erfassen Sie bitte die Adresse!");
		document.bestellung.adresse.focus();
		return false;
		}
			
	if(document.bestellung.zip.value == "")
		{
		alert("Erfassen Sie bitte die Postnummer!");
		document.bestellung.zip.focus();
		return false;
		}
		
	if(document.bestellung.ort.value == "")
		{
		alert("Erfassen Sie bitte die Örtlichkeit!");
		document.bestellung.ort.focus();
		return false;
		}
			
	if(document.bestellung.tel.value == "")
		{
		alert("Erfassen Sie bitte ihr Nr. Telefons!");
		document.bestellung.tel.focus();
		return false;
		}
		
	document.bestellung.submit();
	}

	
// POPUP pour le poème du mois
/****************************************************
 *	Pour appeler la fonction :                      *
 *	                                                *
 *	<A onclick="bildmonats();">                     *
 *                                                  *
 ****************************************************/

var cdo_nav;
var loaded=false;
function init_nav()
{
	cdo_nav = new Array();
	cdo_nav[0] = new Image();
	cdo_nav[0].src = "images/space.gif";
	cdo_nav[1] = new Image();
	cdo_nav[1].src = "images/boutons_over/clin-d-oeil.jpg";
	cdo_nav[2] = new Image();
	cdo_nav[2].src = "images/boutons_off/clin-d-oeil.jpg";
	cdo_nav[3] = new Image();
	cdo_nav[3].src = "images/boutons_over/graphisme.jpg";
	cdo_nav[4] = new Image();
	cdo_nav[4].src = "images/boutons_off/graphisme.jpg";
	cdo_nav[5] = new Image();
	cdo_nav[5].src = "images/boutons_over/illustration.jpg";
	cdo_nav[6] = new Image();
	cdo_nav[6].src = "images/boutons_off/illustration.jpg";
	cdo_nav[7] = new Image();
	cdo_nav[7].src = "images/boutons_over/3d.jpg";
	cdo_nav[8] = new Image();
	cdo_nav[8].src = "images/boutons_off/3d.jpg";
	cdo_nav[9] = new Image();
	cdo_nav[9].src = "images/boutons_over/site.jpg";
	cdo_nav[10] = new Image();
	cdo_nav[10].src = "images/boutons_off/site.jpg";
	cdo_nav[11] = new Image();
	cdo_nav[11].src = "images/boutons_over/clients.jpg";
	cdo_nav[12] = new Image();
	cdo_nav[12].src = "images/boutons_off/clients.jpg";
	cdo_nav[13] = new Image();
	cdo_nav[13].src = "images/boutons_over/contact.jpg";
	cdo_nav[14] = new Image();
	cdo_nav[14].src = "images/boutons_off/contact.jpg";
	cdo_nav[15] = new Image();
	cdo_nav[15].src = "images/boutons_over/liens.jpg";
	cdo_nav[16] = new Image();
	cdo_nav[16].src = "images/boutons_off/liens.jpg";

	imagecdo_nav="";
	loaded=true;
}

function chgimg_nav(imagecdo_nav,nomimg){
	if (loaded && document.images[nomimg] && cdo_nav && cdo_nav[imagecdo_nav])
	{
	document.images[nomimg].src=cdo_nav[imagecdo_nav].src;
	}
}
