////////////////////////////////////////////////////////////////////////////////////////////////////
// JavaScript - Copyright Peter Boulton, Data Perceptions 2006
// Usage: the span which is hidden / shown is given an ID.
//        the + or - image is given an id which is the same as the hidden/shown span + "IMG"
//        for example:
////////////////////////////////////////////////////////////////////////////////////////////////////
//    ** Include this file in the <head> section of the web page **
//    <script src="peteutils.js" type="text/javascript"></script>
//    ** images expand.gif and collapse.gif must be in the 'images' subfolder beneath the web page **
//    ** Then for each expanding link/para.... **
//    <span onclick="ToggleDiv('span_name')"  style="font-weight: bold;cursor: hand">
//            <img id="span_nameIMG"  src="images/expand.gif" /> Click the '+' for more detail
//    <span>
//    <span id="span_name" style="display: none">
//            This is the text which is hidden / shown
//    <span>
////////////////////////////////////////////////////////////////////////////////////////////////////

function ToggleDiv(divID)
{
  if(document.getElementById (divID).style.display == 'inline-block')
  {
    document.getElementById (divID).style.display='none';
    document.getElementById (divID+'IMG').src="images/expand.gif";
  }
  else
  {
    document.getElementById (divID).style.display='inline-block';
    document.getElementById (divID+'IMG').src="images/collapse.gif";
  }
}
