





















































































var version = 11

function classe_mensuel()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "mensuel en tableau"
     this.nom_modele = ""
     this.nom_fichier = ""
     this.optfetes = true
     this.optsem = true
     this.optzones = "Toutes"
     this.GTFetes = "picto"
     this.GTAnni = "picto"
     this.GTRapport = "detail"
     this.GTSuivi = "detailrecap" 
     this.PhotoAnni = "l_t_sous"
     this.GTAgenda = "picto" 
     this.cellHeight = 80
     this.taillepicto = "small"
     this.pictoagenda = "event.gif"
     this.colWidth = 80 
     this.alih = "center"
     this.aliv = "center"
     this.ColorBord = "808000"
     this.ColorCase = ""
     this.ColorFond = ""
     this.TailleBord = 6
     this.MargeExt = 2
     this.MargeInt = 2
     this.FontName = "Arial"
     this.FontSize = 3
     this.posPhoto = 2
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1 
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = "photos/p_titicaca.jpg"
     this.Image = "photos/cercles.jpg"
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = ""
     this.exemple = false
     this.perso = false
     this.formatjour = 3
     this.cassejour = 0
     }
  }

function classe_mensuelcolonne()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "mensuel en colonne"
     this.nom_modele = "colonne"
     this.nom_fichier = ""
     this.optfetes = true
     this.optsem = true
     this.optzones = "Toutes"
     this.GTFetes = "detail"
     this.GTAnni = "detail"
     this.GTRapport = "detail"
     this.GTSuivi = "detailrecap" 
     this.PhotoAnni = "h_t_sous"
     this.GTAgenda = "detail" 
     this.cellHeight = 30
     this.taillepicto = "small"
     this.pictoagenda = "event.gif"
     this.colWidth = 480 
     this.alih = "left"
     this.aliv = "center"
     this.ColorBord = "808000"
     this.ColorCase = ""
     this.ColorFond = ""
     this.TailleBord = 6
     this.MargeExt = 2
     this.MargeInt = 2
     this.FontName = "Arial"
     this.FontSize = 2
     this.posPhoto = 0
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1 
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = ""
     this.Image = "photos/cercles.jpg"
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = ""
     this.exemple = false
     this.perso = false
     this.formatjour = 1
     this.cassejour = 0
     }
  }

function classe_semestre()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "semestriel"
     this.nom_modele = "semestre"
     this.nom_fichier = ""
     this.optfetes = true
     this.optsem = false
     this.optzones = "Toutes"
     this.GTFetes = "picto"
     this.GTAnni = "picto"
     this.GTRapport = "detail"
     this.PhotoAnni = "h_"
     this.GTAgenda = "picto"
     this.GTSuivi = "detailrecap"  
     this.cellHeight = 25
     this.taillepicto = "small"
     this.pictoagenda = "event.gif"
     this.colWidth = 80 
     this.alih = "left"
     this.aliv = "center"
     this.ColorBord = "808000"
     this.ColorCase = "CCFFFF"
     this.ColorFond = ""
     this.TailleBord = 2
     this.MargeExt = 2
     this.MargeInt = 2
     this.FontName = "Arial"
     this.FontSize = 1
     this.posPhoto = 0
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1 
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = ""
     this.Image = "photos/cercles.jpg"
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = ""
     this.exemple = false
     this.perso = false
     this.formatjour = 1
     this.cassejour = 0
     }
  }
  
  function classe_trimestre()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "trimestriel"
     this.nom_modele = "trimestre"
     this.nom_fichier = ""
     this.optfetes = true
     this.optsem = false
     this.optzones = "Toutes"
     this.GTFetes = "picto"
     this.GTAnni = "picto"
     this.GTRapport = "detail"
     this.GTSuivi = "detailrecap" 
     this.PhotoAnni = "h_"
     this.GTAgenda = "picto" 
     this.cellHeight = 25
     this.taillepicto = "small"
     this.pictoagenda = "event.gif"
     this.colWidth = 160 
     this.alih = "left"
     this.aliv = "center"
     this.ColorBord = "009900"
     this.ColorCase = "99FF66"
     this.ColorFond = ""
     this.TailleBord = 2
     this.MargeExt = 2
     this.MargeInt = 2
     this.FontName = "Arial"
     this.FontSize = 1
     this.posPhoto = 0
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1 
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = ""
     this.Image = "photos/cercles.jpg"
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = ""
     this.exemple = false
     this.perso = false
     this.formatjour = 1
     this.cassejour = 0
     }
  }
  
  function classe_annuel()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "annuel ou glissant en colonnes"
     this.nom_modele = "annuel"
     this.nom_fichier = ""
     this.optfetes = false
     this.optsem = false
     this.optzones = "Toutes"
     this.GTFetes = "picto"
     this.GTAnni = "picto"
     this.GTRapport = "detail"
     this.GTSuivi = "detailrecap" 
     this.PhotoAnni = "h_"
     this.GTAgenda = "picto" 
     this.cellHeight = 25
     this.taillepicto = "small"
     this.pictoagenda = "event.gif"
     this.colWidth = 40 
     this.alih = "left"
     this.aliv = "center"
     this.ColorBord = "808000"
     this.ColorCase = ""
     this.ColorFond = ""
     this.TailleBord = 2
     this.MargeExt = 2
     this.MargeInt = 2
     this.FontName = "Arial"
     this.FontSize = 1
     this.posPhoto = 0
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1 
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = ""
     this.Image = "photos/cercles.jpg"
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = ""
     this.exemple = false
     this.perso = false
     this.formatjour = 1
     this.cassejour = 0
     }
  }
  
  
   function classe_tableau()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "en tableau"
     this.nom_modele = "tableau"
     this.nom_fichier = ""
     this.optfetes = false
     this.optsem = true
     this.optzones = "Toutes"
     this.GTFetes = "picto"
     this.GTAnni = "picto"
     this.GTRapport = "detail"
     this.GTSuivi = "detailrecap" 
     this.PhotoAnni = "l_"
     this.GTAgenda = "picto" 
     this.cellHeight = 20
     this.taillepicto = "small"
     this.pictoagenda = "event.gif"
     this.colWidth = 40 
     this.alih = "center"
     this.aliv = "center"
     this.ColorBord = "808000"
     this.ColorCase = ""
     this.ColorFond = ""
     this.TailleBord = 2
     this.MargeExt = 2
     this.MargeInt = 2
     this.FontName = "Arial"
     this.FontSize = 1
     this.posPhoto = 2
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = "photos/p_titicaca.jpg"
     this.Image = "photos/cercles.jpg"
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = ""
     this.exemple = false
     this.perso = false
     this.formatjour = 3
     this.cassejour = 0
     }
  }
  
    function classe_planningh()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "de type planning horizontal"
     this.nom_modele = "planningh"
     this.nom_fichier = ""
     this.optfetes = false
     this.optsem = false
     this.optzones = "Toutes"
     this.GTFetes = "detail"
     this.GTAnni = "detail"
     this.GTRapport = "detail"
     this.GTSuivi = "detailrecap" 
     this.PhotoAnni = "l_t_sous"
     this.GTAgenda = "detail" 
     this.cellHeight = 480
     this.taillepicto = "small"
     this.pictoagenda = "event.gif"
     this.colWidth = 40 
     this.alih = "center"
     this.aliv = "top"
     this.ColorBord = "808000"
     this.ColorCase = ""
     this.ColorFond = ""
     this.TailleBord = 2
     this.MargeExt = 2
     this.MargeInt = 2
     this.FontName = "Arial"
     this.FontSize = 1
     this.posPhoto = 2
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1 
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = "photos/p_titicaca.jpg"
     this.Image = "photos/cercles.jpg"
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = "" 
     this.exemple = false
     this.perso = false
     this.formatjour = 3
     this.cassejour = 0
     }
  }
  
      function classe_planningv()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "de type planning vertical"
     this.nom_modele = "planningv"
     this.nom_fichier = ""
     this.optfetes = false
     this.optsem = false
     this.optzones = "Toutes"
     this.GTFetes = "picto"
     this.GTAnni = "picto"
     this.GTRapport = "detail"
     this.GTSuivi = "detailrecap" 
     this.PhotoAnni = "h_t_sous"
     this.GTAgenda = "picto" 
     this.cellHeight = 20
     this.taillepicto = "small"
     this.pictoagenda = "event.gif"
     this.colWidth = 320 
     this.alih = "left"
     this.aliv = "center"
     this.ColorBord = "808000"
     this.ColorCase = ""
     this.ColorFond = ""
     this.TailleBord = 2
     this.MargeExt = 2
     this.MargeInt = 2
     this.FontName = "Arial"
     this.FontSize = 1
     this.posPhoto = 2
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1 
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = "photos/p_titicaca.jpg"
     this.Image = "photos/cercles.jpg"
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = "" 
     this.exemple = false
     this.perso = false
     this.formatjour = 1
     this.cassejour = 0
     }
  }
  
  
  function classe_jour()
  {
  if (this.initialize = 'undefined')
     {
     this.initialize = false
     this.lib_modele = "du jour"
     this.nom_modele = "jour"
     this.nom_fichier = ""
     this.optfetes = true
     this.optsem = true
     this.optzones = "Toutes"
     this.GTFetes = "detail"
     this.GTAnni = "detail"
     this.GTRapport = "detail"
     this.GTSuivi = "detailrecap" 
     this.PhotoAnni = "h_t_sous"
     this.GTAgenda = "detail" 
     this.cellHeight = 30
     this.taillepicto = "small"
     this.pictoagenda = "agenda.png"
     this.colWidth = 480 
     this.alih = "left"
     this.aliv = "center"
     this.ColorBord = "808000"
     this.ColorCase = "CCFFCC"
     this.ColorFond = ""
     this.TailleBord = 6
     this.MargeExt = 6
     this.MargeInt = 6
     this.FontName = "Arial"
     this.FontSize = 2
     this.posPhoto = 0
     this.wphoto = 100
     this.lumPhoto = ""
     this.TextePos = "0"
     this.calLeft = -1
     this.calTop = -1
     this.texteLeft = -1
     this.texteTop = -1
     this.photoLeft = -1
     this.photoTop = -1 
     this.Cvoyage = 3
     this.CRepet = 3
     this.Repet = "repeat"
     this.photo = ""
     this.Image = ""
     this.TexteFond = "Arial"
     this.TexteFondR = ""
     this.TexteColor = "808000"
     this.TexteSize = "3"
     this.TexteS = ""
     this.exemple = false
     this.perso = false
     this.formatjour = 1
     this.cassejour = 0
     }
  }

 
  function classe_rapportp()
  {
  this.init = function ()
     {  
     this.r = ""
     this.f = ""
     this.t = ""
     } 
  this.init()
  }
  var phpannee = ""
  var phpmois = ""
  var meteo_villenum = ""
  var meteo_villenom = ""
  var meteo_jours = ""
  var meteo_contenu = ""  // pour optimiser l'accés au serveur météo, si on change de jour...
  var xmlDoc
  var nodesuivi
  var ssuivi = ""
  var suivacti = "<xml><sa>"
  suivacti += "<s a='travail' u='t' h='7' m='30' d='' c='' t='c' j=''>Travail</s>"
  suivacti += "<s a='RDV' u='t' h='8' m='' d='' c='' t='c' j=''>Rendez-vous</s>"
  suivacti += "<s a='conges' u='t' h='8' m='' d='c' c='00FF00' t='c' j=''>Congés légaux</s>"
  suivacti += "<s a='RTT' u='t' h='8' m='' d='c' c='FFFF00' t='c' j=''>RTT</s>"
  suivacti += "<s a='ferie' u='t' h='8' m='' d='c' c='33CC99' t='c' j=''>Férié</s>"
  suivacti += "<s a='projet' u='t' h='8' m='' d='l' c='660000' t='c' j=''>Projet</s>"
  suivacti += "<s a='ventes' u='m'  d='' t='c' j='n' h='' m=''>Ventes</s>"
  suivacti += "<s a='achats' u='m'  d='' t='c' j='n' h='' m=''>Achats</s>"
  suivacti += "<s a='prospects' u='n' d='a' t='c' j='n' h='' m=''>Prospects</s>"
  suivacti += "<s a='clients' u='n'  d='a' t='c' j='n' h='' m=''>Clients</s>"
  suivacti += "</sa></xml>"
  var suivinbactis = 0
  var suiviliste = ""
  var suiviunite = new Array()
  var suividetail = new Array()
  var suivicouleur = new Array()
  var suivicomptage = new Array()
  var suiviListeArray = new Array()
  var suivilibelle = new Array()
  var suivi_jh = new Array()
  var suivi_jm = new Array()
  var suivi_tj = new Array()
  var suivi_tm = new Array()
  var suivi_th = new Array()
  var suivi_nb = new Array()
  var suivicouleurcase = ""
  var suivicouleurtexte = ""
  var suivicouleurliseret = new Array()
  var suivilibelleliseret = new Array()
  var suivinbliserets = 0
  var retourLiseret = "" 
  var styleLiseret = ""
  var parser
  var onserialize
  var xmlDocType = "IE"
  if (window.DOMParser)
    {
    onserialize = new XMLSerializer()
    parser=new DOMParser();
    xmlDocType = "DOM"
    }
  else // Internet Explorer
    {
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async="false";
    } 
    
  function suivichargerliste()
    {
    top.rapportp.init()
    lire_rapportp(suivacti,"s")
    var numopt = 0
    suiviliste = ""
    suivinbactis = top.nodesuivi.childNodes.length
    for (i=0;i<suivinbactis;i++)
       {itemsuivi = top.nodesuivi.childNodes.item(i)
       if (top.xmlDocType != "DOM")
          {contenuxml = itemsuivi.text}
          else
          {contenuxml = itemsuivi.textContent}
       suiviliste += "<option value='" + itemsuivi.getAttribute('a') + "'>"
       suiviliste += contenuxml + "</option>"
       suiviunite[numopt] = itemsuivi.getAttribute('u')
       suividetail[numopt] = itemsuivi.getAttribute('d')
       suivicouleur[numopt] = itemsuivi.getAttribute('c')
       suivicomptage[numopt] = itemsuivi.getAttribute('t')
       suiviListeArray[numopt] = itemsuivi.getAttribute('a')
       suivilibelle[numopt] = contenuxml
       suivi_jh[numopt] = itemsuivi.getAttribute('h')
       suivi_jm[numopt] = itemsuivi.getAttribute('m')
       numopt ++
       }
     suiviliste += "<option value=' '>(Nouvelle)</option>"  
    }  
  
  function lire_rapportp(crapport,stype)
  {
  ssuivi = ""
  sdetail = ""
  sbulle = ""
  sbulleacti = ""
  suivicouleurcase = ""
  suivicouleurtexte = ""
  GTRapportAgenda = (stype == "a" ? cm.GTAgenda : cm.GTRapport)
  if (xmlDocType == "DOM")
    {
    xmlDoc=parser.parseFromString(crapport,"text/xml");
    }
  else // Internet Explorer
    {
    xmlDoc.loadXML(crapport); 
    } 
  try  
     {
     nodexml = xmlDoc.childNodes.item(0)
     for (var ino=0;ino<nodexml.childNodes.length;ino++)
       {
       itemxml = nodexml.childNodes.item(ino)
       if (xmlDocType != "DOM")
          {contenuxml = itemxml.text}
          else
          {contenuxml = itemxml.textContent}
       switch (itemxml.nodeName)
          {
          case "r":
             rapportp.r = contenuxml;
             if (rapportp.r != "") (sbulle += rapportp.r) 
             break;
          case "f":
             rapportp.f = contenuxml;
             if (rapportp.f != "") (sbulle += (sbulle != "" ? "<br />" :"") + rapportp.f)
             break;
          case "t":
             rapportp.t += contenuxml;
             if (rapportp.t != "") (sbulle += (sbulle != "" ? "<br />" :"") + mepentree(rapportp.t)) 
             break;
          case "sa":
             ssuivi = "oui"
             nodesuivi = itemxml
             if ((stype < "s") && (cm.GTSuivi != ""))
                {colorligne = "FFFF99"
                for (var n=0;n<top.nodesuivi.childNodes.length;n++)
                    {var ia = -1
                    itemsuivi = top.nodesuivi.childNodes.item(n)
                    for (na=0;na<suivinbactis;na++)
                         {if (suiviListeArray[na]==itemsuivi.getAttribute('a')) {ia=na;na=999}}
                    if (ia > -1)
                       {
                       var sqt = ""
                       var contenurem = xmlDocType != "DOM" ? itemsuivi.text : itemsuivi.textContent
                       if (suiviunite[ia] == "t")
                          {sqtj = itemsuivi.getAttribute('j')
                          sqjh =  itemsuivi.getAttribute('h')
                          sqt = (sqtj==""?"":sqtj + "j ") + (sqjh == ""?"0":sqjh)  + "h " + itemsuivi.getAttribute('m') }
                           else
                           {sqt = itemsuivi.getAttribute('m').replace(".",",") }
                       if ((stype == "a") && (cm.GTagenda != "") && (cm.GTSuivi != ""))
                          {if (colorligne == "FFFF99") {colorligne = "CCFF99"} else {colorligne = "FFFF99"} 
                          sbulleacti += "<tr><td style='background-color:#" + colorligne +"'>" + suivilibelle[ia] + "&nbsp;" + contenurem + "</td>"
                          sbulleacti += "<td align='right' nowrap style='background-color:#" + colorligne + "'>" + sqt + "</td></tr>"} 
                       if ((cm.GTSuivi.indexOf("recap") > -1) && (suivicomptage[ia] == "c" ))
                          {
                          var typeu = itemsuivi.getAttribute('j')
                          if (typeu == "n")
                             {suivi_tm[ia] = suivi_tm[ia] + parseFloat("0" + itemsuivi.getAttribute('m'))}
                             else
                             {suivi_tj[ia] = suivi_tj[ia] + parseFloat("0" + typeu)
                             suivi_th[ia] = suivi_th[ia] + parseFloat("0" + itemsuivi.getAttribute('h'))
                             suivi_tm[ia] = suivi_tm[ia] + parseFloat("0" + itemsuivi.getAttribute('m'))}
                          suivi_nb[ia] = suivi_nb[ia] + 1
                          }
                       afficherdetail = suividetail[ia]
                       if ((stype == "r") && (afficherdetail != "") ) {afficherdetail = "a"}
                       if (cm.nom_modele == "jour") {afficherdetail = "a"}
                       if (itemsuivi.getAttribute('a') == 'fete') 
                          {fetespec = contenurem} 
                       switch (afficherdetail)
                          {
                          case "a" :
                              if ((cm.GTSuivi.indexOf("detail") > -1) && (GTRapportAgenda != ""))
                                  {
                                  sdetail += "<tr><td>" + mepsuivi(suivilibelle[ia] + "&nbsp;",stype)  + "</td>"
                                  sdetail += "<td>" + mepsuivi("&nbsp;" + contenurem,stype) + "</td>"
                                  sdetail += "<td align='right' nowrap>" + mepsuivi("&nbsp;&nbsp;" + sqt,stype)  + "</td>"
                                  sdetail += "</tr>"
                                  }
                              break ;
                          case "c" :
                              suivicouleurcase = suivicouleur[ia] 
                              break ;
                          case "l" :
                              suivicouleurliseret[suivinbliserets] = suivicouleur[ia] 
                              suivilibelleliseret[suivinbliserets] = suivilibelle[ia] + " " + contenurem.replace(/"/g,"'") + "  " + sqt 
                              suivinbliserets++
                              break ;
                          default:
                              break;
                          }
                       }     
                    }
                }   
          default:
             break;
          }
       }
       }
    catch (ex) {}  
    if (suivicouleurcase != '')    
       {suivicouleurtexte = suivicouleurcase.substring(1)
       if (Math.abs(suivicouleurtexte) == suivicouleurtexte)  
           {suivicouleurtexte = '#FFFFFF'}
           else
           {suivicouleurtexte = '#000000'}
       }
    if (sdetail != "") {rapportp.t += "<table cellspacing='0' cellpadding='0' style='border:0px;" +  (stype=="a"?oncolorieletexte():"")  +"'>" + sdetail + "</table>"}  
    if (sbulleacti != "")  {sbulleacti = "<table style='width:100%' cellspacing='0' cellpadding='0'>" + sbulleacti + "</table>"}
    htmlbulle = sbulle + sbulleacti
    // if (htmlbulle != "") {alert (htmlbulle)}  
    }
    
var cptime
var formatmensuel = "tableau"
var opthisto = true
var optwiki = true
var optgoogle = true
var Image = "photos/cercles.jpg"
var FontNameR = ""
var nummois = 0
var numan = 0
var backgen = "photos/papier_vert.jpg"
var nota = ""
var persist= "non"
var now = new Date()
var calmois = now.getMonth()
var calannee = now.getFullYear()
var menuJourLeft = -1
var menuJourTop = -1
var annifete = ""
var libevent = ""
var nbevent = 0
var htmlevent = ""
var htmlbulle = ""
var fetespec = ""
var montreoption = ""
var Rtype = 0
var Rmois = 0
var Rtexte = ""
var Rannee = ""
var Rexact = 0
var RFormat = 0
var Iimporthtm = false
var Ichamp = 0
var Itype = 0
var Ifichier = ""
var nbclics = 0
var totnbclics = 0
var indpub = 0
var RegCarA = /[àäâ]/g
var RegCarE = /[éèêë]/g
var RegCarI = /[îï]/g
var RegCarU = /[ùüû]/g
var RegCarO = /[ôö]/g
var RegCarC = /[çk]/g
// var RegRC = /[\r\n]/g
var RegRC = /[\n]/g
var reget = new RegExp('(&)','g')
var reglt = new RegExp('(<)','g')
var reggt = new RegExp('(>)','g')
var regespace = new RegExp('(  )','g')
var regespace2 = new RegExp('(  )','g')
var erreurIE = false
var ColorTexte = "FFFFFF"
var hrColor = ""
var hrHeight = 50 
var hrSize = ""
var hdHeight = 25 
var hdColor = "darkblue" 
var timeColor = "purple" 
var hauteurPhoto = 0
var largeurContenu = 0
var largeurCompteur = 0
var largeurJourSem = 0
var hauteurTexte = 0
var typecal = "mois"
var semcal = 0
var debsem = new Date()
var finsem = new Date()
var jouragenda = "" 
var jouranni = ""
var jourfete = ""
var typecal = "mois"
var mapage=""
var monmesage = ""
var monmodele = ""
var saisie_type = "a"
var precedent_modele = "aucun"
var mois_modele = new classe_mensuel
var moiscolonne_modele = new classe_mensuelcolonne
var semestre_modele = new classe_semestre
var trimestre_modele = new classe_trimestre
var annuel_modele = new classe_annuel
var tableau_modele = new classe_tableau
var planningh_modele = new classe_planningh
var planningv_modele = new classe_planningv
var jour_modele = new classe_jour
var rapportp = new classe_rapportp
var cm
var premiere_fois = true
var PrefixeNotes = ""
var SuffixeNotes = ""
var libcalmois = ""
var libperiode = ""
var ini_formatmensuel = ""
var sem_num = 0
var sem_year = 0
var glissant_typecal = ""
var glissant_debmois = 0
var glissant_finmois = 0
var glissant_finannee = 0
var glissant_debannee = 0
var actauto_deb = new Date()
var actauto_fin = new Date()
var glissant_jours = new Array(true,true,true,true,true,true,true,true,true,true)
var libzonea = "Caen,  Clermont-Ferrand,  Grenoble,  Lyon,  Montpellier,  Nancy-Metz,  Nantes,  Rennes,  Toulouse."
var libzoneb = "Aix-Marseille,  Amiens,  Besançon,  Dijon,  Lille,  Limoges,  Nice,  Orléans-Tours,  Poitiers,  Reims,  Rouen,  Strasbourg."
var libzonec = "Bordeaux,  Créteil,  Paris,  Versailles."
var libzones = "<img src='gif/zonea.png' height='10'> Zone A : " + libzonea
libzones += "<br><img src='gif/zoneb.png' height='10'> Zone B : " + libzoneb
libzones += "<br><img src='gif/zonec.png' height='10'> Zone C : " + libzonec
var datezonesdeb = new Date (2009,00,01)
var datezonesfin = new Date (2013,07,31)
var indzonesscol = false
var largeurzones = 0
var fonctionphoto = ""
var calzones =    "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"                // 1er semestre 2009
calzones += "0077777777777777777777777777777777777777777777777777777777777770000000000000000000000000000000000000000000000000000077777777777000000000000000000000000000000000000000000000777777777777"   // 2ème semestre 2009
calzones += "7770000000000000000000000000000000000222222233333337555555544444440000000000000000000000000002222222333333375555555444444400000000000000000000000000000000000000000000000000000000000"    // 1er semestre 2010 
calzones+="0077777777777777777777777777777777777777777777777777777777777770000000000000000000000000000000000000000000000000000777777777770000000000000000000000000000000000000000000007777777777777"   // 2ème semestre 2010
calzones += "7700000000000000000000000000000000000000000444444466666667333333311111110000000000000000000000000004444444666666677333333111111100000000000000000000000000000000000000000000000000000"     // 1er semestre 2011
calzones += "0077777777777777777777777777777777777777777777777777777777777777770000000000000000000000000000000000000000000000007777777777700000000000000000000000000000000000000000000077777777777777"   // 2émé semestre 2011
calzones += "77000000000000000000000000000000000000000011111115555555766666662222222000000000000000000000000000111111155555557666666622222220000000000000000000000000000000000000000000000000000000"     // 1er semestre 2012
calzones += "0000077777777777777777777777777777777777777777777777777777777777700000000000000000000000000000000000000000000000000000077777777777000000000000000000000000000000000000000000000777777777"   // 2ème semestre 2012
calzones += "7777770000000000000000000000000000000000000000022222223333333755555554444444000000000000000000000000000222222233333337555555544444440000000000000000000000000000000000000000000000000"   // 1er semestre 2013
calzones += "00007777777777777777777777777777777777777777777777777777777777"   // 2ème semestre 2013 incomplet
// create array of abbreviated day names
var jourSemaine = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche")
//   alert (window.localStorage + " <- local --- global -> " + window.globalStorage)
var lStorage = window.localStorage
var persistIE = "" 
var typeStorage = ""
var typeNav = ""
var typub = 0
// var tSize = new Array ("", "xx-small","x-small","small","medium","large","x-large","xx-large")
var tSize = new Array ("", "10px","13px","16px","18px","24px","32px","36px")
var datejour = new Date()    // date à traiter pour le calendrier du jour
var datecur  = new Date()    // date du jour - ne pas la modifier !
datecur.setHours(0)
try
{
if ((lStorage) && (top.location.href.indexOf("nav=AXO") == -1))
   {typeStorage = "DOM"
   typeNav = "W3C"}
   else
   {if (window.ActiveXObject)
       {typeNav = "IE"
       typeStorage = "IE"}
    else
       {
       if ((window.globalStorage) && (top.location.href.indexOf("calagenda.fr") > 0)) 
          {
          typeNav = "FireFox30"
          var domaine = 'calagenda.fr'
          if (top.location.href.indexOf("www.") > 0) {domaine = "www." + domaine}
          lStorage = globalStorage[domaine];
          typeStorage = "DOM" 
          }
          else
          {erreurIE=true}
       }   
   }
}
catch (ex) {}   
if (navigator.appName.indexOf("Internet Explorer") > 0) 
   {typeNav = "IE"}  

if (typeNav != "IE") {opthisto = false}
   
function lirinit(modele)
   {
   var nommodele = ""
   if (typeStorage != "")
       {if (modele.nom_modele == "") 
           {nommodele = ""
            sauverdur("totnbclics",parseInt(lire("totnbclics",0))+1)
            totnbclics = parseInt(lire("totnbclics",0))
            if (totnbclics > 10) {nbclics = 10}}
            else
            {
            nommodele = "_" + modele.nom_modele}
       if (top.persist == "oui")
          {
          modele.ColorFond = lire("P_ColorFond" + nommodele,modele.ColorFond)
          modele.Image = lire("P_Image" + nommodele,modele.Image)
          modele.Cvoyage = lire("P_Cvoyage" + nommodele,modele.Cvoyage) 
          modele.ColorCase = lire("P_ColorCase" + nommodele,modele.ColorCase)
          modele.ColorBord = lire("P_ColorBord" + nommodele,modele.ColorBord)
          modele.TexteColor = lire("P_TexteColor" + nommodele,modele.TexteColor)
          modele.CRepet=lire("P_CRepet" + nommodele,modele.CRepet)
          modele.Repet=lire("P_Repet" + nommodele,modele,top.Repet)
          modele.photo=lire("P_photo" + nommodele,modele.photo)
          modele.posPhoto=lire("P_posPhoto" + nommodele,modele.posPhoto)
          modele.wphoto=lire("P_wphoto" + nommodele,modele.wphoto)
          modele.lumPhoto=lire("P_lumPhoto" + nommodele,modele.lumPhoto)
          modele.TexteS=lire("P_TexteS" + nommodele,modele.TexteS)
          modele.TexteSize=lire("P_TexteSize" + nommodele,modele.TexteSize)
          modele.TexteFond=lire("P_TexteFond" + nommodele,modele.TexteFond)
          modele.TextePos=lire("P_TextePos" + nommodele,modele.TextePos)
          modele.optsem=lirecase("P_optsem" + nommodele,modele.optsem)
          modele.optfetes=lirecase("P_optfetes" + nommodele,modele.optfetes)
          modele.optzones=lire("P_optzones" + nommodele,modele.optzones)
          modele.GTFetes=lire("P_GTFetes" + nommodele,modele.GTFetes)
          modele.GTAnni=lire("P_GTAnni" + nommodele,modele.GTAnni)
          modele.GTAgenda=lire("P_GTAgenda" + nommodele,modele.GTAgenda)
          modele.GTRapport=lire("P_GTRapport" + nommodele,modele.GTRapport)
          modele.GTSuivi=lire("P_GTSuivi" + nommodele,modele.GTSuivi)
          modele.PhotoAnni = lire("P_PhotoAnni" + nommodele,modele.PhotoAnni)
          modele.cellHeight=lire("P_cellHeight" + nommodele,modele.cellHeight)
          modele.taillepicto=lire("P_taillepicto" + nommodele,modele.taillepicto)
          modele.pictoagenda=lire("P_pictoagenda" + nommodele,modele.pictoagenda)
          modele.colWidth=lire("P_colWidth" + nommodele,modele.colWidth)
          modele.MargeInt=lire("P_MargeInt" + nommodele,modele.MargeInt)
          modele.MargeExt=lire("P_MargeExt" + nommodele,modele.MargeExt)
          modele.alih=lire("P_alih" + nommodele,modele.alih)
          modele.aliv=lire("P_aliv" + nommodele,modele.aliv)
          modele.FontName=lire("P_FontName" + nommodele,modele.FontName)
          modele.FontSize=lire("P_FontSize" + nommodele,modele.FontSize)
          modele.TailleBord=lire("P_TailleBord" + nommodele,modele.TailleBord)
          modele.formatjour=lire("P_formatjour" + nommodele,modele.formatjour)
          modele.cassejour=lire("P_cassejour" + nommodele,modele.cassejour)
          }
       }
     if (typeStorage == ""  )
        {  modele.GTFetes = ""
           modele.GTAnni= ""
           modele.GTAgenda = ""
           modele.GTRapport = "" }
    }
    
function sauver(cle,valeur)
    {
    if (persist == "oui")    {sauverdur(cle,valeur)}
    }

function sauverdur (cle,valeur)
    { var cler = cle
    if (cle.substring(0,2) == "P_")
       if (cm.exemple == true)
          {return}
          else
          {if  ((cm.nom_modele != "")  && (Iimporthtm == false))
              {cler = cle + "_" + cm.nom_modele}
              else
              {
              if (cle.substring(0,3) == "PX_")
                 {cler = "P_" + cle.substring(3,cle.length)}
              }
          }
    switch (typeStorage)
           {
           case "DOM":
              lStorage.setItem("JV_" + cler,valeur);
              break;
           case "IE":
              try
                 {
                 persistIE.setAttribute(cler, valeur);
                 persistIE.save("JV_Persist"); 
                 }
              catch(e)
                  {erreurIE = true} 
              break;
           default:
              break;
           }
    } 

function sauvercase(cle,valeur)
    {
    if (valeur == true) { sauver(cle,"oui")} else {sauver(cle,"non")}
    }
function sauverdurcase(cle,valeur)
    {if (valeur == true) { sauverdur(cle,"oui")} else {sauverdur(cle,"non")}}    
    
function sauvernoeud(cle,noeud)
    {
    var textnoeud = ""
    if (top.xmlDocType == "DOM")
          {textnoeud = onserialize.serializeToString(noeud)}
          else
          {textnoeud = noeud.xml}
    if (textnoeud.length <= 18)
       {supprimer(cle)}
       else
       {
       sauverdur(cle, textnoeud )}
    }    

function lire(cle,defo)
    {
    var valeur = ""
    switch (typeStorage)
           {
           case "DOM":
               valeur =  lStorage.getItem("JV_" + cle)
               if ("" + valeur + "" == "null")
                  {return defo}
               else
                  {return "" + valeur + ""}
               break;
           case "IE":
              try
                {
                 valeur = persistIE.getAttribute(cle)
                 if ("" + valeur + "" == "null")
                    {return defo}
                 else
                     {return valeur}
                 }
              catch(e)
                 {erreurIE = true}     
              return valeur
              break;
           default:
              return defo
              break;
           }
     }



function lirecase(cle,defo)
    {
    var valeur = "non"
    if (defo) {valeur = "oui"}
    if (lire(cle,valeur) == "oui") { return true} else {return false}
    }

function ajouter(cle,valeur)
    {var valdest = valeur
     var valdeux = valeur     
     var valinit = lire(cle,"")
     if ( valinit != "")
        {if (valinit.substring(0,5).toLowerCase() == "<xml>")
            {valdest = "<xml>"
            var valtemp = extxml(valinit,"r")
            if (valtemp != "" ) {valdest += "<r>" + valtemp + "</r>"}
            valtemp = extxml(valinit,"t") + extxml(valdeux,"t")
            if (valtemp != "" ) {valdest += "<t>" + valtemp + "</t>"}
            valtemp = extxml(valinit,"f")
            if (valtemp != "" ) {valdest += "<f>" + valtemp + "</f>"}
            valtemp = extxml(valinit,"sa") + extxml(valdeux,"sa")
            if (valtemp != "" ) {valdest += "<sa>" + valtemp + "</sa>"}
            valdest += "</xml>"
            }
            else
            {valdest = valinit + '\r' + valdeux}}
     sauverdur(cle,valdest)
     }

function supprimer(cle)
    {
    switch (typeStorage)
           {
           case "DOM":
               valeur =  lStorage.removeItem("JV_" + cle)
               break;
           case "IE":
              valeur = persistIE.removeAttribute(cle)
              persistIE.save("JV_Persist"); 
              break;
           default:
              break;
           }
    
    }
    
function retourdate(v)
{
var vv = ""
var rmois = nummois
if (v < 10) {v = "0" + v}
if (nummois < 10) {rmois = "0" + nummois} 
vv =  v + "/" + rmois + "/" + numan
if (parent.top.name == "Nouvelle")
{
parent.opener.saisie(vv)
if (nummois < 10) {rmois = "0" + nummois}
parent.opener.numm = rmois
parent.opener.numa = numan
top.close()
}
else
{alert ("Date = " + vv)}
}

function rechercher(fete)
{
if (fete != "")
{
var fetemin = fete.toLowerCase()
var mm = 0
var jj = 0
var libfete = ""
for (var i=0; i <= 11; i++)
     {for (var j=0; j<=32; j++)
         {var fetemax = getFonc(i,j)
          fetemax = fetemax.toLowerCase()
         if (fetemax == fetemin)
            {mm = i
             jj = j + 1
             libfete += "\r     le " + jj + " " + getMonthName(mm)}  
         }
     }
// if (top.typeStorage != "")
//    {
//    var tableau = new typetableau()
//    for (var i=0; i < tableau.length; i++)
//      {
//      var cle = getCle(tableau,i)
//      var valeur = getValeur(tableau,i)
//      if ((cle.indexOf("JV_F_") == 0) && (valeur.toLowerCase() == fetemin))
//          {
//          mm = cle.substring(5,7)
//          jj = cle.substring(8,10)
//          libfete += "\r     le " + jj + " " + getMonthName(mm)
//          }
//      }
//    }     
if (fete == "") {jj = 0}
if (libfete == "")
   {alert ("Aucune date n'a été trouvée pour cette fête")}
    else
   {alert ("La saint " + fete + " se fête " + libfete + ".")} 
}
}

function bissex(annee) {
	if ((annee % 4 == 0) && ((annee % 100 != 0) || (annee == 2000))) 
		{return true} 
	return false 
}

function rechevent(jourE,colspan)
   {
   ssuivi = ""
   annifete = "rien"
   suivicouleurcase = ""
   suivinbliserets = 0
   var pictoagenda = ""
   var agendaresume = ""
   var anniphoto = ""
   var texteseul = ""
   var meppictoagenda
   if (cm.pictoagenda == "")
      {meppictoagenda = ""}
      else
      {meppictoagenda = '<img src="gif/' + cm.pictoagenda + '" style="margin-top:2px">'}
   libevent = ""
   htmlevent = ""
   htmlbulle = ""
   if (typeNav != "")
      {var mm2 = n2((jourE.getMonth())+1)
       jjnombre = jourE.getDate()
       jj2 = n2(jjnombre)
       yy4 = jourE.getFullYear()
        if (cm.GTAgenda != "")
           {jouragenda = lire("Agenda_" + yy4 + "_" + mm2 + "_" + jj2,"")
            if (jouragenda != "")
                {
                // libevent +=  "Agenda :\r  " + jouragenda
                var ragenda = jouragenda
                var debres = jouragenda.indexOf("[")
                var finres = jouragenda.indexOf("]")
                if ((debres == 0) && (finres > 1))
                   {agendaresume = jouragenda.substring(1,finres)
                    ragenda = jouragenda.substring(finres+1)
                    if (ragenda != "") {ragenda = "<br>" + ragenda}
                    htmlbulle = agendaresume + "<br>" + mepentree(ragenda)}
                    else
                   {
                   // if (jouragenda.indexOf("<xml>") == 0)
                   if (jouragenda.substring(0,5).toLowerCase() == "<xml>")
                        {
                        top.rapportp.init()
                        top.lire_rapportp(jouragenda,"a")
                        agendaresume = top.rapportp.r
                        ragenda = top.rapportp.t
                        if ((ragenda != "") && (agendaresume != "") ){ragenda = "<br>" + ragenda}   
                        }
                        else
                        {htmlbulle = mepentree(ragenda)}
                   }
                libevent = agendaresume + ragenda
                if (htmlbulle != "" ) {htmlbulle = "<b>Agenda</b> :<br />" + htmlbulle}
                // if (libevent != "") {libevent = "Agenda :\r  " + libevent.replace("<br>","\r")}   
                var htmlagenda = ""
                if (agendaresume != "") {agendaresume = "<b>" + meptexte(agendaresume) + "</b>"}   
                if ((cm.GTAgenda == "detail") || (typecal > "p"))
                   {if (libevent != "") {htmlagenda = agendaresume +  meptexte(mepentree(ragenda)) }   }
                if (cm.GTAgenda != "resume") {agendaresume = "" } 
                if (htmlagenda != "")
                   {htmlevent += '<tr><td style="width:1%;height:1px;text-align:left;vertical-align:top">' + meppictoagenda  + '</td><td colspan="' + colspan + '">' + htmlagenda + '</td></tr>'}
                else   
                   {if ((libevent != "")  &&  (meppictoagenda != "")) {pictoagenda = '&nbsp;' +  meppictoagenda }} 
                }
           }
        if (cm.GTAnni != "")
           {jouranni = lire("Anni_" + mm2 + "_" + jj2,"")
            if (jouranni != "")
               {libevent +=  "anni"
                htmlbulle += (htmlbulle != "" ? "<br>":"") + "<b>Anniversaire(s) :</b><br />" + mepentree(jouranni)
                var ranni = jouranni
                var debres = jouranni.indexOf("[")
                var finres = jouranni.indexOf("]")  
                var typetraitanni = "normal"              
                if ((debres == 0) && (finres > 1))
                    {
                    anniphoto = '<img src="' + jouranni.substring(1,finres) + (top.cm.PhotoAnni.indexOf("l_") == 0 ? '" width="' +  largeurContenu : '" height="' +   hauteurPhoto) + '">'
                    ranni =  jouranni.substring(finres+1)} 
                if (cm.GTAnni.indexOf("photo") == 0) 
                   {
                   var TextePhoto = ""
                   if (top.cm.PhotoAnni.indexOf("t_") == 2)
                       TextePhoto = '<br>' + meptexte(mepentree(ranni))
                   switch (cm.GTAnni)
                     {
                     case "photopicto" :
                          if (anniphoto != "") 
                             {typetraitanni = ""
                             anniphoto += TextePhoto}
                          break; 
                     case "photodetail" :
                          if (anniphoto != "")
                             {typetraitanni = ""
                             anniphoto += TextePhoto}
                          break; 
                     case "photo" :
                          typetraitanni = ""
                           if (anniphoto != "")
                             {anniphoto += TextePhoto}
                          break; 
                     }
                   }
                if ((typetraitanni == "normal") || (typecal > "p"))
                   { anniphoto = ""      
                     if ((cm.GTAnni.indexOf("detail") > -1) || (typecal > "p"))
                        {if (nbevent > 1) 
                             {htmlevent += '<tr><td style="width:1%;height:1px;text-align:left;vertical-align:top"><img src="gif/anni' + cm.taillepicto + '.gif"></td><td colspan="' + colspan + '">' + meptexte(mepentree(ranni) )+ '</td></tr>'}
                          else
                             {texteseul += meptexte(mepentree(ranni)) }   
                        }
                     else  
                        {annifete = 'anni' + cm.taillepicto}
                    } 
               }
           }
       if (cm.GTFetes != "")
           {jourfete = lire("Fete_" + mm2 + "_" + jj2,"")
            if (jourfete != "")
               {libevent +=  "fete"
               htmlbulle += (htmlbulle != "" ? "<br>":"") + "<b>Fête à souhaiter :</b><br />" + mepentree(jourfete)
               if ((cm.GTFetes == "detail") || (typecal > "p"))
                  {if (nbevent > 1)
                      {htmlevent += '<tr><td style="width:1%;height:1px;text-align:left;vertical-align:top"><img src="gif/fete' + cm.taillepicto + '.gif"></td><td colspan="' + colspan + '">' + meptexte(mepentree(jourfete)) + '</td></tr>'}
                   else
                      {texteseul += meptexte(mepentree(jourfete))}
                   }      
               else
                  {   
                   if (annifete == "rien")
                      {annifete = "fete" + cm.taillepicto}
                      else
                      {annifete = "annifete" + cm.taillepicto}
               }    
                }
           }
       if (htmlbulle == "")    
          {libevent = 'Cliquer pour ajouter un évènement' }
          else
          {libevent = "Passer la souris sur '" + jjnombre + "' pour voir le détail,\r ou cliquer pour modifier."}
      }
   var reg = new RegExp('(")','g') 
   // libevent = libevent.replace(reg,"'")
   if (pictoagenda != "") 
      {pictoagenda += "&nbsp;" + agendaresume}
      else
      {pictoagenda = agendaresume}
   if (anniphoto != "")
      {if (pictoagenda != "") {pictoagenda += '<br>'}
      pictoagenda += anniphoto}
   if (texteseul != "") {pictoagenda += "&nbsp;" + texteseul}
   // alert ("picto=" + pictoagenda + ". au " + jourE)
   return pictoagenda
   }
   

function getCle(tableau,i)
  {
  var cle = ""
           switch (top.typeStorage)
              {
               case "DOM":
                  cle = tableau.key(i);
                  break;
               case "IE":
                   cle = "JV_" + tableau[i].nodeName;
                   break;
               default:
                  break;
               } 
  return cle 
  }
  
function getValeur(tableau,i)
  {
  var valeur = ""
             switch (top.typeStorage)
              {
               case "DOM":
                  valeur= "" + tableau.getItem(tableau.key(i)) + ""
                  break;
               case "IE":
                   valeur = tableau[i].nodeValue; 
                   break;
               default:
                  break;
               } 
  return valeur 
  }  

function getXML(filtre,contenu,yy,mm,libele,format)
    {
    // format = 0 : affichage
    // format = 1 : htm pour exportation vers un autre ordinateur
    // format = 9 : suppression (operationnel pour l'importation uniquement)
    var nblignes = 0
    var t = ""
    var tx = "" 
    var mm2 = "_" + top.n2(parseInt(mm)+1)
    var scle = "JV_"
    var tricle = ""
    if (filtre != "PourTout") {scle += filtre + "_"}
    var lcle = scle.length
    var contient = contenu
    var valeure = ""
    if (top.Rexact == 0)
       {
       var contient = contenu.toLowerCase().replace(top.RegCarA,"a").replace(top.RegCarE,"e").replace(top.RegCarI,"i").replace(top.RegCarO,"o").replace(top.RegCarU,"u").replace(top.RegCarC,"c")
       }
    // ATTENTION : "Exportation" est teste dans debHTML !
    if (format == 1)
       {t += top.debHTML ("Exportation")}
       else
       {t+= top.debHTML('Evénements')
       t += '<script type="text/javascript"  src="tablesort.js"></script> \r'}  
      var chargerscript = "" 
     if (format == 1)
       {chargerscript =  ' onload="charger()" '     
       t += '<script type="text/javascript">\r'
       t += '   var RegD = /[<]/g\r'
       t += '   var RegF = /[>]/g\r'
       t += '   function charger()\r'
       t += '    {if (top.Iimporthtm == true) \r'
       t += '       {top.importerhtm(document)}\r'
       t += '    else\r'
       t += '       {hbody = document.getElementById("monbody")\r'
       t += '        for (var i=0; i< hbody.rows.length; i++)\r'
       t += '          {var t = hbody.rows[i].cells[3].innerHTML\r'
       t += '          t = t.replace(RegD,"&lt;")\r'
       t += '           t = t.replace(RegF,"&gt;")\r'
       t += '          hbody.rows[i].cells[3].innerHTML =  t } } }\r'
       t += '</script>\r'
       }
    if (filtre == "NOTEP")
       {t += '<script type="text/javascript"  src="rechenotep.js"></script> \r'}
    t += '</head>\r'
    tx += "<table id='matable' class='sortable-onload-0' border='1' cellpadding='5'>\r"
    tx += "<thead><tr>\r"
    tx +="<th"
    if (format !=1)
       {tx += " class='sortable' style='display:none'>TRI</th><th onclick='fdTableSort.jsWrapper(\"matable\", [0])' title='Cliquer pour inverser le tri' style='color:blue;cursor:pointer'"}
    if (filtre.substring(0,1) == "P")
       {tx += ">Clé</th><th></th><th>Valeur</th>\r"}
       else
       {tx += ">Date</th><th></th><th>Evénement</th>\r"} 
    tx += "</tr></thead><tbody id='monbody'>\r"   
    var jour = "" 
    var tableau =  new top.typetableau()
    if (top.typeStorage != "")
       {
       for (var i=0; i < tableau.length; i++)
           { 
           var cle = getCle(tableau,i)
           var valeur = getValeur(tableau,i)
           var pos = cle.indexOf(scle)
           if (pos > -1)
              {tricle = cle.substring(3,cle.length)
              var sele = true
              if (contenu != "")
                 {valeure = valeur
                  if (top.Rexact == 0)
                     {
                     valeure = valeur.toLowerCase().replace(top.RegCarA,"a").replace(top.RegCarE,"e").replace(top.RegCarI,"i").replace(top.RegCarO,"o").replace(top.RegCarU,"u").replace(top.RegCarC,"c")
                     }
                  if (valeure.indexOf(contient) == -1) {sele = false}}
              if ((filtre =="Agenda") || (filtre =="NOTEP") )
                 {
                 if (yy != "")  {if (cle.indexOf(yy) == -1) {sele = false}}
                 }
              if (mm != "")  {if (cle.indexOf(mm2) == -1) {sele = false }}
              if (tricle.substring(0,3) == 'tot') {sele = false}
              if (sele == true)
                 {  
                 var sdate = cle.substring(pos + lcle ,cle.length)
                 var smep = ""
                 if (filtre == "Agenda")
                   {var jjd = sdate.substring(8,10)
                    var mmd = sdate.substring(5,7)
                    var yyd = sdate.substring(0,4)
                    var dd = new Date(yyd,mmd-1,jjd-1) 
                    jour = top.jourSemaine[dd.getDay()+1]
                    smep = "<a title='Cliquer pour afficher le calendrier mensuel' href='javascript:top.drawCalouve(" +  (mmd -1) + "," + yyd + ", \"\")'>" + jjd + " / " + mmd + " / " + yyd + "</a>"
                    }
                   else
                   {if (filtre.substring(0,1) == "P")
                       {smep =  sdate }
                    else
                       {if (filtre == "NOTEP")  
                           {smep = "<a title='Cliquer pour afficher le calendrier de cette période' href='javascript:calendap(\"" + sdate  + "\")'>" + sdate + "</a>" } 
                       else 
                           {if (filtre == "F")
                               {smep = "" + n2(Math.abs(sdate.substring(3,5))+1) + " / " + n2(Math.abs(sdate.substring(0,2))+1) }                     
                               else
                               {smep = sdate.substring(3,5) + " / " + sdate.substring(0,2)}
                           }
                       }
                   }  
                 tx += "<tr>\r"
                 tx += "     <td style='display:none'>" + tricle + "</td>\r"
                 tx += "     <td nowrap>" + smep + "</td>\r"
                 tx += "     <td> - " + jour + " </td>\r"
                 var reg = new RegExp('(&)','g') 
                 if (format ==1 )
                    {
                    // valeur = mepxml(valeur)
                    // valeur = valeur.replace(top.reget," et ")
                    }
                    else
                    {
                    if (valeur.substring(0,5).toLowerCase() == "<xml>")
                        {
                        var tnote = ""
                        top.rapportp.init()
                        top.lire_rapportp(valeur,"x")
                        if (top.rapportp.r != "")
                            {tnote += "<b>" + top.rapportp.r + "</b><br />"
                            }
                        if (top.rapportp.f != "")
                            {tnote += "<a href='" + top.rapportp.f + "' target='_blank'>" + top.rapportp.f + "</a><br />"
                            }
                        if (top.rapportp.t != "")
                           {tnote +=  top.mepentree(top.rapportp.t) + "<br />"}
                           
                        if ((top.ssuivi != "") && (top.nodesuivi.childNodes.length > 0))
                           {
                           tnote += "<table border='0' cellspacing='0' cellpadding='0'>"
                           tnote += "<tr><td><b>Activité</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td>Remarque&nbsp;&nbsp;&nbsp;</td><td>Temps/nb/mt</td></tr>"
                           for (var is=0;is<top.nodesuivi.childNodes.length;is++)
                               {itemsuivi = top.nodesuivi.childNodes.item(is)
                               if (top.xmlDocType != "DOM")
                                  {contenuxml = itemsuivi.text}
                                   else
                                  {contenuxml = itemsuivi.textContent}
                               tnote += "<tr>" 
                               tnote += "<td>" + itemsuivi.getAttribute('a') + "&nbsp;&nbsp;</td>"
                               tnote += "<td>" + contenuxml + "&nbsp;&nbsp;</td><td>" 
                               if (itemsuivi.getAttribute('j') == "n")
                                  {tnote += itemsuivi.getAttribute('m') }
                                  else 
                                  {if (itemsuivi.getAttribute('j') != "") {tnote += itemsuivi.getAttribute('j') + "j"}
                                  if (itemsuivi.getAttribute('h') != "") {tnote += itemsuivi.getAttribute('h') + "h"}
                                  if (itemsuivi.getAttribute('m') != "") {tnote += itemsuivi.getAttribute('m') + "m"}}
                               tnote += "</td>"
                              }
                            tnote += "</tr></table>"  
                           }
                        valeur = tnote   
                        }
                     else   
                       {valeur = top.mepentree(valeur)}
                    }
                 tx += "     <td>" + valeur + "</td>\r"
                 tx += "</tr>\r"
                 if (format == 9)   
                     {
                     top.supprimer(cle.substring(3))
                     i = i - 1 }  
                 nblignes ++
                 }
              }    
           }
       }
    if (format == 9) 
       {tableau = null
       return}
      
    if (nblignes == 0)
       {var mess = "Pas d'événement trouvé pour cette sélection. "
       if (filtre == "Agenda")
          {mess += "\rPour saisir une entrée d'agenda, cliquez sur Afficher, "
          mess += "\rpuis cliquez dans la case du jour concerné..."}  
       alert (mess)
       }
       else
       {
           tx += "</tbody>\r"
           tx += "</table>\r"
           t += '<BODY'
           if (format != 1) {t += ' background="' + top.backgen + '" style="font-family:' + top.FontNameR + '"'}
           t += chargerscript + '> \r'
           if (format == 1)
              {
              t += "<div id='notesauve'>"
              t += "<p><b>Pour permettre une restauration ultérieure, ou une importation de vos données vers un autre ordinateur, respectez la procédure suivante :</b></p>" 
              t += "<ul>" 
              t += "<li>Dans cette fenêtre, faîtes <i>Bouton droit de souris, afficher la source</i></li>" 
              t += "<li>Dans la nouvelle fenêtre qui s'affiche :</li>" 
              t += "<ul>" 
              t += "<li>Vérifiez que vos données sont présentes</li>"
              t += "<li>Si vos données ne sont pas affichées dans le bloc-notes, mais dans un éditeur spécifique au navigateur (c'est le cas par défaut pour Internet Explorer 8 et Firefox) :</li>"
              t += "<ul>"
              t += "   <li>Faîtes Edition, Sélectionner tout</li>" 
              t += "   <li>Faîtes Edition Copier</li>"
              t += "   <li>Ouvrez le bloc notes (avec Windows XP : Démarrer, Exécuter, saisissez 'notepad' et validez, avec Vista et Windows 7 : Tous les programmes, Accessoires, Bloc-Notes) </li>"
              t += "   <li>Dans le bloc-notes, faîtes Edition Coller.</li>"
              t += "</ul>"
              t += "<li>Dans le bloc-notes, faîtes <i>Fichier, enregister sous</i> et choisissez un emplacement (par exemple une clé USB), <strong>un nom de fichier avec l'extension .htm</strong> et enregistrez le fichier</li>" 
              t += "<li>Fermez le bloc-notes</li>"
              t += "</ul>"
              t += "<li><b>Vérifiez que la procédure de sauvegarde s'est terminée avec succès en ouvrant le fichier obtenu avec votre navigateur : vos données doivent s'afficher dans un tableau, au-dessous de ce texte.</b></li>"
              t += "</ul>"
              t += "</div>"
              }
           t += '<H2 align="center">' + libele + '</H2>'
           t += '<div id="contenu" align="center">' + tx + '</div>'
           t += '<h3 align="center" id="resultat">' + nblignes +    ((nblignes==1) ? " résultat" : " résultats") + "</h3>"
           t += '</BODY>\r'
           t += '</HTML>\r'
           if (format == 1) 
              {
              var fen = window.open("","_blank")
              var fendoc = fen.document.open("text/html")
              fendoc.write (t)
              fendoc.close()
              }
              else
              {
              top.choixjs.document.choixjs.Afficher.disabled = false
              top.choixjs.document.choixjs.options.disabled = false
              top.choixjs.document.choixjs.Imprimer.disabled = false
              var oNewDoc = top.choixjd.document.open("text/html");
              oNewDoc.write(t);
              oNewDoc.close();
              }
      }
      tableau = null
    }   
   
   
function importerhtm(dochtml)
   {
   var nb = 0
   hbody = dochtml.getElementById("monbody")
   var stype = top.Itype
   var schamp = top.Ichamp
   if (stype == 1)
      {  // suppression
      top.getXML(schamp,"","","","", 9) 
      } 
   dochtml.getElementById("matable").style.display = 'none'  
   try {dochtml.getElementById("notesauve").style.display = 'none'} catch (ex) {}
   for (var i=0; i< hbody.rows.length; i++)
       {var ligne = hbody.rows[i]
            var cle = ligne.cells[0].innerHTML
            var valeur = ligne.cells[3].innerHTML
            if ((cle != 'persist') && ((schamp == "PourTout") || (cle.indexOf(schamp + "_") == 0)))
               {
               nb++
               if ((cle.substring(0,2) == 'P_') || (cle.substring(0,2) == 'F_') || (cle.substring(0,6) == 'NOTEP_') || (stype == 1))
                  {
                  top.sauverdur(cle,valeur)
                  }
                  else
                  {
                  top.ajouter(cle,valeur)
                  } 
               } 
        }    
    top.Iimporthtm = false   
    var t = '<p><strong><font color="006600"><center>' + nb + " lignes (" + schamp + ") ont été importées.</center></font></strong></p>" 
    t += "<p>Cliquez sur le lien ci-dessous pour prendre en compte l'importation :<br>"
    t += "<a href='" + top.choixjs.document.getElementById("accueil").href + "' target='_top'>Accueil Calendrier agenda</a>"
    t += "<br>ou relancez votre navigateur.</p>"
    dochtml.getElementById("resultat").innerHTML = t   
   }   

function n2(nn)
  {
  if (parseInt(nn) < 10 )
     {return ("0" + nn) }
     else
     {return nn}
  }


function getDays(mois, annee) {
	var dd = new Array(12)
	dd[0] = 31 
	dd[1] = (bissex(annee)) ? 29 : 28 
	dd[2] = 31 
	dd[3] = 30 
	dd[4] = 31 
	dd[5] = 30 
	dd[6] = 31 
	dd[7] = 31 
	dd[8] = 30 
	dd[9] = 31 
	dd[10] = 30 
	dd[11] = 31 
	return dd[mois]
}

function getMonthName(month) {
	var mm = new Array(12)
	mm[0] = "Janvier"
	mm[1] = "Février"
	mm[2] = "Mars"
	mm[3] = "Avril"
	mm[4] = "Mai"
	mm[5] = "Juin"
	mm[6] = "Juillet"
	mm[7] = "Août"
	mm[8] = "Septembre"
	mm[9] = "Octobre"
	mm[10] = "Novembre"
	mm[11] = "Décembre"
	return mm[month]
}

function getFete(mois,jour)
    {
    if (fetespec != "" )
       {return fetespec}
    else
       {return getFonc(mois,jour)}   
    }

function getFonc(mois,jour) {
    var ar = new Array(12)
    ar[0] = getFete01(jour)
    ar[1] = getFete02(jour)
	ar[2] = getFete03(jour)
	ar[3] = getFete04(jour)
	ar[4] = getFete05(jour)
	ar[5] = getFete06(jour)
	ar[6] = getFete07(jour)
	ar[7] = getFete08(jour)
	ar[8] = getFete09(jour)
	ar[9] = getFete10(jour)
	ar[10] = getFete11(jour)
	ar[11] = getFete12(jour)
    if (typeStorage != "")
       {
       var stoF = "" + lire("F_" + n2(mois) + "_" + n2(jour),"")
       if (stoF == "") 
	      {return ar[mois]}
       else
          {return stoF}
       }
       else
       {return ar[mois]}
   }

function setFete(mois,jour,p)
{
  if (typeStorage == "")
    {
    var stm = "m" + mois + "m"
    switch (stm)
      {
      case "m0m":
         setFete01(jour-1,p);
         break;
      case "m1m":
         setFete02(jour-1,p);
         break;
      case "m2m":
         setFete03(jour-1,p);
         break;
      case "m3m":
         setFete04(jour-1,p);
         break;
      case "m4m":
         setFete05(jour-1,p);
         break;
      case "m5m":
         setFete06(jour-1,p);
         break;
      case "m6m":
         setFete07(jour-1,p);
         break;
      case "m7m":
         setFete08(jour-1,p);
         break;
      case "m8m":
         setFete09(jour-1,p);
         break;
      case "m9m":
         setFete10(jour-1,p);
         break;
      case "m10m":
         setFete11(jour-1,p);
         break;
      case "m11m":
        setFete12(jour-1,p);
        break;
       }
     }  
     else  
       {
       if (p.replace(/[ \n\r]/g,"") == "")
           {supprimer ("F_" + n2(mois) +"_" + n2(jour-1))}
           else
           {sauverdur("F_" + n2(mois) +"_" + n2(jour-1),p)}
       }
      sp = p   
      if (p == "") {sp = getFonc(mois,(jour-1))}
      rechercher(sp)
}



 function insFete(mois,jour,p)
    {
    if (typeNav != "")
      {
      if (persist =='oui' )
         {ajouter("Fete_" + mois +"_" + (jour-1),p)
          alert(p + " a été inscrite comme fête à souhaiter le " + jour + " " + getMonthName(mois))}
         else
         {alert("cocher d'abord la case 'Conserver mes options' ci-dessus")}
      }
     else
     {alert("La gestion des fêtes à souhaiter n'est pas possible avec ce navigateur.")} 
    }

 function setAnni(mois,jour,p)
    {
    if (typeNav != "")
      {
      if (persist =='oui' )
         {ajouter("Anni_" + mois +"_" + (jour-1),p)
          alert("L'anniversaire de " + p + " a été inscrit le " + jour + " " + getMonthName(mois))}
         else
         {alert("cocher d'abord la case 'Conserver mes options' ci-dessus")}
      }
     else
     {alert("La gestion des anniversaires n'est  n'est pas possible avec ce navigateur.")} 
    }

function typetableau()
    {
     switch (typeStorage)
           {
           case "DOM":
              return lStorage;
              break;
           case "IE":
              return persistIE.XMLDocument.childNodes[0].attributes; 
              break;
           default:
              return "" 
              break;
           }
    }

var fetes01 = new Array("Jour de l'an","Basile","Geneviève","Odilon","Edouard","Melaine","Raymond","Lucien","Alix","Guillaume","Paulin","Tatiana","Yvette","Nina","Rémi","Marcel",
   "Roseline","Prisca","Audric","Sébastien","Agnès","Vincent","Barnard","François","Paul","Paule","Angèle","Thomas","Gildas","Martine","Marcelle","","","");

function getFete01(num)
{return fetes01[num]}

function setFete01(num,p)
{fetes01[num] = p}

var fetes02 = new Array("Ella","Présention","Blaise","Véronique","Agathe","Gaston","Eugènie","Jacqueline","Apolline","Arnaud","ND Lourdes","Félix","Béatrice","Valentin","Claude","Julienne",
   "Alexis","Bernadette","Gabin","Aimée","Damien","Isabelle","Lazare","Modeste","Roméo","Nestor","Honorine","Romain","Auguste","","","","","");

function getFete02(num)
{ return fetes02[num]}

function setFete02(num,p)
{fetes02[num] = p}

var fetes03 = new Array("Aubin","Charles","Guénolé","Casimir","Olive","Colette","Félicité","Jean","Françoise","Vivien","Rosine","Justine","Rodrigue","Mathilde","Louise","Bénédicte",
   "Patrice","Cyrille","Joseph","Herbert","Clémence","Léa","Victorien","Karine","Ann.","Larissa","Habib","Gontran","Gwladys","Amédée","Benjamin","","","");

function getFete03(num)
{ return fetes03[num]}

function setFete03(num,p)
{fetes03[num] = p}

var fetes04 = new Array("Hugues","Sandrine","Richard","Isidore","Irène","Marcellin","JB.de la S","Julie","Gautier","Fulbert","Stanislas","Jules","Ida","Maxime","Paterne","Benoït",
   "Anicet","Parfait","Emma","Odette","Anselme","Alexandre","Georges","Fidèle","Marc","Alida","Zita","Valérie","Catherine","Robert","","","");

function getFete04(num)
{return fetes04[num]}

function setFete04(num,p)
{fetes04[num] = p}

var fetes05 = new Array("F.travail","Boris","Philippe","Sylvain","Judith","Prudence","Gisèle","V.1945","Pâcome","Solange","Estelle","Achille","Rolande","Matthias","Denise","Honoré",
   "Pascal","Eric","Yves","Bernardin","Constantin","Emile","Didier","Donatien","Sophie","Béranger","Augustin","Germain","Aymar","Ferdinand","Visitation","","","");

function getFete05(num)
{return fetes05[num]}

function setFete05(num,p)
{fetes05[num] = p}

var fetes06 = new Array("Justin","Blandine","Kévin","Clotilde","Igor","Norbert","Gilbert","Médard","Diane","Landry","Yolande","Guy","Antoine","Elisée","Germaine","J.F.Régis","Hervé",
   "Léonce","Romuald","Silvère","Rodolphe","Alban","Audrey","Baptiste","Prosper","Anthelme","Fernand","Irénée","Paul/Pierre","Martial","","","");

function getFete06(num)
{return fetes06[num]}

function setFete06(num,p)
{fetes06[num] = p}

var fetes07 = new Array("Thierry","Martinien","Thomas","Florent","Antoine","Mariette","Raoul","Thibaut","Amandine","Ulrich","Benoït","Olivier","Joël","Camille","Donald","ND.Carmel",
   "Caroline","Frédéric","Arsène","Marina","Victor","Madeleine","Brigitte","Christine","Jacques","Anne","Nathalie","Samson","Marthe","Juliette","Ignace","","","");

function getFete07(num)
{return fetes07[num]}

function setFete07(num,p)
{fetes07[num] = p}

var fetes08 = new Array("Alphonse","Julien","Lydie","Jean-Marie","Abel","Marlène","Gaétan","Dominique","Amour","Laurent","Claire","Clarisse","Hippolyte","Evrard","Alfred","Armel",
   "Hyacinthe","Hélène","Jean","Bernard","Christophe","Fabrice","Rose","Barthélémy","Louis","Natacha","Monique","Augustin.","Sabine","Fiacre","Aristide","","","");

function getFete08(num)
{ return fetes08[num]}

function setFete08(num,p)
{fetes08[num] = p}

var fetes09 = new Array("Gilles","Ingrid","Grégoire","Rosalie","Raïssa","Bertrand","Reine","Nativité","Alain","Inés","Adelphe","Apollinaire","Aimé","Ste-Croix","Roland","Edith",
   "Renaud","Nadège","Amélie","Davy","Mathieu","Maurice","Constant","Thècle","Hermann","Côme","Vincent","Venceslas","Gabriel","Jérôme","","","");

function getFete09(num)
{return fetes09[num]}

function setFete09(num,p)
{fetes09[num] = p}

var fetes10 = new Array("Thérèse","Léger","Gérard","François","Fleur","Bruno","Serge","Pélagie","Denis","Ghislain","Firmin","Wilfried","Géraud","Juste","Thérèse","Edwige","Baudoin",
   "Luc","René","Adeline","Céline","Elodie","Jean","Florentin","Enguerran","Dimitri","Emeline","Simon","Narcisse","Bienvenue","Quentin","","","");

function getFete10(num)
{return fetes10[num]}

function setFete10(num,p)
{fetes10[num]=p}

var fetes11 = new Array("Toussaint","Défunts","Hubert","Charles","Sylvie","Bertille","Carine","Geoffroy","Théodore","Léon","Martin","Christian","Brice","Sidoine","Albert",
   "Marguerite","Elisabeth","Aude","Tanguy","Edmond","Présentat.","Cécile","Clément","Augusta","Catherine","Delphine","Séverin","Jacques","Saturnin","André","","","");

function getFete11(num)
{ return fetes11[num]}

function setFete11(num,p)
{fetes11[num]=p}

var fetes12 = new Array("Florence","Viviane","François","Barbara","Gérald","Nicolas","Ambroise","Imm.Conc.","Pierre","Romaric","Daniel","Chantal","Lucie","Odile","Ninon","Alice","Gaël",
   "Gatien","Urbain","Abraham","Pierre","Françoise","Armand","Adèle","Noël","Etienne","Jean","Innocents","David","Roger","Sylvestre","","","");

function getFete12(num)
{ return fetes12[num]}

function setFete12(num,p)
{fetes12[num]=p}

function initcalend()
   {
    indzonesscol = false
    typecal = "mois"     
    hrHeight = 10 
	hrColor = "midnightblue" 
	hrSize = parseInt(cm.FontSize) + 3
    hdHeight = 10 
	hdColor = "darkblue" 
	timeColor = "purple" 
	ColorTexte = "FFFFFF"
	if (cm.ColorFond != '') {ColorTexte=cm.ColorFond}
    if (Math.abs(ColorTexte) == ColorTexte)  
           {hrColor='#FFFF66'}
    ColorTexte = "FFFFFF"       
    if (cm.ColorFond != '') {ColorTexte=cm.ColorFond}
    if (cm.ColorCase != '') {ColorTexte=cm.ColorCase}
    if (Math.abs(ColorTexte) == ColorTexte)  
           {ColorTexte = '#FFFFFF'
            hdColor='#FFFF33'}
           else
           {ColorTexte = '#000000'}
   var liberannee = top.verifannee()
   if (liberannee != "")
      {
      top.choixjs.document.getElementById("nota").innerHTML = '<strong><font color="#990000">' + liberannee + '</font></strong>' 
      top.choixjs.document.choixjs.annee.focus()
      }
      else
      {top.choixjs.document.getElementById("nota").innerHTML = top.nota}
	nbevent = 0
    retourLiseret = "" 
    styleLiseret = "width:4px;height:" + hauteurTexte + "px;margin:0px 2px 0px 0px;font-size:" + hauteurTexte + "px;vertical-align:bottom;display:inline"
	if (cm.GTAgenda != "") {nbevent++}
	if (cm.GTAnni != "") {nbevent++}
	if (cm.GTFetes != "") {nbevent++} 
	if (cm.nom_modele != precedent_modele) 
	   {saisie_type = "a"
	   precedent_modele = cm.nom_modele}
	for (var i =0;i<suivinbactis;i++)
	    {suivi_tj[i] = 0
	     suivi_th[i] = 0
	     suivi_tm[i] = 0
	     suivi_nb[i] = 0
	    }
	if (top.choixjs.document.getElementById("nota").innerHTML == "")
	   {
	   indpub += 1
	   if ((indpub > 5) & (indpub < 10))
	      {top.choixjs.document.getElementById("nota").innerHTML = "Si vous aimez ce calendrier agenda,<br /><a href='promotion.htm' target='choixjd'>merci de m'encourager</a>, c'est gratuit." }
	   }
	   
	}
	
	
function estnum(s,l)
{ 
  var retour = true
  for (var num = 0; num <= l-1; num++)
      {
      if ((s.substring(num,num+1) > "9") || (s.substring(num,num+1) < "0"))
         {retour = false}
      }
  return retour
}

function verifannee()
  {var annee = top.choixjs.document.choixjs.annee.value
   if (estnum(annee,4) == false)
     {return "l'année doit comporter 4 chiffres"}
     else
     { if ((annee.length != 4) || (annee < 1601) || (annee > 2200)) 
        {return "frapper 4 chiffres compris entre 1601 et 2200 pour l'année"}
     }
   return ""
  }	
	


function drawCal(mois, year, libelmois) {
    libcalmois = libelmois
    libperiode = libelmois
    top.SuffixeNotes = top.n2(parseInt(mois)+1) 
    if (formatmensuel == "tableau")
       {
       top.cm = top.mois_modele}
      else
      {
      top.cm = top.moiscolonne_modele}
    initcalend()
    var text = debHTML('Calendrier mensuel')
	text = '<table id="latable"  style="position:relative;z-index:2000"  '
    text += ' BORDER=' + cm.TailleBord + ' CELLSPACING=' + cm.MargeExt + ' CELLPADDING=' + cm.MargeInt + ' '
    if (cm.Image == "")
           {
           if (cm.ColorFond != '')
              {text += ' bgcolor="#' + cm.ColorFond + '"' }
           }
           else
           {if (cm.CRepet < 4)
              {text += ' background="' + cm.Image + '"' }}
    text += ' bordercolor="#' + cm.ColorBord + '">\r'
    var wcol = 7
    if (cm.optsem) {wcol = 8} 
	text += 	'<TH COLSPAN=' + wcol + ' HEIGHT=' + hrHeight + ' onmousedown="drags(event,document.getElementById(\'latable\'))" onmouseup="fixerCal()" title="Vous pouvez faire glisser le calendrier pour le positionner..."' 
	text += ' style="cursor:Move;border-style:solid;border-color:' +  cm.ColorBord + '">'
	text += 		'<FONT COLOR="' + hrColor + '" SIZE=' + hrSize + '>' // set font for table header
	text += 			libelmois + ' '
	text += 		'</FONT>' 
	text += 	'</TH>\r' 
	if (formatmensuel == "tableau")
		{text += drawMonth(mois,year,libelmois)}
		else
		{text += drawLigne(mois,year,libelmois)}
	text += '</table>'
    return text 
}

function drawCalouve(mois, year, libelmois)
  {
    window.choixjs.document.choixjs.mois.value = mois
    window.choixjs.document.choixjs.annee.value = year
    var a = window.open("mod_mois.htm","choixjd")
  }
  
function calnumweek(dateweek)
  {
    var jjj = dateweek.getDay()
    if (jjj == 0) {jjj = 7}
    jjj = -jjj + 4
    for (var m = 0; m < dateweek.getMonth(); m++)
        {jjj = jjj + getDays(m, dateweek.getFullYear())}
    jjj = jjj + dateweek.getDate()   
    return (Math.ceil(jjj / 7))
  }


function drawMonth(mois, year, libelmois)
    {
    var text = ""
    numan = year
    nummois = parseInt(mois) 
    nummois++
	if (year <= 100) {year = year + 1900}
    var calmmaa = "" + mois + "-" + year    
    var nowmmaa = "" + now.getMonth() + "-" + now.getFullYear()
   	var premierdumois = new Date(year, mois, 1)
   	var jjj = calnumweek(premierdumois)
    var firstDay = premierdumois.getDay()
    if (firstDay == 0) {firstDay = 7} 
	premierdumois = null
	libcalmois = libelmois
	var lastDate = getDays(mois, year)
    var fontcase = '<FONT FACE="' + FontNameR + '" SIZE="' + cm.FontSize + '" COLOR="' + ColorTexte + '">'
	var openCol = '<TD style="border-style:solid;border-color:' +  cm.ColorBord + '" HEIGHT=' + hdHeight + ' bgcolor="' + cm.ColorCase + '"' + '><B>'
	openCol += '<FONT COLOR="' + hdColor + '" FACE="' + FontNameR + '" SIZE=' + cm.FontSize + '>'
	var closeCol = '</FONT></TD>\r'
	text += '<TR ALIGN="center" VALIGN="center">\r'
    if (cm.optsem) text+= "<TD style='border-style:solid;border-color:" +  cm.ColorBord + "' >" + fontcase + "Sem</FONT></TD>"
	for (var dayNum = 1; dayNum < 8; ++dayNum)
		{text += openCol + mepjourSemaine(dayNum) + '</B>' + closeCol }
	text += '</TR>\r'
	var compteur = 1
	var curCell = 1
	for (var row = 1; row <= Math.ceil((lastDate + firstDay -1) / 7); ++row) {
		text += '<TR ALIGN="' + cm.alih + '" VALIGN="' + cm.aliv + '">'
                               text += '\r'
                if (cm.optsem) 
                   {text += "<TD align='center' valign='middle' title='Cliquer pour afficher le calendrier hebdomadaire détaillé' "
                   text += ' style="cursor:pointer;border-style:solid;border-color:' +  cm.ColorBord + '"'
                    text += " onclick='top.calWeekouve(" + jjj + "," + year + ")'>" + '<FONT FACE="' + FontNameR + '" SIZE="' + cm.FontSize + '" COLOR="' + hrColor + '">' + jjj + "</FONT></TD>"
                    ++jjj}
		for (var col = 1; col < 8; ++col) {
			if (compteur > lastDate)
				break
			var jourDate = new Date (year,mois, compteur)	
			if (curCell < firstDay) {
				text += '<TD></TD>';
				curCell++
			} else
			    {
			    fetespec = ""
				var colspan = ""
				var zonesvacances = mepzones(jourDate,"mois")
				largeurContenu = cm.colWidth - largeurzones 
                var textevent = rechevent(jourDate,1)
				var fff = ""
            	if (cm.optfetes) {fff = getFete(mois,compteur-1)}
                var textetotal = mepjourbulle(jourDate) + mepliserets()
                if (fff == "")
                   {textetotal += textevent }
                   else
                   {if (textevent == "")
                       {textetotal += '<br>' + fff}
                    else
                       {textetotal += "&nbsp; " +  fff +  "<br>" + textevent}
                   }
                if (htmlevent == "")
                   {colspan = " colspan='1' "}
                   else
                   {colspan = " colspan='2' "}
				text += '<TD align="left" HEIGHT="' + cm.cellHeight + '" '
				// if (cm.ColorCase != "")
				//    {text += ' bgcolor="' + cm.ColorCase + '"'}
				//    else
				//    {if (cm.CRepet > 3) {text += ' background="' + cm.Image + '"'}}
				var sclass = ' class="' + annifete
				var sstyle = ' style="' 
                // text += ' class="' + annifete 
                if (now.getDate() == compteur)
                   {
                   if (calmmaa == nowmmaa) 
                      {sclass += ' datejour' }
                   else
                      {sstyle += 'border-color:' + cm.ColorBord}
                   }
                   else
                   {sstyle += 'border-color:' + cm.ColorBord}
                text += sstyle + ";" + oncolorielacase() + '"' +  sclass + '"'
                text += ' title="' + libevent + '" onclick="ouvrirmenu(event,' + year + ','+ mois +',' + compteur +  ')" ' 
                text += '><TABLE height="' + cm.cellHeight + '" border="0" cellspacing="0" cellpadding="0" width="' + cm.colWidth + '" style="' + oncolorieletexte() + '"><TR>'
                if (largeurzones == 0)
                   {
                   colspan = " colspan='2' "}
                   else
                   {text += '<TD align="left" nowrap>' + zonesvacances + '</TD>'}
                text += '<TD ' + colspan
                text +=  'width="' + (cm.colWidth - largeurzones)  + '" align="' + cm.alih + '" valign="' + cm.aliv + '"><FONT FACE="' + FontNameR + '" SIZE="' + cm.FontSize + '">'
                text +=  textetotal + '</FONT></TD></TR>'
                text += htmlevent
                text += '</TABLE></TD>\r'
	    		compteur++
	    		}
		}
		text += '</TR>'
    	}
    totaliselemois(nummois,year)   
    return text
    } 
    
function drawTableau(mois, year,libelmois)
   {
   var text = ""
   text += "<table style='z-index:4000' bordercolor='#" + cm.ColorBord  +  "' cellPadding='" + cm.MargeInt + "' cellSpacing='0' border='" + (cm.TailleBord==0?0:1) + "'>\r"
   text += "<tr>"
   var wcol = 7
   if (cm.optsem) {wcol = 8} 
   var libelcal = getMonthName(parseInt(mois)) + " " + year  
   text += '<td colspan="' + wcol + '" align="center" valign="middle" title="Cliquer pour afficher le calendrier de ' + libelcal + '"'
   text += "style='overflow:hidden;cursor:pointer;border-style:solid;border-color:" +  cm.ColorBord + "' "
   text += "onclick='top.drawCalouve(" + mois + "," + year + ",\"" + libelcal +  "\")'>" 
   text += '<font face="' + FontNameR +'" size="' + cm.FontSize + '" color="' + hrColor +'"><strong>' + libelmois + "</strong></font></td>"
   text += "</tr>\r"
   text += drawMonth (mois, year, libelmois)
   text += "</table>\r"
   return text
   }    

function drawObjets(doc)
   {
   fonctionphoto = ""
   switch ("P" + cm.posPhoto)
           {
       case "P1":
            doc.getElementById("avantcal").innerHTML = unephoto(doc.getElementById("latable").offsetWidth,0,doc.getElementById("avantcal")) + "<br>&nbsp;"
            doc.getElementById("aprescal").innerHTML = ''
            break;
       case "P2":
            doc.getElementById("avantcal").innerHTML = ''
            doc.getElementById("aprescal").innerHTML = "<br>&nbsp;" + unephoto(doc.getElementById("latable").offsetWidth,0,doc.getElementById("aprescal"))
            break;
       case "P3":
            try
               {
               doc.getElementById("avantcal").innerHTML = ''
               doc.getElementById("aprescal").innerHTML = ''
               doc.getElementById("agauchecal").innerHTML = unephoto(0,doc.getElementById("latable").offsetHeight,doc.getElementById("agauchecal")) + "&nbsp;"
               } 
            catch (ex) {}
            break;
       case "P4":
            try
               {
               doc.getElementById("aprescal").innerHTML = ''
               doc.getElementById("avantcal").innerHTML = ''
               doc.getElementById("adroitecal").innerHTML = "&nbsp;" + unephoto(0,doc.getElementById("latable").offsetHeight,doc.getElementById("adroitecal"))
               }
            catch (ex) {}   
            break;
       case "P5":
            try
               {
               doc.getElementById("aprescal").innerHTML = ''
               doc.getElementById("avantcal").innerHTML = ''
               fonctionphoto = "photo_dessous()"
               doc.getElementById("adroitecal").innerHTML = unephoto(0,doc.getElementById("latable").offsetHeight,doc.getElementById("adroitecal"))
               }
            catch (ex) {}   
            break;
       case "P6":
            try
               {
               doc.getElementById("aprescal").innerHTML = ''
               doc.getElementById("avantcal").innerHTML = ''
               fonctionphoto = "photo_dessous()"
               doc.getElementById("adroitecal").innerHTML = unephoto(doc.getElementById("latable").offsetWidth,doc.getElementById("latable").offsetHeight,doc.getElementById("adroitecal"))
               }   
            catch (ex) {}   
            break;
       default:
            doc.getElementById("avantcal").innerHTML = ''
            doc.getElementById("aprescal").innerHTML = ''
           break;
           }
   if (cm.TexteS != "")
      {
      var textemep = "<div id='texte'  style='margin:10px;position:relative;z-index:3000;cursor:Move' onmousedown=\"drags(event,document.getElementById(\'texte\'))\" onmouseup='fixerTexte()' "
      textemep += "title='Vous pouvez faire glisser ce texte pour le positionner...\rPour modifier ce texte ou le supprimer, cliquez sur Options, puis sur Légende...' >"
      textemep += '<font face="' + cm.TexteFondR + '" size="' + cm.TexteSize + '" color="' + cm.TexteColor + '">'
      textemep += cm.TexteS.replace(RegRC,"<br>").replace(regespace2,"&nbsp;&nbsp;") + '</font></div>'
      
      if (cm.TextePos == "0")  
         {
         doc.getElementById("avantcal").innerHTML = textemep + doc.getElementById("avantcal").innerHTML
         }
         else
         {
         if (cm.TextePos == "1")
            {
            doc.getElementById("aprescal").innerHTML = doc.getElementById("aprescal").innerHTML + textemep
            }
         else
            {
            if (cm.posPhoto == 1)
               {
               doc.getElementById("avantcal").innerHTML = doc.getElementById("avantcal").innerHTML  + textemep 
               }
            else
               {
               doc.getElementById("aprescal").innerHTML =  textemep + doc.getElementById("aprescal").innerHTML
               }  
            }  
         }
      } 
      var largetout = doc.getElementById("latable").offsetWidth
      try
         {
         if (doc.getElementById('photo').offsetWidth > largetout)
            {largetout = doc.getElementById('photo').offsetWidth}
         if ((top.cm.posPhoto == 3) || (top.cm.posPhoto == 4))
            {largetout = doc.getElementById('photo').offsetWidth + doc.getElementById('latable').offsetWidth}
         }
      catch (ex) {}   
      doc.getElementById("avantcal").style.width = "" + largetout +"px"
      doc.getElementById("aprescal").style.width = "" + largetout +"px"
      doc.getElementById("avantcal").style.textAlign = "center"
      doc.getElementById("aprescal").style.textAlign = "center"        
      doc.body.style.backgroundImage = "url(" + backgen + ")"
      cadrerObjets(doc)
   } 
   
function cadrerObjets(doc)
  {
      try
      {
      if (top.cm.calLeft != -1)
                       {doc.getElementById('latable').style.left = top.cm.calLeft
                        doc.getElementById('latable').style.top = top.cm.calTop}
      if (top.cm.texteLeft != -1)
         {if (top.cm.TexteS != "")
                
                       {doc.getElementById('texte').style.left = top.cm.texteLeft
                        doc.getElementById('texte').style.top = top.cm.texteTop}
         }
      if (top.cm.photoLeft != -1)
                       {doc.getElementById('photo').style.left = top.cm.photoLeft
                        doc.getElementById('photo').style.top = top.cm.photoTop}
      }
      catch (e) {}
  }   
   


function drawLigne(mois,year,libelmois)
  {
  numan = year
  nummois = parseInt(mois) 
  nummois++
  var text = ""
  var fontcase = '<FONT FACE="' + FontNameR + '" SIZE="' + cm.FontSize + '">'
  var openCol = '<TD HEIGHT=' + hdHeight + ' bgcolor="' + cm.ColorCase +    '"' + '><B>'
  openCol += '<FONT COLOR="' + hdColor + '" FACE="' + FontNameR + '" SIZE=' + cm.FontSize + '>'
  var closeCol = '</FONT></B></TD>\r'
  var titrerow = ""
  var typeVacances = "mois"
  var mepalign = ' align="' + cm.alih + '" valign="' + cm.aliv + '" '
  var colrow = "<tr><td height='" + cm.cellHeight + "' width='" + cm.colWidth + "' "  
  if (cm.nom_modele.substring(0,8) == "planning")  
     { if (glissant_typecal == "glissantpv")
          {titrerow = ' rowspan="' + (getDays(mois,year) +1) + '" width="' + cm.cellHeight + 'px"' }
       else
          {titrerow = ' colspan="' + (getDays(mois,year) +1) + '"' 
          typeVacances = "h"
          colrow = "<td "}
     } 
     else
     {if (cm.optzones == "")  {titrerow = ' colspan="3"'} else {titrerow = ' colspan="4"'}}
  if (cm.nom_modele != "colonne")
     {
     text += "<table bordercolor='#" + cm.ColorBord  +  "' cellPadding='" + cm.MargeInt + "' cellSpacing='0' border='" + (cm.TailleBord==0?0:1) + "' width='" + cm.colWidth + "'> \r"
     text += "<tr>"
     var libelcal = getMonthName(parseInt(mois)) + " " + year  
     text += '<td' + titrerow + ' align="center" valign="middle" style="overflow:hidden;cursor:pointer" title="Cliquer pour afficher le calendrier de ' + libelcal + '" '
     text += "onclick='top.drawCalouve(" + mois + "," + year + ",\"" + libelcal +  "\")'>" 
     text += '<font face="' + FontNameR +'" size="' + cm.FontSize + '" color="' + hrColor +'"><strong>' + libelmois + "</strong></font></td>"
     text += "</tr>\r"
     if (cm.nom_modele == "planningh") 
        {
        // retourLiseret = "<br>" 
        styleLiseret = "height:" + (parseInt (hauteurTexte/ 4) + 1) +"px;width:100%;font-size:" + (parseInt(hauteurTexte / 4) + 1) + "px;margin:2px 0px 0px 0px;display:block"
        text += "<tr>"} 
     }   
  var lastDate = getDays(mois,year)
  var calmmaa = "" + parseInt(mois) + "-" + year    
  var nowmmaa = "" + now.getMonth() + "-" + now.getFullYear()
  var compteur = 1
  for (var dayNum = 0; dayNum < lastDate; ++dayNum)
      {
      var dateCourante = new Date (year,mois,compteur)
      var fff = ""
      var vacances = ""
      var textevent = ""
      fetespec = ""
      if ((top.choixjd.document.location.pathname.indexOf("glissant") < 0) || (glissant_jours[dateCourante.getDay()] == true))
      {
      if (cm.nom_modele == "planningh")
         {textevent = rechevent(dateCourante,1)}
         else
         {vacances = mepzones(dateCourante,typeVacances)
         textevent = rechevent(dateCourante,3)}
      text += colrow + ' style="cursor:pointer;' + oncolorielacase() + '" ' 
      text += ' title="' + libevent + '" onclick="ouvrirmenu(event,' + year + ','+ mois +',' + compteur +  ')"' 
      var classejour = ' class="rien '  
      if (now.getDate() == compteur)
          { if (calmmaa == nowmmaa) {classejour = ' class="datejour '}}  
      text += classejour + annifete + '"'
      var alignJourSem = top.cm.alih   
      if (cm.nom_modele == "planningh") 
         {
         text += " valign='top'>" + textunjour(dateCourante,"h",textevent) + "</td>"
         alignJourSem = "center"
 	     }
 	     else
         {
         text +="><table style='height:" + cm.cellHeight + "px;" + oncolorieletexte() + "'><tr>"
         if (cm.optzones != "")
             {text +='<td' + mepalign + ' width="' + largeurVacances +'" style="margin:0px;padding:0px" nowrap >' + (vacances==""?"":vacances) + '</td>'}
         var casecontenu = ""  
	     if (cm.optfetes) 
	        {casecontenu +=  meptexte(getFete(mois,compteur-1))
	         if (textevent != "") {casecontenu += '<br>'}
	         }
	     casecontenu += textevent    
	     text +='<td  align="' + alignJourSem + '" width="' + largeurJourSem + '">' + fontcase + mepjourSemaine(dateCourante.getDay()) + closeCol + '</FONT></td>'
         text += '<td align="center" width="' + largeurCompteur + '">' + fontcase + mepjourbulle(dateCourante) + '</font></td>'
         text += '<td'  + mepalign +  ' width="' + largeurContenu  + '" style="margin:0px;padding:0px">' + mepliserets() + casecontenu + '</td></tr>'
 	     text += htmlevent
 	     text += "</table></td></tr>"
 	     }
	  }
  	  compteur++
      }
  if (cm.nom_modele != "colonne")
     {
     if (cm.nom_modele == "planningh") 
        {text += "</tr>"}    
     text += "</table>\r"
     }
  totaliselemois(nummois,year)   
  return text
  }
  
function mepjourbulle(dateC)
  {sjour = dateC.getDate()
  if (sjour < 10) {sjour = "&nbsp;"  + sjour}
  sjour =  "<b>" + sjour + "</b>"
  if (htmlbulle == "")
     {return  sjour }
     else
     {
     var t = "<a href='javascript:void(0)' class='jourinfo' style='width:" + largeurCompteur + ";" + oncolorieletexte() + "' title=''>" + sjour  
     t += "<div class='jourbulle'>"
     t += '&nbsp;&nbsp;' + jourSemaine[dateC.getDay()] + '&nbsp;' + sjour + '&nbsp;' + getMonthName(dateC.getMonth()) + '&nbsp;' + dateC.getFullYear() + '&nbsp;&nbsp;<br />'
     t += htmlbulle.replace(/<a/g,"<b").replace(/a>/g,"b>") + '<p style="text-align:center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cliquer pour modifier&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></div>'
     t += "</a>" 
     return t}
  } 
  
function mepjourSemaine(inds)
  {var textjoursemaine = ""
  if (cm.formatjour == 0)
      {textjoursemaine = jourSemaine[inds]}
      else
      {textjoursemaine = jourSemaine[inds].substring(0,cm.formatjour) }
  if (cm.cassejour == 0)
     {return textjoursemaine}
     else
     {return textjoursemaine.toUpperCase()}
  }
  
function mepliserets()
  {slises = ""
  if (suivinbliserets > 0)
     {slises = "&nbsp;" 
     for (nblises = 0;nblises < suivinbliserets;nblises++)
         {slises += "<span style='" + styleLiseret +";padding:0px;border:0px" 
          slises += ";background-color:" + suivicouleurliseret[nblises] + "' title=\"" + suivilibelleliseret[nblises] + "\">&nbsp;</span>" }
     // alert (slises)     
     }
  return slises   
  }  
   
  
function totaliselemois(mois,year)
  {if (cm.nom_modele == "") {return}
   if (cm.nom_modele == "colonne") {return}
   if (top.cm.GTSuivi.indexOf ("recap") > -1) 
      {var crapport = ""
      rapportp.init() 
      crapport = lire("NOTEP_" + year + "_MM_" + n2(mois), "")
      if (crapport != "") {lire_rapportp(crapport,"r")}
      }
  }  
  
function oncolorielacase()
  {
  if (suivicouleurcase != "")
     {return 'background-color:' + suivicouleurcase + ';color:' + suivicouleurtexte}
  if (cm.ColorCase != "")
     {return 'background-color:' + cm.ColorCase + ';color:' + ColorTexte } 
  if (cm.ColorFond != "")
     {return 'background-color:' + cm.ColorFond + ';color:' + ColorTexte }  
  if ((cm.CRepet > 3) && (annifete == 'rien'))
     {return 'background-image:url(' + cm.Image + ');' + cm.Repet + ';color:#000000'}
  }
  
function oncolorieletexte()
  {
    if (suivicouleurcase != "")
     {return 'color:' + suivicouleurtexte}
     else
     {return 'color:' + ColorTexte}
  
  }    
  
function textunjour(dateC,typeC,textevent)
  {
  largeurContenu = cm.colWidth
  var t = ""
  var mm2 = n2(dateC.getMonth()+1)
  var jj2 = n2(dateC.getDate()) 
  if (textevent != "") {textevent = '<br>' + textevent} 
  t += "<table width='" + cm.colWidth + "' height='" + cm.cellHeight + "' cellspacing='0' valign='center' style='" + oncolorieletexte() +  "'>" 
  var mepalign = ' align="' + cm.alih + '" '   
  if (cm.optzones != "")
     {var vacances = mepzones(dateC,typeC)
     t += "<tr><td colspan='2' width='100%' style='border-width:0;height:15px'>" +  (vacances==""?"&nbsp;":vacances) + "</td></tr>"}   
  if (cm.aliv == "bottom") {t += htmlevent + "<tr><td height='100%'></td></tr>"}
  if (typeC == "h" )
     {t += "<tr><td colspan='2'"  + mepalign + "style='border-width:0;height:1%;width:1%'>" + meptexte(mepjourSemaine(dateC.getDay()))  + "</td></tr>"}
  t += "<tr><td colspan='2'" + mepalign + "style='border-width:0;height:1%;width:1%''>" + "<FONT FACE='" + FontNameR + "' SIZE='" + cm.FontSize + "' COLOR='" + ColorTexte + "'>" +   mepjourbulle(dateC)  + mepliserets() + textevent + "</FONT></td></tr>" 
  if (cm.optfetes == true)  
     {t += "<tr><td colspan='2'" + mepalign + "style='border-width:0;height:1%'>" + meptexte(getFete(dateC.getMonth(),dateC.getDate()-1))  + "</td></tr>"}
   if (cm.aliv != "bottom") {t += htmlevent}
   if (cm.aliv == "top") {t +="<tr><td height='100%'></td></tr>"}
   
   t += "</table>"
    return t
  }  

function calWeek(sem,year)
  {
  top.cm = top.mois_modele
  initcalend()
  semcal = sem
  libperiode = "Semaine n° " + sem + " de " +  year
  top.calannee = year   
  typecal = "sem"
  debsem = new Date(year,00,01)
  var premjour = debsem.getDay()
  if (premjour == 0) {premjour = 7}
  var debjour = (sem*7)-5-premjour
  if (calnumweek(debsem) == 0) {debjour = debjour + 7}
  debsem.setDate(debjour) 
  finsem = new Date(year,00,01)
  finsem.setDate(debjour +7)
    var fontcase = '<FONT FACE="' + FontNameR + '" SIZE="' + cm.FontSize + '">'
    var text = debHTML('Calendrier hebdomadaire')
	text = '<TABLE id="latable"  style="position:relative;z-index:2000" '
    text += ' BORDER=' + cm.TailleBord + ' CELLSPACING=' + cm.MargeExt + ' CELLPADDING=' + cm.MargeInt + ' ' 
    if (cm.Image == "")
           {
           if (cm.ColorFond != '')
              {text += ' bgcolor="#' + cm.ColorFond + '"' }
           }
           else
           {if (cm.CRepet < 4)
              {text += ' background="' + cm.Image + '"' }}
    text += ' bordercolor="#' + cm.ColorBord + '">\r' 
    text += '<tr><td HEIGHT=' + hrHeight + '>'
    text += '<table width="100%" border="0">' 
    text += 	'<tr>'
    text += '<th align="left"' + semmoinsun(sem,debsem.getFullYear()) + '</th>'
    text += '<th onmousedown="drags(event,document.getElementById(\'latable\'))" onmouseup="fixerCal()" style="cursor:Move" title="Vous pouvez faire glisser le calendrier pour le positionner...">' 
	text += 		meptitre ('&nbsp;&nbsp;&nbsp;&nbsp;Semaine ' + sem + '&nbsp;&nbsp;&nbsp;&nbsp;')
	text += 		'</FONT>' // close table header's font settings
	text += '<th align="right"' + semplusun(sem,finsem.getFullYear()) + '</th>'
	text += 	'</th>'
	text += '</tr>\r'   
	text += '</table></td></tr>'
 
    for (var i = 0; i < 7;i++)
        {
        var jourDate = new Date (year,00,01)
        jourDate.setDate(debjour + i)
        fetespec = ""
        var textevent = rechevent(jourDate,1)
        text += '\r<tr><td'
		if (cm.ColorCase != "")
		   {text += ' bgcolor="' + cm.ColorCase + '"'}
		   else
		   {if (cm.CRepet > 3) {text += ' background="' + cm.Image + '"'}}
        text += ' onclick="ouvrirmenu(event,' + jourDate.getFullYear() + ','+ jourDate.getMonth() +',' + jourDate.getDate() +  ')" '  
        text += ' style="cursor:pointer" title="Cliquer pour afficher l\'agenda du ' + jourDate.getDate() + " " + getMonthName(jourDate.getMonth()) + '"'    
        text += '><table border="0" width="100%" style="' + oncolorielacase() + '">'    
        text += '<tr>'
        text += '<td colspan="3">' + mepzones(jourDate,"sem") + meptexte(jourSemaine[i+1] + ' ' + mepjourbulle(jourDate) + ' ' + getMonthName(jourDate.getMonth()) + ' ' + jourDate.getFullYear() + ' - ' + mepliserets() + getFete(jourDate.getMonth(),jourDate.getDate()-1)) + '</td></tr>' 
        text += htmlevent
        text += '</table></td></tr>'   
        }
    text += "<tr><td>" + meplibzones() + "</td></tr>"    
    text += '\r</TABLE>'
	return text

  }
  
  function meptitre(tt)
  {return '<FONT SIZE="' + (parseInt(cm.FontSize) + 3) + '" COLOR="' + hrColor + '">' + tt + '</FONT>'}
  
  function meptexte(tt)
  {// return '<FONT FACE="' + FontNameR + '" SIZE="' + cm.FontSize + '" COLOR="' + ColorTexte + '">' + tt + '</FONT>'}
  return '<FONT FACE="' + FontNameR + '" SIZE="' + cm.FontSize + '">' + tt + '</FONT>'}
  
  function meprapport(tt)
  {return '<font face="' + FontNameR + '" size="' + cm.FontSize + '" color="'  + hrColor +'">' + tt  + '</FONT>'}
  
  function mepsuivi(tt,stype)
  {
  if (stype == 'a')
     {return meptexte(tt)}
     else
     {return meprapport(tt)}
  }
  
  function mepentree(tt)
  {return tt.replace(RegRC,"<br>").replace(/{/g,"<").replace(/}/g,">")}
  
  function mepxml(entree)
  {
  var valeur = entree.replace(reget,"&amp;")
  valeur = valeur.replace(reggt,"}")
  return valeur.replace(reglt,"{")
  } 
  
  function semmoinsun(sem,year)
    {
    var dateprecedente = new Date(debsem.valueOf() - 84600)
    return ' title="Semaine précédente" style="cursor:pointer" onclick="top.calWeekouve(' + (calnumweek(dateprecedente)) + ',' + (dateprecedente.getFullYear()) + ')">' + meptitre('&nbsp;<<')
    }
  
  function semplusun(sem,year)
    {
    var datesuivante = new Date(finsem.valueOf() + 84600)
    return ' title="Semaine suivante" style="cursor:pointer" onclick="top.calWeekouve(' + (calnumweek(datesuivante)) + ',' + (datesuivante.getFullYear()) + ')">' + meptitre('>>&nbsp;')
   }
  function calWeekouve(nsem,nyear)
    {
    sem_num = nsem
    sem_year = nyear
    var a = window.open("mod_sem.htm","choixjd")
    }   
function unephoto(malargeur,mahauteur,madiv)
{
   var htmlphoto = ""
   if (madiv.getAttribute("photo") == "non") {return ""}
   if (cm.photo.indexOf ("<object") == 0)
      {return cm.photo}
   var titlephoto = ""
   var hautoularge = '" width="'
   var madimphoto = malargeur
   titlephoto += "Vous pouvez faire glisser la photo pour la positionner.\r "
   titlephoto += "Cliquez ci-dessus sur OPTIONS pour choisir une autre photo.\r "
   titlephoto += "Si la photo ne s\'affiche pas"
   titlephoto += ", cliquez sur Plan, Les calendriers, Photo, ..."
   htmlphoto += '<img border="0" src="'+ cm.photo + '" id="photo" '
   htmlphoto += 'style="position:relative;z-index:1000;cursor:Move'
   if (cm.lumPhoto != "")  {htmlphoto += ';' + opacitePhoto()}                                                              
   htmlphoto += '" onmousedown="drags(event,document.getElementById(\'photo\'))" onmouseup="fixerPhoto()"  '
   if (madiv.id == "danscal")
       {htmlphoto += ' onload="cadrerphoto(' + madiv.offsetHeight  + ',' + madiv.offsetWidth  + ')" '}
       else
       {
       if (fonctionphoto != "")
          {htmlphoto += ' onload="' + fonctionphoto + '" '}
       }
   if (mahauteur == 0)
      {}
      else
      if (malargeur == 0)
         {
         hautoularge = '" height="'
         madimphoto = mahauteur
         }
         else
         {
         if (cm.posPhoto == 1) {htmlphoto += ' align="left"'}
         if (cm.posPhoto == 2) {htmlphoto += ' align="center"'}
         if (cm.posPhoto == 3) {htmlphoto += ' align="right"'}
         }
   if (cm.wphoto != 100)
      {madimphoto = madimphoto / 100 * cm.wphoto  }
   if (cm.posPhoto == 6)
      {
      madimphoto += '" height="'
      if (cm.wphoto != 100)
          {madimphoto += mahauteur / 100 * cm.wphoto  }
          else
          {madimphoto += mahauteur}
      }
   htmlphoto += ' title="' + titlephoto + hautoularge + madimphoto +'" '
   htmlphoto += '>'
   if ((cm.wphoto > 109) & (cm.posPhoto == 6) & (cm.photo.indexOf("-motif")>2) & (top.choixjs.document.getElementById("nota").innerHTML == ""))
	   {top.choixjs.document.getElementById("nota").innerHTML = "<input type='button' value='Changer le cadre photo' onclick=\"window.top.choixjd.document.location.href='/photos/d_motifs.htm'\" />" }
   return htmlphoto
}

function opacitePhoto()
   {
   var optexte = 'opacity:0.' + cm.lumPhoto + ';'
   optexte += '-ms-filter:\'progid:DXImageTransform.Microsoft.Alpha(Opacity=' + cm.lumPhoto + '0)\';' 
   optexte += 'filter: alpha(opacity=' + cm.lumPhoto + '0)'
   return optexte
   }

function chargestyle(docu)
   {
   docu.body.style.backgroundImage = "url(" + backgen + ")"
   }
   
function debHTML(titre)
{
	var text = '<HTML>\r '
    text += '<head>\r ' 
    text  += '<TITLE>' + titre + '</TITLE>\r'
    if (titre != "Exportation")
       {
       text += '<script type="text/javascript"  src="js.js"></script> \r'
       text += '<STYLE> '
       text += stylepolice() + ' </STYLE>\r'
       text += '<link rel="stylesheet" href="options.css" type="text/css">\r'
       }
    return text
}

function stylepolice()
  { var text = ""
    cm.TexteFondR = cm.TexteFond  
    if (cm.CRepet > 3)
        {text += " TD {" + cm.Repet + " }  \r "}
        else
        {text += ' TABLE {background-repeat : ' + cm.Repet + ' ; background-position : center } \r ' }     
    if (cm.TexteFond.indexOf('__') > 0)  
       {
       cm.TexteFondR =  cm.TexteFond.substring(cm.TexteFond.indexOf('__') + 2,cm.TexteFond.length) 
       text += '@font-face { \r'
	   text += 'font-family:    ' + cm.TexteFond.substring(cm.TexteFond.indexOf('__') + 2,cm.TexteFond.length) + '; \r'
	   text += 'font-style:     normal; \r'
	   text += 'font-weight:    normal; \r'
	   text += 'src:            url(polices/' + cm.TexteFond.substring(0,cm.TexteFond.indexOf('__'))  + '.eot); \r'
       text += '     } '
       }
    FontNameR = cm.FontName   
    if (cm.FontName.indexOf('__') > 0) 
     {
     FontNameR = cm.FontName.substring(cm.FontName.indexOf('__') + 2,cm.FontName.length)
     if (cm.FontName != cm.TexteFond ) 
          {
       text += '@font-face { \r'
	   text += 'font-family:    ' + cm.FontName.substring(cm.FontName.indexOf('__') + 2,cm.FontName.length) + '; \r'
	   text += 'font-style:     normal; \r'
	   text += 'font-weight:    normal; \r'
	   text += 'src:            url(polices/' + cm.FontName.substring(0,cm.FontName.indexOf('__'))  + '.eot); \r'
       text += '     } '
          }
       }   
  return text
  }

function mepzones(datedujour,typecal)
{  largeurzones = 0
   if (cm.optzones == "")
       {return ""}
   if (datedujour < datezonesdeb)
       {return ""}
   if (datedujour > datezonesfin)
       {return ""}       
   var te = ""
   var jours = parseInt(((datedujour - datezonesdeb) / 86400000) + .1)
   var jzone = calzones.substring(jours,jours +1)
   var libzone = ""
   if (jzone > 0)
      {
      if ((jzone / 4) >= 1)
         {jzone = jzone - 4
         libzone = libzonec
         te=mepimgzone("c",typecal,libzone)}
      else
         {   te=mepimgzone("0",typecal,libzone) }
      if ((jzone / 2) >= 1)
         {jzone = jzone - 2
         libzone = libzoneb
         te=mepimgzone("b",typecal,libzone) + te} 
         else
         {    te=mepimgzone("0",typecal,libzone) + te }  
      if (jzone == 1)
         {libzone = libzonea
         te=mepimgzone("a",typecal,libzone) + te } 
         else
         {te=mepimgzone("0",typecal,libzone) + te } 
      }   
   if (te == "")
      {return "<font size='1'>&nbsp;</font>"}
   else   
      {return te}
}
function mepimgzone(typezone,typecal,liblib)
{ 
  var hautzone = "width='5' height='" + top.cm.cellHeight + "'"
  var libzz = ""
  var typimgzone = ""
  var span_dim = "width:5px;height:100%"
  if (typecal == "sem") 
     {hautzone = "width='5' height='20'"
      span_dim="width:5px;height:20px"}
     else
     {if (typecal == "h")  
     {typimgzone = "h"
     hautzone = "width='" + top.cm.cellWidth + "' height='5'"
     span_dim="width:100%;height:5px"}
      }
  if (typezone != "0") {libzz = ' title="Vacances scolaires pour la zone ' + typezone + ' : ' + liblib  + '"'} 
  if ((cm.optzones != "Toutes") && (cm.optzones != typezone))  
     {return ""}                    
  else   
      {
      if (cm.optzones == "Toutes") {indzonesscol = true}
	  if (typecal != "h") {largeurzones = largeurzones + 5}
	  // return  "<img src = 'gif/zone" + typezone + typimgzone + ".png' " + hautzone  + libzz +  ">" 
	  return "<img " + hautzone + " src='gif/zone" + typezone + typimgzone + ".png' style='" + span_dim + "' " + libzz + ">"
      }

}

function meplibzones ()
  {
  var t = ''
  var FonTSizeCopy =  Math.ceil((parseInt(top.cm.FontSize) - 0.6) / 2)
  var textcopyright = '<img src="gif/favicon16.png" border="0"><font face="Arial" size="' + FonTSizeCopy + '" color="' + top.hrColor + '"> Calendriers agendas : http://www.calagenda.fr/calendriers.htm</font>' 
  if ((top.cm.optzones == "Toutes") && (top.indzonesscol == true) && (typecal != "sem"))
     {
     t += '<font face="Arial" size="' + FonTSizeCopy + '" color="' + top.hrColor +'">' +  top.libzones + '</font><br>' 
     }
   var bullerapport = "Cliquer pour saisir une note ou un rapport périodique"
   var perioderapport = top.calannee + "_" + PrefixeNotes  
   if (SuffixeNotes != "") {perioderapport += "_" + SuffixeNotes} 
   rapportp.init()
   var crapport = ""
   if (top.cm.GTRapport != "")
      {  
      crapport = lire("NOTEP_" + perioderapport, "")
      if (crapport != "") {lire_rapportp(crapport,"r")}
      }
   if (crapport != "") 
      {if (top.cm.GTRapport == "resume")
         {bullerapport = "Cliquer pour afficher le détail des notes ou du rapport périodique"}  
         else
         {bullerapport = "Cliquer pour modifier les notes ou le rapport périodique"}
      }
   t += '<div title="' + bullerapport + '" style="cursor:pointer" onclick="onrapporte(event,\''  + perioderapport + "\',\'" + libperiode +  '\')">' + textcopyright  
   if (rapportp.f != "") 
      {t += "&nbsp;&nbsp;<a onclick='conflit=true;' href='" + rapportp.f + "' target='_blank' title='Cliquer pour ouvrir le fichier'><img src='gif/fichier.png' border='0'></a>"}
   var fontbas =    '<font face="' + top.FontNameR + '" size="' + top.cm.FontSize + '" color="' + top.hrColor +'">' 
   t += fontbas   
   if (rapportp.r != "")
      {t += "<br><strong>" + rapportp.r + "</strong>"}   
   if ((rapportp.t != "") && (top.cm.GTRapport != "resume"))
      {t += "<br>" + mepentree(rapportp.t) }
   var iacti = false
   var sacti = "<table align='center'>"
   sacti += "<tr><td colspan='4' align='center'><b>" + fontbas + "Récapitulatif des activités</font></b></td></tr>"
   sacti += "<tr><td></td>"
   sacti += "<td align='right'>" + fontbas + "Temps/nb/mt</font></td>"
   sacti += "<td align='right'>" + fontbas + "&nbsp;&nbsp;Lignes</font></td>"
   sacti += "<td align='right'>" + fontbas + "&nbsp;&nbsp;Moyenne</font></td></tr>" 
   for (var ia = 0; ia < suivinbactis;ia++)
       {if ( suivi_nb[ia] != 0)
           {iacti = true
           var tota = 0
           var stota = ""
           var moacti = ""
           if (suiviunite[ia] == 't')
              {// alert ("" + suivi_tj[ia] + "j " + suivi_th[ia] + "h " + suivi_tm[ia])
              tota = suivi_tj[ia] * (parseFloat("0" + suivi_jm[ia]) + (parseFloat("0" + suivi_jh[ia]) * 60))
              tota = tota + (suivi_th[ia] * 60)
              tota = tota + suivi_tm[ia]
              stota = meptemps(tota,ia)
              moacti = meptemps(parseFloat(tota/suivi_nb[ia]),ia)} 
              else
              {tota = parseFloat(suivi_tm[ia]) 
              stota = tota
              moacti = ("" + (Math.round(parseFloat(tota / suivi_nb[ia]) * 100) / 100)).replace(".",",")
              // alert (moacti) 
              // var svirgule = moacti.indexOf(".")
              // if ((svirgule > -1) && (moacti.length - svirgule > 3))
              }
           sacti += "<tr><td>" + fontbas + suivilibelle[ia] + "&nbsp;&nbsp;</font></td>"
           sacti += "<td align='right'>" + fontbas + stota + "</font></td>"
           sacti += "<td align='right'>" + fontbas + "&nbsp;&nbsp;" + suivi_nb[ia] + "</font></td>"
           sacti += "<td align='right'>" + fontbas + "&nbsp;&nbsp;" + moacti + "</font></td></tr>"
           }
       } 
   if (iacti == true)
       {
       sacti += "</table>"
       t += sacti
       }           
   t += "</font></div>" 
   return t   
  }
  
function meptemps(mt,ia)
 {
 var stota = ""
 jourm = ((parseFloat("0" + suivi_jh[ia]) * 60) + (parseFloat("0" + suivi_jm[ia]))) 
 var totj = Math.floor(mt / jourm)
 var totm = mt - (totj * jourm)
 // alert (suivilibelle[ia] + "=" + mt + "jourm=" + jourm ) 
 var toth = Math.floor(totm / 60)
 totm = Math.round(totm - (toth * 60))
 stota = "" + (totj==0 ? "": totj + "j ") + toth + "h " + totm + "mn" 
 return stota
 }  
  
  
function extxml(myxml,noeud)
  {
  var debxml = myxml.indexOf("<" + noeud + ">")
  var finxml = myxml.indexOf("/" + noeud + ">")
  if ((debxml == -1) || (finxml < debxml) )
     {return ""}
     else
     {return myxml.substring(debxml + 2 + noeud.length, myxml.indexOf("</" + noeud + ">"))}
  }
  
function comexemples(exempleversion)
  {
  var monurl = top.choixjd.document.location.href
  switch (top.cm.nom_fichier)
     {   
     case "mod_glissant.htm" : 
         if (monurl.indexOf("trimestre=1") > 0)
            {top.glissant_debmois = 0
            top.glissant_finmois = 2}
         if (monurl.indexOf("trimestre=2") > 0)
            {top.glissant_debmois = 3
            top.glissant_finmois = 5}
         if (monurl.indexOf("trimestre=3") > 0)
            {top.glissant_debmois = 6
             top.glissant_finmois = 8}
         if (monurl.indexOf("trimestre=4") > 0)
            {top.glissant_debmois = 9
             top.glissant_finmois = 11}
         break;
     case "mod_trimestre1.htm" :
        if (monurl.indexOf("trimestre=1") > 0) {top.cm.nom_fichier = "mod_trimestre1.htm"}
        if (monurl.indexOf("trimestre=2") > 0) {top.cm.nom_fichier = "mod_trimestre2.htm"}
        if (monurl.indexOf("trimestre=3") > 0) {top.cm.nom_fichier = "mod_trimestre3.htm"}
        if (monurl.indexOf("trimestre=4") > 0) {top.cm.nom_fichier = "mod_trimestre4.htm"}
        top.choixjs.document.choixjs.mois.value = top.cm.nom_fichier
        break;
     case "mod_scolaire2.htm" :
        if (monurl.indexOf("trimestre=1") > 0) {top.cm.nom_fichier = "mod_scolaire1.htm"}
        if (monurl.indexOf("trimestre=2") > 0) {top.cm.nom_fichier = "mod_scolaire2.htm"}
        if (monurl.indexOf("trimestre=3") > 0) {top.cm.nom_fichier = "mod_scolaire3.htm"}
        top.choixjs.document.choixjs.mois.value = top.cm.nom_fichier
        break;
     case "mod_semestre1.htm" :
        if (monurl.indexOf("semestre=1") > 0) {top.cm.nom_fichier = "mod_semestre1.htm"}
        if (monurl.indexOf("semestre=2") > 0) {top.cm.nom_fichier = "mod_semestre2.htm"}
        top.choixjs.document.choixjs.mois.value = top.cm.nom_fichier
        break;
     case "mod_semestre1a.htm" :
        if (monurl.indexOf("semestre=1") > 0) {top.cm.nom_fichier = "mod_semestre1a.htm"}
        if (monurl.indexOf("semestre=2") > 0) {top.cm.nom_fichier = "mod_semestre2a.htm"}
        top.choixjs.document.choixjs.mois.value = top.cm.nom_fichier
        break;
     case "mod_semestre1b.htm" :
        if (monurl.indexOf("semestre=1") > 0) {top.cm.nom_fichier = "mod_semestre1b.htm"}
        if (monurl.indexOf("semestre=2") > 0) {top.cm.nom_fichier = "mod_semestre2b.htm"}
        top.choixjs.document.choixjs.mois.value = top.cm.nom_fichier
        break;
     case "mod_semestre1p.htm" :
        if (monurl.indexOf("semestre=1") > 0) {top.cm.nom_fichier = "mod_semestre1p.htm"}
        if (monurl.indexOf("semestre=2") > 0) {top.cm.nom_fichier = "mod_semestre2p.htm"}
        top.choixjs.document.choixjs.mois.value = top.cm.nom_fichier
        break;
     case "mod_mois.htm" :
        if (top.choixjs.document.choixjs.mois.value.length > 3)
           {var nowmois = new Date()   
           top.choixjs.document.choixjs.mois.value = nowmois.getMonth()}
        break;
     } 
  var monannee = varurl_js(monurl,"annee")   
  // var monannee = monurl.indexOf("annee=2") 
  // if (monannee > -1)
  //    {top.choixjs.document.choixjs.annee.value = monurl.substring(monannee + 6 , monannee + 10 )}   
  if (monannee.length == 4)
     {top.choixjs.document.choixjs.annee.value = monannee} 
  var monmois = varurl_js(monurl,"mois")
  if (monmois != "")   
     {top.choixjs.document.choixjs.mois.value = (monmois -1)}
  if (exempleversion < 9 ) {top.cm.lumPhoto = ""}
  if (exempleversion < 10 ) 
     {top.cm.cassejour = 0
      if((top.cm.nom_modele =="" ) || (top.cm.nom_modele =="tableau" ) || (top.cm.nom_modele =="planningh" ))
        {top.cm.formatjour = 3}
        else
        {top.cm.formatjour = 1}
     }   
  window.top.nota = "cliquer sur Options pour personnaliser cet exemple,<br>ou pour le choisir comme modèle par défaut"
  window.top.choixjs.document.getElementById("nota").innerHTML = window.top.nota
  top.chargestyle(window.top.choixjs.document)
  var monadresse = top.cm.nom_fichier
  if (location.href.indexOf("calagenda.fr/") > -1) 
     {monadresse = "../../" + monadresse}
     else
     {top.cm.perso = true}
   if (typeNav == "IE")
     {window.open(monadresse,"choixjd","",true)}
     else
     {window.top.choixjd.document.location.href = monadresse}
  }

function meppictoagenda()
  {
  var spictoagenda = ""
  spictoagenda += '<a href="javascript:void(0)" class="infolien"'
  spictoagenda += 'onmouseover="chargerbulle(this,\'&nbsp;<br /><b>&nbsp;Pour changer la forme du pictogramme Agenda,<br>&nbsp;pour le calendrier actif,<br />&nbsp;cliquez sur le bouton Options ci-dessus,<br>&nbsp;et choisissez dans `Informations à afficher`.<br>&nbsp;Ce choix est spécifique à chaque type de calendrier.&nbsp;</b><br />&nbsp;\')">'
  spictoagenda += "pictogramme Agenda"
  try
     {if (top.cm.pictoagenda == "")
        {}
        else
        {spictoagenda += "&nbsp;<img src='gif/" + top.cm.pictoagenda + "' border='0'/>"}
     }
   catch (ex)
     {spictoagenda += "&nbsp;<img src='gif/event.gif' border='0'>"}  
   spictoagenda += '<span class="infobulle" style="display:none"></span></a>'
   return spictoagenda  
  } 

function varurl_js(urljs,varjs)
  {
  var debjs = urljs.indexOf("?" + varjs + "=")
  if (debjs == -1)
     {debjs = urljs.indexOf("&" + varjs + "=")}
  if (debjs == -1)
      {return ""}
  var finjs = urljs.indexOf("&", debjs + 2) 
  if (finjs == -1)       
      {finjs = urljs.length}
  return urljs.substring(debjs + varjs.length + 2, finjs)    
  }   


   


