function loadGlobalNav(whichNav) {
  var navBarSpan = document.getElementById('globalNavText');
  switch (whichNav) {
    case 'prospects':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/prospects2/about.html" title="Learn about ECSI">ABOUT US</a> &nbsp;|&nbsp; <a href="/prospects2/services.html" title="Learn about ECSI\'s services">SERVICES</a> &nbsp;|&nbsp; <a href="/prospects2/testimonial.html" title="Learn what our clients are saying about us.">TESTIMONIALS</a> &nbsp;|&nbsp; <a href="/prospects2/news.html" title="Learn about new items in the industry and about ECSI">NEWS</a> &nbsp;|&nbsp; <a href="/prospects2/contact.html" title="Contact ECSI">CONTACT</a> &nbsp;|&nbsp; <a href="/video/index.html" title="ECSI Videos">VIDEOS</a>';
      break;
    case 'borrower':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/bwr/borrower.html" title="Return to the main Borrower page">BORROWERS</a> &nbsp;|&nbsp; <a href="/bwr/contacts.html" title="This page contains all of the information you need to contact ECSI: Address, phone and email information">CONTACTS</a> &nbsp;|&nbsp; <a href="/bwr/links_borrower.html" title="Other web resources that may be of interest">LINKS</a>';
      break;
    case 'student':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/tpp/student.html" title="Return to the main Students page">STUDENTS</a> &nbsp;|&nbsp; <a href="/bwr/contacts.html" title="This page contains all of the information you need to contact ECSI: Address, phone and email information">CONTACTS</a> &nbsp;|&nbsp; <a href="/bwr/links_borrower.html" title="Other web resources that may be of interest">LINKS</a>';
      break;
    case 'client':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="/client/clients.html" title="Return to the main Client page">CLIENTS</a> &nbsp;|&nbsp; <a href="/client/contacts.html" title="This page contains all of the information you need to contact ECSI: Address, phone and email information">CONTACTS</a> &nbsp;|&nbsp; <a href="/video/index.html" title="ECSI Videos">VIDEOS</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/login" title="Login to view and manage your borrower and student information">SECURE LOGIN</a>';
      break;
    case 'agency':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="/agency/agency.html" title="Return to the main Agency page">AGENCIES</a> &nbsp;|&nbsp; <a href="/client/contacts.html" title="This page contains all of the information you need to contact ECSI: Address, phone and email information">CONTACTS</a> &nbsp;|&nbsp; <a href="/video/index.html" title="ECSI Videos">VIDEOS</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/cgi-bin/acgi-entry.exe" title="View and manage your clients\' inventory">ONLINE SERVICES</a>';
      break;
    case 'prom':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/tpp/student.html" title="Return to the main Students page">STUDENTS</a> &nbsp;|&nbsp; <a href="/bwr/contacts.html" title="This page contains all of the information you need to contact ECSI: Address, phone and email information">CONTACTS</a> &nbsp;|&nbsp; <a href="/bwr/links_borrower.html" title="Other web resources that may be of interest">LINKS</a>';
      break;
    case 'general':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/bwr/borrower.html" title="Return to the main Borrower page">BORROWERS</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/tpp/student.html" title="Return to the main Student page">STUDENTS</a> &nbsp;|&nbsp; <a href="/client/clients.html" title="Return to the main Client page">CLIENTS</a> &nbsp;|&nbsp; <a href="/agency/agency.html" title="Return to the main Agency page">AGENCIES</a>';
      break;
    case 'generalWithVideo':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/bwr/borrower.html" title="Return to the main Borrower page">BORROWERS</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/tpp/student.html" title="Return to the main Student page">STUDENTS</a> &nbsp;|&nbsp; <a href="/client/clients.html" title="Return to the main Client page">CLIENTS</a> &nbsp;|&nbsp; <a href="/agency/agency.html" title="Return to the main Agency page">AGENCIES</a> &nbsp;|&nbsp; <a href="/video/index.html" title="ECSI Videos">VIDEOS</a>';
      break;
    case 'noNav':
      navBarSpan.innerHTML = '&nbsp;';
      break;
    case 'webX':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="javascript:launch(\'webx-menu\')" title="Return to Main Menu">MENU</a> &nbsp;|&nbsp; <a href="javascript:launch(\'webx-logoff\')" title="Logout of Online Services">LOGOUT</a>';
      break;
    case 'myAcct':
      var mySess = document.getElementById('xsess').value;
      var myCGI = document.getElementById('navcgi').value;
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/cgi-bin/' + myCGI + '.exe?bcgi00' + mySess + '" title="Return to the Menu">MENU</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/cgi-bin/' + myCGI + '.exe?bcgi44' + mySess + '" title="Make a Payment">MAKE A PAYMENT</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/bwr/livehelper.html" title="Chat with a Customer Service Representative" target="_blank">LIVE CUSTOMER SERVICE</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/bwr/contacts.html" title="Contact ECSI" target="_blank">CONTACTS</a> &nbsp;|&nbsp; <a href="/cgi-bin/' + myCGI + '.exe?bcgi06' + mySess + '" title="Logout of My Account">LOGOUT</a>';
      break;
    case 'promt8':
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="/bwr/contacts.html" title="This page contains all of the information you need to contact ECSI: Address, phone and email information">CONTACTS</a> &nbsp;|&nbsp; <a href="/bwr/links_borrower.html" title="Other web resources that may be of interest">LINKS</a>';
      break;
    default:
      navBarSpan.innerHTML = '&nbsp;&nbsp; <a href="/index.html" title="Return to the main page">HOME</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/bwr/borrower.html" title="Return to the main Borrower page">BORROWERS</a> &nbsp;|&nbsp; <a href="https://www.ecsi.net/tpp/student.html" title="Return to the main Student page">STUDENTS</a> &nbsp;|&nbsp; <a href="/client/clients.html" title="Return to the main Client page">CLIENTS</a> &nbsp;|&nbsp; <a href="/agency/agency.html" title="Return to the main Agency page">AGENCIES</a>';
      break;
//&nbsp;|&nbsp; <a href="/updates/site_revision.html" title="Find out what has changed on our site">SITE CHANGES</a>
  }
}
function loadGlobalNavWebx() {
  if (document.form01 && document.form01.webxsession && document.form01.webxsession.value != '') {
    loadGlobalNav('webX');
  }
}
function loadGlobalNavMyAcct() {
  if (document.getElementById('navbar') && document.getElementById('navbar').value == '1') {
    if (document.getElementById('xsess') && document.getElementById('xsess').value != '' && document.getElementById('xsess').value != '                ') {
      loadGlobalNav('myAcct');
    } else {
      loadGlobalNav('borrower');
    }
  }
}
function dispCopyright() {
  var crYear = new Date().getFullYear()
  var crSpan = document.getElementById('copyright');
  crSpan.innerHTML = '&copy; Copyright ' + crYear + ', ECSI';
}
function stripeElems(container, eoTag, stripeWidth) {
  //container = id of the element containing the span tags
  //eoTag = tag to put the "everyother" class on
  //stripeWidth [full|half|none]
  var eoTagArray = new Array();
  var contElem = document.getElementById(container);
  var eoTagArray = contElem.getElementsByTagName(eoTag);
  for (var j=1; j < eoTagArray.length; j=j+2) {
    switch (stripeWidth) {
      case 'full':
        eoTagArray[j].className = 'everyother_full';
        break;
      case 'half':
        eoTagArray[j].className = 'everyother_half';
        break;
      case 'none':
        eoTagArray[j].className = 'everyother';
        break;
      default:
        eoTagArray[j].className = 'everyother';
        break;
    }
  }
}
function PopUpWindow(URL) {
  window.open(URL, 'popup', 'width=275,height=300,scrollbars,menubar,resizable');
}
function toggleDisplay(whichElem) {
  switch (document.getElementById(whichElem).className) {
    case 'elemNotDisplayed':
      document.getElementById(whichElem).className = "elemDisplayed";
      break;
    case 'elemDisplayed':
      document.getElementById(whichElem).className = "elemNotDisplayed";
      break;
  }
}
function toggleMyAcctGroup(whichGroup, whichImg) {
  switch (document.getElementById(whichGroup).className) {
    case 'myAcctGroup elemNotDisplayed':
      document.getElementById(whichGroup).className = "myAcctGroup elemDisplayed";
      document.getElementById(whichImg).src = "/img/vwa/button_arrow_up.gif";
      break;
    case 'myAcctGroup elemDisplayed':
      document.getElementById(whichGroup).className = "myAcctGroup elemNotDisplayed";
      document.getElementById(whichImg).src = "/img/vwa/button_arrow_down.gif";
      break;
  }
}
function loginTabToggle(whichTab) {
  //highlight the correct tab
  switch (whichTab) {
    case 'bwr':
      document.getElementById('bwrLogin').className = 'loginDisplayed';
      document.getElementById('clientLogin').className = 'loginNotDisplayed';
      document.getElementById('bwrLoginTab').className = 'loginIndivTabSelected';
      document.getElementById('clientLoginTab').className = 'loginIndivTab';
      document.getElementById('bwrHelp').src = '/img/vwa/button_question_white_15.gif';
      document.getElementById('clientHelp').src = '/img/vwa/button_question_blue_15.gif';
      document.bcgi01.school.focus();
      break;
    case 'client':
      document.getElementById('bwrLogin').className = 'loginNotDisplayed';
      document.getElementById('clientLogin').className = 'loginDisplayed';
      document.getElementById('bwrLoginTab').className = 'loginIndivTab';
      document.getElementById('clientLoginTab').className = 'loginIndivTabSelected';
      document.getElementById('bwrHelp').src = '/img/vwa/button_question_blue_15.gif';
      document.getElementById('clientHelp').src = '/img/vwa/button_question_white_15.gif';
      document.form01.client.focus();
      break;
  }
}
function showHideElement(showElemID, elemState, posElemID, vPos, hPos) {
  //show or hide an absolutely positioned element
  //showElemID = id of element to display
  //elemState = ['show'|'hide']
  //posElemID = id of element to position relative to (only required if elemState = 'show')
  //vPos = ['above'|'below'] - is element displayed above or below posElemID - default=below
  //hPos = ['left'|'right'] - is element displayed to the left of or to the right of posElemID - default=right
  if (!vPos) {vPos = 'below'}
  if (!hPos) {hPos = 'right'}

  showElem = document.getElementById(showElemID);
  posElem = document.getElementById(posElemID);
  elemStyle = showElem.style;

  //set sytle properties
  switch (elemState) {
    case 'hide':
      elemStyle.display = 'none';
      break;
    case 'show':
      posElemCoord = getPosition(posElem);
      elemStyle.display = 'block';
      if (vPos == 'below') {
        elemStyle.top = (posElemCoord[1] + 7) + 'px';
      } else if (vPos == 'above') {
        elemStyle.top = (posElemCoord[1] + 7 - showElem.offsetHeight) + 'px';
      }
      if (hPos == 'right') {
        elemStyle.left = (posElemCoord[0] + 7) + 'px';
      } else if (hPos == 'left') {
        elemStyle.left = (posElemCoord[0] + 7 - showElem.offsetWidth) + 'px';
      }
      break;
  }
}
function getPosition(obj) {
  //get position of object
  //returns array of left and top positions (just the numbers)
  var curleft = curtop = 0;
  if (obj.offsetParent) {
    do {
      curleft += obj.offsetLeft;
      curtop += obj.offsetTop;
    } while (obj = obj.offsetParent);
  }
  return [curleft,curtop];
}
function submitOnEnter(whichElem) {
  //whichElem is the id of the element that has the onclick event you want to fire when enter key is pressed
  if (window.event && window.event.keyCode == 13) {
    document.getElementById(whichElem).onclick();
  }
}

