diff -ruN ar.CP1256/calpopup.js ar.CP1256/calpopup.js
--- ar.CP1256/calpopup.js	Wed Dec 31 16:00:00 1969
+++ ar.CP1256/calpopup.js	Sun Dec 14 15:05:52 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN ar.CP1256/dayview.template ar.CP1256/dayview.template
--- ar.CP1256/dayview.template	Mon Oct 13 11:20:00 2003
+++ ar.CP1256/dayview.template	Sun Dec 14 09:04:56 2003
@@ -56,66 +56,23 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+<div id="additemformpopupCal"></div>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ar.CP1256/editcalendar.template ar.CP1256/editcalendar.template
--- ar.CP1256/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ ar.CP1256/editcalendar.template	Sun Dec 14 14:36:41 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ar.CP1256/nothing.js ar.CP1256/nothing.js
--- ar.CP1256/nothing.js	Wed Dec 31 16:00:00 1969
+++ ar.CP1256/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN ar.CP1256/validate.js ar.CP1256/validate.js
--- ar.CP1256/validate.js	Wed Dec 31 16:00:00 1969
+++ ar.CP1256/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN ar.ISO8859-6/calpopup.js ar.ISO8859-6/calpopup.js
--- ar.ISO8859-6/calpopup.js	Wed Dec 31 16:00:00 1969
+++ ar.ISO8859-6/calpopup.js	Sun Dec 14 15:05:53 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN ar.ISO8859-6/dayview.template ar.ISO8859-6/dayview.template
--- ar.ISO8859-6/dayview.template	Mon Oct 13 11:20:00 2003
+++ ar.ISO8859-6/dayview.template	Sun Dec 14 09:05:26 2003
@@ -56,66 +56,21 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
-
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
+<div id="additemformpopupCal"></div>
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ar.ISO8859-6/editcalendar.template ar.ISO8859-6/editcalendar.template
--- ar.ISO8859-6/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ ar.ISO8859-6/editcalendar.template	Sun Dec 14 14:36:56 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ar.ISO8859-6/nothing.js ar.ISO8859-6/nothing.js
--- ar.ISO8859-6/nothing.js	Wed Dec 31 16:00:00 1969
+++ ar.ISO8859-6/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN ar.ISO8859-6/validate.js ar.ISO8859-6/validate.js
--- ar.ISO8859-6/validate.js	Wed Dec 31 16:00:00 1969
+++ ar.ISO8859-6/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN bg/calpopup.js bg/calpopup.js
--- bg/calpopup.js	Wed Dec 31 16:00:00 1969
+++ bg/calpopup.js	Sun Dec 14 15:05:53 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN bg/dayview.template bg/dayview.template
--- bg/dayview.template	Mon Oct 13 11:20:00 2003
+++ bg/dayview.template	Sun Dec 14 09:05:40 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "������� �� ���� �� "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN bg/editcalendar.template bg/editcalendar.template
--- bg/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ bg/editcalendar.template	Sun Dec 14 14:37:08 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "������� �� ���� �� "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN bg/nothing.js bg/nothing.js
--- bg/nothing.js	Wed Dec 31 16:00:00 1969
+++ bg/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN bg/validate.js bg/validate.js
--- bg/validate.js	Wed Dec 31 16:00:00 1969
+++ bg/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN ca/calpopup.js ca/calpopup.js
--- ca/calpopup.js	Wed Dec 31 16:00:00 1969
+++ ca/calpopup.js	Sun Dec 14 15:05:54 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN ca/dayview.template ca/dayview.template
--- ca/dayview.template	Wed Dec  3 17:15:53 2003
+++ ca/dayview.template	Sun Dec 14 09:05:53 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Ho sento, "+selectedmonth+" nom�s t� "+daysinmonth+" dies en l'any "+formYear+".\n"+
-           "El dia s'ha canviat a "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ca/editcalendar.template ca/editcalendar.template
--- ca/editcalendar.template	Wed Dec  3 17:15:53 2003
+++ ca/editcalendar.template	Sun Dec 14 14:37:18 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Ho sento, "+selectedmonth+" nom�s t� "+daysinmonth+" dies a l'any "+formYear+".\n"+
-           "El dia ha estat canviat a "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ca/nothing.js ca/nothing.js
--- ca/nothing.js	Wed Dec 31 16:00:00 1969
+++ ca/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN ca/validate.js ca/validate.js
--- ca/validate.js	Wed Dec 31 16:00:00 1969
+++ ca/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN cs/calpopup.js cs/calpopup.js
--- cs/calpopup.js	Wed Dec 31 16:00:00 1969
+++ cs/calpopup.js	Sun Dec 14 15:05:54 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN cs/dayview.template cs/dayview.template
--- cs/dayview.template	Mon Oct 13 11:20:00 2003
+++ cs/dayview.template	Sun Dec 14 09:06:07 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN cs/editcalendar.template cs/editcalendar.template
--- cs/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ cs/editcalendar.template	Sun Dec 14 14:37:28 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN cs/nothing.js cs/nothing.js
--- cs/nothing.js	Wed Dec 31 16:00:00 1969
+++ cs/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN cs/validate.js cs/validate.js
--- cs/validate.js	Wed Dec 31 16:00:00 1969
+++ cs/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN da/calpopup.js da/calpopup.js
--- da/calpopup.js	Wed Dec 31 16:00:00 1969
+++ da/calpopup.js	Sun Dec 14 15:05:54 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN da/dayview.template da/dayview.template
--- da/dayview.template	Mon Oct 13 11:20:00 2003
+++ da/dayview.template	Sun Dec 14 09:06:28 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN da/editcalendar.template da/editcalendar.template
--- da/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ da/editcalendar.template	Sun Dec 14 14:37:37 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN da/nothing.js da/nothing.js
--- da/nothing.js	Wed Dec 31 16:00:00 1969
+++ da/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN da/validate.js da/validate.js
--- da/validate.js	Wed Dec 31 16:00:00 1969
+++ da/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN de/calpopup.js de/calpopup.js
--- de/calpopup.js	Wed Dec 31 16:00:00 1969
+++ de/calpopup.js	Sun Dec 14 15:05:55 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN de/dayview.template de/dayview.template
--- de/dayview.template	Mon Oct 13 11:20:00 2003
+++ de/dayview.template	Sun Dec 14 09:06:42 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN de/editcalendar.template de/editcalendar.template
--- de/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ de/editcalendar.template	Sun Dec 14 14:37:46 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN de/nothing.js de/nothing.js
--- de/nothing.js	Wed Dec 31 16:00:00 1969
+++ de/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN de/validate.js de/validate.js
--- de/validate.js	Wed Dec 31 16:00:00 1969
+++ de/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN el/calpopup.js el/calpopup.js
--- el/calpopup.js	Wed Dec 31 16:00:00 1969
+++ el/calpopup.js	Sun Dec 14 15:05:55 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN el/dayview.template el/dayview.template
--- el/dayview.template	Mon Oct 13 11:20:00 2003
+++ el/dayview.template	Sun Dec 14 09:06:56 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN el/editcalendar.template el/editcalendar.template
--- el/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ el/editcalendar.template	Sun Dec 14 14:37:56 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN el/nothing.js el/nothing.js
--- el/nothing.js	Wed Dec 31 16:00:00 1969
+++ el/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN el/validate.js el/validate.js
--- el/validate.js	Wed Dec 31 16:00:00 1969
+++ el/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN en/calpopup.js en/calpopup.js
--- en/calpopup.js	Wed Dec 31 16:00:00 1969
+++ en/calpopup.js	Sun Dec 14 15:05:33 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN en/dayview.template en/dayview.template
--- en/dayview.template	Mon Oct 13 11:20:00 2003
+++ en/dayview.template	Sun Dec 14 09:07:08 2003
@@ -56,66 +56,21 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
-
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
+<div id="additemformpopupCal"></div>
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN en/editcalendar.template en/editcalendar.template
--- en/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ en/editcalendar.template	Sun Dec 14 14:38:06 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN en/nothing.js en/nothing.js
--- en/nothing.js	Wed Dec 31 16:00:00 1969
+++ en/nothing.js	Sun Dec 14 07:47:22 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN en/validate.js en/validate.js
--- en/validate.js	Wed Dec 31 16:00:00 1969
+++ en/validate.js	Sun Dec 14 07:47:30 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN es/calpopup.js es/calpopup.js
--- es/calpopup.js	Wed Dec 31 16:00:00 1969
+++ es/calpopup.js	Sun Dec 14 15:05:55 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN es/dayview.template es/dayview.template
--- es/dayview.template	Mon Oct 13 11:20:00 2003
+++ es/dayview.template	Sun Dec 14 09:07:20 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Lo lamento, "+selectedmonth+" s�lo tiene "+daysinmonth+" d�as en el a�o "+formYear+".\n"+
-           "El d�a ha sido cambiado a "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN es/editcalendar.template es/editcalendar.template
--- es/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ es/editcalendar.template	Sun Dec 14 14:38:18 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Lo lamento, "+selectedmonth+" s�lo tiene "+daysinmonth+" d�as en el a�o "+formYear+".\n"+
-           "El d�a ha sido cambiado a "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN es/nothing.js es/nothing.js
--- es/nothing.js	Wed Dec 31 16:00:00 1969
+++ es/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN es/validate.js es/validate.js
--- es/validate.js	Wed Dec 31 16:00:00 1969
+++ es/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN fi/calpopup.js fi/calpopup.js
--- fi/calpopup.js	Wed Dec 31 16:00:00 1969
+++ fi/calpopup.js	Sun Dec 14 15:05:56 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN fi/dayview.template fi/dayview.template
--- fi/dayview.template	Mon Oct 13 11:20:00 2003
+++ fi/dayview.template	Sun Dec 14 09:07:34 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN fi/editcalendar.template fi/editcalendar.template
--- fi/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ fi/editcalendar.template	Sun Dec 14 14:38:27 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN fi/nothing.js fi/nothing.js
--- fi/nothing.js	Wed Dec 31 16:00:00 1969
+++ fi/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN fi/validate.js fi/validate.js
--- fi/validate.js	Wed Dec 31 16:00:00 1969
+++ fi/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN fr/calpopup.js fr/calpopup.js
--- fr/calpopup.js	Wed Dec 31 16:00:00 1969
+++ fr/calpopup.js	Sun Dec 14 15:05:56 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN fr/dayview.template fr/dayview.template
--- fr/dayview.template	Mon Oct 13 11:20:00 2003
+++ fr/dayview.template	Sun Dec 14 09:07:46 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN fr/editcalendar.template fr/editcalendar.template
--- fr/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ fr/editcalendar.template	Sun Dec 14 14:38:38 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN fr/nothing.js fr/nothing.js
--- fr/nothing.js	Wed Dec 31 16:00:00 1969
+++ fr/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN fr/validate.js fr/validate.js
--- fr/validate.js	Wed Dec 31 16:00:00 1969
+++ fr/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN he.CP1255/calpopup.js he.CP1255/calpopup.js
--- he.CP1255/calpopup.js	Wed Dec 31 16:00:00 1969
+++ he.CP1255/calpopup.js	Sun Dec 14 15:05:56 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN he.CP1255/dayview.template he.CP1255/dayview.template
--- he.CP1255/dayview.template	Mon Oct 13 11:20:00 2003
+++ he.CP1255/dayview.template	Sun Dec 14 09:07:59 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN he.CP1255/editcalendar.template he.CP1255/editcalendar.template
--- he.CP1255/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ he.CP1255/editcalendar.template	Sun Dec 14 14:38:49 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN he.CP1255/nothing.js he.CP1255/nothing.js
--- he.CP1255/nothing.js	Wed Dec 31 16:00:00 1969
+++ he.CP1255/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN he.CP1255/validate.js he.CP1255/validate.js
--- he.CP1255/validate.js	Wed Dec 31 16:00:00 1969
+++ he.CP1255/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN he.ISO8859-8/calpopup.js he.ISO8859-8/calpopup.js
--- he.ISO8859-8/calpopup.js	Wed Dec 31 16:00:00 1969
+++ he.ISO8859-8/calpopup.js	Sun Dec 14 15:05:57 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN he.ISO8859-8/dayview.template he.ISO8859-8/dayview.template
--- he.ISO8859-8/dayview.template	Mon Oct 13 11:20:00 2003
+++ he.ISO8859-8/dayview.template	Sun Dec 14 09:08:12 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN he.ISO8859-8/editcalendar.template he.ISO8859-8/editcalendar.template
--- he.ISO8859-8/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ he.ISO8859-8/editcalendar.template	Sun Dec 14 14:38:58 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN he.ISO8859-8/nothing.js he.ISO8859-8/nothing.js
--- he.ISO8859-8/nothing.js	Wed Dec 31 16:00:00 1969
+++ he.ISO8859-8/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN he.ISO8859-8/validate.js he.ISO8859-8/validate.js
--- he.ISO8859-8/validate.js	Wed Dec 31 16:00:00 1969
+++ he.ISO8859-8/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN hu/calpopup.js hu/calpopup.js
--- hu/calpopup.js	Wed Dec 31 16:00:00 1969
+++ hu/calpopup.js	Sun Dec 14 15:05:57 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN hu/dayview.template hu/dayview.template
--- hu/dayview.template	Mon Oct 13 11:20:00 2003
+++ hu/dayview.template	Sun Dec 14 09:08:26 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN hu/editcalendar.template hu/editcalendar.template
--- hu/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ hu/editcalendar.template	Sun Dec 14 14:39:07 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN hu/nothing.js hu/nothing.js
--- hu/nothing.js	Wed Dec 31 16:00:00 1969
+++ hu/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN hu/validate.js hu/validate.js
--- hu/validate.js	Wed Dec 31 16:00:00 1969
+++ hu/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN id/calpopup.js id/calpopup.js
--- id/calpopup.js	Wed Dec 31 16:00:00 1969
+++ id/calpopup.js	Sun Dec 14 15:05:58 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN id/dayview.template id/dayview.template
--- id/dayview.template	Fri Oct 31 22:52:58 2003
+++ id/dayview.template	Sun Dec 14 09:08:38 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN id/editcalendar.template id/editcalendar.template
--- id/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ id/editcalendar.template	Sun Dec 14 14:39:15 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN id/nothing.js id/nothing.js
--- id/nothing.js	Wed Dec 31 16:00:00 1969
+++ id/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN id/validate.js id/validate.js
--- id/validate.js	Wed Dec 31 16:00:00 1969
+++ id/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN it/calpopup.js it/calpopup.js
--- it/calpopup.js	Wed Dec 31 16:00:00 1969
+++ it/calpopup.js	Sun Dec 14 15:05:58 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN it/dayview.template it/dayview.template
--- it/dayview.template	Mon Oct 13 11:20:00 2003
+++ it/dayview.template	Sun Dec 14 09:08:50 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN it/editcalendar.template it/editcalendar.template
--- it/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ it/editcalendar.template	Sun Dec 14 14:39:24 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN it/nothing.js it/nothing.js
--- it/nothing.js	Wed Dec 31 16:00:00 1969
+++ it/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN it/validate.js it/validate.js
--- it/validate.js	Wed Dec 31 16:00:00 1969
+++ it/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN ja_JP.Shift_JIS/calpopup.js ja_JP.Shift_JIS/calpopup.js
--- ja_JP.Shift_JIS/calpopup.js	Wed Dec 31 16:00:00 1969
+++ ja_JP.Shift_JIS/calpopup.js	Sun Dec 14 15:05:58 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN ja_JP.Shift_JIS/dayview.template ja_JP.Shift_JIS/dayview.template
--- ja_JP.Shift_JIS/dayview.template	Mon Oct 13 11:20:00 2003
+++ ja_JP.Shift_JIS/dayview.template	Sun Dec 14 09:09:03 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ja_JP.Shift_JIS/editcalendar.template ja_JP.Shift_JIS/editcalendar.template
--- ja_JP.Shift_JIS/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ ja_JP.Shift_JIS/editcalendar.template	Sun Dec 14 14:39:33 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ja_JP.Shift_JIS/nothing.js ja_JP.Shift_JIS/nothing.js
--- ja_JP.Shift_JIS/nothing.js	Wed Dec 31 16:00:00 1969
+++ ja_JP.Shift_JIS/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN ja_JP.Shift_JIS/validate.js ja_JP.Shift_JIS/validate.js
--- ja_JP.Shift_JIS/validate.js	Wed Dec 31 16:00:00 1969
+++ ja_JP.Shift_JIS/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN ja_JP.eucJP/calpopup.js ja_JP.eucJP/calpopup.js
--- ja_JP.eucJP/calpopup.js	Wed Dec 31 16:00:00 1969
+++ ja_JP.eucJP/calpopup.js	Sun Dec 14 15:05:59 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN ja_JP.eucJP/dayview.template ja_JP.eucJP/dayview.template
--- ja_JP.eucJP/dayview.template	Mon Oct 13 11:20:00 2003
+++ ja_JP.eucJP/dayview.template	Sun Dec 14 09:09:14 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ja_JP.eucJP/editcalendar.template ja_JP.eucJP/editcalendar.template
--- ja_JP.eucJP/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ ja_JP.eucJP/editcalendar.template	Sun Dec 14 14:39:43 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ja_JP.eucJP/nothing.js ja_JP.eucJP/nothing.js
--- ja_JP.eucJP/nothing.js	Wed Dec 31 16:00:00 1969
+++ ja_JP.eucJP/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN ja_JP.eucJP/validate.js ja_JP.eucJP/validate.js
--- ja_JP.eucJP/validate.js	Wed Dec 31 16:00:00 1969
+++ ja_JP.eucJP/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN kr/calpopup.js kr/calpopup.js
--- kr/calpopup.js	Wed Dec 31 16:00:00 1969
+++ kr/calpopup.js	Sun Dec 14 15:05:59 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN kr/dayview.template kr/dayview.template
--- kr/dayview.template	Mon Oct 13 11:20:00 2003
+++ kr/dayview.template	Sun Dec 14 09:09:25 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN kr/editcalendar.template kr/editcalendar.template
--- kr/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ kr/editcalendar.template	Sun Dec 14 14:39:53 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN kr/nothing.js kr/nothing.js
--- kr/nothing.js	Wed Dec 31 16:00:00 1969
+++ kr/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN kr/validate.js kr/validate.js
--- kr/validate.js	Wed Dec 31 16:00:00 1969
+++ kr/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN lt/calpopup.js lt/calpopup.js
--- lt/calpopup.js	Wed Dec 31 16:00:00 1969
+++ lt/calpopup.js	Sun Dec 14 15:06:00 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN lt/dayview.template lt/dayview.template
--- lt/dayview.template	Mon Oct 13 11:20:00 2003
+++ lt/dayview.template	Sun Dec 14 09:09:36 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN lt/editcalendar.template lt/editcalendar.template
--- lt/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ lt/editcalendar.template	Sun Dec 14 14:40:02 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN lt/nothing.js lt/nothing.js
--- lt/nothing.js	Wed Dec 31 16:00:00 1969
+++ lt/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN lt/validate.js lt/validate.js
--- lt/validate.js	Wed Dec 31 16:00:00 1969
+++ lt/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN nl/calpopup.js nl/calpopup.js
--- nl/calpopup.js	Wed Dec 31 16:00:00 1969
+++ nl/calpopup.js	Sun Dec 14 15:06:00 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN nl/dayview.template nl/dayview.template
--- nl/dayview.template	Mon Oct 13 11:20:00 2003
+++ nl/dayview.template	Sun Dec 14 09:09:48 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN nl/editcalendar.template nl/editcalendar.template
--- nl/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ nl/editcalendar.template	Sun Dec 14 14:40:11 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN nl/nothing.js nl/nothing.js
--- nl/nothing.js	Wed Dec 31 16:00:00 1969
+++ nl/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN nl/validate.js nl/validate.js
--- nl/validate.js	Wed Dec 31 16:00:00 1969
+++ nl/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN no/calpopup.js no/calpopup.js
--- no/calpopup.js	Wed Dec 31 16:00:00 1969
+++ no/calpopup.js	Sun Dec 14 15:06:00 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN no/dayview.template no/dayview.template
--- no/dayview.template	Mon Oct 13 11:20:00 2003
+++ no/dayview.template	Sun Dec 14 09:09:59 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN no/editcalendar.template no/editcalendar.template
--- no/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ no/editcalendar.template	Sun Dec 14 14:40:19 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN no/nothing.js no/nothing.js
--- no/nothing.js	Wed Dec 31 16:00:00 1969
+++ no/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN no/validate.js no/validate.js
--- no/validate.js	Wed Dec 31 16:00:00 1969
+++ no/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN pl/calpopup.js pl/calpopup.js
--- pl/calpopup.js	Wed Dec 31 16:00:00 1969
+++ pl/calpopup.js	Sun Dec 14 15:06:01 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN pl/dayview.template pl/dayview.template
--- pl/dayview.template	Mon Oct 13 11:20:00 2003
+++ pl/dayview.template	Sun Dec 14 09:10:10 2003
@@ -56,67 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Niestety, "+selectedmonth+" ma tylko "+daysinmonth+" dni w roku "+formYear+".\n"+
-           "Ustawiam dzie� na "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
-
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
+<div id="additemformpopupCal"></div>
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
 
diff -ruN pl/editcalendar.template pl/editcalendar.template
--- pl/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ pl/editcalendar.template	Sun Dec 14 14:40:30 2003
@@ -60,67 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Niestety, "+selectedmonth+" ma tylko "+daysinmonth+" dni w roku "+formYear+".\n"+
-           "Ustawiam dzie� na "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
-
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
+<div id="editcalendarpopupCal"></div>
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
 
diff -ruN pl/nothing.js pl/nothing.js
--- pl/nothing.js	Wed Dec 31 16:00:00 1969
+++ pl/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN pl/validate.js pl/validate.js
--- pl/validate.js	Wed Dec 31 16:00:00 1969
+++ pl/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN pt/calpopup.js pt/calpopup.js
--- pt/calpopup.js	Wed Dec 31 16:00:00 1969
+++ pt/calpopup.js	Sun Dec 14 15:06:01 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN pt/dayview.template pt/dayview.template
--- pt/dayview.template	Mon Oct 13 11:20:00 2003
+++ pt/dayview.template	Sun Dec 14 09:10:27 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN pt/editcalendar.template pt/editcalendar.template
--- pt/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ pt/editcalendar.template	Sun Dec 14 14:40:39 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN pt/nothing.js pt/nothing.js
--- pt/nothing.js	Wed Dec 31 16:00:00 1969
+++ pt/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN pt/validate.js pt/validate.js
--- pt/validate.js	Wed Dec 31 16:00:00 1969
+++ pt/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN pt_BR/calpopup.js pt_BR/calpopup.js
--- pt_BR/calpopup.js	Wed Dec 31 16:00:00 1969
+++ pt_BR/calpopup.js	Sun Dec 14 15:06:01 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN pt_BR/dayview.template pt_BR/dayview.template
--- pt_BR/dayview.template	Mon Oct 13 11:20:00 2003
+++ pt_BR/dayview.template	Sun Dec 14 09:10:39 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Desculpe, "+selectedmonth+" existem apenas "+daysinmonth+" dias em "+formYear+".\n"+
-           "Mudando o dia para "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN pt_BR/editcalendar.template pt_BR/editcalendar.template
--- pt_BR/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ pt_BR/editcalendar.template	Sun Dec 14 14:40:49 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Desculpe, "+selectedmonth+" existem apenas "+daysinmonth+" dias em "+formYear+".\n"+
-           "Mudando o dia para "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN pt_BR/nothing.js pt_BR/nothing.js
--- pt_BR/nothing.js	Wed Dec 31 16:00:00 1969
+++ pt_BR/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN pt_BR/validate.js pt_BR/validate.js
--- pt_BR/validate.js	Wed Dec 31 16:00:00 1969
+++ pt_BR/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN ro/calpopup.js ro/calpopup.js
--- ro/calpopup.js	Wed Dec 31 16:00:00 1969
+++ ro/calpopup.js	Sun Dec 14 15:06:02 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN ro/dayview.template ro/dayview.template
--- ro/dayview.template	Mon Oct 13 11:20:00 2003
+++ ro/dayview.template	Sun Dec 14 09:10:50 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ro/editcalendar.template ro/editcalendar.template
--- ro/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ ro/editcalendar.template	Sun Dec 14 14:40:57 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ro/nothing.js ro/nothing.js
--- ro/nothing.js	Wed Dec 31 16:00:00 1969
+++ ro/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN ro/validate.js ro/validate.js
--- ro/validate.js	Wed Dec 31 16:00:00 1969
+++ ro/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN ru/calpopup.js ru/calpopup.js
--- ru/calpopup.js	Wed Dec 31 16:00:00 1969
+++ ru/calpopup.js	Sun Dec 14 15:06:02 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN ru/dayview.template ru/dayview.template
--- ru/dayview.template	Mon Oct 13 11:20:00 2003
+++ ru/dayview.template	Sun Dec 14 09:11:00 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ru/editcalendar.template ru/editcalendar.template
--- ru/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ ru/editcalendar.template	Sun Dec 14 14:41:08 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ru/nothing.js ru/nothing.js
--- ru/nothing.js	Wed Dec 31 16:00:00 1969
+++ ru/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN ru/validate.js ru/validate.js
--- ru/validate.js	Wed Dec 31 16:00:00 1969
+++ ru/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN sk/calpopup.js sk/calpopup.js
--- sk/calpopup.js	Wed Dec 31 16:00:00 1969
+++ sk/calpopup.js	Sun Dec 14 15:06:03 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN sk/dayview.template sk/dayview.template
--- sk/dayview.template	Mon Oct 13 11:20:00 2003
+++ sk/dayview.template	Sun Dec 14 09:11:11 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN sk/editcalendar.template sk/editcalendar.template
--- sk/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ sk/editcalendar.template	Sun Dec 14 14:41:17 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN sk/nothing.js sk/nothing.js
--- sk/nothing.js	Wed Dec 31 16:00:00 1969
+++ sk/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN sk/validate.js sk/validate.js
--- sk/validate.js	Wed Dec 31 16:00:00 1969
+++ sk/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN sr/calpopup.js sr/calpopup.js
--- sr/calpopup.js	Wed Dec 31 16:00:00 1969
+++ sr/calpopup.js	Sun Dec 14 15:06:03 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN sr/dayview.template sr/dayview.template
--- sr/dayview.template	Mon Oct 13 11:20:00 2003
+++ sr/dayview.template	Sun Dec 14 09:11:21 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN sr/editcalendar.template sr/editcalendar.template
--- sr/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ sr/editcalendar.template	Sun Dec 14 14:41:27 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN sr/nothing.js sr/nothing.js
--- sr/nothing.js	Wed Dec 31 16:00:00 1969
+++ sr/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN sr/validate.js sr/validate.js
--- sr/validate.js	Wed Dec 31 16:00:00 1969
+++ sr/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN sv/calpopup.js sv/calpopup.js
--- sv/calpopup.js	Wed Dec 31 16:00:00 1969
+++ sv/calpopup.js	Sun Dec 14 15:06:03 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN sv/dayview.template sv/dayview.template
--- sv/dayview.template	Mon Oct 13 11:20:00 2003
+++ sv/dayview.template	Sun Dec 14 09:11:33 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN sv/editcalendar.template sv/editcalendar.template
--- sv/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ sv/editcalendar.template	Sun Dec 14 14:41:35 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN sv/nothing.js sv/nothing.js
--- sv/nothing.js	Wed Dec 31 16:00:00 1969
+++ sv/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN sv/validate.js sv/validate.js
--- sv/validate.js	Wed Dec 31 16:00:00 1969
+++ sv/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN th/calpopup.js th/calpopup.js
--- th/calpopup.js	Wed Dec 31 16:00:00 1969
+++ th/calpopup.js	Sun Dec 14 15:06:04 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN th/dayview.template th/dayview.template
--- th/dayview.template	Mon Oct 13 11:20:00 2003
+++ th/dayview.template	Sun Dec 14 09:11:44 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN th/editcalendar.template th/editcalendar.template
--- th/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ th/editcalendar.template	Sun Dec 14 14:41:45 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN th/nothing.js th/nothing.js
--- th/nothing.js	Wed Dec 31 16:00:00 1969
+++ th/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN th/validate.js th/validate.js
--- th/validate.js	Wed Dec 31 16:00:00 1969
+++ th/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN tr/calpopup.js tr/calpopup.js
--- tr/calpopup.js	Wed Dec 31 16:00:00 1969
+++ tr/calpopup.js	Sun Dec 14 15:06:04 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN tr/dayview.template tr/dayview.template
--- tr/dayview.template	Mon Oct 13 11:20:00 2003
+++ tr/dayview.template	Sun Dec 14 09:11:56 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN tr/editcalendar.template tr/editcalendar.template
--- tr/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ tr/editcalendar.template	Sun Dec 14 14:41:55 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN tr/nothing.js tr/nothing.js
--- tr/nothing.js	Wed Dec 31 16:00:00 1969
+++ tr/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN tr/validate.js tr/validate.js
--- tr/validate.js	Wed Dec 31 16:00:00 1969
+++ tr/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN uk/calpopup.js uk/calpopup.js
--- uk/calpopup.js	Wed Dec 31 16:00:00 1969
+++ uk/calpopup.js	Sun Dec 14 15:06:04 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN uk/dayview.template uk/dayview.template
--- uk/dayview.template	Mon Oct 13 11:20:00 2003
+++ uk/dayview.template	Sun Dec 14 09:12:06 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN uk/editcalendar.template uk/editcalendar.template
--- uk/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ uk/editcalendar.template	Sun Dec 14 14:42:05 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN uk/nothing.js uk/nothing.js
--- uk/nothing.js	Wed Dec 31 16:00:00 1969
+++ uk/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN uk/validate.js uk/validate.js
--- uk/validate.js	Wed Dec 31 16:00:00 1969
+++ uk/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN ur/calpopup.js ur/calpopup.js
--- ur/calpopup.js	Wed Dec 31 16:00:00 1969
+++ ur/calpopup.js	Sun Dec 14 15:06:05 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN ur/dayview.template ur/dayview.template
--- ur/dayview.template	Mon Oct 13 11:20:00 2003
+++ ur/dayview.template	Sun Dec 14 09:12:18 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ur/editcalendar.template ur/editcalendar.template
--- ur/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ ur/editcalendar.template	Sun Dec 14 14:42:15 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
-           "Changing the day to "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN ur/nothing.js ur/nothing.js
--- ur/nothing.js	Wed Dec 31 16:00:00 1969
+++ ur/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN ur/validate.js ur/validate.js
--- ur/validate.js	Wed Dec 31 16:00:00 1969
+++ ur/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN zh_CN.GB2312/calpopup.js zh_CN.GB2312/calpopup.js
--- zh_CN.GB2312/calpopup.js	Wed Dec 31 16:00:00 1969
+++ zh_CN.GB2312/calpopup.js	Sun Dec 14 15:06:05 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN zh_CN.GB2312/dayview.template zh_CN.GB2312/dayview.template
--- zh_CN.GB2312/dayview.template	Mon Oct 13 11:20:00 2003
+++ zh_CN.GB2312/dayview.template	Sun Dec 14 09:12:28 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("�ܱ�Ǹ, "+selectedmonth+" �� "+formYear+" ��ֻ�� "+daysinmonth+" ��.\n"+
-           "���������Ļ� "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN zh_CN.GB2312/editcalendar.template zh_CN.GB2312/editcalendar.template
--- zh_CN.GB2312/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ zh_CN.GB2312/editcalendar.template	Sun Dec 14 14:42:24 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("�ܱ�Ǹ, "+selectedmonth+" �� "+formYear+" ��ֻ�� "+daysinmonth+" ��.\n"+
-           "���������Ļ� "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN zh_CN.GB2312/nothing.js zh_CN.GB2312/nothing.js
--- zh_CN.GB2312/nothing.js	Wed Dec 31 16:00:00 1969
+++ zh_CN.GB2312/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN zh_CN.GB2312/validate.js zh_CN.GB2312/validate.js
--- zh_CN.GB2312/validate.js	Wed Dec 31 16:00:00 1969
+++ zh_CN.GB2312/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
diff -ruN zh_TW.Big5/calpopup.js zh_TW.Big5/calpopup.js
--- zh_TW.Big5/calpopup.js	Wed Dec 31 16:00:00 1969
+++ zh_TW.Big5/calpopup.js	Sun Dec 14 15:06:06 2003
@@ -0,0 +1,299 @@
+<script type="text/javascript" language="javascript">
+<!--
+// When you want to include this popup in a page you MUST:
+// 1) create a named div for the popup to attach to in the page.
+//    It should look like <div id="mypopup"></div>. Do not put
+//    the div anywhere in a table. It should be outside tables.
+// 2) create a stylesheet id selector entry for your div. It
+//    MUST be position absolute and should look like:
+//    #mypopup{ position: absolute;
+//              visibility: hidden;
+//              background-color: @@@MENUBAR@@@;
+//              layer-background-color: @@@MENUBAR@@@; }
+// 3) call the popup with code that looks like
+//    <a href="javascript:nothing();" onClick="calPopup(this,'mypopup',-175,15,'AddItemForm','valiDate');">
+//    where -175 and 15 are your desired x and y offsets from the link.
+//    The final argument indicates the validation script to run after
+//    the popup makes a change to the form. This argument is optional.
+
+var nn4 = (document.layers) ? true : false;
+var ie  = (document.all) ? true : false;
+var dom = (document.getElementById && !document.all) ? true : false;
+var popups = new Array(); // keeps track of popup windows we create
+var calHtml = '';
+
+// language and preferences
+wDay = new Array(@@@WDAY_ARRAY@@@);
+wDayAbbrev = new Array(@@@WDAYABBREV_ARRAY@@@);
+wMonth = new Array(@@@WMONTH_ARRAY@@@);
+wOrder = new Array(@@@WORDER_ARRAY@@@);
+wStart = @@@WSTART@@@;
+
+function calPopup(obj, id, xOffset, yOffset, formName, validationScript) {
+   attachListener(id);
+   registerPopup(id);
+   calHtml = makeCalHtml(id,null,null,null,formName,validationScript);
+   writeLayer(id,calHtml);
+   setLayerPos(obj,id,xOffset,yOffset);
+   showLayer(id);
+   return true;
+}
+
+function attachListener(id) {
+   var layer = new pathToLayer(id)
+   if (layer.obj.listening == null) {
+      document.oldMouseupEvent = document.onmouseup;
+      if (document.oldMouseupEvent != null) {
+         document.onmouseup = new Function("document.oldMouseupEvent(); hideLayersNotClicked();");
+      } else {
+         document.onmouseup = hideLayersNotClicked;
+      }
+      layer.obj.listening = true;
+   }
+}
+
+function registerPopup(id) {
+   // register this popup window with the popups array
+   var layer = new pathToLayer(id);
+   if (layer.obj.registered == null) {
+      var index = popups.length ? popups.length : 0;
+      popups[index] = layer;
+      layer.obj.registered = 1;
+   }
+}
+
+function makeCalHtml(id, calYear, calMonth, calDay, formName, validationScript) {
+   var calYear = calYear ? calYear : document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var calMonth = calMonth ? calMonth : document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var calDay = calDay ? calDay : document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+
+   var daysInMonth = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+   if ((calYear % 4 == 0 && calYear % 100 != 0) || calYear % 400 == 0) {
+      daysInMonth[2] = 29;
+   }
+
+   var calDate = new Date(calYear,calMonth-1,calDay);
+
+   //-----------------------------------------
+   // check if the currently selected day is
+   // more than what our target month has
+   //-----------------------------------------
+   if (calMonth < calDate.getMonth()+1) {
+     calDay = calDay-calDate.getDate();
+     calDate = new Date(calYear,calMonth-1,calDay);
+   }
+
+   var calNextYear  = calDate.getMonth() == 11 ? calDate.getFullYear()+1 : calDate.getFullYear();
+   var calNextMonth = calDate.getMonth() == 11 ? 1 : calDate.getMonth()+2;
+   var calLastYear  = calDate.getMonth() == 0 ? calDate.getFullYear()-1 : calDate.getFullYear();
+   var calLastMonth = calDate.getMonth() == 0 ? 12 : calDate.getMonth();
+
+   var todayDate = new Date();
+
+   //---------------------------------------------------------
+   // this relies on the javascript bug-feature of offsetting
+   // values over 31 days properly. Negative day offsets do NOT
+   // work with Netscape 4.x, and negative months do not work
+   // in Safari. This works everywhere.
+   //---------------------------------------------------------
+   var calStartOfThisMonthDate = new Date(calYear,calMonth-1,1);
+   var calOffsetToFirstDayOfLastMonth = calStartOfThisMonthDate.getDay() >= wStart ? calStartOfThisMonthDate.getDay()-wStart : 7-wStart-calStartOfThisMonthDate.getDay()
+   if (calOffsetToFirstDayOfLastMonth > 0) {
+      var calStartDate = new Date(calLastYear,calLastMonth-1,1); // we start in last month
+   } else {
+      var calStartDate = new Date(calYear,calMonth-1,1); // we start in this month
+   }
+   var calStartYear = calStartDate.getFullYear();
+   var calStartMonth = calStartDate.getMonth();
+   var calCurrentDay = calOffsetToFirstDayOfLastMonth ? daysInMonth[calStartMonth+1]-(calOffsetToFirstDayOfLastMonth-1) : 1;
+
+   var html = '';
+   // writing the <html><head><body> causes some browsers (Konquerer) to fail
+   html += '<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="0" cellspacing="2" border="0" bgcolor=@@@MENUBAR@@@>\n';
+   html += '<tr>\n';
+   html += '<td valign="top">\n';
+   html += '<table cellpadding="3" cellspacing="1" border="0">\n';
+   html += '<tr>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calLastYear+','+calLastMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&lt;&lt;</a></td>\n';
+   html += '<td class="stylecal" align="center" colspan="5">&nbsp;' +wMonth[calDate.getMonth()]+ ' ' +calDate.getFullYear()+ '&nbsp;</td>\n';
+   html += '<td><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+calNextYear+','+calNextMonth+','+calDay+',\''+formName+'\',\''+validationScript+'\'); return false;">&gt;&gt;</a></td>\n';
+   html += '</tr>\n';
+   for (var row=1; row <= 7; row++) {
+      // check if we started a new month at the beginning of this row
+      upcomingDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+      if (upcomingDate.getDate() <= 8 && row > 5) {
+         continue; // skip this row
+      }
+
+      html += '<tr>\n';
+      for (var col=0; col < 7; col++) {
+         var tdColor = col % 2 ? '@@@TABLEROW_DARK@@@' : '@@@TABLEROW_LIGHT@@@';
+         if (row == 1) {
+            html += '<td bgcolor='+tdColor+' align="center" class="stylecal">'+wDayAbbrev[(wStart+col)%7]+'</td>\n';
+         } else {
+            var hereDate = new Date(calStartYear,calStartMonth,calCurrentDay);
+            var hereDay = hereDate.getDate();
+            var aClass = '"stylecal"';
+
+            if (hereDate.getYear() == todayDate.getYear() && hereDate.getMonth() == todayDate.getMonth() && hereDate.getDate() == todayDate.getDate()) {
+               tdColor = '"#ff9999"';
+            }
+            if (hereDate.getMonth() != calDate.getMonth()) {
+               tdColor = '@@@MENUBAR@@@';
+               var aClass = '"notmonth"';
+            }
+
+            html += '<td bgcolor='+tdColor+' align="right"><a class='+aClass+' href="javascript:nothing();" onClick="changeFormDate('+hereDate.getFullYear()+','+(hereDate.getMonth()+1)+','+hereDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); hideLayer(\''+id+'\'); return false;">'+hereDay+'</a></td>\n';
+            calCurrentDay++;
+         }
+      }
+      html += '</tr>\n';
+   }
+   html += '<tr>\n';
+   html += '<td align="center" colspan="7"><a class="stylecal" href="javascript:nothing();" onClick="updateCal(\''+id+'\','+todayDate.getFullYear()+','+(todayDate.getMonth()+1)+','+todayDate.getDate()+',\''+formName+'\',\''+validationScript+'\'); return false;">@@@TODAY@@@</a></td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+   html += '</td>\n';
+   html += '</tr>\n';
+   html += '</table>\n';
+
+   return html;
+}
+
+function updateCal(id, calYear, calMonth, calDay, formName, validationScript) {
+   calHtml = makeCalHtml(id,calYear,calMonth,calDay,formName,validationScript);
+   writeLayer(id,calHtml);
+}
+
+function writeLayer(id, html) {
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.obj.document.open();
+      layer.obj.document.write(html);
+      layer.obj.document.close();
+   } else {
+      layer.obj.innerHTML = '';
+      layer.obj.innerHTML = html;
+   }
+}
+
+function setLayerPos(obj, id, xOffset, yOffset) {
+   var newX = 0;
+   var newY = 0;
+   if (obj.offsetParent) {
+      // if called from href="setLayerPos(this,'example')" then obj will
+      // have no offsetParent properties. Use onClick= instead.
+      while (obj.offsetParent) {
+         newX += obj.offsetLeft;
+         newY += obj.offsetTop;
+         obj = obj.offsetParent;
+      }
+   } else if (obj.x) {
+      // nn4 - only works with "a" tags
+      newX += obj.x;
+      newY += obj.y;
+   }
+
+   // apply the offsets
+   newX += xOffset;
+   newY += yOffset;
+
+   // apply the new positions to our layer
+   var layer = new pathToLayer(id);
+   if (nn4) {
+      layer.style.left = newX;
+      layer.style.top  = newY;
+   } else {
+      // the px avoids errors with doctype strict modes
+      layer.style.left = newX + 'px';
+      layer.style.top  = newY + 'px';
+   }
+}
+
+function hideLayersNotClicked(e) {
+   if (!e) var e = window.event;
+   e.cancelBubble = true;
+   if (e.stopPropagation) e.stopPropagation();
+   if (e.target) {
+      var clicked = e.target;
+   } else if (e.srcElement) {
+      var clicked = e.srcElement;
+   }
+
+   // go through each popup window,
+   // checking if it has been clicked
+   for (var i=0; i < popups.length; i++) {
+      if (nn4) {
+         if ((popups[i].style.left < e.pageX) &&
+             (popups[i].style.left+popups[i].style.clip.width > e.pageX) &&
+             (popups[i].style.top < e.pageY) &&
+             (popups[i].style.top+popups[i].style.clip.height > e.pageY)) {
+            return true;
+         } else {
+            hideLayer(popups[i].obj.id);
+            return true;
+         }
+      } else if (ie) {
+         while (clicked.parentElement != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentElement;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      } else if (dom) {
+         while (clicked.parentNode != null) {
+            if (popups[i].obj.id == clicked.id) {
+               return true;
+            }
+            clicked = clicked.parentNode;
+         }
+         hideLayer(popups[i].obj.id);
+         return true;
+      }
+      return true;
+   }
+   return true;
+}
+
+function pathToLayer(id) {
+   if (nn4) {
+      this.obj = document.layers[id];
+      this.style = document.layers[id];
+   } else if (ie) {
+      this.obj = document.all[id];
+      this.style = document.all[id].style;
+   } else {
+      this.obj = document.getElementById(id);
+      this.style = document.getElementById(id).style;
+   }
+}
+
+function showLayer(id) {
+   var layer = new pathToLayer(id)
+   layer.style.visibility = "visible";
+}
+
+function hideLayer(id) {
+   var layer = new pathToLayer(id);
+   layer.style.visibility = "hidden";
+}
+
+function changeFormDate(changeYear,changeMonth,changeDay,formName,validationScript) {
+   document.forms[formName].elements['year'].selectedIndex = changeYear-1970;
+   document.forms[formName].elements['month'].selectedIndex = changeMonth-1;
+   document.forms[formName].elements['day'].selectedIndex = changeDay-1;
+   if (validationScript) {
+      eval(validationScript+"('"+formName+"')"); // to update the other selection boxes in the form
+   }
+}
+// -->
+</script>
+
diff -ruN zh_TW.Big5/dayview.template zh_TW.Big5/dayview.template
--- zh_TW.Big5/dayview.template	Mon Oct 13 11:20:00 2003
+++ zh_TW.Big5/dayview.template	Sun Dec 14 09:12:38 2003
@@ -56,66 +56,22 @@
 </td></tr></table>
 </center>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.AddItemForm.year.options[document.AddItemForm.year.selectedIndex].value;
-   var formMonth = document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].value;
-   var formDay = document.AddItemForm.day.options[document.AddItemForm.day.selectedIndex].value;
-   var dayfreqSelection = document.AddItemForm.dayfreq.selectedIndex;
-   var monthfreqSelection = document.AddItemForm.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.AddItemForm.month.options[document.AddItemForm.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("�ܩ�p, "+selectedmonth+" �b "+formYear+" �~�u�� "+daysinmonth+" ��.\n"+
-           "��ƱN�Q��^ "+daysinmonth+".");
-     document.AddItemForm.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.AddItemForm.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.AddItemForm.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.AddItemForm.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.AddItemForm.dayfreq.options.length =0; // clear popup
-      document.AddItemForm.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.AddItemForm.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#additemformpopupCal{ position: absolute;
+                      visibility: hidden;
+                      background-color: @@@MENUBAR@@@;
+                      layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.AddItemForm.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="additemformpopupCal"></div>
 
-   document.AddItemForm.dayfreq.selectedIndex = dayfreqSelection;
-   document.AddItemForm.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN zh_TW.Big5/editcalendar.template zh_TW.Big5/editcalendar.template
--- zh_TW.Big5/editcalendar.template	Mon Oct 13 11:20:00 2003
+++ zh_TW.Big5/editcalendar.template	Sun Dec 14 14:42:33 2003
@@ -60,66 +60,22 @@
 </tr></table>
 </td></tr></table>
 
-<script type="text/javascript" language="javascript">
+<style type="text/css">
 <!--
-function valiDate() {
-   var formYear = document.editcalendar.year.options[document.editcalendar.year.selectedIndex].value;
-   var formMonth = document.editcalendar.month.options[document.editcalendar.month.selectedIndex].value;
-   var formDay = document.editcalendar.day.options[document.editcalendar.day.selectedIndex].value;
-   var dayfreqSelection = document.editcalendar.dayfreq.selectedIndex;
-   var monthfreqSelection = document.editcalendar.monthfreq.selectedIndex;
-   var checkDate = new Date(formYear,formMonth-1,formDay);
-
-   wDay = new Array(@@@WDAY_ARRAY@@@);
-   wOrder = new Array(@@@WORDER_ARRAY@@@);
-
-   if (formMonth < checkDate.getMonth()+1) {
-     var selectedmonth=document.editcalendar.month.options[document.editcalendar.month.selectedIndex].text;
-     var daysinmonth=formDay-checkDate.getDate();
-     alert("�ܩ�p, "+selectedmonth+" �b "+formYear+" �~�u�� "+daysinmonth+" ��.\n"+
-           "��ƱN�Q��^ "+daysinmonth+".");
-     document.editcalendar.day.selectedIndex = formDay-checkDate.getDate()-1;
-     // reset our vars
-     formDay = formDay-checkDate.getDate();
-     checkDate = new Date(formYear,formMonth-1,formDay);
-   }
-
-   var weekOrder = parseInt((parseInt(formDay)+6)/7);
-
-   // update the day recurrance
-   if (weekOrder<=4) {
-      if (! document.editcalendar.dayfreq[2]) {  // coming from 2 choice menu
-         if (dayfreqSelection==1) {
-            dayfreqSelection++;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
-      document.editcalendar.dayfreq[2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   } else {
-      if (document.editcalendar.dayfreq[2]) {  // coming from 3 choice menu
-         dayfreqSelection--;
-         if (dayfreqSelection < 0) {
-            dayfreqSelection = 0;
-         }
-      }
-      document.editcalendar.dayfreq.options.length =0; // clear popup
-      document.editcalendar.dayfreq[0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
-      document.editcalendar.dayfreq[1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
-   }
+#editcalendarpopupCal{ position: absolute;
+                       visibility: hidden;
+                       background-color: @@@MENUBAR@@@;
+                       layer-background-color: @@@MENUBAR@@@; }
+.stylecal { font-size: 9pt; color: #000000; }
+A.notmonth:link { font-size: 9pt; color: #cccccc; }
+A.notmonth:visited { font-size: 9pt; color: #cccccc; }
+A.notmonth:hover { font-size: 9pt; color: #ff0000; }
+A.stylecal:link { font-size: 9pt; color: #000000; }
+A.stylecal:visited { font-size: 9pt; color: #000000; }
+A.stylecal:hover { font-size: 9pt; color: #ff0000; }
+// -->
+</style>
 
-   // update the month recurrance
-   if (formMonth%2) {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
-   } else {
-      document.editcalendar.monthfreq[1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
-   }
+<div id="editcalendarpopupCal"></div>
 
-   document.editcalendar.dayfreq.selectedIndex = dayfreqSelection;
-   document.editcalendar.monthfreq.selectedIndex = monthfreqSelection;
-}
 
-function nothing() { ; } // for the colorpicker to work properly
-// -->
-</script>
diff -ruN zh_TW.Big5/nothing.js zh_TW.Big5/nothing.js
--- zh_TW.Big5/nothing.js	Wed Dec 31 16:00:00 1969
+++ zh_TW.Big5/nothing.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,7 @@
+<script type="text/javascript" language="javascript">
+<!--
+// this script provides hrefs a target that does nothing and goes nowhere.
+function nothing() { ; }
+// -->
+</script>
+
diff -ruN zh_TW.Big5/validate.js zh_TW.Big5/validate.js
--- zh_TW.Big5/validate.js	Wed Dec 31 16:00:00 1969
+++ zh_TW.Big5/validate.js	Sun Dec 14 08:30:07 2003
@@ -0,0 +1,60 @@
+<script type="text/javascript" language="javascript">
+<!--
+function valiDate(formName) {
+   var formYear = document.forms[formName].elements['year'].options[document.forms[formName].elements['year'].selectedIndex].value;
+   var formMonth = document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].value;
+   var formDay = document.forms[formName].elements['day'].options[document.forms[formName].elements['day'].selectedIndex].value;
+   var dayfreqSelection = document.forms[formName].elements['dayfreq'].selectedIndex;
+   var monthfreqSelection = document.forms[formName].elements['monthfreq'].selectedIndex;
+   var checkDate = new Date(formYear,formMonth-1,formDay);
+
+   if (formMonth < checkDate.getMonth()+1) {
+     var selectedmonth=document.forms[formName].elements['month'].options[document.forms[formName].elements['month'].selectedIndex].text;
+     var daysinmonth=formDay-checkDate.getDate();
+     alert("Sorry, "+selectedmonth+" only has "+daysinmonth+" days in "+formYear+".\n"+
+           "Changing the day to "+daysinmonth+".");
+     document.forms[formName].elements['day'].selectedIndex = formDay-checkDate.getDate()-1;
+     // reset our vars
+     formDay = formDay-checkDate.getDate();
+     checkDate = new Date(formYear,formMonth-1,formDay);
+   }
+
+   var weekOrder = parseInt((parseInt(formDay)+6)/7);
+
+   // update the day recurrance
+   if (weekOrder<=4) {
+      if (! document.forms[formName].elements['dayfreq'][2]) {  // coming from 2 choice menu
+         if (dayfreqSelection==1) {
+            dayfreqSelection++;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@THE_WDAY_OF_THISMONTH@@@","thewdayofthismonth");
+      document.forms[formName].elements['dayfreq'][2] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   } else {
+      if (document.forms[formName].elements['dayfreq'][2]) {  // coming from 3 choice menu
+         dayfreqSelection--;
+         if (dayfreqSelection < 0) {
+            dayfreqSelection = 0;
+         }
+      }
+      document.forms[formName].elements['dayfreq'].options.length =0; // clear popup
+      document.forms[formName].elements['dayfreq'][0] = new Option("@@@THISDAY_ONLY@@@","thisdayonly");
+      document.forms[formName].elements['dayfreq'][1] = new Option("@@@EVERY_WDAY_THISMONTH@@@","everywdaythismonth");
+   }
+
+   // update the month recurrance
+   if (formMonth%2) {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_ODDMONTH_THISYEAR@@@","everyoddmonththisyear");
+   } else {
+      document.forms[formName].elements['monthfreq'][1] = new Option("@@@EVERY_EVENMONTH_THISYEAR@@@","everyevenmonththisyear");
+   }
+
+   document.forms[formName].elements['dayfreq'].selectedIndex = dayfreqSelection;
+   document.forms[formName].elements['monthfreq'].selectedIndex = monthfreqSelection;
+   return true;
+}
+// -->
+</script>
+
