function openwindow(popup)
{
window.open(popup,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=818, height=600, left=0, top=0");
}
										

function calendrier(date, id, user)
         {
         //si pas de parametre  passes,  utilise la date courante.
         if(date == null)
            date = new Date();
         
         day = date.getDate();
         month = date.getMonth();
         year = date.getFullYear();
         
         months = new Array('Janvier',
                            'Février',
                            'Mars',
                            'Avril',
                            'Mai',
                            'Juin',
                            'Juillet',
                            'Aout',
                            'Septembre',
                            'Octobre',
                            'Novembre',
                            'Decembre');

       jours = new Array('DIM', 'LUN', 'MAR', 'MER', 'JEU','VEN','SAM');
         
         this_month = new Date(year, month, 1);
         next_month = new Date(year, month + 1, 1);
         
         //Debut et fin du mois ?.         
         first_week_day = this_month.getDay();
         days_in_this_month = Math.floor((next_month.getTime() - this_month.getTime()) / (1000 * 60 * 60 * 24));
         
// Première couleur de fond - caractère  ANCIEN
// calendar_html = '<table style="background-color:336799; color:ffffff;"  width="100%" >';

// Première couleur de fond - caractère
         calendar_html = '<table  border="0" cellspacing="1"  cellpadding="0" height="200"   bgcolor="#000000"  width="100%" >';
         
  //calendar_html = '<table style="background-color:166699; color:ffffff;">';


// ANCIENNE Couleur du titre du mois, fond - caractères   // Ancienne 003399
//         calendar_html += '<tr><td colspan="7" align="center" style="background-color:336799; color:FFFFFF;">' +  '<B>' +
                          months[month] + ' ' + year + '</B>' + '</td></tr>';



/*
//Couleur du titre du mois, fond - caractères   // Ancienne 003399
         calendar_html += '<tr bgcolor="#336799"><td colspan="7" align="center">   <A href="../../PHP/Membres/Affcalendrier.php?id=' + id + '&' + 'nu=' + user + '"' +'TARGET=\"_BLANK\">'  +   ' <FONT SIZE="2" COLOR=white> <B>' +
                  months[month] + ' ' + year +  '</B> </FONT>' + '  </A></td></tr>';

*/

//Couleur du titre du mois, fond - caractères   // Ancienne 003399
         calendar_html += '<tr bgcolor="#336799"><td colspan="7" align="center">   <A href="../../PHP/Membres/Affcalendrier.php" '+ 'TARGET=\"_BLANK\">'  +   ' <FONT SIZE="2" COLOR=white> <B>' +
                  months[month] + ' ' + year +  '</B> </FONT>' + '  </A></td></tr>';



//calendar_html +='<tr>';  //Ajout

//Affichage des jours
    calendar_html += '<tr>';
         //Remplir la premiere semaine du mois avec le nombre d'espaces ou blancs requis.       

/*  BON avec  id
         for(i = 0; i < 7; i++)
            {
            calendar_html += '<td bgcolor="#000000">  <A href="../../PHP/Membres/Affcalendrier.php?id=' + id + '&' + 'nu=' + user + '"' +'TARGET=\"_BLANK\">'   +    '<FONT color="#FFFFFF"> <B>' + jours[i] +   '</B></FONT>' +' </A></td>';  

*/
         for(i = 0; i < 7; i++)
            {
            calendar_html += '<td bgcolor="#000000">  <A href="../../PHP/Membres/Affcalendrier.php"' +'TARGET=\"_BLANK\">'   +    '<FONT color="#FFFFFF"> <B>' + jours[i] +   '</B></FONT>' +' </A></td>';  





//ANCIENNE
   // calendar_html += '<td style="background-color:FFFFFF; color:000000;"> <A href=\"../index.html\">'   + jours[i] + ' </A></td>';  

            }
 // calendar_html += '<tr>';  // Fin Ajout
//  Fin Affichage jours


         calendar_html += '<tr>';
          
         //Remplir la premiere semaine du mois avec le nombre d'espaces ou blancs requis.       
         for(week_day = 0; week_day < first_week_day; week_day++)
            {
            calendar_html += '<td bgcolor="#FFFFFF"  color="#000000">  <A href="../../PHP/Membres/Affcalendrier.php?id=' + id + '&' + 'nu=' + user + '"' +'TARGET=\"_BLANK\">  &nbsp; &nbsp; </A></td>';  
 
            }
          
         week_day = first_week_day;
         for(day_counter = 1; day_counter <= days_in_this_month; day_counter++)
            {
            week_day %= 7;
            
            if(week_day == 0)
               calendar_html += '</tr><tr>';
            
            //Si journee courante couleur differente ou fond different. FF9933
            if(day == day_counter)    //EFF4FD ancienne couleur
               calendar_html += '<td align="center" bgcolor="#808000"><A href="../../PHP/Membres/Affcalendrier.php?id=' + id + '&' + 'nu=' + user + '"' +'TARGET=\"_BLANK\">  <b>' +  '<FONT COLOR=white>' + day_counter +  '</FONT>' + ' </A> </b></td>';
            else
            

calendar_html += '<td align="center" bgcolor="#FFFFFF" color="#000000"> <A href="../../PHP/Membres/Affcalendrier.php?id=' + id + '&' + 'nu=' + user + '"' +'TARGET=\"_BLANK\"> &nbsp;' + '<FONT COLOR=black>' + day_counter + '</FONT>' + '&nbsp;  </A> </td>';

            week_day++;
            }
            
         calendar_html += '</tr>';
         calendar_html += '</table>';
         
         //Afficher le  calendrier.     
         document.write(calendar_html);                  
         }




































































































