/* 

1 - the Loader() function is called via the body element's onload event and ensures that all description are hidden as the page loads if the browser understands the DOM.

2 - The Toggle() function takes the following arguments :
  a) id: id name of the container element.
  b) tagname: element that contains the descriptions to be hidden.
  c) state: class name that (!important do not change).
  d) tglid - id name to be used by the show/hide toggle element (not required onload).

*/

function loader()
{
  if (document.getElementById)
  {
    hideall();
  }
}

function hideall()
{
  if (document.getElementById)
  {
	var dds = document.getElementsByTagName("dd");
	for (var i = 0; i < dds.length; i++)
	{
	   dds[i].className = "hide";
    }
  }
}

function show(id)
{
  if (document.getElementById)
  {
    hideall();
	var dd = document.getElementById(id);
	dd.className = "show";
   }
}

function showHide(id)
{
      if (document.getElementById)
      {
        if (document.getElementById(id).className == "show")
        {
            document.getElementById(id).className = "hide";
        }
        else{
            hideall();
	        var dd = document.getElementById(id);
	        dd.className = "show";
        }
      }  
}

function showHideSection(id,section)
{
      if (document.getElementById)
      {
        if (document.getElementById(id).className == "show")
        {
            document.getElementById(id).className = "hide";
        }
        else{
            hideallSection(section);
	        var dd = document.getElementById(id);
	        dd.className = "show";
        }
      }  
}

function hideallSection(section)
{
  if (document.getElementById)
  {
    var parent = document.getElementById(section);
    if (parent)
    {
	    var dds = parent.getElementsByTagName("dd");
	    for (var i = 0; i < dds.length; i++)
	    {
	       dds[i].className = "hide";
        }
    }
  }
}

function hideSection(section)
{
  if (document.getElementById)
  {
     document.getElementById(section).className = "hide";
  }
}