/*********************************************** * TOGGLE VISIBILITY * Function to toggle visibility of objects, normally used for DIVs. * Inputs are ID of object (object must have an ID), followed by display style: e.g. "block" or "inline" * Copyright Marian Zamfirescu. This note must be kept with all instances of the sripts wherever used. * This script may not be re-distributed in any for-profit form. ***********************************************/ function showhide(obj, displaystyle){ prop = "display"; switch (true) { case (document.getElementById(obj).style[prop] == "" ): document.getElementById(obj).style[prop] = "none"; break; case (document.getElementById(obj).style[prop] != displaystyle): document.getElementById(obj).style[prop] = displaystyle; break; default : document.getElementById(obj).style[prop] = "none"; } }