/***********************************************
* CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for source code
* This copyright notice must stay intact for legal use
* Modified for autowidth and optional starting positions in
* http://www.dynamicdrive.com/forums/showthread.php?t=11839 by jschuer1 8/5/06
***********************************************/

var ie = (document.all)? true:false;
var ns4 = (document.layers)? true:false;
var ns6 = (document.getElementById)? true:false;

 //1) Set width of the "neutral" area in the center of the gallery.
var restarea=6;
 //2) Set top scroll speed in pixels. Script auto creates a range from 0 to top speed.
var maxspeed=7;
 //3) Set to maximum width for gallery - must be less than the actual length of the image train.
var maxwidth=2000;
 //4) Set to 1 for left start, 0 for right, 2 for center.
var startpos=0;
 //5) Set message to show at end of gallery. Enter "" to disable message.
var endofgallerymsg='<span style="font-size: 11px;">Fin de la gallerie</span>';

//function to enlarge image. Change as desired.
function enlargeimage(path, optWidth, optHeight)
{
	var actualWidth=typeof optWidth!="undefined" ? optWidth : "800px" //set 600px to default width
	var actualHeight=typeof optHeight!="undefined" ? optHeight : "600px" //set 500px to  default height
	var winattributes="width="+actualWidth+",height="+actualHeight+",resizable=yes"
	window.open(path,"", winattributes)
}

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById, scrollspeed=0, movestate='', actualwidth='', cross_scroll, ns_scroll, statusdiv, loadedyes=0, lefttime, righttime;

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function creatediv(){
statusdiv=document.createElement("div")
statusdiv.setAttribute("id","statusdiv")
document.body.appendChild(statusdiv)
statusdiv=document.getElementById("statusdiv")
statusdiv.innerHTML=endofgallerymsg
}

function positiondiv(){
var mainobjoffset=getposOffset(crossmain, "left"),
menuheight=parseInt(crossmain.offsetHeight),
mainobjoffsetH=getposOffset(crossmain, "top");
statusdiv.style.left=mainobjoffset+(menuwidth/2)-(statusdiv.offsetWidth/2)+"px";
statusdiv.style.top=menuheight+mainobjoffsetH+"px";
}

function showhidediv(what){
if (endofgallerymsg!="") {
positiondiv();
statusdiv.style.visibility=what;
}
}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function moveleft(){
if (loadedyes){
movestate="left";
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px";
showhidediv("hidden");
}
else
showhidediv("visible");
}
lefttime=setTimeout("moveleft()",10);
}

function moveright(){
if (loadedyes){
movestate="right";
if (iedom&&parseInt(cross_scroll.style.left)<0){
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px";
showhidediv("hidden");
}
else
showhidediv("visible");
}
righttime=setTimeout("moveright()",10);
}

function motionengine(e){
var mainobjoffset=getposOffset(crossmain, "left"),
dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft,
dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop,
curposy=window.event? event.clientX : e.clientX? e.clientX: "";
curposy-=mainobjoffset-dsocx;
var leftbound=(menuwidth-restarea)/2;
var rightbound=(menuwidth+restarea)/2;
if (curposy>rightbound){
scrollspeed=(curposy-rightbound)/((menuwidth-restarea)/2) * maxspeed;
clearTimeout(righttime);
if (movestate!="left") moveleft();
}
else if (curposy<leftbound){
scrollspeed=(leftbound-curposy)/((menuwidth-restarea)/2) * maxspeed;
clearTimeout(lefttime);
if (movestate!="right") moveright();
}
else
scrollspeed=0;
}

function contains_ns6(a, b) {
if (b!==null)
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion(e){
if (!window.opera||(window.opera&&e.relatedTarget!==null))
if ((window.event&&!crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
clearTimeout(lefttime);
clearTimeout(righttime);
movestate="";
}
}

function fillup(){
if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer;
if(typeof crossmain.style.maxWidth!=='undefined')
crossmain.style.maxWidth=maxwidth+'px';
menuwidth=crossmain.offsetWidth;
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery;
actualwidth=document.getElementById? document.getElementById("trueContainer").offsetWidth : document.all['trueContainer'].offsetWidth;
if (startpos)
cross_scroll.style.left=(menuwidth-actualwidth)/startpos+'px';
crossmain.onmousemove=function(e){
motionengine(e);
}

crossmain.onmouseout=function(e){
stopmotion(e);
showhidediv("hidden");
}
}
loadedyes=1
if (endofgallerymsg!=""){
creatediv();
positiondiv();
}
if (document.body.filters)
onresize()
}
window.onload=fillup;

onresize=function(){
if (typeof motioncontainer!=='undefined'&&motioncontainer.filters){
motioncontainer.style.width="0";
motioncontainer.style.width="";
motioncontainer.style.width=Math.min(motioncontainer.offsetWidth, maxwidth)+'px';
}
menuwidth=crossmain.offsetWidth;
cross_scroll.style.left=startpos? (menuwidth-actualwidth)/startpos+'px' : 0;
}

function affiche_infoH()
{
	document.write('    <div id="div_info" style="position:absolute;overflow:auto;top:250px;left:300px;width:600px;height:;border:0px solid red;">');
  document.write('  	  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('  	  	<tr height="20px">');
  document.write('  	  		<td background="../images/hInfo.gif">&nbsp;</td>');
  document.write('  	  	</tr>');
  document.write('  	  	<tr bgcolor="#8BE381">');
  document.write('  	  		<td align="right" valign="top" class="Info"><a href="javascript:cacheInfo();" class="skip"><b>X&nbsp;&nbsp;</b></a></td>');
  document.write('  	  	</tr>');
  document.write('  	  	<tr bgcolor="#8BE381" height="100%">');
  document.write('  	  		<td valign="top" class="InfoRouge" align="center">');
}
  
function affiche_infoB()
{
  document.write('  	  		</td>');
  document.write('  	  	</tr>');
  document.write('  	  	<tr height="20px">');
  document.write('  	  		<td background="../images/bInfo.gif">&nbsp;</td>');
  document.write('  	  	</tr>');
  document.write('  	  </table>');
  document.write('    </div>');
}

function affiche_menu(l)
{
	if (l=="F"){
		document.write('  <div style="position:absolute">');
	  document.write('		<p align="center"><font face="Arial" size="1">Site référencé par l\'Annuaire Pêche </font>');
	  document.write('		 <br><a href="http://www.etang-peche.com" target="_blank"><img border="0" src="http://www.etang-peche.com/img/peche.gif" width="88" height="31"></a>');
	  document.write('		 <br><a href="http://www.stickybaits.com/" target="_blank"><img border="0" src="../images/sticky_baits.png" width="88" height="31"></a>');
	  document.write('		</p>');
	  document.write('	</div>');
		document.write('<center>');
		document.write('<table cellpadding="0" cellspacing="0" border="0" class="tableMain">');
		document.write('<tr height="80px">');
		document.write('  <td colspan="8"><img src="../images/bandeauH.jpg" border="none"></td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('	<td colspan="8"><hr></td>');
		document.write('</tr>');
		document.write('<tr height="26px">');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'accueil.html\'">Accueil</button></td>');
		document.write('	<td align="center">');
		document.write('		<button class="BoutonMenu" type="button" OnClick="window.location.href=\'reglement.html\'">');
		document.write('			Règlement');
		document.write('		</button>');
		document.write('	</td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'postes.html\'">Postes</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'photos2011_1.html\'">Photos</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'forum.html\'">Forum</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'tarifs.html\'">Réservation</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'plan.html\'">Plan d accès</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'records.html\'">Palmarès</button></td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('	<td colspan="8"><hr></td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('  <td colspan="8" valign="top">');
}else{
		document.write('  <div style="position:absolute">');
	  document.write('		<p align="center"><font face="Arial" size="1">Site référencé par l\'Annuaire Pêche </font>');
	  document.write('		 <br><a href="http://www.etang-peche.com" target="_blank"><img border="0" src="http://www.etang-peche.com/img/peche.gif" width="88" height="31"></a>');
	  document.write('		 <br><a href="http://www.stickybaits.com/" target="_blank"><img border="0" src="../images/sticky_baits.png" width="88" height="31"></a>');
	  document.write('		</p>');
	  document.write('	</div>');
		document.write('<center>');
		document.write('<table cellpadding="0" cellspacing="0" border="0" class="tableMain">');
		document.write('<tr height="80px">');
		document.write('  <td colspan="8"><img src="../images/bandeauH.jpg" border="none"></td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('	<td colspan="8"><hr></td>');
		document.write('</tr>');
		document.write('<tr height="26px">');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'accueil.html\'">Home</button></td>');
		document.write('	<td align="center">');
		document.write('		<button class="BoutonMenu" type="button" OnClick="window.location.href=\'reglement.html\'">');
		document.write('			Rules');
		document.write('		</button>');
		document.write('	</td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'postes.html\'">Sites</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'photos2011_1.html\'">Photos</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'forum.html\'">Forum</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'tarifs.html\'">Reservation</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'plan.html\'">Access map</button></td>');
		document.write('	<td align="center"><button class="BoutonMenu" OnClick="window.location.href=\'records.html\'">Prize list</button></td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('	<td colspan="8"><hr></td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('  <td colspan="8" valign="top">');
}
}

function affiche_menu_bis()
{
	document.write('<center>');
	document.write('<table cellpadding="0" cellspacing="0" border="0" class="tableMain">');
	document.write('<tr height="80px">');
	document.write('  <td colspan="8"><img src="../images/bandeauH.jpg" border="none"></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('	<td colspan="8"><hr></td>');
	document.write('</tr>');
	document.write('<tr height="26px">');
	document.write('	<td align="center" colspan="8">http://www.lesgrandesmuettes.com</td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('	<td colspan="8"><hr></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('  <td colspan="8" valign="top">');
}

function affiche_basPage(l)
{
	if (l=="F"){
		document.write('  </td>');
		document.write('</tr>');
		document.write('<tr height="26px">');
		document.write('	<td colspan="8" valign="top" align="center">');
		document.write('		<hr>');
		document.write('	</td>');
		document.write('<tr height="26px">');
		document.write('	<td colspan="8" valign="top" align="center">');
		document.write('		<font size="2">Copyright © 2009 - TGO - tous droits réservés - <a href="contact.html" class="contact">Contact</a></font>');
		document.write('	</td>');
		document.write('</tr>');
		document.write('</table>');
	  document.write('</center>');
	}else{
		document.write('  </td>');
		document.write('</tr>');
		document.write('<tr height="26px">');
		document.write('	<td colspan="8" valign="top" align="center">');
		document.write('		<hr>');
		document.write('	</td>');
		document.write('<tr height="26px">');
		document.write('	<td colspan="8" valign="top" align="center">');
		document.write('		<font size="2">Copyright © 2009 - TGO - all rights reserved - <a href="contact.html" class="contact">Contact</a></font>');
		document.write('	</td>');
		document.write('</tr>');
		document.write('</table>');
	  document.write('</center>');
}
}

function PopupImage(img) { 
titre="Agrandissement"; 
w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no'); 
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+10,document.images[0].height+30); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>"); 
w.document.write("<BODY onload='checksize()' onblur='window.close()' onclick='window.close()' 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 alt='Mon image'>"); 
w.document.write("</TD></TR></TABLE>");
w.document.write("</BODY></HTML>"); 
w.document.close(); 
} 

function affiche_poste(a,b,c,d,f,g,i,l)
{
	if (l=="A"){
		var texte = "The " + i + "\n\n";
	
		//poste1
		if (a==0)
		{
			texte += "Site 1 : free\n";
		}else{
			texte += "Site 1 : reserved\n";
		}
		
		//poste2
		if (b==0)
		{
			texte += "Site 2 : free\n";
		}else{
			texte += "Site 2 : reserved\n";
		}
		
		//poste3
		if (c==0)
		{
			texte += "Site 3 : free\n";
		}else{
			texte += "Site 3 : reserved\n";
		}
		
		//poste4
		if (d==0)
		{
			texte += "Site 4 : free\n";
		}else{
			texte += "Site 4 : reserved\n";
		}
		
		//poste5
		if (f==0)
		{
			texte += "Site 5 : free\n";
		}else{
			texte += "Site 5 : reserved\n";
		}
		
		//poste6
		if (g==0)
		{
			texte += "Site 6 : free\n";
		}else{
			texte += "Site 6 : reserved\n";
		}
	}else{
		var texte = "Le " + i + "\n\n";
		
		//poste1
		if (a==0)
		{
			texte += "Poste 1 : libre\n";
		}else{
			texte += "Poste 1 : réservé\n";
		}
		
		//poste2
		if (b==0)
		{
			texte += "Poste 2 : libre\n";
		}else{
			texte += "Poste 2 : réservé\n";
		}
		
		//poste3
		if (c==0)
		{
			texte += "Poste 3 : libre\n";
		}else{
			texte += "Poste 3 : réservé\n";
		}
		
		//poste4
		if (d==0)
		{
			texte += "Poste 4 : libre\n";
		}else{
			texte += "Poste 4 : réservé\n";
		}
		
		//poste5
		if (f==0)
		{
			texte += "Poste 5 : libre\n";
		}else{
			texte += "Poste 5 : réservé\n";
		}
		
		//poste6
		if (g==0)
		{
			texte += "Poste 6 : libre\n";
		}else{
			texte += "Poste 6 : réservé\n";
		}
}
	
	document.getElementById('detail').value = texte;
	document.getElementById('detail').style.visible = 'visible';
	document.getElementById(i).style.fontWeight = 'bold';
	document.getElementById(i).style.color = '#FFFFFF';
	
}

function cacheTA()
{
	document.getElementById('detail').value = '';
	document.getElementById('detail').style.visible = 'hidden';
	for (var j=1;j<32;j++)
	{
		document.getElementById(j).style.fontWeight = 'normal';
		document.getElementById(j).style.color = '#FFCC00';
	}
}

function cacheInfo()
{
	document.getElementById('div_info').style.visibility = 'hidden';
}

function ouvre_calendrier()
{
	var d= new Date();
	var a = d.getFullYear();
	var m;
	
	switch (d.getMonth()){
		case 0: m='janvier';break;
		case 1: m='fevrier';break;
		case 2: m='mars';break;
		case 3: m='avril';break;
		case 4: m='mai';break;
		case 5: m='juin';break;
		case 6: m='juillet';break;
		case 7: m='aout';break;
		case 8: m='septembre';break;
		case 9: m='octobre';break;
		case 10: m='novembre';break;
		case 11: m='decembre';break;
	}
	document.location.href='calendrier_'+m+'_' + a + '.html';
}

function start() {
  if (ie) {

      // lance ma_fonction quand on appuie sur le bouton de la souris
      div_info.onmousedown= ma_fonction;

	}else if (ns4) {

      // lance ma_fonction quand on appuie sur le bouton de la souris
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown=ma_fonction;

	}else if (ns6) {
      // lance ma_fonction quand on appuie sur le bouton de la souris
      document.getElementById("div_info").addEventListener("mousedown",ma_fonction, false);

	}
}

function ma_fonction(e) {

      if (ie) {
            //Récupération de la position de la souris
            window.lastX=event.clientX;
            window.lastY=event.clientY;
            // lance doDrag tant que l'on appuie sur le bouton de la souris en la bougeant
            document.onmousemove=doDrag;
            // lance endDrag quand on relache le bouton de la souris
            document.onmouseup=endDrag; }else if (ns4) {
            //Récupération de la position de la souris
            window.lastX=e.pageX;
            window.lastY=e.pageY;
            // lance doDrag tant que l'on appuie sur le bouton de la souris en la bougeant
            document.captureEvents(Event.MOUSEMOVE)
            document.onmousemove=doDrag;
            // lance endDrag quand on relache le bouton de la souris
            document.captureEvents(Event.MOUSEUP)
            document.onmouseup=endDrag; }else if (ns6) {
            //Récupération de la position de la souris
            window.lastX=e.clientX;
            window.lastY=e.clientY;
            // lance doDrag tant que l'on appuie sur le bouton de la souris en la bougeant
            window.onmousemove=doDrag;
            // lance endDrag quand on relache le bouton de la souris
            window.onmouseup=endDrag; }

}

function doDrag(e) {
	if (ns6) {
	
	      // Calcul de l'écart de position de la souris
	      var difX=e.clientX-window.lastX;
	      var difY=e.clientY-window.lastY;
	      //Récupération de la position du div et ajout de l'écart de position de la souris
	      var newX1 = parseInt(document.getElementById("div_info").style.left)+difX;
	      var newY1 = parseInt(document.getElementById("div_info").style.top)+difY;
	      // Assignation des nouvelles coordonnées au div
	      document.getElementById("div_info").style.left=newX1+"px";
	      document.getElementById("div_info").style.top=newY1+"px";
	      //Assignation de l'anciènne position de la souris
	      window.lastX=e.clientX;
	      window.lastY=e.clientY;
	    }
	 if (ns4) {
	
	      // Calcul de l'écart de position de la souris
	      var difX=e.pageX-window.lastX;
	      var difY=e.pageY-window.lastY;
	      //Récupération de la position du div et ajout de l'écart de position de la souris
	      var newX1 = parseInt(document.layers.div_info.left)+difX;
	      var newY1 = parseInt(document.layers.div_info.top)+difY;
	      // Assignation des nouvelles coordonnées au div
	      document.layers.div_info.left=newX1;
	      document.layers.div_info.top=newY1;
	      //Assignation de l'anciènne position de la souris
	      window.lastX=e.pageX;
	      window.lastY=e.pageY;
	}
	
	if (ie4) {
	
	      // Calcul de l'écart de position de la souris
	      var difX=event.clientX-window.lastX;
	      var difY=event.clientY-window.lastY;
	      //Récupération de la position du div et ajout de l'écart de position de la souris
	      var newX1 = parseInt(div_info.style.left)+difX;
	      var newY1 = parseInt(div_info.style.top)+difY;
	      // Assignation des nouvelles coordonnées au div
	      div_info.style.left=newX1+"px";
	      div_info.style.top=newY1+"px";
	      //Assignation de l'anciènne position de la souris
	      window.lastX=event.clientX;
	      window.lastY=event.clientY;
	
	} 
}

function endDrag(e) {

      if (ie || ns4) {
            //Réinitialisation du onmousemove
            document.onmousemove=null; }else if (ns6) {
            //Réinitialisation du onmousemove
            window.onmousemove=null; }

}

function bissextile(annee) {
	if (annee%4==0 && annee %100!=0 || annee%400==0) return true; else return false
}

/******************************************************
FONCTION QUI DETERMINE LE NUMERO DE LA SEMAINE EN COURS
******************************************************/
function DefSemaineNum(aaaa, mm, jj)
{
//initialisation des variables
//----------------------------
var MaDate  = new Date(aaaa,mm,jj);//date a traiter
var annee = MaDate.getFullYear();//année de la date à traiter
var NumSemaine = 0,//numéro de la semaine

// calcul du nombre de jours écoulés entre le 1er janvier et la date à traiter.
// ----------------------------------------------------------------------------
// initialisation d'un tableau avec le nombre de jours pour chaque mois
ListeMois = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
// si l'année est bissextile alors le mois de février vaut 29 jours
if (annee %4 == 0 && annee %100 !=0 || annee %400 == 0) {ListeMois[1]=29};
// on parcours tous les mois précédants le mois à traiter 
// et on calcul le nombre de jour écoulé depuis le 1er janvier dans TotalJour
var TotalJour=0;
for(cpt=0; cpt<mm; cpt++){TotalJour+=ListeMois[cpt];}
TotalJour+=jj;

//Calcul du nombre de jours de la première semaine de l'année à retrancher de TotalJour
//-------------------------------------------------------------------------------------
//on initialise dans DebutAn le 1er janvier de l'année à traiter
DebutAn = new Date(annee,0,1);
//on determine ensuite le jour correspondant au 1er janvier
//de 1 pour un lundi à 7 pour un dimanche/
var JourDebutAn;
JourDebutAn=DebutAn.getDay();
if(JourDebutAn==0){JourDebutAn=7};

//Calcul du numéro de semaine
//----------------------------------------------------------------------
//on retire du TotalJour le nombre de jours que dure la première semaine 
TotalJour-=8-JourDebutAn;
//on comptabilise cette première semaine
NumSemaine = 1;
//on ajoute le nombre de semaine compléte (sans tenir compte des jours restants)
NumSemaine+=Math.floor(TotalJour/7);
// s'il y a un reste alors le n° de semaine est incrémenté de 1
if(TotalJour%7!=0){NumSemaine+=1};

return(NumSemaine);
}

function affiche_calendrier()
{
	var form = document.frm_calendrier;
	var m = form.mois.value;
	var mBis = m-1;
	var a = form.annee.value;
	var aAvant = a-1;
	var aApres = a+1;
	var mLettre = "";
	var mLettreAvant = "";
	var mLettreApres = "";
	var texte = "";
	switch (mBis){
		case 0: mLettre='Janvier';mLettreAvant='decembre_'+aAvant;mLettreApres='fevrier_'+a;break;
		case 1: mLettre='Février';mLettreAvant='janvier_'+a;mLettreApres='mars_'+a;break;
		case 2: mLettre='Mars';mLettreAvant='fevrier_'+a;mLettreApres='avril_'+a;break;
		case 3: mLettre='Avril';mLettreAvant='mars_'+a;mLettreApres='mai_'+a;break;
		case 4: mLettre='Mai';mLettreAvant='avril_'+a;mLettreApres='juin_'+a;break;
		case 5: mLettre='Juin';mLettreAvant='mai_'+a;mLettreApres='juillet_'+a;break;
		case 6: mLettre='Juillet';mLettreAvant='juin_'+a;mLettreApres='aout_'+a;break;
		case 7: mLettre='Août';mLettreAvant='juillet_'+a;mLettreApres='septembre_'+a;break;
		case 8: mLettre='Septembre';mLettreAvant='aout_'+a;mLettreApres='octobre_'+a;break;
		case 9: mLettre='Octobre';mLettreAvant='septembre_'+a;mLettreApres='novembre_'+a;break;
		case 10: mLettre='Novembre';mLettreAvant='octobre_'+a;mLettreApres='decembre_'+a;break;
		case 11: mLettre='Décembre';mLettreAvant='novembre_'+a;mLettreApres='janvier_'+aApres;break;
	}
	
	//1er jour de la semaine
	obj = new Date(a,mBis,1);
	var PremierJour = obj.getDay();
	
	//nb de jour dans le mois
	var nbJourParMois=0;
	switch (mBis){
		case 0: nbJourParMois=31;break;
		case 1: if (bissextile(a)){nbJourParMois = 29}else{nbJourParMois = 28};break;
		case 2: nbJourParMois=31;break;
		case 3: nbJourParMois=30;break;
		case 4: nbJourParMois=31;break;
		case 5: nbJourParMois=30;break;
		case 6: nbJourParMois=31;break;
		case 7: nbJourParMois=31;break;
		case 8: nbJourParMois=30;break;
		case 9: nbJourParMois=31;break;
		case 10: nbJourParMois=30;break;
		case 11: nbJourParMois=31;break;
	}
	
	//nb semaine dans le mois
	var nbSemaineParMois = (DefSemaineNum(a, mBis, nbJourParMois) - DefSemaineNum(a, mBis, 01)) + 1
	texte = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
	texte += "<html>\n";
	texte += "  <head>\n";
	texte += "  	<meta http-equiv=\"content-language\" content=\"fr\" />\n";
	texte += "  	<meta name=\"TITLE\" content=\"Les grandes muettes\">\n";
	texte += "    <meta name=\"AUTHOR\" content=\"Les grandes muettes\">\n";
	texte += "    <meta name=\"OWNER\" content=\"contact@lesgrandesmuettes.com\">\n";
	texte += "    <meta name=\"SUBJECT\" content=\"Site de pêche à la carpe 28500\">\n";
	texte += "    <meta name=\"RATING\" content=\"GENERAL\">\n";
	texte += "    <meta name=\"DISTRIBUTION\" content=\"GLOBAL\">\n";
	texte += "    <meta name=\"Description\" content=\"peche a la carpe dans l'etang des grandes muettes de sainte gemme moronval\"> \n";
	texte += "    <meta name=\"ABSTRACT\" content=\"peche a la carpe dans l'etang des grandes muettes de sainte gemme moronval\">\n";
	texte += "  	<meta name=\"keywords\" content=\"pêche,peche,carpe,etang,centre,poisson,sainte,gemme,moronval,28500,dreux\"> \n";
	texte += "  	<meta name=\"category\" content=\"sport et loisirs peche\">\n";
	texte += "  	<meta name=\"LANGUAGE\" content=\"FR\">\n";
	texte += "    <meta name=\"COPYRIGHT\" content=\"Copyright BACHELET.PETRA 2009\">\n";
	texte += "    <meta name=\"Robots\" content=\"index, follow\">\n";
	texte += "  	<title>Les Grandes Muettes - Calendrier</title>\n";
	texte += "  	<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/LGM.css\" />\n";
	texte += "  	<script type=\"text/javascript\" src=\"../js/fonctions.js\">\n";
	texte += "  	</script>\n";
	texte += "  </head>\n";
	texte += "  <body onload=\"cacheTA();\">\n";
	texte += "	  		<script language=\"Javascript\">\n";
	texte += "	  			affiche_menu(\"F\");\n";
	texte += "	  		</script>\n";
	texte += "	  				<div style=\"height: 666px; overflow: auto;\" style=\"div_accueil\">\n";
	texte += "							<center>\n";
	texte += "								<table align=\"center\" border=\"0\" style=\"text-align:center;font-family:Arial;font-size:17px;\">\n";
	texte += "								  <tr>\n";
	texte += "								    <td colspan=\"7\">\n";
	texte += "								      <a href=\"calendrier_" + mLettreAvant + ".html\" class=\"sans\"><b><<</b></a> " + mLettre + " " + a + " <a href=\"calendrier_" + mLettreApres + ".html\" class=\"sans\"><b>>></b></a><br><br>\n";
	texte += "								    </td>\n";
	texte += "								  </tr>\n";
	texte += "								  <tr>\n";
	texte += "								    <td>Dim</td>\n";
	texte += "								    <td>Lun</td>\n";
	texte += "								    <td>Mar</td>\n";
	texte += "								    <td>Mer</td>\n";
	texte += "								    <td>Jeu</td>\n";
	texte += "								    <td>Ven</td>\n";
	texte += "								    <td>Sam</td>\n";
	texte += "								  </tr>\n";
	
	var k=0;
	var z=0;
	
	//alert(nbJourParMois);
	
	for (i=1;i<=nbSemaineParMois;i++)
	{
		texte += "								  <tr>\n";
		for (j=1;j<8;j++)
		{
			z++;
			if ((z>PremierJour) && (k<nbJourParMois))
			{
				k++;
				texte += "  								  <td onmouseout=\"cacheTA()\" onmouseover=\"affiche_poste(0,0,0,0,0,0," + k + ");\" id=\"" + k + "\" class=\"libre\">" + k + "</td>\n";
			}
			else{
				texte += "  								  <td onmouseout=\"cacheTa()\" onmouseover=\"\" class=\"\">&nbsp;</td>\n";
			}
		}		
		texte += "								  </tr>\n";
	}
	
	texte += "									<tr>\n";
	texte += "										<td colspan=\"7\"><font size=\"2pt\">Passez la souris sur une journée pour voir l'état des réservations</font></td>\n";
	texte += "									</tr>\n";
	texte += "									<tr>\n";
	texte += "										<td colspan=\"7\" align=\"left\"><br><br><textarea class=\"detail\" id=\"detail\" rows=\"10\" cols=\"50\"></textarea></td>\n";
	texte += "									</tr>\n";
	texte += "									<tr>\n";
	texte += "										<td bgcolor=\"green\">&nbsp;</td>\n";
	texte += "										<td colspan=\"6\" align=\"left\">Libre</td>\n";
	texte += "									</tr>\n";
	texte += "									<tr>\n";
	texte += "										<td bgcolor=\"#FF9933\">&nbsp;</td>\n";
	texte += "										<td colspan=\"6\" align=\"left\">Places disponibles</td>\n";
	texte += "									</tr>\n";
	texte += "									<tr>\n";
	texte += "										<td bgcolor=\"red\">&nbsp;</td>\n";
	texte += "										<td colspan=\"6\" align=\"left\">Complet</td>\n";
	texte += "									</tr>\n";
	texte += "								</table>\n";
	texte += "							</center>\n";
	texte += "							<br><br><br><center>Le calendrier est mis à jour toutes les 24 heures. Pour plus de détails veuillez nous contacter par téléphone.</center>\n";
	texte += "						</div>\n";
	texte += "	  		<script language=\"Javascript\">\n";
	texte += "	  			affiche_basPage(\"F\");\n";
	texte += "		</script>\n";
	texte += "  </body>\n";
	texte += "</html>\n";
	form.CodeMois.value=texte;
}
