// to use this script file include the following in the head section of your html page
// <script type="text/javascript" language="JavaScript" src="javaUtilityScripts.js"></script>

// This function toggles the visibily of text in you document 
// To use: the follow or something similar must be included in your html
// 
//<a onClick="toggleText('hiddenText')">Always in Veiw</a>  
//<div id="hiddenText" style="display: none;">Hidden message</div>
function toggleText(element)
{
  var element = document.getElementById(element)
 
  if ( element.style.display == 'block' )
  {
    element.style.display = 'none'
  }
  else
  {
    element.style.display = 'block'
  }
}

// This function alternates the colors of rows in a table
// To use: the follow or something similar must be included in your html
//
//<body onload="alternateTableRows('unitTable')">
//<table id="unitTable">

function alternateTableRows(id) 
{
  if (document.getElementsByTagName)
  {
    var table = document.getElementById(id);
    var rows = table.getElementsByTagName("tr");
    for (row=0; row < rows.length; row++)
    {
      if ((row % 2) == 0)
      {
        rows[row].className = "odd";
      }
    }
  }
}
