YAHOO.namespace("geny");YAHOO.geny.calGeny=function(C,A,B){YAHOO.geny.calGeny.superclass.constructor.call(this,C,A,B)};YAHOO.lang.extend(YAHOO.geny.calGeny,YAHOO.widget.Calendar);var DEF_CFG=YAHOO.widget.Calendar._DEFAULT_CONFIG;YAHOO.widget.Calendar.prototype.renderHeader=function(D){var G=7,E="us/tr/callt.gif",F="us/tr/calrt.gif",H=this.cfg,J,K=false,A=H.getProperty(DEF_CFG.NAV_ARROW_LEFT.key),B=(A===null)?"":' style="background-image:url('+A+')"',C=H.getProperty(DEF_CFG.NAV_ARROW_RIGHT.key),I=(C===null)?"":' style="background-image:url('+C+')"';if(H.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key)){G+=1}if(H.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key)){G+=1}D[D.length]="<thead>";D[D.length]='<tr><th colspan="'+G+'" height="10"></th></tr>';D[D.length]='<tr valign="middle">';D[D.length]='<th colspan="'+G+'" class="'+this.Style.CSS_HEADER_TEXT+'">';D[D.length]='<div class="'+this.Style.CSS_HEADER+'">';if(this.parent){if(this.index===0){J=true}if(this.index===(this.parent.cfg.getProperty("pages")-1)){K=true}}else{J=true;K=true}if(J){D[D.length]='<a class="anneePrec" title="'+YAHOO.geny.l10n.AnneePrecedente+'">&#160;</a>';if(A===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){A=YAHOO.widget.Calendar.IMG_ROOT+E}D[D.length]='<a class="'+this.Style.CSS_NAV_LEFT+'"'+B+' title="'+YAHOO.geny.l10n.MoisPrecedent+'">&#160;</a>'}D[D.length]=this.buildMonthLabel();if(K){D[D.length]='<a class="anneeSuiv" title="'+YAHOO.geny.l10n.AnneeSuivante+'">&#160;</a>';if(C===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){C=YAHOO.widget.Calendar.IMG_ROOT+F}D[D.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'"'+I+' title="'+YAHOO.geny.l10n.MoisSuivant+'">&#160;</a>'}D[D.length]="</div>\n</th>\n</tr>";if(H.getProperty(DEF_CFG.SHOW_WEEKDAYS.key)){D=this.buildWeekdays(D)}D[D.length]="</thead>";return D};YAHOO.widget.Calendar.prototype.render=function(){var A=YAHOO.util.Event,C=YAHOO.util.Dom,D=YAHOO.widget.DateMath,E=D.findMonthStart(this.cfg.getProperty(DEF_CFG.PAGEDATE.key)),B=[];this.beforeRenderEvent.fire();this.resetRenderers();this.cellDates.length=0;A.purgeElement(this.oDomContainer,true);B[B.length]='<table style="width:100%" cellSpacing="0" class="'+this.Style.CSS_CALENDAR+" y"+(E.getFullYear()+this.Locale.YEAR_OFFSET)+'" id="'+this.id+'">';B=this.renderHeader(B);B=this.renderBody(E,B);B=this.renderFooter(B);B[B.length]="</table>";this.oDomContainer.innerHTML=B.join("\n");this.applyListeners();this.cells=C.getElementsByClassName(this.Style.CSS_CELL,"td",this.id);this.cfg.refireEvent(DEF_CFG.TITLE.key);this.cfg.refireEvent(DEF_CFG.CLOSE.key);this.cfg.refireEvent(DEF_CFG.IFRAME.key);this.renderEvent.fire()};YAHOO.geny.calGeny.prototype.applyListenersForYears=function(){var A=this.oDomContainer,D,C,B;D=this.parent||this;C=YAHOO.util.Dom.getElementsByClassName("anneePrec","a",A);B=YAHOO.util.Dom.getElementsByClassName("anneeSuiv","a",A);if(C){this.linkLeftYear=C[0];YAHOO.util.Event.addListener(this.linkLeftYear,"mousedown",D.previousYear,D,true)}if(B){this.linkRightYear=B[0];YAHOO.util.Event.addListener(this.linkRightYear,"mousedown",D.nextYear,D,true)}};YAHOO.geny.calGeny.prototype.applyListeners=function(){var I=this.oDomContainer,B,F,C,D,A,K,G,E,J,H;B=this.parent||this;F=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT,"a",I);C=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT,"a",I);if(F){this.linkLeft=F[0];YAHOO.util.Event.addListener(this.linkLeft,"mousedown",B.previousMonth,B,true)}if(C){this.linkRight=C[0];YAHOO.util.Event.addListener(this.linkRight,"mousedown",B.nextMonth,B,true)}this.applyListenersForYears();if(this.domEventMap){for(K in this.domEventMap){if(YAHOO.lang.hasOwnProperty(this.domEventMap,K)){G=this.domEventMap[K];if(!(G instanceof Array)){G=[G]}for(E=0;E<G.length;E++){J=G[E];A=YAHOO.util.Dom.getElementsByClassName(K,J.tag,this.oDomContainer);for(H=0;H<A.length;H++){D=A[H];YAHOO.util.Event.addListener(D,J.event,J.handler,J.scope,J.correct)}}}}}YAHOO.util.Event.addListener(this.oDomContainer,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this)};YAHOO.widget.Calendar.prototype.renderCellDefault=function(B,A){A.innerHTML='<a href="#" >'+this.buildDayLabel(B)+"</a>"};function addDays(B,A){return new Date(B.getTime()+(1000*60*60*24*A))}function redirect(A,B,C){if(B<10){B="0"+B}if(C<10){C="0"+C}YAHOO.geny.cal.clear();YAHOO.geny.cal.hide();var D="/"+nomHandler+"?date="+A+"-"+B+"-"+C;window.location.href=D}function handleSelect(E,C,H){var G=C[0],B=G[0],A=B[0],D=B[1],F=B[2];redirect(A,D,F)}function hier(){var A=addDays(YAHOO.geny.cal.today,-1);redirect(A.getFullYear(),A.getMonth()+1,A.getDate())}function aujourdhui(){var A=YAHOO.geny.cal.today;redirect(A.getFullYear(),A.getMonth()+1,A.getDate())}function demain(){var A=addDays(YAHOO.geny.cal.today,1);redirect(A.getFullYear(),A.getMonth()+1,A.getDate())}function init(){var B,A;YAHOO.geny.cal=new YAHOO.geny.calGeny("cal","calContainer",{close:true});if(language==="en"){YAHOO.geny.cal.cfg.setProperty("DATE_FIELD_DELIMITER","/");YAHOO.geny.cal.cfg.setProperty("MDY_DAY_POSITION",2);YAHOO.geny.cal.cfg.setProperty("MDY_MONTH_POSITION",1);YAHOO.geny.cal.cfg.setProperty("MDY_YEAR_POSITION",3);YAHOO.geny.cal.cfg.setProperty("MD_DAY_POSITION",2);YAHOO.geny.cal.cfg.setProperty("MD_MONTH_POSITION",1);YAHOO.geny.cal.cfg.setProperty("START_WEEKDAY",1);YAHOO.geny.cal.cfg.setProperty("STRINGS",{previousMonth:"YAHOO.geny.l10n.MoisPrecedent",nextMonth:"YAHOO.geny.l10n.MoisSuivant",close:""})}else{YAHOO.geny.cal.cfg.setProperty("DATE_FIELD_DELIMITER","/");YAHOO.geny.cal.cfg.setProperty("MDY_DAY_POSITION",1);YAHOO.geny.cal.cfg.setProperty("MDY_MONTH_POSITION",2);YAHOO.geny.cal.cfg.setProperty("MDY_YEAR_POSITION",3);YAHOO.geny.cal.cfg.setProperty("MD_DAY_POSITION",1);YAHOO.geny.cal.cfg.setProperty("MD_MONTH_POSITION",2);YAHOO.geny.cal.cfg.setProperty("START_WEEKDAY",1);YAHOO.geny.cal.cfg.setProperty("STRINGS",{previousMonth:"YAHOO.geny.l10n.MoisPrecedent",nextMonth:"YAHOO.geny.l10n.MoisSuivant",close:""})}YAHOO.geny.cal.cfg.setProperty("MONTHS_SHORT",[YAHOO.geny.l10n.JanvierCourt,YAHOO.geny.l10n.FevrierCourt,YAHOO.geny.l10n.MarsCourt,YAHOO.geny.l10n.AvrilCourt,YAHOO.geny.l10n.MaiCourt,YAHOO.geny.l10n.JuinCourt,YAHOO.geny.l10n.JuilletCourt,YAHOO.geny.l10n.AoutCourt,YAHOO.geny.l10n.SeptembreCourt,YAHOO.geny.l10n.OctobreCourt,YAHOO.geny.l10n.NovembreCourt,YAHOO.geny.l10n.DecembreCourt]);YAHOO.geny.cal.cfg.setProperty("MONTHS_LONG",[YAHOO.geny.l10n.Janvier,YAHOO.geny.l10n.Fevrier,YAHOO.geny.l10n.Mars,YAHOO.geny.l10n.Avril,YAHOO.geny.l10n.Mai,YAHOO.geny.l10n.Juin,YAHOO.geny.l10n.Juillet,YAHOO.geny.l10n.Aout,YAHOO.geny.l10n.Septembre,YAHOO.geny.l10n.Octobre,YAHOO.geny.l10n.Novembre,YAHOO.geny.l10n.Decembre]);YAHOO.geny.cal.cfg.setProperty("WEEKDAYS_1CHAR",[YAHOO.geny.l10n.DimancheChar,YAHOO.geny.l10n.LundiChar,YAHOO.geny.l10n.MardiChar,YAHOO.geny.l10n.MercrediChar,YAHOO.geny.l10n.JeudiChar,YAHOO.geny.l10n.VendrediChar,YAHOO.geny.l10n.SamediChar]);YAHOO.geny.cal.cfg.setProperty("WEEKDAYS_SHORT",[YAHOO.geny.l10n.DimancheCourt,YAHOO.geny.l10n.LundiCourt,YAHOO.geny.l10n.MardiCourt,YAHOO.geny.l10n.MercrediCourt,YAHOO.geny.l10n.JeudiCourt,YAHOO.geny.l10n.VendrediCourt,YAHOO.geny.l10n.SamediCourt]);YAHOO.geny.cal.cfg.setProperty("WEEKDAYS_MEDIUM",[YAHOO.geny.l10n.DimancheMedium,YAHOO.geny.l10n.LundiMedium,YAHOO.geny.l10n.MardiMedium,YAHOO.geny.l10n.MercrediMedium,YAHOO.geny.l10n.JeudiMedium,YAHOO.geny.l10n.VendrediMedium,YAHOO.geny.l10n.SamediMedium]);YAHOO.geny.cal.cfg.setProperty("WEEKDAYS_LONG",[YAHOO.geny.l10n.Dimanche,YAHOO.geny.l10n.Lundi,YAHOO.geny.l10n.Mardi,YAHOO.geny.l10n.Mercredi,YAHOO.geny.l10n.Jeudi,YAHOO.geny.l10n.Vendredi,YAHOO.geny.l10n.Samedi]);B=document.getElementById("selectedDateValue").value;YAHOO.geny.cal.select(B);A=YAHOO.geny.cal.getSelectedDates()[0];YAHOO.geny.cal.cfg.setProperty("pagedate",(A.getMonth()+1)+"/"+A.getFullYear());YAHOO.geny.cal.selectEvent.subscribe(handleSelect,YAHOO.geny.cal,true);YAHOO.geny.cal.render();YAHOO.util.Event.addListener("selectedDateLink","click",YAHOO.geny.cal.show,YAHOO.geny.cal,true);YAHOO.util.Event.addListener("hier","click",hier,YAHOO.geny.cal,true);YAHOO.util.Event.addListener("aujourdhui","click",aujourdhui,YAHOO.geny.cal,true);YAHOO.util.Event.addListener("demain","click",demain,YAHOO.geny.cal,true)}YAHOO.util.Event.onAvailable("selectedDateLink",init);
