var DateExtension={version:"1.4"};Date.prototype.dayname=["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"];Date.prototype.monthname=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"];Date.prototype.clone=function(){return(new Date(this.getTime()));};Date.prototype.incMin=function(i){this.setTime(this.getTime()+(($defined(i)?i:1)*60000));return(this);};Date.prototype.decMin=function(i){this.setTime(this.getTime()-(($defined(i)?i:1)*60000));return(this);};Date.prototype.incHour=function(i){this.setTime(this.getTime()+(($defined(i)?i:1)*3600000));return(this);};Date.prototype.decHour=function(i){this.setTime(this.getTime()-(($defined(i)?i:1)*3600000));return(this);};Date.prototype.incDay=function(i){this.setTime(this.getTime()+(($defined(i)?i:1)*86400000));return(this);};Date.prototype.decDay=function(i){this.setTime(this.getTime()-(($defined(i)?i:1)*86400000));return(this);};Date.prototype.incWeek=function(i){this.setTime(this.getTime()+(($defined(i)?i:1)*604800000));return(this);};Date.prototype.decWeek=function(i){this.setTime(this.getTime()-(($defined(i)?i:1)*604800000));return(this);};Date.prototype.incMonth=function(){if(this.getMonth()==11){this.setFullYear(this.getFullYear()+1,0);}else{this.setMonth(this.getMonth()+1);}return(this);};Date.prototype.decMonth=function(){if(this.getMonth()==0){this.setFullYear(this.getFullYear()-1,11);}else{this.setMonth(this.getMonth()-1);}return(this);};Date.prototype.dayInMonth=function(){var tmp=new Date(this.getTime());tmp.incMonth();tmp.setDate(1);tmp.decDay();return(tmp.getDate());};Date.prototype.weekInYear=function(){var tmp=[1,0,-1,-2,-3,3,2];var nd=new Number((this.getTime()-new Date(this.getFullYear(),0,1).getTime())/86400000).toFixed(0);nd++;nd-=tmp[new Date(this.getFullYear(),0,1).getDay()];return(Math.ceil(nd/7));};Date.prototype.firstDayOfWeek=function(){i=this.getDay();return(this.decDay((i==0?6:i-1)));};Date.prototype.firstDayOfMonth=function(){tmp=new Date(this.getTime());tmp.setDate(1);return(tmp.getDay());};Date.prototype.compare=function(d){return(this.getTime()-d.getTime());};Date.prototype.dayInitial=function(size){return(this.dayname[this.getDay()].substr(0,($defined(size)?size:1)));};Date.prototype.monthInitial=function(size){return(this.monthname[this.getMonth()].substr(0,($defined(size)?size:1)));};Date.prototype.dateFromStr=function(str,h,m){h=($defined(h)?h:0);m=($defined(m)?m:0);this.setMinutes(m);this.setHours(h);this.setYear(str.substr(6,4));this.setMonth(Number(str.substr(3,2))-1,Number(str.substr(0,2)));return(this);};Date.prototype.timeFromStr=function(str){m=0;h=0;s=0;if(ret=str.match(/^(\d{1,3}):(\d{2}):(\d{2})$/)){h=Number(ret[1]);m=Number(ret[2]);s=Number(ret[3]);}else{if(ret=str.match(/^(\d{2}):(\d{2})$/)){m=Number(ret[1]);s=Number(ret[2]);}}this.setMinutes(m);this.setHours(h);this.setSeconds(s);return(this);};Date.prototype.formatDate=function(enclair){if(enclair!=undefined){return(this.dayname[this.getDay()]+" "+this.getDate()+" "+this.monthname[this.getMonth()]+" "+this.getFullYear());}return((this.getDate()<10?"0":"")+this.getDate()+"/"+(this.getMonth()<9?"0":"")+(this.getMonth()+1)+"/"+this.getFullYear());};Date.prototype.formatTime=function(full){if(full!=undefined){return((this.getHours()<10?"0":"")+this.getHours()+":"+(this.getMinutes()<10?"0":"")+this.getMinutes()+":"+(this.getSeconds()<10?"0":"")+this.getSeconds());}return((this.getHours()<10?"0":"")+this.getHours()+":"+(this.getMinutes()<10?"0":"")+this.getMinutes());};
