﻿// Application  : Simple script to toggle showing and hiding an element on a page
// Written by   : Karl Stringer
// Email        : karl.stringer@zeninternet.co.uk
// Created      : 30/05/2006
// Last Updated : 30/05/2006

// Usage        : Set style to display:none on a page element, and give the element a unique id.
//                This element can then be referenced in the href or onClick event to show or hide the element

// Example      : <a href="javascript:elShowHide('unmanaged1');">Unmanaged solution</a>
//                <div id="unmanaged1" style="display:none">hidden content</div>

function elShowHide(toggleShowHide) {
  var elId = (document.getElementById) ? document.getElementById(toggleShowHide) : eval("document.all[toggleShowHide]");
  if (elId != null) {
    if (elId.style.display=="none") {
      elId.style.display="block"
    } else {
      elId.style.display="none";
    }
  }
}