// Used to swap inset content in bio material, here to enlarge/minimize images & captions:
function toggleSwapDiv(divID1,divID2) {  // Takes as params two valid DIV IDs.
  if (document.getElementById(divID1).style.display == 'block') {
      document.getElementById(divID1).style.display = 'none';
      document.getElementById(divID2).style.display = 'block'; // Faster by not checking to see if both are displayed.
  } else {
      document.getElementById(divID1).style.display = 'block';
      document.getElementById(divID2).style.display = 'none'; // Faster by not checking to see if both are displayed.
  }

}

// Array of indicator graphics used for hide-show text divs.
var indicator_arrow  = new Array();
  indicator_arrow[0] = new Image(9,9);
  indicator_arrow[1] = new Image(9,9);
  indicator_arrow[2] = new Image(9,9);
  indicator_arrow[3] = new Image(9,9);
  
  indicator_arrow[0].src = '../images/global/arrowRight.gif';
  indicator_arrow[1].src = '../images/global/arrowRightHover.gif';
  indicator_arrow[2].src = '../images/global/arrowDown.gif';
  indicator_arrow[3].src = '../images/global/arrowDownHover.gif';

// Reveal images based onmouseover link that specifies... 
// ...[image ID] and [new image's url or array element id].
function swap(imageName,url) {
  if (document.getElementById) {
    document.getElementById(imageName).src = url;
  } else if (document.images) {
    (document.images[imageName].src = url);
  }
}
function swapIndicator(imageName) {
  if (document.getElementById(imageName).src == indicator_arrow[0].src) {
      document.getElementById(imageName).src = indicator_arrow[1].src;
  } else if (document.getElementById(imageName).src == indicator_arrow[1].src) {
      document.getElementById(imageName).src = indicator_arrow[0].src;
  } else if (document.getElementById(imageName).src == indicator_arrow[2].src) {
      document.getElementById(imageName).src = indicator_arrow[3].src;
  } else if (document.getElementById(imageName).src == indicator_arrow[3].src) {
      document.getElementById(imageName).src = indicator_arrow[2].src;
  }
}
function swapDivIndicator(imageName) { // The graphic indicator is already in a hover statea when clicked.
  if (document.getElementById(imageName).src == indicator_arrow[1].src) {
    (document.getElementById(imageName).src = indicator_arrow[3].src);
  } else if (document.getElementById(imageName).src == indicator_arrow[3].src) {
    (document.getElementById(imageName).src = indicator_arrow[1].src);
  }
}
function toggleSwap(imageName) { // To change indicator icon when a div is revealed/hidden:
  if (document.getElementById(imageName).src == indicator_arrow[1].src) {
    document.getElementById(imageName).src = indicator_arrow[3].src;
  } else if (document.getElementById(imageName).src == indicator_arrow[3].src) {
    (document.getElementById(imageName).src = indicator_arrow[1].src);
  }
}

function hideDiv(id) {      // Hide a named div.
  document.getElementById(id).style.display = 'none';
}
function hideDivOfParent(id) {      // Hide a named div.
  parent.document.getElementById(id).style.display = 'none';
}
function showDiv(id) {      // Hide a named div.
  document.getElementById(id).style.display = 'block';
}
function toggleShowDiv(id) {
  if (document.getElementById(id).style.display == 'none') {
      document.getElementById(id).style.display = 'block';
  } else {
      document.getElementById(id).style.display = 'none';
  }
}
// var currDiv = ""; // The default here should be a valid (incl. a null-content) div that can be hidden or revealed without side effects.
function swapDiv(id) {
  hideDiv(currDiv);
  showDiv(id);
  currDiv = id;
}

function myVoid() {
  return;
}

// Custom clear function; simply reloads original page.
function clearFormFields() {
  document.location = document.location;
}
function changeURL(url) {
  document.location.href=url;
}

/*
function popWin(url,windowname,w,h,x,y) {
    popUp=window.open(url,windowname,width="+w+",height="+h+",left="+x+",top="+y+");
}

var WindowObjectReference = null; // global variable
function openWin(strUrl, strWindowName) {
  if (WindowObjectReference == null || WindowObjectReference.closed) {
      WindowObjectReference = window.open(strUrl, strWindowName,"resizable=yes,scrollbars=yes,status=yes");
  } else {
      WindowObjectReference.focus();
      WindowObjectReference.location.href(strUrl);
  }
}
*/