diff --git a/ws/Docbook/CustomLayer/Common/common.xsl b/ws/Docbook/CustomLayer/Common/common.xsl index 7769cc72a9eaae327d3db36d4f2f74c93cd6fdfa..7129ecfe8ad7403f4f3387e718e451a8f8d98b63 100644 --- a/ws/Docbook/CustomLayer/Common/common.xsl +++ b/ws/Docbook/CustomLayer/Common/common.xsl @@ -14,23 +14,21 @@ <xsl:param name="toggleDisplayScript"> <script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript"> <!-- goiks extension head start --> - function toggleDisplay(inputEl) { - divElem = nextSibling(inputEl); - if (divElem.style.visibility == 'hidden') { - divElem.style.visibility = 'visible'; - inputEl.setAttribute('value','-'); - } else { - divElem.style.visibility = 'hidden'; - inputEl.setAttribute('value','+'); - } - } - function nextSibling(n) { - x=n.nextSibling; - while (x.nodeType!=1) { - x=x.nextSibling; - } - return x; - } + "use strict"; + function toggleDisplay(inputElement) { + var divElement = inputElement.nextElementSibling; + + switch(divElement.style.visibility) { + case 'hidden': + divElement.style.visibility = 'visible'; + inputElement.setAttribute('value', '-'); + break; + default: + divElement.style.visibility = 'hidden'; + inputElement.setAttribute('value', '+'); + break; + } + } </script> </xsl:param> @@ -87,4 +85,4 @@ </xsl:template> -</xsl:stylesheet> \ No newline at end of file +</xsl:stylesheet>