//
// Copyright 2007, ZoomOnTime, Inc.
//
//this script relies on prototype library
//this function hides and shows divs based on the input arrays; optionally it hides browser scroll bar (false by default)
function div_toggle(hide_divs, show_divs, hide_select)
{
//first we hide divs
  if (hide_divs.length > 0)
  {
    for (i=0; i<hide_divs.length; i++)
    {
      $(hide_divs[i]).style['display'] = 'none';
    }
  }
//now we show divs
  if (show_divs.length > 0)
  {
    for (i=0; i<show_divs.length; i++)
    {
      $(show_divs[i]).style['display'] = ($(show_divs[i]).tagName == 'DIV') ? 'block' : '';
    }
  }
//now we hide or show scroll-bar
  if (hide_select)
  {
    if (document.all)
    {
      document.all.blockIEselect.filters["revealTrans"].apply();
      var myEls = document.getElementsByTagName("select");
      for ( i=0;i<myEls.length;i++ )
      {
        myEls[i].style.visibility="hidden";
      }
    }
  }
  else
  {
    if (document.all)
    {
      //document.all.blockIEselect.filters["revealTrans"].transition = 12;
      document.all.blockIEselect.filters["revealTrans"].Play();
      var myEls = document.getElementsByTagName("select");
      for ( i=0;i<myEls.length;i++ )
      {
        myEls[i].style.visibility="visible";
      }
    }
  }
}

//this script relies on prototype library
//it adjust the size (height and width) of the given element to the height of the screen 
//including scrollable part of it

function set_max_size (div_id)
{
  var maxHeight
  var maxWidth
  var test1 = document.body.scrollHeight;
  var test2 = document.body.offsetHeight
  if (test1 > test2) // all but Explorer Mac
  {
    maxHeight = document.body.scrollHeight;
    maxWidth = document.body.scrollWidth;
  }
  else // Explorer Mac;
       //would also work in Explorer 6 Strict, Mozilla and Safari
  {
    maxHeight = document.body.offsetHeight;
    maxWidth = document.body.offsetWidth;
  }
  $(div_id).style.height = maxHeight;
  $(div_id).style.width = maxWidth;
}