<!-- Paste this code into an external JavaScript file named: expandCollapse.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Ultimater, Mr J :: http://www.webdeveloper.com/forum/showthread.php?t=77389 */

function toggleMe(a,b){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    closeAll(b);
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  
  return true;
}

/* my code to open  or close all hidden elements */

function openAll(count){
  var theID="para"
  var divID = theID + i;

  for (i=1;i<=count;i++)
  {
     divID= theID + i;
     var e=document.getElementById(divID);
     if(!e)return true;
      if(e.style.display=="none"){
         e.style.display="block"
      }
     

  }
  
  return true;
}

function closeAll(theID){
  
      
     var e=document.getElementById(theID);
     if(!e)return true;
     e.style.display="none"
    
  
  return true;
}
