var dDate = new Date(); var dCurMonth = dDate.getMonth(); var dCurDayOfMonth = dDate.getDate(); var dCurYear = dDate.getFullYear(); var objPrevElement = new Object(); function fToggleColor(myElement) { var toggleColor = "#ff0000"; if (myElement.id == "calDateText") { if (myElement.color == toggleColor) { myElement.color = ""; } else { myElement.color = toggleColor; } } else if (myElement.name == "calCell") { for (var i in myElement.children) { if (myElement.children[i].id == "calDateText") { if (myElement.children[i].color == toggleColor) { myElement.children[i].color = ""; } else { myElement.children[i].color = toggleColor; } } } } } function fSetSelectedDay(myElement){ if (myElement.name == "calCell") { if (!isNaN(parseInt(myElement.children["calDateText"].innerText))) { myElement.bgColor = "#c0c0c0"; objPrevElement.bgColor = ""; document.all.calSelectedDate.value = parseInt(myElement.children["calDateText"].innerText); objPrevElement = myElement; } } } function fGetDaysInMonth(iMonth, iYear) { var dPrevDate = new Date(iYear, iMonth, 0); return dPrevDate.getDate(); } function fBuildCal(iYear, iMonth, iDayStyle) { var aMonth = new Array(); aMonth[0] = new Array(7); aMonth[1] = new Array(7); aMonth[2] = new Array(7); aMonth[3] = new Array(7); aMonth[4] = new Array(7); aMonth[5] = new Array(7); aMonth[6] = new Array(7); var dCalDate = new Date(iYear, iMonth-1, 1); var iDayOfFirst = dCalDate.getDay(); var iDaysInMonth = fGetDaysInMonth(iMonth, iYear); var iVarDate = 1; var i, d, w; if (iDayStyle == 2) { aMonth[0][0] = "Sun"; aMonth[0][1] = "Mon"; aMonth[0][2] = "Tue"; aMonth[0][3] = "Wed"; aMonth[0][4] = "Thu"; aMonth[0][5] = "Fr"; aMonth[0][6] = "Sat"; } else if (iDayStyle == 1) { aMonth[0][0] = "Dim"; aMonth[0][1] = "Lun"; aMonth[0][2] = "Mar"; aMonth[0][3] = "Mer"; aMonth[0][4] = "Jeu"; aMonth[0][5] = "Ven"; aMonth[0][6] = "Sam"; } else { aMonth[0][0] = "Di"; aMonth[0][1] = "Lu"; aMonth[0][2] = "Ma"; aMonth[0][3] = "Me"; aMonth[0][4] = "Je"; aMonth[0][5] = "Ve"; aMonth[0][6] = "Sa"; } for (d = iDayOfFirst; d < 7; d++) { aMonth[1][d] = iVarDate; iVarDate++; } for (w = 2; w < 7; w++) { for (d = 0; d < 7; d++) { if (iVarDate <= iDaysInMonth) { aMonth[w][d] = iVarDate; iVarDate++; } } } return aMonth; } function fDrawCal(iYear, iMonth, iCellWidth, iCellHeight, sDateTextSize, sDateTextWeight,lang) { var myMonth; var iDayStyle = '1'; if (lang == 'en'){ iDayStyle = '2'; } myMonth = fBuildCal(iYear, iMonth, iDayStyle); document.write("") document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); for (w = 1; w < 7; w++) { document.write("") for (d = 0; d < 7; d++) { //document.write("") } document.write(""); } document.write("
" + myMonth[0][0] + "" + myMonth[0][1] + "" + myMonth[0][2] + "" + myMonth[0][3] + "" + myMonth[0][4] + "" + myMonth[0][5] + "" + myMonth[0][6] + "
"); document.write(""); if (!isNaN(myMonth[w][d])) { document.write("" + myMonth[w][d] + ""); } else { document.write(" "); } document.write("
") } function fDrawCal2(iYear, iMonth, lang){ fDrawCal(iYear,iMonth,30,30,"12px","bold",lang); } function fMarquerCelluleForum(an,mois,jour,info){ var idCellule = an+"-"+mois+"-"+jour; if (document.getElementById(idCellule)){ document.getElementById(idCellule).name='calCellForum'; document.getElementById(idCellule).bgColor='#9A8C83'; document.getElementById(idCellule).info=info; } } function fMarquerCelluleConcertation(an,mois,jour,info){ var idCellule = an+"-"+mois+"-"+jour; if (document.getElementById(idCellule)){ document.getElementById(idCellule).name='calCellConcertation'; document.getElementById(idCellule).bgColor='#E98400'; document.getElementById(idCellule).info=info; } } function fMarquerCellulePresentation(an,mois,jour,info){ var idCellule = an+"-"+mois+"-"+jour; if (document.getElementById(idCellule)){ document.getElementById(idCellule).name='calCellPresentation'; document.getElementById(idCellule).bgColor='#00927F'; document.getElementById(idCellule).info=info; } } function fOuvrirPage(cellule,lang){ if(cellule.name == 'calCellForum'){ document.location.href = 'index.jsp?page=acheminement-actualites-reunions&voir=forums&lang='+lang; } else if(cellule.name == 'calCellConcertation'){ document.location.href = 'index.jsp?page=acheminement-actualites-reunions&voir=concertations&lang='+lang; } else if(cellule.name == 'calCellPresentation'){ document.location.href = 'index.jsp?page=acheminement-actualites-reunions&voir=presentations&lang='+lang; } } function fAfficherInfoReunion(info,couleur){ if (info != null && couleur!=null){ document.getElementById('infoReunion').value = info; document.getElementById('infoReunion').style.backgroundColor = couleur; } else { document.getElementById('infoReunion').value = ''; document.getElementById('infoReunion').style.backgroundColor = '#000000'; } } function updateCal(_mois,calendrier){ var cals = getElementsByName_iefix('div', calendrier); if (cals != null){ for (i=0; i