﻿//Given the id of an element, this script toggles its visability.
//
// Note: 'whichElement' can be more then one element simply 
//          seperate each element name with a space.

function toggleVisibleOn(whichElement)
{
    /*
    Using the space between element names passed to the 
    function inside the 'whichElement' variable, break up
    each element into it own and store them all into an
    array named ElementArray. 
    */
    var ElementArray = whichElement.split(" ");
    
    //Run through the Array and make every element Visible.
    for (i=0; i <= ElementArray.length-1; i++)
    {
        var YYY = ElementArray[i];

        if (document.getElementById)
        {
            // W3C Complient
            var style2 = document.getElementById(YYY).style;
            style2.display = "block";
        }
        else if (document.all)
        {
            // Old IE
            var style2 = document.all[YYY].style;
            style2.display = "block";
        }
        else if (document.layers)
        {
            // Old Netscape
            var style2 = document.layers[YYY].style;
            style2.display = "block";
        }
    }
}

function toggleVisibleOff(whichElement)
{
    /*
    Using the space between element names passed to the 
    function inside the 'whichElement' variable, break up
    each element into it own and store them all into an
    array named ElementArray. 
    */
    var ElementArray = whichElement.split(" ");
    
    //Run through the Array and make every element Hidden.
    for (i=0; i <= ElementArray.length-1; i++)
    {
        var YYY = ElementArray[i];

        if (document.getElementById)
        {
            // W3C Complient
            var style2 = document.getElementById(YYY).style;
            style2.display = "none";
        }
        else if (document.all)
        {
            // Old IE
            var style2 = document.all[YYY].style;
            style2.display = "none";
        }
        else if (document.layers)
        {
            // Old Netscape
            var style2 = document.layers[YYY].style;
            style2.display = "none";
        }
    }
}