function comboMenuGo (combo)
{
  url = combo.options[combo.selectedIndex].value;
  window.location.href = url;
}

function DoFormSubmit (imgSubmit)
{
  imgSubmit.disabled=true;
}

function DoRefresh()
{
  window.location.reload(true);
}

function goBack ()
{
  history.back();
}

function InsertAge(FromTime,OldAge,OldPrefix,OldSuffix)
{
  var thisTime = new Date();

  var ageTotalMins = Math.floor((thisTime-FromTime)/60000);
  var ageDays = Math.floor(ageTotalMins/60/24);
  var ageHours = Math.floor(ageTotalMins/60)-(ageDays*24);
  var ageMins = ageTotalMins-(ageHours*60);

  if (ageTotalMins < 0)
  {
    document.write("unknown");
  }
  else
  {
    if (ageTotalMins >= OldAge)
    {
      document.write(OldPrefix);
    }

    if (ageDays >= 1)
    {
      document.write(ageDays + " day(s)")
    }
    else
    {
      if (ageHours >= 1)
      {
        document.write(ageHours + " hour(s)")
      }
      else
      {
      	if (ageTotalMins >= 1)
      	{
          document.write(ageMins + " minute(s)")
        }
        else
        {
          document.write("less than 1 minute")
        }
      }
    }

    if (ageTotalMins >= OldAge)
    {
      document.write(OldSuffix);
    }
  }
}

function toggleDivVisible(theDiv)
{
  theDiv.style.display = (theDiv.style.display == "none" ) ? "" : "none";
}

function toggleHierNodeExpanded(theDiv,expandImg,expandedImgURL,collapsedImgURL)
{
  if (theDiv.style.display == "none")
    {
      expandImg.src = collapsedImgURL;
      theDiv.style.display = "";
    } else
    {
      expandImg.src = expandedImgURL;
      theDiv.style.display = "none";
    }
}

function toggleSectionVisible(theDiv,theImg)
{
  theDiv.style.display = (theDiv.style.display == "none" ) ? "" : "none";

  if (theDiv.style.display != "none")
    {theImg.src = theImg.imgSourceOpen}
    else
    {theImg.src = theImg.imgSourceClosed}
}

function UpdateButtonImgState (image,state)
{
  image.src = state
}