// JavaScript Document


// ================================================ affichage des flash
	function afficheFlash(nom,largeur,hauteur)
	{
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width='+largeur+' height='+hauteur+'>\n');
		document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
		document.write('<param name="movie" value='+nom+' />\n');
		document.write('<param name="quality" value="high" />\n');
		document.write('<param name="wmode" value="transparent" />\n');
		document.write('<embed src='+nom+' quality="high" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width='+largeur+' height='+hauteur+'></embed>\n');
		document.write('</object>\n');
	}
// ================================================ affichage des flash
	
	
	//agenda
	function mois_suivant()
	{
		mois=parseInt(document.agenda.MOIS.value);
		annee=parseInt(document.agenda.ANNEE.value);
		if(mois<12)
			mois++;
		else
		{
			mois=1;
			annee++;	
		}
		
		window.open('agenda.php?MOIS='+mois+'&ANNEE='+annee,'_self');
		return false;
	}
	
	function mois_precedent()
	{
		mois=parseInt(document.agenda.MOIS.value);
		annee=parseInt(document.agenda.ANNEE.value);
		if(mois>1)
			mois--;
		else
		{
			annee--;
			mois=12;
		}
		
		window.open('agenda.php?MOIS='+mois+'&ANNEE='+annee,'_self');
		return false;
	}
	
	function voir_agenda(id)
	{
		if(document.agenda)
		{
			mois=parseInt(document.agenda.MOIS.value);
			annee=parseInt(document.agenda.ANNEE.value);
			window.open('agenda.php?TYPE='+id+'&MOIS='+mois+'&ANNEE='+annee,'_self');
		}
		else
			window.open('agenda.php?TYPE='+id,'_self');
		return false;
	}
	
	// ================================================= code controle agenda
	function nouveauCode()
	{
		var alea = Math.round(Math.random(0)*10000);
		document.getElementById('CODEIMAGE').src='controle-agenda.php?ALEAT'+alea;
	}
	
	
	// ================================================= donation
	
	function verifForm(monform)
	{
		nom=monform.nom.value;
		prenom=monform.prenom.value;
		adresse=monform.adresse.value;
		cp=monform.cp.value;
		ville=monform.ville.value;
		montant=monform.montant.value;	
		
		if(nom=='')
		{
			alert('Merci de remplir votre nom.')
			return false;
		}
		if(prenom=='')
		{
			alert('Merci de remplir votre prénom.')
			return false;
		}
		if(adresse=='')
		{
			alert('Merci de remplir votre adresse.')
			return false;
		}
		if(cp=='')
		{
			alert('Merci de remplir votre code postal.')
			return false;
		}
		if(ville=='')
		{
			alert('Merci de remplir votre ville.')
			return false;
		}
		if(montant=='')
		{
			alert('Merci de remplir votre montant.')
			return false;
		}
		if(isNaN(montant))
		{
			alert('Le montant remplit n\'est pas un nombre.')
			return false;
		}
		if(montant<1)
		{
			alert('Le montant remplit doit être supérieur à 1')
			return false;
		}
		return true;
	}
	