<!-- Hide from old browsers

var debugWindow;
var debugging=0;
var seqNum=0;

var currentSubjImg="1";

// Browser sensing
var isNS=0;
var isIE=0;
var docObj;
var styleObj;
var availableWidth;
var availableHeight;

// Determine the browser name and version
var browserName=navigator.appName;
var browserVerStr=navigator.appVersion;
var browserNum=parseInt(navigator.appVersion);

// Variables for home page slide show
var numSlides=14;
var curSlide=1;
var runSlideShow=true;


//document.writeln('checking browser<br>');
if (browserName=="Netscape") {
  isNS=1;
}
if (browserName=="Microsoft Internet Explorer"){
  isIE=1;
}

docObj= (isNS) ? 'document' : 'document.all';
styleObj= (isNS && browserNum < 5) ? '' : '.style';

function setWidthHeight() {
  // do object detection
  if (window.innerHeight) { // Mozilla, Opera, Safari
    availableWidth=window.innerWidth;
    availableHeight=window.innerHeight;
  }
  else if (window.document.documentElement.clientHeight) { // IE standards mode
    availableWidth=document.documentElement.clientWidth;
    availableHeight=document.documentElement.clientHeight;
    }
  else { // quirks mode, old versions of IE
    availableWidth=window.document.body.clientWidth;
    availableHeight=window.document.body.clientHeight;
 }
}

function initSetUp() {
  setWidthHeight();
}

// Display a sub-window
//
// Arguments:
//    subWinPath     pathname of document to display in sub-window
//    winWidth    width, in pixels, of sub-window
//    winHeight   height, in pixels, of sub-window
//
function popupSubWindow(winPath, winWidth, winHeight) {
  var features;

  features="width=" + winWidth + "," +
           "height=" + winHeight + "," +
           "resizable,scrollbars,location,status,menubar,toolbar";
  var w=window.open(winPath, // URL
                    self.name + seqNum++, // unique window name
                    features); // features
}

// Go to a new page.
//
// Arguments:
//  pageSource   relative pathname of new page
//  targetName   '_top' makes the new page the top level, removing all frames
//                      Other values are interpreted as the name of a frame
//                      relative to the parent window
function goToPage(pageSource, targetName) {
  if (targetName=="_top") {
    top.location=pageSource;
  }
  else {
    parent.frames[targetName].location=pageSource;
  }
}

// Show an element
//
// Arguments:
//  elem   ID of element to be shown
function showElement(elem) {
  document.getElementById(elem).style.visibility="visible";
}

// Hide an element
//
// Arguments:
//  elem   ID of element to be hidden
function hideElement(elem) {
  document.getElementById(elem).style.visibility="hidden";
}

// Hide one element and show another element
//
// Arguments:
//  hideElem   ID of element to be hidden
//  showElem   ID of element to be shown
function hideAndShowElement(hideElem, showElem) {
  hideElement(hideElem);
  showElement(showElem);
}

// Toggle visibility of an element
//
// Arguments:
//  elem   ID of element to be shown
function toggleVisibility(elem) {
  var el=document.getElementById(elem);
  var visi=el.style.visibility;
  if (visi != "visible")
    el.style.visibility="visible";
  else
    el.style.visibility="hidden";
}

// Change the text color of an element
//
// Arguments:
//
// elem   ID of element
// color  new color
//
function changeColor(elem, color) {
  var el=document.getElementById(elem);
  el.style.color=color;
}

// Swap the image in the specified element
//
// Arguments:
//  elem       Element ID
//  imagePath  Pathname of new image
//
function swapImage(elem, imagePath) {
  document.getElementById(elem).src=imagePath;
}

// Display text in a new window
function test() {
  var w=window.open("", // URL not specified
                    "window" + seqNum++, // unique window name
                    "width=400,height=400,left=200,top=200,screenX=200,screenY=200"); // features
  var d=w.document;
  d.write("<html>");
  d.write("<body>");
  d.write("This is a test javascript function");
  d.write("</html>");
  d.close();
  return true;
}

// Blank page
function blank()
{
  return "<html><body></body></html>";
}

// Do Nothing
function doNothing() {
}

// TEST
function testFunc()
{
  alert("test function invoked");
}



// onLoad() setup for the home page
function homeSetUp() {

  // Replace the "loading" message
  var x = document.getElementById("loadShow");
  var y = document.getElementById("stopShow");
  if (x)
    x.style.visibility="hidden";
  if (y)
    y.style.visibility="visible";

  // Determine which slide will go first
  var now = new Date();
  var count = now.getTime();
  curSlide = (count % numSlides) + 1;
  var curSlideElem = "slide" + curSlide;
  showElement(curSlideElem);

  // Start the timer for the slide show
  setInterval("changeImage()", 3000); // 3000 ms is 3 seconds

}


// onUnload() clean-up for home page
function homeCleanUp() {
  clearInterval();
}


// Home page function to automatically change the slide
// if the slide show is running
function changeImage()
{

  if (runSlideShow != true)
    return;
    
  nextImage();
}

// Home page function to show the next slide
function nextImage()
{
  var slidePrev = "slide" + curSlide; 
  var slideNext;  

  if (numSlides < 2)
    return; // Nothing to change
   
  if (curSlide == numSlides)
   curSlide = 1;
  else
   curSlide++;

  slideNext = "slide" + curSlide;
 
  var x = document.getElementById(slidePrev);
  var y = document.getElementById(slideNext);
  if (x)
    x.style.visibility="hidden";
  if (y)
    y.style.visibility="visible";
}

// Home page function to show the previous slide
function prevImage()
{
  var slideNext = "slide" + curSlide; 
  var slidePrev;  

  if (numSlides < 2)
    return; // Nothing to change
   
  if (curSlide == 1)
   curSlide = numSlides;
  else
   curSlide = curSlide - 1;

  slidePrev = "slide" + curSlide;
 
  var x = document.getElementById(slideNext);
  var y = document.getElementById(slidePrev);
  if (x)
    x.style.visibility="hidden";
  if (y)
    y.style.visibility="visible";
}

// Stop the slide show
//
function StopSlideShow()
{
  runSlideShow = false;
  var x = document.getElementById("stopShow");
  var y = document.getElementById("startShow");
  if (x)
    x.style.visibility="hidden";
  if (y)
    y.style.visibility="visible";
}

// Start the slide show
//
function StartSlideShow()
{
  runSlideShow = true;
  var x = document.getElementById("startShow");
  var y = document.getElementById("stopShow");
  if (x)
    x.style.visibility="hidden";
  if (y)
    y.style.visibility="visible";
}


// Write the Navigation links
function WriteNav(elem)
{
  var el = document.getElementById(elem);
  el.innerHTML = 
    /* Home */
   "<a href='index.htm' style='margin-left: 10px; margin-right: 20px;'>Home</a>" + 
   /* Archives */
  "<a href='archives.htm' style='margin-right: 20px;'>Archives</a>" + 
   /* About Us */
   "<a href='about_us.htm' style='margin-right: 20px;'>About&nbsp;Us</a>" + 
   /* Events */
   "<a href='events.htm' style='margin-right: 20px;'>Events</a>" +
   /* News */
   "<a href='news.htm' style='margin-right: 20px;'>News</a>" +
   /* Blog */
   "<a href='http://apagus.blogspot.com' style='margin-right: 20px;'>Blog</a>" +
   /* Members */
   "<a href='members/index.htm' style='margin-right: 20px;'>Members</a>" +
   /* Members */
   "<a href='links.htm' style='margin-right: 20px;'>Links</a>";
}

// Write the Navigation links on members page
function WriteNavMembers(elem)
{
  var el = document.getElementById(elem);
  el.innerHTML = 
    /* Home */
   "<a href='../index.htm' style='margin-left: 10px; margin-right: 20px;'>Home</a>" + 
   /* Archives */
  "<a href='../archives.htm' style='margin-right: 20px;'>Archives</a>" + 
   /* About Us */
   "<a href='../about_us.htm' style='margin-right: 20px;'>About&nbsp;Us</a>" + 
   /* Events */
   "<a href='../events.htm' style='margin-right: 20px;'>Events</a>" +
   /* News */
   "<a href='../news.htm' style='margin-right: 20px;'>News</a>" +
   /* Blog */
   "<a href='http://apagus.blogspot.com' style='margin-right: 20px;'>Blog</a>" +
   /* Members */
   "<a href='index.htm' style='margin-right: 20px;'>Members</a>" +
   /* Members */
   "<a href='../links.htm' style='margin-right: 20px;'>Links</a>";
}

// Write the Bio Div on archives page
function WriteBioArchive(elem, bio, allowScroll)
{
   //alert(elem + " " +bio);
  var el = document.getElementById(elem);
  var bioFrame =
     "<iframe src='PrinterFriendly/Bios/" + bio + 
    ".htm' width='100%' height='1800' frameborder='0' scrolling=" + allowScroll +"></iframe>";
     //alert("bioFrame=" + bioFrame);
   //alert("before innerHTML=" + el.innerHTML);
  el.innerHTML = bioFrame;
   //alert("after innerHTML=" + el.innerHTML);
}
// stop hiding from old browsers -->
