PWin = null;

function initCalendar ()
{
  var eventdetails = document.getElementById('eventdetails');
  if (eventdetails.hasChildNodes())
  {
    var children = eventdetails.childNodes;
    for (var i = 0; i < children.length; i++)
    {
      if (children[i].nodeName == 'LI')
      {
        thischild = document.getElementById(children[i].getAttribute('id'));
        thischild.style.display = "none";
      }
    }
  }
}

function goDate(gowhere)
{
  if (gowhere == 'selected')
  {
    document.selectdate.submit();
    return true;
  }
  else if (gowhere == 'next')
  {
    if (document.selectdate.date.selectedIndex < 1)
    {
      return false;
    }
    else
    {
      document.selectdate.date.selectedIndex--;
      return true;
    }
  }
  else if (gowhere == 'previous')
  {
    var lastoption = document.selectdate.date.length - 1;

    if (document.selectdate.date.selectedIndex >= lastoption)
    {
      return false;
    }
    else
    {
      document.selectdate.date.selectedIndex++;
      return true;
    }
  }

  return false;
}

function showEvent (pid)
{
  hideEvent();

  PWin = document.getElementById(pid);
  PWin.style.position = "absolute";
  PWin.style.display = "block";

  return false;
}

function hideEvent ()
{
  if (PWin)
  {
    var event = document.getElementById(PWin);
    PWin.style.display = "none";
    PWin.style.position = "static";
    PWin = null;
  }
//  var event = document.getElementById(pid);
//  event.style.display = "none";
//  event.style.position = "static";

  return false;
}

