<!--
// $Id: util.js,v 1.1 2002/04/18 06:03:14 kcochran Exp $

function changeDate(frm)
{
   var monthInd = document.forms[frm].Month.selectedIndex;
   var yearInd = document.forms[frm].Year.selectedIndex;
   location.search = "?Month=" + document.forms[frm].Month.options[monthInd].value + "&Year=" + document.forms[frm].Year.options[yearInd].value;
}

function addInvolved(frm)
{
   var invSel = document.forms[frm].invSel;
   var niSel  = document.forms[frm].niSel;
   var numOpts = niSel.options.length;
   for(var i = 0; i < numOpts; i++)
   {
      if(niSel.options[i].selected)
      {
         invSel.options[invSel.options.length] = new Option(niSel.options[i].text, niSel.options[i].value, false, false);
         niSel.options[i] = null;
         numOpts--; i--;
      }
   }
   //return false;
}

function removeInvolved(frm)
{
   var invSel = document.forms[frm].invSel;
   var niSel  = document.forms[frm].niSel;
   var numOpts = invSel.options.length;
   for(var i = 0; i < numOpts; i++)
   {
      if(invSel.options[i].selected)
      {
         niSel.options[niSel.options.length] = new Option(invSel.options[i].text, invSel.options[i].value, false, false);
         invSel.options[i] = null;
         numOpts--; i--;
      }
   }
   //return false;
}

function sendForm(frm)
{
   var inv = "";
   var ni = "";
   var f = document.forms[frm];
   for(var i = 0; i < f.invSel.options.length; i++)
   {
      inv += f.invSel.options[i].value + ";";
   }
   for(var i = 0; i < f.niSel.options.length; i++)
   {
      ni += f.niSel.options[i].value + ";";
   }
   f.involved.value = inv.substring(0, inv.length - 1);
   f.not_involved.value = ni.substring(0, ni.length - 1);
   return confirm("This will submit the event to the calendar.  Do not select send again, or there will be a duplicate event posted.  This means you, Victor! :D");
}

// -->
