﻿function toggleFAQ(id)
{
  var div = document.getElementById(id);
  
  var divColl = document.getElementsByTagName('DIV');
  for (var i=0; i<divColl.length; i++)
  {
    if (divColl[i].id.indexOf('divFAQ') == 0 && divColl[i].id != id)
    {
      divColl[i].style.display = 'none';
    }
  }
  
  if (div != null)
  {
    div.style.display = (div.style.display == 'none') ? '' : 'none';
  }
  
  return false;
}

var winPopup = null;

function popupExternal(pageUrl, width, height)
{
  if (winPopup != null)
  {
    winPopup.close();
  }
  
  var iTop = parseInt((screen.availHeight - height) / 2);
  var iLeft = parseInt((screen.availWidth - width) / 2);
  winPopup = window.open(pageUrl, "winPopup", "scrollbars, resizable, resizeable, width=" + width + "px, height=" + height + "px, top=" + iTop + "px, left=" + iLeft + "px");
  winPopup.focus();
  
  return false;
}

function popupImage(imageTitle, imageName, width, height)
{
  if (winPopup != null)
  {
    winPopup.close();
  }
  
  var iTop = parseInt((screen.availHeight - height) / 2);
  var iLeft = parseInt((screen.availWidth - width) / 2);
  var strURL = "../Popup.aspx?title=" + imageTitle + "&image=" + imageName + "&width=" + width + "&height=" + height + "&left=" + iLeft + "&top=" + iTop;
  winPopup = window.open(strURL, "winPopup", "width=" + width + "px, height=" + height + "px, top=" + iTop + "px, left=" + iLeft + "px");
  winPopup.focus();
  
  return false;
}
