function addEvent()
{
     displayText('maincontent','modules.php?mod=admincalendar&req=add');
     return false;
}

function insertEvent(form)
{
     var url='modules.php?mod=admincalendar&req=insert'+
               '&startyear='+form.startyear.value+
               '&startmonth='+form.startmonth.value+
               '&startday='+form.startday.value+
               '&endyear='+form.endyear.value+
               '&endmonth='+form.endmonth.value+
               '&endday='+form.endday.value+
               '&starttime='+form.starttime.value+
               '&endtime='+form.endtime.value+
               '&event='+escape(form.event.value)+
               '&description='+escape(form.description.value)+
               '&location='+escape(form.location.value);
     ret=serverFunction(url);
     displayText('maincontent','modules.php?mod=admincalendar');
     return false;
}

function editEvent(eventid)
{
     displayText('maincontent','modules.php?mod=admincalendar&req=edit&eventid='+eventid);
     return false;
}

function updateEvent(form)
{
     var url='modules.php?mod=admincalendar&req=update'+
               '&eventid='+form.eventid.value+
               '&startyear='+form.startyear.value+
               '&startmonth='+form.startmonth.value+
               '&startday='+form.startday.value+
               '&endyear='+form.endyear.value+
               '&endmonth='+form.endmonth.value+
               '&endday='+form.endday.value+
               '&starttime='+form.starttime.value+
               '&endtime='+form.endtime.value+
               '&event='+escape(form.event.value)+
               '&description='+escape(form.description.value)+
               '&location='+escape(form.location.value);
     ret=serverFunction(url);
     displayText('maincontent','modules.php?mod=admincalendar');        
     return false;
}

function deleteEvents(form)
{
     var norecs=form.del.length;
     var url='modules.php?mod=admincalendar&req=delete'
     for (x=0, y=0; x < norecs; x++)
          {
          if (form.del[x].checked==true)
               {
               url+='&recno'+y+'='+form.recno[x].value;
               y++;
               }
          }
     url+='&norecs='+y;
     ret=serverFunction(url);
     displayText('maincontent','modules.php?mod=admincalendar');         
     return false;
}