/* library.js */

var toggledDisplay = new Object();

function toggleDisplay(bDisplayed)
{
  if(!document.getElementById || toggleDisplay.arguments.length < 2) return;
  var displayed = new Object();
      displayed['true'] = 'block';
      displayed['false'] = 'none';
  for(var i = 1; i < toggleDisplay.arguments.length; i++)
  {
    oDisplay = document.getElementById(toggleDisplay.arguments[i]);
    if(oDisplay)
    {
      oDisplay.style.display = displayed[bDisplayed];
      if(bDisplayed)
      {
        oImages = oDisplay.getElementsByTagName('IMG');
        for(var j = 0; j < oImages.length; j++)
          oImages[j].src = oImages[j].src;
      }
       if(typeof toggledDisplay[toggleDisplay.arguments[i]] != 'undefined')
        toggledDisplay[toggleDisplay.arguments[i]] = !bDisplayed;
    }
  }
}


function newWindow(href, target, width, height)
{
  var returnValue = false;
  var features = (width != null && height != null) ? ((arguments.length == 4) ? 'noscrollbars,status,width=' + width + ',height=' + height : ((arguments[4]) ? arguments[4] + ',width=' + width + ',height=' + height : 'width=' + width + ',height=' + height)) : ((arguments.length > 4) ? arguments[4] : null);
  if(width != null && height != null && window.screen)
  {
    var pxLeft = ((screen.availWidth - width - 10) * .5);
    var pxTop = ((screen.availHeight - height - 30) * .5);
    features += ',left=' + pxLeft + ',top=' + pxTop + ',x=' + pxLeft + ',y=' + pxTop;
  }
  if(!window.open)
    returnValue = true;
  else
  {
    if(features != null)
      self[target + 'Win'] = window.open(href, target, features);
    else
      self[target + 'Win'] = window.open(href, target);
    if(!self[target + 'Win'])
    {
      if(enableBlockerMessage)
        alert('You appear to be using pop-up blocking software.\n\nYou are trying to use a feature of this site that uses a pop-up window.\n\nPlease disable your pop-up blocker or enable pop-ups for this site.');
      else
        returnValue = true;
    }
    else if(self[target + 'Win'].focus)
      self[target + 'Win'].focus();
  }
  return returnValue;
}