/* mouse clicked on the tab */
function tab_toggle(obj)
{
  for (var index = 1; document.
    getElementById("tab" + index); index++)
  {
    var className = document.
      getElementById("tab" + index).className;
    var bodyStyle = document.
      getElementById("tabb" + index).style;
    if (className.match(/act$/))
      document.getElementById("tab" + index).className =
        className.substring(0, className.length - 3);
    if (bodyStyle.display != "none")
      document.getElementById("tabb" + index).
	    style.display = "none";
  }
  if (obj.className.match(/sel$/))
    obj.className = obj.className.substring(0,
      obj.className.length - 3);
  obj.className = obj.className + "act";
  document.getElementById("tabb" +
    obj.id.substring(3, 4)).style.display = "block";
}

/* mouse moved over the tab */
function tab_over(obj)
{
  if (obj.className.match(/act$/))
    return;
  if (obj.className.match(/sel$/))
    return;
  obj.className = obj.className + "sel";
}

/* mouse moved out from tab */
function tab_out(obj)
{
  if (!obj.className.match(/sel$/))
    return;
  obj.className = obj.className.substring(0,
    obj.className. length - 3);
}
