/*
function togglestylesheets(x)
{
  n = 0;
  while (document.styleSheets[n] != undefined)
    document.styleSheets[n++].disabled = x;
}
*/

/* dim_buttons_submit_reset assumes buttons have ID 'submit' and 'reset'.
For forms submissions that take a while, use this function as the onsubmit,
as in <form onsubmit="return dim_buttons_submit_reset()" ... to prevent
impatient users from submitting multiple times in a row. */
function dim_buttons_submit_reset()
{
  document.getElementById("submit").disabled = true;
  document.getElementById("reset").disabled = true;
  return true;
}

function is_not_return_key(myfield,e)
{
  // Using this in a form's onkeypress prevents the return key
  // from submitting the form.
  if (window.event)
  {
    if (window.event.keyCode == 13)
      return false;
  }
  else if (e)
  {
    if (e.which == 13)
      return false;
  }
  return true;
}
