Pb calendrier XP javascript

Pb calendrier XP javascript - HTML/CSS - Programmation

Marsh Posté le 03-08-2005 à 11:28:40    

Bonjour voila j'ai un calendrier MOD javascript XP qui marche trés bien sous firefox , qui marche aussi tres bien tous seul sous Ie mais des que je le met dans mon code j'ai une erreur objet sous IE (gdCtrl n'est pas un objet) dc je comprend plus rien sa marche sous firefox avec mon code  et le code d'origine marche nikel sous IE  
donc que faire lol  
je vous met le code genere la page  

Code :
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3.   <head>
  4.   <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  5.   <meta name="generator" content="PSPad editor, www.pspad.com">
  6.   <link rel="stylesheet" href="ged.css" type="text/css">
  7.   <script type="text/javascript" src="ged.js"></script>
  8.   <title></title>
  9.   </head>
  10.   <body>
  11.   <div id="recherche" style="visibility:visible;">
  12. <table align='center' class='center_haut' cellspacing="0" cellpadding="0" width="800" border="0">
  13. <tr><td class="titre_haut" colspan="3">Gestion Documentaire</td></tr>
  14. <tr><td class="titremenu_haut"><a class="titremenu" href="index.php">Accueil</a></tD>
  15. <td class="titremenu_haut"><a class="titremenu" href="index.php?op=administration">Administration</a></td>
  16. <td class="titremenu_haut"><a class="titremenu" href="index.php?op=aide">Aide</a></td></tr>
  17. </table>
  18. <br>
  19. <FORM name="demoform" method="post" action="index.php?op=resultat">
  20. <table class="recherche_milieu" width="800" align="center" cellspacing="0" cellpadding="0">
  21. <tr><td class="titre_haut2">Recherche</td></tr>
  22. <tr><td class="recherche">&nbsp;Titre&nbsp;:&nbsp;<input type="text" name="titre" size="35">&nbsp;&nbsp;Domaine&nbsp;:&nbsp;<select name="domaine" onChange="affiche_spe()">
  23. <option value="0"></option>
  24. <option value=Informatique>Informatique</option>
  25. <option value=Juridique>Juridique</option>
  26. </select>
  27. </td></tr>
  28. <tr><td class="recherche">
  29. &nbsp;Date: <input name="date" value="" size="20"><a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(document.demoform.date);return false;" HIDEFOCUS><img name="popcal" align="absmiddle" src="WeekPicker/calbtn.gif" width="34" height="22" border="0" alt=""></a>
  30. <iframe width=199 height=178 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="WeekPicker/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
  31. </iframe></td></tr>
  32. <tr><td class="recherche">&nbsp;Mot cl&eacute;s:&nbsp;&nbsp;&nbsp;&nbsp;ET&nbsp;
  33. <input type="checkbox" name="et" onclick="choixcheckbox()">
  34. &nbsp;OU&nbsp;<input type="checkbox" name="ou" onclick="choixcheckbox()"><div class="liaison">***Cliquer sur  l&#39;
  35. ic&ocirc;ne pour choisir un mot cl&eacute;s , remplir les cases de gauche &agrave; droite</div><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="cles0" value="" size="10"><a onClick=" return Verifier_cles('cles0')"  href="javascript:OuvrirFenetre('cles/cles.php?cles=cles0','popup','resizable=no, location=no, width=550, height=300, menubar=no, status=no, left=320,top=500')" ><img  name="popcal" align="absmiddle" src="WeekPicker/metal.ico" width="34" height="22" border="0" alt=""></a>
  36. <input name="cles1" value="" size="10"><a onClick=" return Verifier_cles('cles1')"  href="javascript:OuvrirFenetre('cles/cles.php?cles=cles1','popup','resizable=no, location=no, width=550, height=300, menubar=no, status=no, left=320,top=500')" ><img  name="popcal" align="absmiddle" src="WeekPicker/metal.ico" width="34" height="22" border="0" alt=""></a>
  37. <input name="cles2" value="" size="10"><a onClick=" return Verifier_cles('cles2')"  href="javascript:OuvrirFenetre('cles/cles.php?cles=cles2','popup','resizable=no, location=no, width=550, height=300, menubar=no, status=no, left=320,top=500')" ><img  name="popcal" align="absmiddle" src="WeekPicker/metal.ico" width="34" height="22" border="0" alt=""></a>
  38. <input name="cles3" value="" size="10"><a onClick=" return Verifier_cles('cles3')"  href="javascript:OuvrirFenetre('cles/cles.php?cles=cles3','popup','resizable=no, location=no, width=550, height=300, menubar=no, status=no, left=320,top=500')" ><img  name="popcal" align="absmiddle" src="WeekPicker/metal.ico" width="34" height="22" border="0" alt=""></a>
  39. <input name="cles4" value="" size="10"><a onClick=" return Verifier_cles('cles4')"  href="javascript:OuvrirFenetre('cles/cles.php?cles=cles4','popup','resizable=no, location=no, width=550, height=300, menubar=no, status=no, left=320,top=500')" ><img  name="popcal" align="absmiddle" src="WeekPicker/metal.ico" width="34" height="22" border="0" alt=""></a>
  40. <br><br></td></tr>
  41. <tr><td align="center" class="recherche"><div id="bouton" style="visibility:visible;"><input name="bouton" type="submit" value="Rechercher"></div></tr></tD>
  42. </table><br>
  43. <DIV id="juridique" style="visibility:hidden;position:fixed;">
  44. <table name="juridique"  cellspacing="0" align="center" width="800" cellpadding="0" class="recherche_milieu">
  45. <tr><td class="recherche">&nbsp;Nature du texte&nbsp;:&nbsp;<select name="nature_texte">
  46. <option value=""></option>
  47. <option value=1>Loi</option>
  48. <option value=2>Ordonnance</option>
  49. </select>
  50. &nbsp;&nbsp;&nbsp;</td>
  51. <td>&nbsp;Num&eacute;ro du texte&nbsp;:&nbsp;<input type="text" size="20" name="numero_text"></td></tr>
  52. <tr><td class="recherche">
  53. &nbsp;Date de publication:<input name="dp" value="" size="20"><a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(document.demoform.dp);return false;" HIDEFOCUS><img name="popcal" align="absmiddle" src="WeekPicker/calbtn.gif" width="34" height="22" border="0" alt=""></a>
  54. <iframe width=199 height=178 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="WeekPicker/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
  55. </iframe>
  56. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>
  57. &nbsp;Date de cr&eacute;ation: <input name="dcp" value="" size="20"><a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(document.demoform.dcp);return false;" HIDEFOCUS><img name="popcal" align="absmiddle" src="WeekPicker/calbtn.gif" width="34" height="22" border="0" alt=""></a>
  58. <!--  PopCalendar(tag name and id must match) Tags should not be enclosed in tags other than the html body tag. -->
  59. <iframe width=199 height=178 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="WeekPicker/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
  60. </iframe></td></tr><tr><td align="center" class="recherche" colspan="2"><input type="submit" value="Rechercher"></tr></td>
  61. </table><br>
  62. </DIV>
  63. <DIV id="informatique" style="visibility:hidden;position:absolute;">
  64. <table name="informatique"  cellspacing="0" align="center" width="800" cellpadding="0" class="recherche_milieu"><tr><td class="recherche">&nbsp;Natures du texte&nbsp;:&nbsp;<select name="nature_texte">
  65. <option value=""></option>
  66. <option value=1>Loi</option>
  67. <option value=2>Ordonnance</option>
  68. </select>
  69. </td></tr><tr><td class="recherche">&nbsp;Num&eacute;ro du texte&nbsp;:&nbsp;<input type="text" size="20" name="numero_text2"></td></tr><tr><td class="recherche">
  70. &nbsp;Date de publication: <input name="dc" value="" size="20"><a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(document.demoform.dc);return false;" HIDEFOCUS><img name="popcal" align="absmiddle" src="WeekPicker/calbtn.gif" width="34" height="22" border="0" alt=""></a>
  71. <!--  PopCalendar(tag name and id must match) Tags should not be enclosed in tags other than the html body tag. -->
  72. <iframe width=199 height=178 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="WeekPicker/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
  73. </iframe></td></tr></table>
  74. <br></FORM>
  75. </DIV>
  76. </div>
  77.   </body>
  78. </html>


 
Le code du calendrie en javascript
l'erreur est ligne 134 pour IE lol

Code :
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <title>PopCalendarXP 9.4.265 Lite Edition - Copyright 2003-2005 Idemfactor Solutions, Inc.</title>
  5. <script id='dynaScript' type='text/javascript'></script>
  6. <script type='text/javascript'>
  7. // WARNING: Do NOT make any modification to this file, and do NOT use this file in any commercial website or product.
  8. // You must purchase Commercial Licensed Edition for such purposes, otherwise it'll get yourself into a lawsuit eventually.
  9. var gd=new Date(), gToday=[gd.getFullYear(),gd.getMonth()+1,gd.getDate()];
  10. var ua=navigator.userAgent.toLowerCase();
  11. var KO=ua.match(/konqueror\/(\d+)/),KO3=KO&&KO[1]==3,SA=ua.match(/safari\/(\d+)/),SA1=SA&&SA[1]<86; KO=!!KO; SA=!!SA;
  12. var MAC=/mac/.test(ua),OP=!!self.opera,WEBTV=/webtv/.test(ua),IE=/msie/.test(ua)&&!OP&&!WEBTV&&!SA&&!KO,GK=/gecko/.test(ua),OP8=/opera 8/.test(ua)&&OP;
  13. var NN4=IE4=NS6=false,IE5=IE&&![].push&&!IE4;
  14. var gfSelf=fGetById(parent.document,self.name);
  15. var gTheme=self.name.split(":" );
  16. var gCurMonth=eval(gTheme[0]); gCurMonth=fCalibrate(gCurMonth[0],gCurMonth[1]);
  17. var gContainer=parent,gDays=[31,31,28,31,30,31,30,31,31,30,31,30,31];
  18. var fOnResize,fRepaint,fHoliday,fOnChange,fAfterSelected,fOnDrag,gcOtherDayBG,fOnWeekClick,fIsSelected,fParseInput,fFormatInput,fOnDoWClick,fOnload;
  19. var __agenda=[], popkey=["Lite"], flatkey=["Lite"], __stub=[];
  20. var MILLIDAY=86400000, giInitDelay=200, _lineThru=true, _noBound=false, _mcafee=false, _animPop=NN4||IE&&!IE4&&!MAC, _animInt=20, _preferOOR=true;
  21. if (![].push) Array.prototype.push=function () {
  22. for (var i=0; i<arguments.length; i++)
  23.  this[this.length]=arguments[i];
  24. return this.length;
  25. }
  26. function varDate() {
  27. alert("Missing or invalid licence for PopCalendarXP!\nPlease make sure the licence file is in the right place." );
  28. }
  29. function fCalibrate(y,m) {
  30. if (m<1) { y--; m+=12; }
  31. else if (m>12) { y++; m-=12; }
  32. return [y,m];
  33. }
  34. function fGetById(doc, id) {
  35. return doc.getElementById(id);
  36. }
  37. function fLoadScript(url) {
  38. if (!(IE4||IE&&MAC)) fGetById(document, "dynaScript" ).src=url;
  39. }
  40. function fFilterNull(str) {
  41. return str==null||str=="null"?null:str;
  42. }
  43. function fAddEvent(y,m,d,message,action,bgcolor,fgcolor,bgimg,boxit,html,etc) {
  44. var ag=gbShareAgenda?eval(gsAgShared):__agenda;
  45. ag[y+"-"+m+"-"+d]=[message,fFilterNull(action),fFilterNull(bgcolor),fFilterNull(fgcolor),fFilterNull(bgimg),fFilterNull(boxit),fFilterNull(html),etc];
  46. }
  47. function fGetEvent(y,m,d) {
  48. var ag=gbShareAgenda?eval(gsAgShared):__agenda, id=y+"-"+m+"-"+d;
  49. return ag[id]?ag[id].slice(0):null;
  50. }
  51. function fRemoveEvent(y,m,d) {
  52. var ag=gbShareAgenda?eval(gsAgShared):__agenda;
  53. ag[y+"-"+m+"-"+d]=null;
  54. }
  55. function fWeekOffset(dow) {
  56. return dow<=3?1:0;
  57. }
  58. function fGetDays(y) {
  59. gDays[2]=y%4==0&&y%100!=0||y%400==0?29:28;
  60. return gDays;
  61. }
  62. document.write("<scr"+"ipt type='text/javascript' src='"+gTheme[1]+".js'></scr"+"ipt>" );
  63. document.write("<lin"+"k rel='stylesheet' type='text/css' href='normal.css'>" );
  64. </script>
  65. </head>
  66. <body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 hspace=0 vspace=0 onload="fInitRange();if(fOnload)fOnload()" onselectstart="return false" ondraggesture="return false" ondragstart="return false" oncontextmenu="return false" onmouseup="top.defaultStatus='Powered by PopCalendarXP 9.4.265 Lite Edition (c)2003-2005 Idemfactor Solutions, Inc.';fDragIt(0,0,0,2,event);return true;">
  67. <script type='text/javascript'>
  68. var gdBegin,gdEnd,gcbMon,gcbYear,gdCtrl,gcTemp;
  69. var giSat=(6-giFirstDOW)%7,giSun=(7-giFirstDOW)%7,gRange=[],__cal=[];
  70. for (var i=0;i<6;i++) { __cal[i]=[]; for (var j=0;j<7;j++) __cal[i][j]=[]; }
  71. with (document) {
  72. write("<scr"+"ipt type='text/javascript' src='"+(gTheme[4]?gTheme[4]:"plugins.js" )+"'></scr"+"ipt>" );
  73. write("<lin"+"k rel='stylesheet' type='text/css' href='normal.css'>" );
  74. }
  75. </script>
  76. <script type='text/javascript'>
  77. var __gdos=gdSelect.slice(0); // keep the initial selected date
  78. gCurMonth=fCalibrate(gCurMonth[0],gCurMonth[1]);
  79. gdSelect=gdSelect.slice(0); gBegin=gBegin.slice(0); gEnd=gEnd.slice(0);
  80. if (gCurMonth[0]>gEnd[0]||gCurMonth[0]==gEnd[0]&&gCurMonth[1]>gEnd[1]) gCurMonth=gEnd.slice(0);
  81. if (gCurMonth[0]<gBegin[0]||gCurMonth[0]==gBegin[0]&&gCurMonth[1]<gBegin[1]) gCurMonth=gBegin.slice(0);
  82. if (gsSplit=="" ) {giMonthMode=0; gbPadZero=true;}
  83. gWeekDay=gWeekDay.slice(giFirstDOW).concat(gWeekDay.slice(0,giFirstDOW));
  84. if (!fIsSelected)
  85. fIsSelected=function(y,m,d) {
  86.  return gdSelect[2]==d&&gdSelect[1]==m&&gdSelect[0]==y;
  87. }
  88. if (!fParseInput)
  89. fParseInput=function(str) {
  90.  return fParseDate(str);
  91. }
  92. if (!fFormatInput)
  93. fFormatInput=function(y,m,d) {
  94.  return fFormatDate(y,m,d);
  95. }
  96. if (fOnDrag&&!(IE&&MAC||OP)) {
  97. var __om=IE4||IE5?gContainer.document.onmouseover:gContainer.document.onmouseup;
  98. if (IE4||IE5) gContainer.document.onmouseover=fOm;
  99. else gContainer.document.onmouseup=fOm;
  100. }
  101. function fOm(e){
  102. if(!e)e=gContainer.event;var t=e.target?e.target:e.srcElement;
  103. if(t.name!=self.name)__lastDrag=null;if(__om)__om(e)
  104. }
  105. var __lastDrag=null;
  106. function fDragIt(y,m,d,aStat,e) {
  107. if (!fOnDrag||!(__lastDrag&&aStat>0||aStat==0)) return false;
  108. var dt=[y,m,d];
  109. if (aStat==1&&__lastDrag+''==dt+'') return false;
  110. __lastDrag=aStat==2||IE&&MAC||OP?null:dt;
  111. return fOnDrag(dt[0],dt[1],dt[2],aStat,e);
  112. }
  113. function fRepaint() {
  114. fSetCal(gCurMonth[0],gCurMonth[1],0,false,null);
  115. }
  116. function fUpdSelect(y,m,d,bDoNotReformat) {
  117. gdSelect[0]=y; gdSelect[1]=m; gdSelect[2]=d;
  118. if (!bDoNotReformat) gdCtrl.value=d==0?"":fFormatInput(y,m,d);
  119. }
  120. function fPopCalendar(dateCtrl,range,posLayerId,posCtrl,posOffset) {
  121. var dc=dateCtrl;
  122. var pc=posCtrl?posCtrl:dc;
  123. if (gdCtrl!=dc) {gdCtrl=dc; fHideCal();}
  124. else if (fIsShown()) {fHideCal(); return;}
  125. var s=fParseInput(gdCtrl.value);
  126. var b=false;
  127. if (s==null)
  128.  if (__gdos[2]==0) {
  129.   b=true; s=eval(gTheme[0]); s=[s[0],s[1],0];
  130.  } else s=__gdos;
  131. fUpdSelect(s[0],s[1],s[2],b);
  132. fInitRange(range);
  133. if (gRange[2]&&fIsOutRange(s[0],s[1])) {
  134.  fUpdSelect(0,0,0);
  135.  s=gRange[2];
  136. }
  137. if (!fSetCal(s[0],s[1],0,true,null)) {
  138.  fUpdSelect(0,0,0);
  139.  return;
  140. }
  141. var p,oh,isFixed=posOffset?posOffset[2]:gbFixedPos,isUp;
  142. if (isFixed) {
  143.  p=posOffset?posOffset:gPosOffset;
  144.  oh=-1;
  145. } else {
  146.  p=fGetXY(pc,posOffset?posOffset:gPosOffset);
  147.  if (posLayerId) {
  148.   var lyr=fGetById(parent.document,posLayerId);
  149.   if (lyr&&lyr.tagName.toUpperCase()=="IFRAME" ) {
  150.    var pl=fGetXY(lyr);
  151.    var p2=fGetWinSize(parent.frames[posLayerId]).slice(2);
  152.    p[0]+=pl[0]-p2[0];
  153.    p[1]+=pl[1]-p2[1];
  154.   }
  155.  }
  156.  var oh=pc.offsetHeight,ptb=fGetById(document,"outerTable" ),h=ptb.offsetHeight,w=ptb.offsetWidth;
  157.  h=(h?h:gfSelf.height)+oh;
  158.  if (gbAutoPos) {
  159.   var ws=fGetWinSize(parent);
  160.   var tmp=ws[0]+ws[2]-(w?w:gfSelf.width);
  161.   p[0]=p[0]<ws[2]?ws[2]+2:p[0]>tmp?tmp:p[0];
  162.   tmp=ws[1]+ws[3]-h;
  163.   isUp=p[1]>tmp&&(!gbPopDown||p[1]-ws[3]+oh>=h);
  164.  } else isUp=!gbPopDown;
  165.  if (isUp) p[1]-=oh>0?h+2:h+25;
  166. }
  167. fShowCal(p[0],p[1]+oh+1,isUp);
  168. }
  169. function fGetWinSize(w) {
  170. if (w.innerWidth)
  171.  return [w.innerWidth-16,w.innerHeight,w.pageXOffset,w.pageYOffset];
  172. else if (w.document.compatMode=='CSS1Compat')
  173.  with (w.document.documentElement) return [clientWidth,clientHeight,scrollLeft,scrollTop];
  174. else
  175.  with (w.document.body) return [clientWidth,clientHeight,scrollLeft,scrollTop];
  176. }
  177. function fShowCal(xx,yy,isUp) {
  178. with (gfSelf.style) {
  179.  if (_animPop) clip="rect(0px auto 0px auto)";
  180.  left=xx+"px"; top=yy+"px";
  181. }
  182. if (_animPop) {
  183.  __strips=0;
  184.  __stub[2]=setInterval("fAnimPop("+yy+","+fGetById(document,"outerTable" ).offsetHeight+","+isUp+" )",_animInt);
  185. }
  186. }
  187. function fAnimPop(t,h,u) {
  188. h=h?h:gfSelf.height; __strips+=20;
  189. with (gfSelf.style)
  190. if (__strips<=h){
  191.  var d=h-__strips;
  192.   clip="rect("+(u?"auto":d+"px" )+" auto "+(u?h-d+"px":"auto" )+" auto)";
  193.  top=(u?t+d:t-d)+"px";
  194. }
  195. else {
  196.  clearInterval(__stub[2]);
  197.  clip="rect(auto auto auto auto)";
  198.  top=t+"px";
  199. }
  200. }
  201. function fHideCal() {
  202. gfSelf.style.top="-500px";
  203. __lastDrag=null;
  204. if (__stub[2]) clearInterval(__stub[2]);
  205. }
  206. function fIsShown() {
  207. return gfSelf.offsetTop>-100;
  208. }
  209. function fGetXY(a,offset) {
  210. var p=offset?offset.slice(0):[0,0],tn;
  211. while(a) {
  212.  tn=a.tagName.toUpperCase();
  213.  p[0]+=a.offsetLeft-(!KO3&&tn=="DIV"&&a.scrollLeft?a.scrollLeft:0);
  214.  p[1]+=a.offsetTop-(!KO3&&tn=="DIV"&&a.scrollTop?a.scrollTop:0);
  215.  if (tn=="BODY" ) break;
  216.  a=a.offsetParent;
  217. }
  218. return p;
  219. }
  220. function fInitRange(r) {
  221. gRange=r?r:[];
  222. var rb=gRange[0]?r[0]:gBegin;
  223. gdBegin=new Date(rb[0],rb[1]-1,rb[2]);
  224. gRange[0]=rb;
  225. var re=gRange[1]?r[1]:gEnd;
  226. gdEnd=new Date(re[0],re[1]-1,re[2]);
  227. gRange[1]=re;
  228. if (gcbYear) {
  229.   for(var i=0;i+rb[0]<=re[0];i++) gcbYear.options[i]=new Option(i+rb[0],i+rb[0]);
  230.   for(var j=gcbYear.options.length-1;j>=i;j--) gcbYear.options[j]=null;
  231. }
  232. if (!gRange[2]) gRange[2]=rb.slice(0);
  233. }
  234. function fParseDate(ds) {
  235. var i,r=null,pd=[];
  236. if (!ds) return r;
  237. if (gsSplit.length>0) {
  238.  pd=ds.split(gsSplit);
  239. } else {
  240.  var yl=gbShortYear?2:4;
  241.  if (giDatePos==2) { pd[0]=ds.substring(0,yl);pd[1]=ds.substring(yl,yl+2);pd[2]=ds.substring(yl+2,yl+4); }
  242.  else { pd[0]=ds.substring(0,2);pd[1]=ds.substring(2,4);pd[2]=ds.substring(4,4+yl); }
  243. }
  244. if (pd.length==3) {
  245.  var m=pd[giDatePos==1?0:1], ml=giMonthMode>1?giMonthMode:3;
  246.  for (i=0; (i<12)&&(gMonths[i].substring(0,ml).toLowerCase()!=m.substring(0,ml).toLowerCase())&&(i+1!=m); i++);
  247.  if (i<12) {
  248.   var y=parseInt(pd[giDatePos==2?0:2].substring(0,4),10);
  249.   var pf=Math.floor(gEnd[0]/100)*100;
  250.   r=[y<100?y>gEnd[0]%100?pf-100+y:pf+y:y,i+1,parseInt(pd[giDatePos],10)];
  251.  } else return null;
  252. } else return null;
  253. var td=new Date(r[0],r[1]-1,r[2]);
  254. if (isNaN(td)||td.getMonth()!=r[1]-1) return null;
  255. return r;
  256. }
  257. function fFormatDate(y,m,d){
  258. var M=giMonthMode==0?gbPadZero&&m<10?"0"+m:m:giMonthMode==1?gMonths[m-1]:gMonths[m-1].substring(0,giMonthMode);
  259. var D=gbPadZero&&d<10?"0"+d:d;
  260. var sy=y%100;
  261. var Y=gbShortYear?sy<10?"0"+sy:sy:y;
  262. switch (giDatePos) {
  263.  case 0: return D+gsSplit+M+gsSplit+Y;
  264.  case 1: return M+gsSplit+D+gsSplit+Y;
  265.  case 2: return Y+gsSplit+M+gsSplit+D;
  266. }
  267. }
  268. function fGetAgenda(y,m,d,taint) {
  269. var s=fCalibrate(y,m),cm=gCurMonth;
  270. var def=["",gsAction,gcCellBG,null,guCellBGImg,false,gsCellHTML];
  271. if (taint) if ((giShowOther&4)&&(s[0]<cm[0]||s[0]==cm[0]&&s[1]<cm[1])||(giShowOther&8)&&(s[0]>cm[0]||s[0]==cm[0]&&s[1]>cm[1]))
  272.  return null;
  273. var ag=fHoliday?fHoliday(s[0],s[1],d):fGetEvent(y,m,d);
  274. if (ag==null) ag=def;
  275. else {
  276.  for (var i=0;i<7;i++) {
  277.   if (gAgendaMask[i]!=-1) ag[i]=gAgendaMask[i];
  278.   if (ag[i]==null&&i!=1) ag[i]=def[i];
  279.  }
  280.  if (taint&&s[1]!=cm[1]&&!(giShowOther&1)) {
  281.   def[0]=ag[0]; def[1]=ag[1]; ag=null; ag=def;
  282.  }
  283. }
  284. if (taint&&s[1]!=cm[1]) {
  285.  if (gcOtherDayBG&&ag[2]==gcCellBG) ag[2]=gcOtherDayBG;
  286.  ag[3]=gcOtherDay;
  287. }
  288. if (!fValidRange(s[0],s[1],d)) {
  289.  ag[1]=null;
  290.  if (_preferOOR&&gsOutOfRange) ag[0]=gsOutOfRange;
  291.  if (_preferOOR&&guOutOfRange) ag[4]=guOutOfRange;
  292. }
  293. return ag;
  294. }
  295. function fGetDOW(y,m,d) {
  296. return (7+(new Date(y,m-1,d).getDay())-giFirstDOW)%7;
  297. }
  298. function fGetWeekNo(y,m,d) {
  299. var dow=fGetDOW(y,1,1);
  300. return Math.ceil(((Date.UTC(y,m-1,d)-Date.UTC(y,0,1))/MILLIDAY+dow-6)/7)+fWeekOffset(dow);
  301. }
  302. function fW2Date(y,w,wd) { // w > 0, wd > 0
  303. var dow=fGetDOW(y,1,1);
  304. if (dow<=3) w--;
  305. var date=new Date(new Date(y,0,1)-0+(w*7+wd-dow-1)*MILLIDAY);
  306. return [date.getFullYear(),date.getMonth()+1,date.getDate()];
  307. }
  308. function fDate2W(y,m,d) {
  309. var w=fGetWeekNo(y,m,d), wd=fGetDOW(y,m,d)+1;
  310. if (w==0) { y--; w=fGetWeekNo(y,12,31); }
  311. else if (w>52) {
  312.  var w1=fGetWeekNo(y+1,1,1);
  313.  if (w1>0) { y++; w=w1; }
  314. }
  315. return [y,w,wd];
  316. }
  317. function fGetDateByDOW(y,m,q,dow) { // q: 1-5; dow: 0-6
  318. var dom=new Date(y,m-1,1).getDay();
  319. var d=7*q-6+dow-dom;
  320. if (dom>dow) d+=7;
  321. if (d>fGetDays(y)[m]) d-=7;
  322. return d; // 1-31
  323. }
  324. function fValidRange(y,m,d) {
  325. for (var i=3; i<gRange.length; i++)
  326.  if (gRange[i][2]==d&&gRange[i][1]==m&&gRange[i][0]==y)
  327.   return false;
  328. var dt=new Date(y,m-1,d);
  329. return (dt>=gdBegin)&&(dt<=gdEnd);
  330. }
  331. function fBuildCal(y,m) {
  332. var days=fGetDays(y),iDay1=fGetDOW(y,m,1);
  333. var iLast=days[m-1]-iDay1+1,iDate=1,iNext=1;
  334. for (var d=0;d<7;d++) {
  335.  __cal[0][d][0]=d<iDay1?m-1:m;
  336.  __cal[0][d][1]=d<iDay1?iLast+d:iDate++;
  337. }
  338. for (var w=1;w<6;w++)
  339.  for (var d=0;d<7;d++) {
  340.   __cal[w][d][0]=iDate<=days[m]?m:m+1;
  341.   __cal[w][d][1]=iDate<=days[m]?iDate++:iNext++;
  342.  }
  343. }
  344. function fIsOutRange(y,m) {
  345. return (y>gRange[1][0]||y<gRange[0][0]||y==gRange[0][0]&&m<gRange[0][1]||y==gRange[1][0]&&m>gRange[1][1]);
  346. }
  347. function fBfRange(y,m) {
  348. return y<gRange[0][0]||y==gRange[0][0]&&m<=gRange[0][1];
  349. }
  350. function fAfRange(y,m) {
  351. return y>gRange[1][0]||y==gRange[1][0]&&m>=gRange[1][1];
  352. }
  353. function fToggleNavs(y,m) {
  354. var n=fGetById(document,"navPrev" ); if(n)n.style.visibility=fBfRange(y,m)?"hidden":"visible";
  355. n=fGetById(document,"navNext" ); if(n)n.style.visibility=fAfRange(y,m)?"hidden":"visible";
  356. }
  357. function fCheckRange(y,m) {
  358. if (!_noBound&&fIsOutRange(y,m)) {
  359.  stopShowMon();
  360.  if (gsOutOfRange!="" ) alert(gsOutOfRange);
  361.  return false;
  362. }
  363. return true;
  364. }
  365. function fSetCal(y,m,d,bTriggerOnChg,e) {
  366. var t=fCalibrate(parseInt(y,10),parseInt(m,10));
  367. y=t[0]; m=t[1];
  368. if (!fCheckRange(y,m)||bTriggerOnChg&&fOnChange&&fOnChange(y,m,d,e)) {
  369.  if (gcbMon) gcbMon.options[gCurMonth[1]-1].selected=true;
  370.  if (gcbYear) gcbYear.options[gCurMonth[0]-gcbYear.options[0].value].selected=true;
  371.  return false;
  372. }
  373. if (d>0) fUpdSelect(y,m,d);
  374. var iDiv=fGetById(document,"innerDiv" );
  375. fGetById(document,"innerDiv" ).innerHTML=fDrawCal(y,m);
  376. if (gcbMon) gcbMon.options[m-1].selected=true;
  377. if (gcbYear) gcbYear.options[y-gcbYear.options[0].value].selected=true;
  378. if (!gbHideTop&&giDCStyle>0) fGetById(document,"calTitle" ).innerHTML=eval(gsCalTitle)+"\n";
  379. fToggleNavs(y,m);
  380. gcTemp=null;
  381. setTimeout("fResize()",giInitDelay+giResizeDelay);
  382. return true;
  383. }
  384. function fResize() {
  385. if (fOnResize) fOnResize();
  386. giInitDelay=0;
  387. var ptb=fGetById(document,"outerTable" );
  388. if (!ptb) return;
  389. var ow=ptb.offsetWidth;
  390. var oh=ptb.offsetHeight;
  391. if (ow) gfSelf.style.width=ow+"px";
  392. if (oh) gfSelf.style.height=oh+"px";
  393. }
  394. function fSetDate(y,m,d,taint,e) {
  395. var ag=fGetAgenda(y,m,d,taint);
  396. if (ag==null||ag[1]==null) return false;
  397. if (!fSetCal(y,m,d,true,e)) return false;
  398. if (gbAutoClose) fHideCal();
  399. eval(ag[1].replace(/\n/g,"\\n" ));
  400. if (fAfterSelected) fAfterSelected(y,m,d,e);
  401. return true;
  402. }
  403. function fPrevMonth(e) {
  404. return fSetCal(gCurMonth[0],gCurMonth[1]-1,0,true,e);
  405. }
  406. function fNextMonth(e) {
  407. return fSetCal(gCurMonth[0],gCurMonth[1]+1,0,true,e);
  408. }
  409. function showPrevMon() {
  410. if (!__stub[1]&&fPrevMonth()&&!fBfRange(gCurMonth[0],gCurMonth[1])) __stub[1]=setInterval("fPrevMonth()", giShowInterval);
  411. }
  412. function showNextMon() {
  413. if (!__stub[1]&&fNextMonth()&&!fAfRange(gCurMonth[0],gCurMonth[1])) __stub[1]=setInterval("fNextMonth()", giShowInterval);
  414. }
  415. function stopShowMon() {
  416. clearInterval(__stub[1]); __stub[1]=null;
  417. }
  418. function fMouseOver(t) {
  419. if (!gbFocus) return;
  420. gcTemp=t.style.backgroundColor;
  421. t.style.backgroundColor=gcToggle;
  422. }
  423. function fMouseOut(t) {
  424. if (!gbFocus||gcTemp==null) return;
  425. t.style.backgroundColor=gcTemp?gcTemp:"transparent";
  426. }
  427. function fHint(t,id) {
  428. t.title=__tis[id];
  429. gContainer.status=__tis[id];
  430. }
  431. var __sWH="<td class='WeekHead'><div style='position:relative;width:"+giWeekWidth+"px;top:"+giHeadTop+"px;'>",
  432. __sCH="<td class='CalHead'><div style='position:relative;width:"+giCellWidth+"px;height:"+giHeadHeight+"px;top:"+giHeadTop+"px;'>",
  433. __sWC="<td class='WeekCol'><div style='position:relative;width:100%;top:"+giWeekTop+"px;'>",
  434. __sCC=" class='CalCol'><div class='CalCell' style='position:relative;width:100%;height:"+giCellHeight+"px;",
  435. __sDIVTD="</div></td>",
  436. __tis=[];
  437. function fDrawCal(y,m) {
  438. var td,htm,bo,ag,i,c,c1,dayNo,dc,cbg,isT,isS,weekNo,cd,ex,bfb,sCellDate,sWkCol,weekYear;
  439. var ms=giMarkSelected,ht=giMarkToday;
  440. var a=["<TABLE width='100%' ",gsInnerTable,"><tr>"];
  441. gCurMonth[0]=y; gCurMonth[1]=m;
  442. fBuildCal(y,m);
  443. for (var wd=0,i=0; i<8; i++)
  444.  if (i==giWeekCol) a.push(__sWH,gsWeekHead,__sDIVTD);
  445.  else if (i!=7||giWeekCol>=0) {
  446.   var sDoW=fOnDoWClick?"<a class='DoWAnchor' href='javascript:void(0)' onfocus='if(this.blur)this.blur()' onclick='fOnDoWClick("
  447.        +y+","+m+","+(giFirstDOW+wd)%7+" );return false;'>"+gWeekDay[wd]+"</a>":"<span class='DoWAnchor'>"+gWeekDay[wd]+"</span>"
  448.   a.push(__sCH,sDoW,__sDIVTD); wd++;
  449.  }
  450. a.push("</tr>" );
  451. if (giWeekCol>=0) {
  452.  var w=fDate2W(y,m,1);
  453.  weekYear=w[0];
  454.  weekNo=w[1];
  455. }
  456. for (var week=0; week<6; week++) {
  457.  ex=week>3&&__cal[week][0][1]<20;
  458.  if (gbShrink2fit&&ex) continue;
  459.  a.push("<tr>" );
  460.  for (var day=-1,i=0; i<8; i++)
  461.   if (i==giWeekCol) {
  462.    sWkCol=fOnWeekClick?"<a class='WeekAnchor' href='javascript:void(0)' onfocus='if(this.blur)this.blur()' onclick='fOnWeekClick("+weekYear+","
  463.        +weekNo+" );return false;'>"+eval(gsWeeks)+"</a>":"<span class='WeekAnchor'>"+eval(gsWeeks)+"</span>";
  464.    a.push(__sWC,(giShowOther&8)&&!(giShowOther&16)&&ex?"<span class='WeekAnchor'>&nbsp;</span>":sWkCol,__sDIVTD);
  465.    if (m==1&&weekNo>50||m==12&&weekNo>=52&&weekNo>=fDate2W(y,12,31)[1]) {
  466.     weekNo=0; weekYear++;
  467.    }
  468.    weekNo++;
  469.   } else if (i!=7||giWeekCol>=0) {
  470.    day++; dayNo=__cal[week][day][1];
  471.    var tid=week*10+day;
  472.    cd=fCalibrate(y,__cal[week][day][0]);
  473.    isT=gToday[2]==dayNo&&gToday[1]==cd[1]&&gToday[0]==cd[0];
  474.    ag=fGetAgenda(cd[0],cd[1],dayNo,true);
  475.    var hs=ag&&ag[1]!=null?";cursor:hand":";cursor:default";
  476.    if (ag==null) {
  477.     dc=giShowOther&16&&(week<2&&(giShowOther&4)||week>3&&(giShowOther&8))?gcOtherDay:"";
  478.     cbg=null; bo=false; __tis[tid]=td=htm=""; bfb=gbFlatBorder; c=c1=gcOtherDayBG;
  479.    } else {
  480.     isS=fIsSelected(cd[0],cd[1],dayNo)&&ag[1]!=null;
  481.     var bt=ag[5]+""=="true";
  482.     if (cd[1]==m||(giShowOther&2)) {
  483.      c=isS&&(ms&2)?gcBGSelected:ag[5]?bt?ag[2]:ag[5]:ag[2]==gcCellBG&&isT&&(ht&3)?gcBGToday:ag[2];
  484.      c1=isS&&(ms&1)&&gcBGSelected?gcBGSelected:ag[2]==gcCellBG||bt?isT&&(ht&1)&&gcBGToday?gcBGToday:gcCellBG:ag[2];
  485.      bo=isS&&(ms&4)||isT&&(ht&4);
  486.      dc=isS&&(ms&8)?gcFGSelected:ag[3]==null&&isT&&(ht&8)?gcFGToday:ag[3];
  487.      cbg=isS&&(ms&16)?guSelectedBGImg:ag[4]==guCellBGImg&&isT&&(ht&16)?guTodayBGImg:ag[4];
  488.     } else {
  489.      bo=false; c=ag[5]&&!bt?ag[5]:ag[2]; c1=bt?gcCellBG:ag[2]; dc=ag[3]; cbg=ag[4];
  490.     }
  491.     bo=gbBoldAgenda&&ag[0]&&ag[0]!=gsOutOfRange||bo;
  492.     bfb=gbFlatBorder&&c1!=gcCellBG;
  493.     htm=ag[6]?ag[6]:"";
  494.     td=ag[1]==null&&_lineThru?";text-decoration:line-through":"";
  495.     __tis[tid]=isS&&gsSelectedTip?gsSelectedTip:ag[0]?ag[0]:isT&&gsTodayTip?gsTodayTip:"";
  496.     if (day==giSun&&gcSunBG){c1=c1==gcCellBG?gcSunBG:c1; c=c==gcCellBG?gcSunBG:c;}
  497.     if (day==giSat&&gcSatBG){c1=c1==gcCellBG?gcSatBG:c1; c=c==gcCellBG?gcSatBG:c;}
  498.     if (dc==null) dc=day==giSun?gcSun:day==giSat?gcSat:gcWorkday;
  499.    }
  500.    if (gbInvertBold) bo=!bo;
  501.    if (gbInvertBorder) bfb=!bfb;
  502.    sCellDate=cd[0]+","+cd[1]+","+dayNo;
  503.    a.push("<td valign='top'" );if(c)a.push(" bgcolor='",c,"'" );if(bfb)a.push(" style='border-style:solid;border-color:",c1,"'" );a.push(__sCC,hs);if(c1)a.push(";background-color:",c1);
  504.    if(cbg)a.push(";background-image:url(",cbg," )" );if(dc=="" )a.push("' ><span class='CellAnchor'>&nbsp;</span>",__sDIVTD);else{
  505.    if(!_mcafee)a.push("' onmouseover='fHint(this,",tid," );fMouseOver(this);fDragIt(",sCellDate,",1,event);return true' onmouseout='fMouseOut(this)' onmousedown='fDragIt(",sCellDate,",0,event)' onmouseup='fDragIt(",sCellDate,",2,event)" );
  506.    a.push("' onclick='fSetDate(",sCellDate,",true,event)'><A href='javascript:void(0)' class='CellAnchor' style='color:",dc,hs);
  507.    if(bo)a.push(";font-weight:bold" );a.push(td,"' onmouseover='fHint(this,",tid," )' onfocus='if(this.blur)this.blur()'>",eval(gsDays),"</A>",htm,__sDIVTD);}
  508.    ag=null;
  509.   }
  510.  a.push("</tr>" );
  511. }
  512. a.push("</TABLE>\n" );
  513. return a.join('');
  514. }
  515. with (document) {
  516. body.bgColor=gcCalBG;
  517. var a=["<TABLE id='outerTable' ",gsOuterTable,"><FORM name='cxpTopForm'>"];
  518. if (!gbHideTop)
  519. if (giDCStyle==2)
  520.  a.push("<TR><TD class='CalTop' nowrap><SPAN id='calTitle' class='CalTitle'>",eval(gsCalTitle),"</SPAN></TD></TR>" );
  521. else if (giDCStyle==1){
  522.  a.push("<TR><TD class='CalTop' nowrap><table border=0 cellspacing=0 cellpadding=0 width='100%'><tr><TD align='left' nowrap>",gsNavPrev,"</TD><TD class='CalTitle' nowrap><SPAN id='calTitle'>" );
  523.  a.push(eval(gsCalTitle));
  524.  a.push("</SPAN></TD><TD align='right' nowrap>",gsNavNext,"</TD></tr></table></TD></TR>" );
  525. } else {
  526.  a.push("<TR><TD class='CalTop' nowrap>",gsNavPrev," " );
  527.  var mstr=["<SELECT id='MonSelect' class='CalTitle' onchange='fSetCal(gcbYear.value, gcbMon.value,0,true,event)'>"];
  528.  for (var i=0; i<12; i++) mstr.push("<OPTION value='",i+1,"'>",gMonths[i],"</OPTION>" );
  529.  mstr.push("</SELECT>" ); mstr=mstr.join('');
  530.  var ystr=["<SELECT id='YearSelect' class='CalTitle' onchange='fSetCal(gcbYear.value, gcbMon.value,0,true,event)'>"];
  531.  for(var i=gBegin[0];i<=gEnd[0];i++)
  532.   ystr.push("<OPTION value='",i,"'>",i,"</OPTION>" );
  533.  ystr.push("</SELECT>" ); ystr=ystr.join('');
  534.  if (gbDCSeq) a.push(mstr,ystr);
  535.  else a.push(ystr,mstr);
  536.  a.push(" ",gsNavNext,"</TD></TR>" );
  537. }
  538. a.push("</FORM><TR><TD class='CalMiddle'><DIV id='innerDiv' style='background:",gcCalFrame,guCalBG?" url("+guCalBG+" ) ":"",";'></DIV></TD></TR>" );
  539. if (!gbHideBottom) a.push("<FORM name='cxpBottomForm'><TR><TD class='CalBottom' nowrap>",gsBottom,"</TD></TR></FORM>" );
  540. a.push("</TABLE>" );
  541. for (var i=0;i<giFreeDiv;i++)
  542.  a.push("<DIV class='FreeDiv' id='freeDiv",i,"' style='position:absolute;visibility:hidden;z-index:500'></DIV>" );
  543. write(a.join(''));
  544. close();
  545. }
  546. </script>
  547. <script type='text/javascript'>
  548. if (giDCStyle==0) {
  549. gcbMon=fGetById(document,"MonSelect" );
  550. gcbYear=fGetById(document,"YearSelect" );
  551. }
  552. if (!gTheme[3]) gTheme[3]="gfPop";
  553. function fAgReady(ctxName) {
  554. var ctx=eval("gContainer."+ctxName);
  555. if (ctx) {
  556.  clearInterval(__stub[0]);
  557.  fHoliday=ctx.fHoliday;
  558.  fRepaint();
  559. }
  560. }
  561. var __isAS=gTheme[2]&&gTheme[2].substring(0,6)=="share[";
  562. if (gbShareAgenda==true) {
  563. if (!eval(gsAgShared)) eval(gsAgShared+"=[]" );
  564. if (__isAS) __stub[0]=setInterval("fAgReady('"+gTheme[2].split('[')[1].split(']')[0]+"')",350);
  565. }
  566. if (gTheme[2]&&!__isAS) document.write("<scr"+"ipt type='text/javascript' src='"+gTheme[2]+(gbCacheAgenda?"":(/\?/.test(gTheme[2])?"&":"?" )+gd.getTime())+"'></scr"+"ipt>" );
  567. </script>
  568. <a href="http://www.calendarxp.net" style="display:none">JavaScript Date Picker</a><a href="http://www.idemfactor.com" style="display:none">Idemfactor Solutions Inc.</a>
  569. <script type='text/javascript'>
  570. var __omd=gContainer.document.onmousedown?gContainer.document.onmousedown:null;
  571. gContainer.document.onmousedown=function(e){
  572.   var n=!e?gContainer.event.srcElement:e.target;
  573.   if (!(/PopcalTrigger/i.test(n.className)||/popcal/i.test(n.name))) fHideCal();
  574.   if (__omd) __omd(e);
  575. }
  576. var __okd=gContainer.document.onkeydown?gContainer.document.onkeydown:null;
  577. gContainer.document.onkeydown=function(e){var evt=e?e:gContainer.event;if(evt.keyCode==27)fHideCal();if(__okd)__okd(e);}
  578. var __okd1=document.onkeydown?document.onkeydown:null;
  579. document.onkeydown=function(e){var evt=e?e:event;if(evt.keyCode==27)fHideCal();if(__okd1)__okd1(e);}
  580. eval("parent."+gTheme[3]+"=parent.frames[self.name]" );
  581. </script>
  582. </body>
  583. </html>


 
deuxieme fichier javascript  
 

Code :
  1. /////////////////// Plug-in file for CalendarXP 9.0 /////////////////
  2. // This file is totally configurable. You may remove all the comments in this file to minimize the download size.
  3. /////////////////////////////////////////////////////////////////////
  4. ///////////// Calendar Onchange Handler ////////////////////////////
  5. // It's triggered whenever the calendar gets changed to y(ear),m(onth),d(ay)
  6. // d = 0 means the calendar is about to switch to the month of (y,m);  
  7. // d > 0 means a specific date [y,m,d] is about to be selected.
  8. // e is a reference to the triggering event object
  9. // Return a true value will cancel the change action.
  10. // NOTE: DO NOT define this handler unless you really need to use it.
  11. ////////////////////////////////////////////////////////////////////
  12. function fOnChange(y,m,d,e) {
  13. if (d==0) return false;
  14. _selDatesRange.length=0; // clear the week selection
  15. return false// return true to cancel the change.
  16. }
  17. ///////////// Calendar AfterSelected Handler ///////////////////////
  18. // It's triggered whenever a date gets fully selected.
  19. // The selected date is passed in as y(ear),m(onth),d(ay)
  20. // e is a reference to the triggering event object
  21. // NOTE: DO NOT define this handler unless you really need to use it.
  22. ////////////////////////////////////////////////////////////////////
  23. // function fAfterSelected(y,m,d,e) {}
  24. ///////////// Calendar Cell OnDrag Handler ///////////////////////
  25. // It triggered when you try to drag a calendar cell. (y,m,d) is the cell date.  
  26. // aStat = 0 means a mousedown is detected (dragstart)
  27. // aStat = 1 means a mouseover between dragstart and dragend is detected (dragover)
  28. // aStat = 2 means a mouseup is detected (dragend)
  29. // e is a reference to the triggering event object
  30. // NOTE: DO NOT define this handler unless you really need to use it.
  31. ////////////////////////////////////////////////////////////////////
  32. // function fOnDrag(y,m,d,aStat,e) {}
  33. ////////////////// Calendar OnResize Handler ///////////////////////
  34. // It's triggered after the calendar panel has finished drawing.
  35. // NOTE: DO NOT define this handler unless you really need to use it.
  36. ////////////////////////////////////////////////////////////////////
  37. // function fOnResize() {}
  38. ////////////////// Calendar fOnWeekClick Handler ///////////////////////
  39. // It's triggered when the week number is clicked.
  40. // NOTE: DO NOT define this handler unless you really need to use it.
  41. ////////////////////////////////////////////////////////////////////
  42. function fOnWeekClick(year, weekNo) {
  43. gdCtrl.value=year+_separator_week+weekNo;
  44. var wk=gdCtrl.value.split(_separator_week);
  45. _selDatesRange[0]=fW2Date(wk[0],wk[1],1);
  46. _selDatesRange[1]=fW2Date(wk[0],wk[1],7);
  47. fHideCal(); // or use fRepaint() to refresh the calendar
  48. }
  49. ////////////////// Calendar fIsSelected Callback ///////////////////////
  50. // It's triggered for every date passed in as y(ear) m(onth) d(ay). And if  
  51. // the return value is true, that date will be rendered using the giMarkSelected,
  52. // gcFGSelected, gcBGSelected and guSelectedBGImg theme options.
  53. // NOTE: If NOT defined here, the engine will create one that checks the gdSelect only.
  54. ////////////////////////////////////////////////////////////////////
  55. function fIsSelected(y,m,d) {
  56. var dt=Date.UTC(y,m-1,d),s=_selDatesRange;
  57. if (s.length==0)
  58.  return gdSelect[2]==d&&gdSelect[1]==m&&gdSelect[0]==y;
  59. else
  60.  return (dt>=Date.UTC(s[0][0],s[0][1]-1,s[0][2])&&dt<=Date.UTC(s[1][0],s[1][1]-1,s[1][2]))
  61. }
  62. ////////////////// Calendar fParseInput Handler ///////////////////////
  63. // Once defined, it'll be used to parse the input string stored in gdCtrl.value.
  64. // It's expected to return an array of [y,m,d] to indicate the parsed date,
  65. // or null if the input str can't be parsed as a date.
  66. // NOTE: If NOT defined here, the engine will create one matching fParseDate().
  67. ////////////////////////////////////////////////////////////////////
  68. function fParseInput(str) {
  69. var wk=str.split(_separator_week);
  70. if (wk.length==2) { // select all week days
  71.  _selDatesRange[0]=fW2Date(wk[0],wk[1],1);
  72.  _selDatesRange[1]=fW2Date(wk[0],wk[1],7);
  73.  return _selDatesRange[0]; // return the 1st day of week so that the calendar can show up that month
  74. } else {
  75.  return fParseDate(str);
  76. }
  77. }
  78. ////////////////// Calendar fFormatInput Handler ///////////////////////
  79. // Once defined, it'll be used to format the selected date - y(ear) m(onth) d(ay)
  80. // into gdCtrl.value.
  81. // It's expected to return a formated date string.
  82. // NOTE: If NOT defined here, the engine will create one matching fFormatDate().
  83. ////////////////////////////////////////////////////////////////////
  84. function fFormatInput(y,m,d) {
  85. if (_selDatesRange.length>0) { // week selection
  86.  var wd=fDate2W(_selDatesRange[0][0],_selDatesRange[0][1],_selDatesRange[0][2]);
  87.  return wd[0]+_separator_week+wd[1];
  88. } else { // date selection
  89.  return fFormatDate(y,m,d);
  90. }
  91. }
  92. ////////////////// Calendar fOnload Handler ///////////////////////
  93. // It's triggered when the calendar engine is fully loaded by the browser.
  94. // NOTE: DO NOT define this handler unless you really need to use it.
  95. ////////////////////////////////////////////////////////////////////
  96. // function fOnload() {}
  97. // ====== predefined utility functions for use with agendas. ========
  98. // load an url in the window/frame designated by "framename".
  99. function popup(url,framename) {
  100. var w=parent.open(url,framename,"top=200,left=200,width=400,height=200,scrollbars=1,resizable=1" );
  101. if (w&&url.split(":" )[0]=="mailto" ) w.close();
  102. else if (w&&!framename) w.focus();
  103. }
  104. // ====== Following are self-defined and/or custom-built functions! =======
  105. giWeekCol=0; // set to show the week number column
  106. var _separator_week="wk"; // separator char that sits between the year and week number
  107. var _selDatesRange=[]; //  a 2-element array contains the first week day and the last week day in format [y,m,d]


 
 
Voila merci pour votre aide

Reply

Marsh Posté le 03-08-2005 à 11:28:40   

Reply

Marsh Posté le 03-08-2005 à 11:30:18    

Pour ceux qui ne voye pas le resultat c que l'on a une image on clique dessus sa affiche un calendrier et en cliquand sur une date sa la rentre dans un champ texte sur la page mere voila

Reply

Marsh Posté le 03-08-2005 à 11:31:49    

:lol: t'a pas peur toi hein ?

Reply

Marsh Posté le 03-08-2005 à 11:32:33    

Je ne sais pas ou tu as trouvé ce calendrier, m'enfin bon
mamannnnnnnnnnnnnnnnnnn

Reply

Marsh Posté le 03-08-2005 à 12:14:37    

lebilien a écrit :

Pour ceux qui ne voye pas le resultat c que l'on a une image on clique  
dessus sa affiche un calendrier et en cliquand sur une date sa la rentre dans un champ texte sur la page mere voila


 
Pour ceux qui ne voient pas le résultat, c'est que l'on a une image, on clique
dessus cela affiche un calendrier et en cliquant sur une date ça la rentre dans un champ texte sur la page mère, voilà.


---------------
Ce n'est pas mieux comme cela ?
Reply

Marsh Posté le 03-08-2005 à 12:16:19    

tU N'AS pas peur toi hein ? :lol:


Message édité par kirua_sama le 03-08-2005 à 12:16:41
Reply

Marsh Posté le 03-08-2005 à 12:16:35    

Courage à celui qui va lire tous sa.

Reply

Marsh Posté le 03-08-2005 à 12:19:46    

xtof_83 a écrit :

Courage à celui qui va lire tous sa.


 
ça...


---------------
Ce n'est pas mieux comme cela ?
Reply

Marsh Posté le 03-08-2005 à 12:22:38    

Nan mais si tu veux on fait pas de support ici, si tu veux de l'aide pour ton machin tu vas là bas [:petrus75]


---------------
Stick a parrot in a Call of Duty lobby, and you're gonna get a racist parrot. — Cody
Reply

Marsh Posté le 03-08-2005 à 12:25:04    

Tu peux rever pour qu'on lise les 850 lignes de codes que tu oses poster, qui ne sont pas de toi et auxquelles tu ne comprends sans doute que dalle.

Reply

Marsh Posté le 03-08-2005 à 12:25:04   

Reply

Marsh Posté le 03-08-2005 à 12:26:34    

et puis je ne sais pas pourquoi, mais ce machin a l'air codé d'une autre ère,

Reply

Marsh Posté le 03-08-2005 à 12:26:41    

J'ai envie d'etre mal poli avec lui :/

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed