function voltJSDisplayShowHide(target,
                               showhide)
{ 
  obj = document.getElementById(target);
  obj.style.display = ((showhide == 'hide') ? 'none' : '');
} 

function voltJSDisplayShowHideToggle(target)
{ 
  obj = document.getElementById(target);
  obj.style.display = ((obj.style.display == 'none') ? '' : 'none');
}

function voltJSDisplaySetElementStyle(id, style, color)
{
  document.getElementById(id).style.color = "#" + color;
}

function voltJSDisplaySetElementColor(id, color)
{
  document.getElementById(id).style.color = "#" + color;
}

function voltJSDisplayGetWindowDimensions()
{
  var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
    }
  }

  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight ); 

  var dimensions = new Array(2);

  dimensions[0] = myWidth;
  dimensions[1] = myHeight;

  return (dimensions);
}

function voltJSDisplayGetScreenDimensions()
{
  var dimensions = new Array(2);

  dimensions[0] = screen.width;
  dimensions[1] = screen.height;

  return (dimensions);
}

function voltJSDisplaySectionToggle(treeitem,
                                    expand)
{
  var tbl = document.getElementById(treeitem + "_container"); // W3C DOM level 2
  var icon = document.getElementById(treeitem + "_icon");     // W3C DOM level 2

  if (expand == true)
  {
    tbl.style.display = "";
    icon.src = "../images/minus.gif";
  }
  else
  {
    if (tbl.style.display == "")
    {
      tbl.style.display = "none";
      icon.src = "../images/plus.gif";
      return;
    }
    else
    {
      tbl.style.display = "";
      icon.src = "../images/minus.gif";
    }
  }

  window.location.hash = treeitem;
}
