/* Module ivb.js - Javascript 1.5

  ImageView_Builder JavaScript module
    [Version 9.9.4]

  ©2000- InnoTech Dynamics® Web Design

  Works in unison with the CSS rules, JavaScript statements and data and HTML statements
   in slide show pages ivbSldShw.htm generated by program ©Image_View Builder.

  Image preload, image size adjustment, title block, message windows, bi-lingual support
   by InnoTech Dynamics® Web Design
    http://idwd.vantonder.net
  Author: J Chris van Tonder

  Note: Rectification of css kludges to work around IE CSS deficiencies indicated by ?IeCssX?

Version history:
Date        Ver     Comments
2009-09-19  9.9.4   "Continue with next set"
2009-02-02  9.9.2   IE 8
2008-02-25  9.8.0.7 Portal and Menu pages
2008-02-21  9.8.0.7 Optimise vertical space
2008-02-09  9.8.0.6 Image height and width multiples of 16, font size
2008-01-16  9.8.0.5 IE window height
2008-01-16  9.8.0.4 Thumbnail max height
2008-01-01  9.8.0.1 wndwSize()  adjMnuLayout()
2007-12-26  9.7.0.1 Thumbnail container fixes
2007-12-23  9.7.0.0 Dynamically generate sound control
2007-12-19  9.6.0.0 Dynamically generate required number of thumbnail containers for albums
2007-11-18  9.4.8.1 Escape reserved characters
2007-07-25  9.4.6.1 Ignore jpeg com consisting of whitespace only
2007-04-09  9.4.3.0 Translation of underscores to spaces removed
2007-04-05  9.4.1.0 Swap title fields in file name
2007-03-25  9.3.18.0 escUri
2007-03-19  9.3.15.0 Raw file names
2007-02-17  9.2.0.0  splitFlnme() flnmLctn fix
2007-01-25           Content frame links underline enabled
2007-01-14           Jpeg comment titles
2007-01-05  9.0.0.0  Folder option files
2007-01-02
2007-01-01  8.9  Toolbar on/off
2006-12-28  8.84 Slideshow problem with one image only
2006-11-17  8.82 <body onresize=..> replaced with window.onresize
2006-09-24  8.81 Image load error handling
2006-06-22  8.8  Banner images
2006-05-26  8.7  Remove provisions for iframe
2006-05-23  7.1  Ticker routines
2006-05-13  7.0  Valid image URI according to rfc2396 (http://www.ietf.org/rfc/rfc2396.txt)
2006-05-04  6.9  Thumbnails
2006-04-27  6.8  First image, sequence no's
2006-04-18  6.7  Scaling of images for different window sizes
2006-04-10  6.6  Thumbnails in album
2005-12-07  6.5  Cater for pop-up blocking
2005-01-19  6.4  Image onload, start and stop logic, speed, control panel
2005-01-15  6.3  Rev 2 Progress bar
2005-01-12  6.3  Rev 1 Message window colour
2005-01-04  6.3  Message windows
2005-01-04  6.2  Revised title block
2000-01-01  1.0  Slide show concept from the original SLIDE.JS by Rick Scott (Only some of the fundamental logic remains)
*/

var adjLayout;
var banrImgHtMn;
var banrImgHtMx;
var banrInx;  //* banner image position in array
var brwIeCssX = false;
var brwNme = "";
var brwVer = "";
var btnvAtp;
var btnvNxt;
var btnvPrv;
var btnvPse;
var btnvRsm;
var btnvVoid = " ";
var curInx = 0;    //*  index of slide currently displayed
var curImgHt;
var curImgWd;
var docTitle = document.title;
var DteSize;
//*  Document elements
var elmImg;
var elmSld;
var elmSndCtrl;
var elmTlbr;
var elmTlsw;
var elmToc;
var elmTochd;
var elmTbTc;  //*  progress ticker table element
var elmTbTcTd;  //*  progress ticker table cell elements

var flgCont = false;
var flnmDte;
var flnmLctn;
var flnmName;
var flnmSeq;
var flnmSpcr;
var flnmTtl;
var fntSz;
var fontSizePct = 100;
var htRat;
var i;
var idSize;
var imgAbrt = [];
var imgCache = [];
var imgErr = [];
var imgHtScld;
var imgInx;
var imgInxPrv;
var imgMxHt;
var imgMxWd;
var imgNew;
var imgNewUri;
var imgUsblHt;
var imgUsblWd;
var imgWdScld;
var isAlb = false;
var IsPlaying = false;
var j;
var JustStarted = true;
var ldBsy;
var ldImgAr = [];
var ldImgErr = [];
var ldImgLd = [];
var ldImgStrt = [];
var ldRetry;
var leaveFont;
var length;
var nbsp = String.fromCharCode(160);    //*  non-breaking space, U+00A0
var nLoadErr; //*  slides not loaded because of errors
var nLoadPrv; //*  slides loaded at previous check
var numLoaded = 0;
var numRetry = 0;
var numSlds;
var prgDspl;
var prgr;
var prgrDspl;
var prgrWdth;
var prgrWdthR;
var prgWdth;
var sldCntnr;
var sldDte;
var sldFrm;
var sldHdFt;
var sldId;
var sldMsg;
var sldMsgTxt;
var sldMsgWndw;
var sldNme;
var sldsArr;
var sldTtlArr;
var sldSecs;
var sldSecsInx;
var sldSpc;
var sldTmrId;
var srclBr;
var srclBrIE = 24;
var srclBrOthr = 16;
var tckrBkgd = "#cccccc";
var tckrClr = "#0033ff";
var tlbrHt;
var tlbrHtShw;
var tlDspl = true;
var tmotN;
var tnHt;
var tnWd;
var tocWd;
var ttlSize;
var undefined;
var uriArr = [];
var waitCyc;
var winMsg;
var winMsgLeft;
var winMsgTop;
var winSld;
var wndwHt;
var wndwUsblHt;
var wndwUsblWd;
var wndwWd;

/* Controller Graphics modes:
320x200 320x240 400x300 512x384 640x400 640x480 800x600 (992x620) (1248x832)
1024x 768 1153x 864 1280x 720 1280x 768 1280x1024 1400x1050 1600x 900
1600x1200 1856x1392 1920x1080 1920x1200 1920x1440 2048x1356 */

srclBr = srclBrOthr;
var brwUsAg = navigator.userAgent;
if (brwUsAg.indexOf("MSIE") > -1) {
  srclBr = srclBrIE;
  brwNme = "IE";
  brwVer = parseFloat(brwUsAg.substr(brwUsAg.indexOf("MSIE") + 5));
  if (brwVer < 8)
    brwIeCssX = true;  /* 9.9.2 */
} else if (brwUsAg.indexOf("Firefox") > -1) {
  brwNme = "Frfx";
  brwVer = brwUsAg.substr(brwUsAg.indexOf("Firefox") + 8);
}

tnWd = screen.width / 8;  /* 9.8.6 */
tnHt = tnWd * 3 / 4;
banrImgHtMn = screen.height * 3 / 16;  /* 9.8.7 */
banrImgHtMx = screen.height * 12 / 16;  /* 9.8.7 */
winMsgLeft = screen.width * 27 / 32;
winMsgTop = screen.height * 7 / 8;

//*  Replace "excluded" US ASCII characters with escaped versions for use in URI
if (sldsArr) {  //*  Defined in ivbImgs.js when present.
  numSlds = sldsArr.length;
  for (i = 0; i < numSlds ; i++)
  {
    uriArr[i] = sldsArr[i];
    uriArr[i] = uriArr[i].replace(/\%/g , "%25");  //*  % first

    uriArr[i] = uriArr[i].replace(/\ /g , "%20");
    uriArr[i] = uriArr[i].replace(/\#/g , "%23");
    uriArr[i] = uriArr[i].replace(/\[/g , "%5B");
    uriArr[i] = uriArr[i].replace(/\]/g , "%5D");
    uriArr[i] = uriArr[i].replace(/\^/g , "%5E");
    uriArr[i] = uriArr[i].replace(/\`/g , "%60");
    uriArr[i] = uriArr[i].replace(/\{/g , "%7B");
    uriArr[i] = uriArr[i].replace(/\}/g , "%7D");

    uriArr[i] = uriArr[i].replace(/\$/g , "%24");
    uriArr[i] = uriArr[i].replace(/\&/g , "%26");
    uriArr[i] = uriArr[i].replace(/\,/g , "%2C");
    uriArr[i] = uriArr[i].replace(/\;/g , "%3B");
    uriArr[i] = uriArr[i].replace(/\@/g , "%40");
    uriArr[i] = uriArr[i].replace(/\+/g , "%2B");
    uriArr[i] = uriArr[i].replace(/\=/g , "%3D");
  }
}
/* http://www.ietf.org/rfc/rfc2396.txt
   Unreserved:-  alphanumerics: [a-z, A-Z, 0-9]  Mark characters:  - _ . ! ~ * ' ( )
     Should be escaped only in context that does not allow the unescaped character
     Not in Windows file names:  *
   Reserved A: ;           @  &  =  +  $  ,
            N:    /  ?  :
   Excluded A:       #  %     {  }        ^  [  ]  `   (space)
            N: <  >        "        |  \
            A = Allowed in Windows file names; N = Not allowed
     Excluded characters must be escaped in a URI
*/


//*  Find banner image index
banrInx = 0;
for (i = 0; i < numSlds ; i++) {
  if (sldsArr[i].search(/_bnr/i) != -1) {
    banrInx = i;
    break;
  }
}

var fctInet = 1;
if (location.protocol.indexOf("http") != -1) {
  fctInet = 5;
}


function userOptions() {
/*  2007-01-03
 Updates:
  2008-02-09
*/
  if (!leaveFont) {
    fntSz = Math.floor(screen.height / (64 * 100 / fontSizePct));  /* 9.8.6 */
    document.body.style.fontSize = fntSz + "px";
  }
}
//** end userOptions()


function sldshwPrep() {
//*  called at body.onload
/* 2000
 Updates:
  2008-02-09
  2008-02-12
  2009-09-12
*/
  if (brwNme == "IE") {  /* 9.9.2 */
    sldHdFt = Math.ceil(fntSz * 6.4);  /* Adjust if CSS font-sizes are changed */  /* 9.9.4 (5.3) */
  } else {
    sldHdFt = Math.ceil(fntSz * 6.6);  /* 9.9.4 (5.3) */
  }
  elmTlbr = document.getElementById("sldIdTlbr");
  if (!brwIeCssX) {
    elmTlbr.style.position = "fixed";  /* ?IeCssX? */
  }

  elmTlsw = document.getElementById("tlSwtch");
  if (!brwIeCssX) {
    elmTlsw.style.position = "fixed";  /* ?IeCssX? */
  }

  if (brwNme == "IE") {  /* 9.9.2 */
    tlbrHtShw = elmTlbr.offsetHeight;
  } else {
    tlbrHtShw = window.getComputedStyle(elmTlbr, null).height;
  }
  tlbrHtShw = parseInt(tlbrHtShw, 10);
  tlbrHt = tlbrHtShw;

  elmSndCtrl = document.getElementById("sndctrl");
  if (!brwIeCssX && elmSndCtrl) {
    elmSndCtrl.style.position = "fixed";  /* ?IeCssX? */
  }

  sldMsgWndw = document.getElementById("sldIdMsgWndw");
  if (!brwIeCssX) {
    sldMsgWndw.style.position = "fixed";  /* ?IeCssX? */
  }

  if (window.location.search.indexOf("doNext") > -1) {
    if (document.frmSldshw.nxtChk) {
      document.frmSldshw.nxtChk.checked = true;
      sldSecsInx = parseInt(window.location.search.substring(7));;
      document.frmSldshw.speedSelect.selectedIndex = sldSecsInx;
    }
  }

  if (banrInx > 0) {curInx = -1;}

  sldCntnr = document.getElementById("sldIdCntnr");
  sldNme = document.getElementById("sldIdNme");
  sldNme.style.color="#fffcfc";
  elmImg = document.getElementById("curSld");
  curImgHt = sldHgtArr[banrInx];
  curImgWd = sldWdtArr[banrInx];
  adjSldLayout();

  imgNew = sldsArr[banrInx];
  imgNewUri = uriArr[banrInx];
  flnmRpl();
  elmImg.src = uriArr[banrInx];
  sldFrm = document.getElementById("frmSldshw");
  prgrDspl = document.getElementById("prgrsDspl");
  prgrWdth = document.getElementById("prgrsWdth");
  prgrWdthR = document.getElementById("prgrsWdthR");
  setTimeout(sldsPreload, 1000); //* time for startup processes
  //* window.addEventListener("resize", adjSldLayout, false);  //* Not supported in IE7
  adjLayout = adjSldLayout;
  window.onresize = adjLayout;
}
//** end sldshwPrep


function sldsPreload() {
//*  follows sldshwPrep
/*
 Updates:
  2006-05-13
  2006-09-24
  2006-12-28
*/

  numLoaded = 0;
  msgWindow(msgLd);
  imgInx = -1;
  imgInxPrv = -1;
  setTimeout(imgCreate, 500);
  waitCyc = 0;
  nLoadErr = 0;
  nLoadPrv = numLoaded;
  setTimeout(sldsLoaded, 1000);
}
//** end sldsPreload


function imgCreate() {
  imgInx = imgInx + 1;
  imgErr[imgInx] = 0;
  imgAbrt[imgInx] = 0;
  imgCache[imgInx] = new Image();
  imgCache[imgInx].onload = img_Load;
  imgCache[imgInx].onerror = img_Error;
  imgCache[imgInx].onabort = img_Abort;
  imgCache[imgInx].index = imgInx;
  imgCache[imgInx].src = uriArr[imgInx];
  if (imgInx < (numSlds - 1)) {
    setTimeout(imgCreate, fctInet * 200);
  }
}
//** end imgCreate


function sldsLoaded() {
/* Updates:
  2006-09-24
  2006-10-12
*/
  if (numLoaded == (numSlds - nLoadErr)) {
    return;
  }
  if (nLoadPrv == numLoaded) {
    waitCyc = waitCyc + 1;
  } else {
    nLoadPrv = numLoaded;
    waitCyc = 0;
  }
  if (waitCyc < 10) { //*  wait for another slide to get loaded
    setTimeout(sldsLoaded, 1000);
  } else { //*  abandon effort to load any more slides
    flgCont = true;
    sldshwStart();
  }
}
//** end sldsLoaded


function sldNotLoaded(ii) {
/* Updates:
  2006-09-24
*/
  alert("Error loading slide " + (ii + 1) + " :\n" + sldsArr[ii]);
}
//** end sldNotLoaded


function img_Abort() {
/* Updates:
  2006-09-24
*/
  imgAbrt[this.index]++;
  nLoadErr++;
}


function img_Error() {
/* Updates:
  2006-09-24
*/
  imgErr[this.index]++;
  nLoadErr++;
}


function img_Load() {
/* Updates:
  2006-09-24
  2006-10-12
  2006-12-28
*/
  if (imgInxPrv !== imgInx) {
    imgInxPrv = imgInx;
    numLoaded++;
    //*  Update the progress display
    prgr = parseFloat(numLoaded) / parseFloat(numSlds) * 100;
    prgrWdth.style.width = prgr + "%";
    prgrWdthR.style.width = (100 - prgr) + "%";
    if (numLoaded == (numSlds - nLoadErr)) {
      flgCont = true;
      setTimeout(sldshwStart, 200);
    }
  }
}
//** end img_Load


function sldshwStart() {
/*  2000
 Updates:
  2008-02-12
  2009-09-16
*/
  sldMsgWndw.style.visibility = "hidden";
  prgrDspl.style.display = "none";
  IsPlaying = false;
  //sldshwSpeed();
  sldSecsInx = document.frmSldshw.speedSelect.selectedIndex;
  sldSecs = document.frmSldshw.speedSelect.options[sldSecsInx].text;
  document.frmSldshw.btnPly.value = btnvPse;
  if (tlDspl == true) {  /* 9.8.7 */
    setTimeout(tlbr_Dspl, sldSecs * 500);
  }
  sldshwPlay();
}
//** end sldshwStart


function sldshwPlay() {
//*  start/run slide show
  if (JustStarted) {    //*  show just starting
    JustStarted = false;
  } else {    //*  show already running
    sldNext();
  }
  IsPlaying = true;
  sldTmrId = setTimeout(sldshwPlay, sldSecs*1000);
}
//** end sldshwPlay


function sldshwStop() {
//*  stop slide show
/*  2000
 Updates:
  2007-01-08
  2008-02-12
*/
  clearTimeout(sldTmrId);  //*  stop slide show by stopping setTimeout()
  IsPlaying = false;       //*  in sldshwPlay()
  JustStarted = true;
  document.frmSldshw.btnPrv.value = btnvPrv;
  document.frmSldshw.btnPrv.onclick = sldPrev;
  document.frmSldshw.btnNxt.value = btnvNxt;
  document.frmSldshw.btnNxt.onclick = sldNext;
  document.frmSldshw.btnPly.value = btnvAtp;
  if (tlDspl == false) {
    setTimeout(tlbr_Dspl, sldSecs * 1000);
  }
}
//** end sldshwStop


function nxtSetUri() {
//*  next set
/* 2009-09-10
 Updates:
*/
  window.location = nxtSet + "?doNext" + sldSecsInx;
}
//** end nxtSetUri


function doNextClick() {
//*  process "next set" check box change
/* 2009-09-11
 Updates:
*/
  if (document.frmSldshw.loopChk.checked && document.frmSldshw.nxtChk.checked) {
    document.frmSldshw.loopChk.checked = false;
  }
}
//** end doNextClick


function doLoopClick() {
//*  process Loop show check box change
/*  2000
 Updates:
  2008-02-21
  2009-09-11
*/
  if (document.frmSldshw.loopChk.checked && document.frmSldshw.nxtChk.checked) {
    document.frmSldshw.nxtChk.checked = false;
  }
  sldMsgWndw.style.visibility = "hidden";
  if (IsPlaying && tlDspl == true) {  /* 9.8.7 */
    setTimeout(tlbr_Dspl, sldSecs * 100);
  }
}
//** end doLoopClick


function doPlayClick() {
//*  process AutoPlay/Stop button click
/*  2000
 Updates:
  2008-02-21
*/
  if (!IsPlaying) {
    document.frmSldshw.btnPrv.value = btnvVoid;
    document.frmSldshw.btnPrv.onclick = "";
    document.frmSldshw.btnNxt.value = btnvVoid;
    document.frmSldshw.btnNxt.onclick = "";
    document.frmSldshw.btnPly.value = btnvPse;
    if (tlDspl == true) {  /* 9.8.7 */
      setTimeout(tlbr_Dspl, sldSecs * 100);
    }
    sldshwPlay();
  } else {
    sldshwStop();
  }
}
//** end doPlayClick


function dispSld(Inx) {
  //*  display current slide image and titles
  curInx = Inx;
  imgRpl(sldsArr[Inx], uriArr[Inx], sldWdtArr[Inx], sldHgtArr[Inx]);
}
//** end dispSld


function sldNext() {
//*  display next slide image/title
/*  Updates:
  2009-09-11
*/
  if (curInx === 0) {    //*  at beginning of show
    sldMsgWndw.style.visibility = "hidden";
  }
  curInx = curInx + 1;
  if (curInx > uriArr.length - 1) {  //*  at end of show
    if (document.frmSldshw.loopChk.checked) {    //*  loop
      curInx = 0;
      if (imgCache[curInx].complete && imgCache[curInx].width !== 0 &&
         imgErr[curInx] === 0 && imgAbrt[curInx] === 0) {
        dispSld(curInx);
      } else {
        sldNotLoaded(curInx);
        if (numLoaded < 1) {
          sldshwStop();
        } else {
          sldNext();
        }
      }
    } else {    //*  don't loop
      msgWindow(msgLst);
      curInx = sldsArr.length - 1;
      if (IsPlaying) { //*  if in AutoPlay mode, stop it
        setTimeout(sldshwStop, 250);
      }  //*  need to delay this a bit ...
    }
    if (document.frmSldshw.nxtChk.checked) {
      var tmp = nxtSet + "?doNext" + sldSecsInx;
      setTimeout(nxtSetUri, sldSecs * 100);
    }
  } else {   //*  not at end of show
    if (imgCache[curInx].complete && imgCache[curInx].width !== 0 &&
       imgErr[curInx] === 0 && imgAbrt[curInx] === 0) {
      dispSld(curInx);
    } else {
      sldNotLoaded(curInx);
      sldNext();
    }
  }
}
//** end sldNext


function sldPrev() {
//*  display previous slide image/title
  if (curInx == sldsArr.length - 1) {  //*  at end of show
    sldMsgWndw.style.visibility = "hidden";
  }
  curInx = curInx - 1;
  if (curInx < 0) {    //*  at beginning of show
    if (document.frmSldshw.loopChk.checked) {    //*  loop
      curInx = sldsArr.length - 1;
      if (imgCache[curInx].complete && imgCache[curInx].width !== 0 &&
         imgErr[curInx] === 0 && imgAbrt[curInx] === 0) {
        dispSld(curInx);
      } else {
        sldNotLoaded(curInx);
        sldPrev();
      }
    } else {    //*  don't loop
      curInx = 0;
      msgWindow(msgFrst);
    }
  } else {    //*  not at beginning of show
    if (imgCache[curInx].complete && imgCache[curInx].width !== 0 &&
       imgErr[curInx] === 0 && imgAbrt[curInx] === 0) {
      dispSld(curInx);
    } else {
      sldNotLoaded(curInx);
      sldPrev();
    }
  }
}
//** end sldPrev


function sldshwSpeed() {
//*  set show speed on the fly
/*  Updates:
  2009-09-09
*/
  sldSecsInx = document.frmSldshw.speedSelect.selectedIndex;
  sldSecs = document.frmSldshw.speedSelect.options[sldSecsInx].text;
  if (IsPlaying) {
    clearTimeout(sldTmrId);
    sldTmrId = setTimeout(sldshwPlay, sldSecs * 1000);
  }
  if (tlDspl == true) {  /* 9.8.7 */
    setTimeout(tlbr_Dspl, sldSecs * 100);
  }
}
//** end sldshwSpeed


function msgWindow(msg) {
  sldMsgWndw.style.visibility = "visible";
  sldMsg = document.getElementById("sldIdMsg");
  sldMsgTxt = document.getElementById("sldIdMsg").childNodes[0];
  sldMsg.replaceChild(document.createTextNode(msg), sldMsgTxt);
}
//** end msgWindow


function focusMsg() {
  sldMsgWndw.style.visibility = "visible";
}


//*            * * * * * * * * *  End slide show logic  * * * * * * * * *

//*             * * * * * * * * *  Begin album logic  * * * * * * * * *


function bldSoundCntrl() {
/* Dynamically generate sound control
  2007-12-23
 Updates:
*/
  if (soundFile != undefined && soundFile != "")
  {
    var strWrt = '<div id="sndctrl" class="sndctrl">\n';
    strWrt = strWrt + '  <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="128" height="16">\n';
    strWrt = strWrt + '  <param name="src" value="' + soundFile + '" />\n';
    strWrt = strWrt + '  <param name="loop" value="true" />\n';
    strWrt = strWrt + '  <param name="volume" value="50" />\n';
    strWrt = strWrt + '  <param name="controller" value="true" />\n';
    strWrt = strWrt + '  <param name="autoplay" value="true" />\n';
    strWrt = strWrt + '  <embed width="128" height="16" loop="true" volume="50" controller="true" autoplay="true" src="' + soundFile + '"\n';
    strWrt = strWrt + '    pluginspage="http://www.apple.com/quicktime/download/" />\n';
    strWrt = strWrt + '  <\/object>\n';
    strWrt = strWrt + '<\/div>';
    document.write(strWrt);
  }
}
//** end bldSoundCntrl


function bldThnlCntnr() {
/* Dynamically generate required thumbnail containers
  2007-12-19
 Updates:
  2007-12-26
*/
  var strWrt;
  for (var ii = 0; ii < numSlds ; ii++)
  {
    strWrt = '  <p class="tnCntnr" onclick="imgShw(' + ii.toString() + ')">';
    if ((thnWdtArr[ii] != 0 && thnHgtArr[ii] != 0)      //*  thumbnail available
        || (thnWdtArr[ii] == sldWdtArr[ii] && thnHgtArr[ii] == sldHgtArr[ii]))      //*  no thumbnail folder, images themselves used for thumbnails
    {
      strWrt = strWrt + '<img /><br />';
    }
    strWrt = strWrt + '</p>';
    document.writeln(strWrt);
  }
  document.write('  <p class="tnCntnr">&nbsp;</p>');
}
//** end bldThnlCntnr


function adjAlbLayout() {
/* Adjust layout according to window size
  2006-04-10
 Updates:
  2006-04-24
  2007-01-01
  2009-02-02
  2009-09-16
*/
  wndwSize();
  elmTlbr.style.width = (wndwUsblWd - Math.floor(tocWd + fntSz * 1.5)) + "px";
  imgMxWd = wndwUsblWd - tocWd - fntSz * 1.5;
  imgMxHt = wndwUsblHt - sldHdFt - tlbrHt;
  adjCurImg();
}
//** end adjAlbLayout


function adjCurImg() {
/* Adjust image size to fit in window
  2006-04
 Updates:
  2006-04-22
  2007-01-01
  2009-09-12
*/
  scaleImg();
  sldCntnr.style.marginTop = Math.floor((wndwUsblHt - imgHtScld - sldHdFt - tlbrHt) / 3) + "px";  /* 9.8.6 */
  elmImg.style.width = imgWdScld + "px";
  elmImg.style.height = imgHtScld + "px";
}
//** end adjCurImg


function adjPrtlLayout() {
/* Adjust portal layout according to window size
   2008-02-22
 Updates:
  2009-01-31
*/
  var prtlHdFt;
  var avlImgHt;
  var newImgHt;

  var prtlImgHtMn = screen.height * 3 / 16;  /* 9.8.7 */
  var prtlImgHtMx = screen.height * 14 / 16;  /* 9.8.7 */
  wndwSize();
  var mnuImgWdMx = wndwUsblWd * 13 / 16;  /* 9.9.2 */

  if (brwNme == "IE") {  /* 9.9.2 */
    prtlHdFt = Math.ceil(fntSz * 16.5);
  } else {
    prtlHdFt = Math.ceil(fntSz * 17.5);
  }

  avlImgHt = wndwUsblHt - prtlHdFt;

  if (elmImg) {
    avlImgHt = Math.min(avlImgHt, prtlImgHtMx, imgHtScld);
    if (avlImgHt == prtlImgHtMx) {
        newImgHt = prtlImgHtMx;
    } else if (avlImgHt < prtlImgHtMn) {
        newImgHt = 0;
    } else {
        newImgHt = avlImgHt;
    }
    var fcHt = newImgHt / imgHtScld;  /* 9.9.2 */
    var newImgWd = imgWdScld * fcHt;  /* 9.9.2 */
    if (newImgWd > mnuImgWdMx) {  /* 9.9.2 */
      var fcWd = mnuImgWdMx / newImgWd;
      newImgHt = newImgHt * fcWd;
      newImgWd = newImgWd * fcWd;
    }
    newImgWd = Math.floor(newImgWd);  /* 9.9.2 */
    newImgHt = Math.floor(newImgHt);  /* 9.9.2 */
    elmImg.style.height = newImgHt + "px";
    elmImg.style.width = newImgWd + "px";  /* IE 8 RC1 bug workaround */  /* 9.9.2 */
  } else {
    newImgHt = 0;
    newImgWd = 0;
  }
}
//** end adjPrtlLayout


function adjMnuLayout() {
/* Adjust menu layout according to window size
  2006-04
 Updates:
  2008-02-22 Rewrite
  2009-02-02
  2009-09-16
*/
  var avlImgHt;
  var newImgHt;
  var curTblTxtHt;
  var mnuTbMrgns;
  var mnuHdFt;

  var mnuImgHtMn = screen.height * 3 / 16;
  var mnuImgHtMx = screen.height * 10 / 16;
  wndwSize();
  var mnuImgWdMx = wndwUsblWd * 14 / 16;  /* 9.9.2 */

  if (brwNme == "IE") {  /* 9.9.2 */
    mnuHdFt = Math.ceil(fntSz * 10);  /* 9.9.4 */
  } else {
    mnuHdFt = Math.ceil(fntSz * 9);  /* 9.9.4 */
  }

  avlImgHt = wndwUsblHt - curTblHt - mnuHdFt;

  if (elmImg) {
    avlImgHt = Math.min(avlImgHt, mnuImgHtMx, imgHtScld);
    if (avlImgHt == mnuImgHtMx) {
        newImgHt = mnuImgHtMx;
    } else if (avlImgHt < mnuImgHtMn) {
        newImgHt = 0;
    } else {
        newImgHt = avlImgHt;
    }

    var fcHt = newImgHt / imgHtScld;  /* 9.9.2 */
    var newImgWd = imgWdScld * fcHt;  /* 9.9.2 */
    if (newImgWd > mnuImgWdMx) {  /* 9.9.2 */
      var fcWd = mnuImgWdMx / newImgWd;
      newImgHt = newImgHt * fcWd;
      newImgWd = newImgWd * fcWd;
    }
    newImgWd = Math.floor(newImgWd);  /* 9.9.2 */
    newImgHt = Math.floor(newImgHt);  /* 9.9.2 */

    elmImg.style.height = newImgHt + "px";
    elmImg.style.width = newImgWd + "px";  /* IE 8 RC1 bug workaround */  /* 9.9.2 */
  } else {
    newImgHt = 0;
    newImgWd = 0;
  }
  mnuTbMrgns = wndwUsblHt - curTblHt - mnuHdFt - newImgHt;
  document.getElementById("table0").style.marginTop = Math.floor(Math.max(mnuTbMrgns / 3, fntSz * 0.5)) + "px";
//alert(document.getElementById("table0").style.marginTop);
}
//** end adjMnuLayout


function adjSldLayout() {
/* Slide show: Adjust layout according to window size
  2006-04
 Updates:
  2007-01-01
  2007-01-04
  2008-02-09
*/
  wndwSize();
  imgMxWd = wndwUsblWd;  /* 9.8.7 */
  imgMxHt = Math.floor(wndwUsblHt - sldHdFt - tlbrHt);  /* 9.8.6 */
  elmTlbr.style.width = imgMxWd -240 + "px";  /* ?IeCssX? */  /* QTime controller ~ 140px */
  adjCurImg();
}
//** end adjSldLayout


function prtlOnload() {
/* 2008-02-22
 Updates:
  2009-02-02
*/
  window.onresize = adjPrtlLayout;
  elmImg = document.getElementById("banrImg");
  if (elmImg) {
    if (brwNme == "IE") {  /* 9.9.2 */
      imgHtScld = elmImg.offsetHeight;
      imgWdScld = elmImg.offsetWidth;  /* 9.9.2 */
    } else {
      imgHtScld = parseInt(window.getComputedStyle(elmImg, null).height);
      imgWdScld = parseInt(window.getComputedStyle(elmImg, null).width);  /* 9.9.2 */
    }
  } else {
    imgHtScld = 0;
  }
  adjPrtlLayout();
}
//** end prtlOnload


var eTbl;
var curTblHt;

function mnuOnload() {
/* Photo Album
  2006-11-17
 Updates:
  2008-02-22 Rewrite
  2009-01-30
*/
  //window.addEventListener("resize", adjMnuLayout, false);  //* Not supported in IE7
  window.onresize = adjMnuLayout;

  elmImg = document.getElementById("banrImg");
  if (elmImg) {
    if (brwNme == "IE") {  /* 9.9.2 */
//    imgHtScld = elmImg.currentStyle.height;
      imgHtScld = elmImg.offsetHeight;
      imgWdScld = elmImg.offsetWidth;  /* 9.9.2 */
    } else {
      imgHtScld = parseInt(window.getComputedStyle(elmImg, null).height);
      imgWdScld = parseInt(window.getComputedStyle(elmImg, null).width);  /* 9.9.2 */
    }
    //elmImg.style.height = "1px";
    //elmImg.style.width = "1px";  /* 9.9.2 */
  } else {
    imgHtScld = 0;
  }

  if (brwNme == "IE") { //* IE bug workaround  /* 9.9.2 */
    document.getElementById('table1').style.fontSize = document.body.style.fontSize;
    document.getElementById('table2').style.fontSize = document.body.style.fontSize;
  }

  eTbl = document.getElementById("table2");
  if (brwNme == "IE") {  /* 9.9.2 */
    curTblHt = eTbl.offsetHeight;
  } else {
    curTblHt = parseInt(window.getComputedStyle(eTbl, null).height);
  }

  adjMnuLayout();
}
//** end mnuOnload


function albOnload() {
/* Photo Album
  2006-04-10
 Updates:
  2007-01-01
  2008-01-16
  2009-09-16
*/
  isAlb = true;
  sldHdFt = fntSz * 6.4;  /* Adjust if CSS font-sizes are changed */  /* 9.9.4 (5.5) */
  tocWd = tnWd * 34 / 32 + srclBr;  /* 9.8.6 */
  elmSld = document.getElementById("slide");
  elmSld.style.left = tocWd + "px";
  sldCntnr = document.getElementById("sldIdCntnr");
  sldNme = document.getElementById("sldIdNme");
  sldNme.style.color="#fffcfc";
  elmImg = document.getElementById("curSld");

  elmTlbr = document.getElementById("albIdTlbr");
  if (!brwIeCssX) {
    elmTlbr.style.position = "fixed";  /* ?IeCssX? */
  }
  elmTlbr.style.left = tocWd + fntSz * 0.25 + "px";

  elmTlsw = document.getElementById("tlSwtch");
  if (!brwIeCssX) {
    elmTlsw.style.position = "fixed";  /* ?IeCssX? */
  }
  elmTlsw.style.left = tocWd + fntSz * 0.25 + "px";

  if (brwNme == "IE") {  /* 9.9.2 */
    tlbrHtShw = elmTlbr.offsetHeight;
  } else {
    tlbrHtShw = window.getComputedStyle(elmTlbr, null).height;
  }
  tlbrHtShw = parseInt(tlbrHtShw, 10);
  //elmTlsw.style.bottom = tlbrHtShw;
  tlbrHt = tlbrHtShw;
  elmTochd = document.getElementById("tochdr");
  elmTochd.style.width = tocWd + "px";
  elmTochd.style.bottom = fntSz * 2 + "px";
  if (!brwIeCssX) {
    elmTochd.style.cssFloat = "none";  /* ?IeCssX? */
  }

  elmToc = document.getElementById("toc");
  if (!brwIeCssX) {
    elmToc.style.clear = "none";  /* ?IeCssX? */
    elmToc.style.cssFloat = "none";  /* ?IeCssX? */
    elmToc.style.height = "auto";  /* ?IeCssX? */
  }
  elmToc.style.width = tocWd + "px";
  elmToc.style.top = fntSz * 2 + "px";

  elmTbTc = document.getElementById("prgrsTckr");
  elmTbTcTd = elmTbTc.getElementsByTagName("td");
  elmTbTc.style.visibility = "hidden";

  curImgHt = 1;
  curImgWd = 1;

  ldBsy = false;
  for (i = 0; i < numSlds ; i++) {
    ldImgAr[i] = new Image();
    ldImgAr[i].onload = ldImgLoad;
    ldImgAr[i].onerror = ldImgEr;
    ldImgAr[i].onabort = ldImgEr;
    ldImgLd[i] = false;
    ldImgErr[i] = false;
  }
  imgShw(banrInx);
  adjAlbLayout();
  bldThn();
  //window.addEventListener("resize", adjAlbLayout, false);  //* Not supported in IE7
  adjLayout = adjAlbLayout;
  window.onresize = adjLayout;
}
//** end albOnload


function big_Window(page, replace) {
  if (window.name != "winIvb") {
    if (!replace) {
      replace = "about:blank";
    }
    window.location = replace;
    var dwdt = screen.width - 8;
    var dhgt = screen.height - 28;
    if (brwNme == "IE") { //* IE  /* 9.9.2 */
      dwdt = dwdt - 2;
      dhgt = dhgt - 2;
    }
    var features = "";
    features = "toolbar=no,location=no,directories=no,status=no," + features;
    features = "menubar=no,left=0,top=0," + features;
    features = "screenX=0,screenY=0,width=" + dwdt + ",height=" + dhgt + "," + features;
    winSld = window.open(page,"winIvb",features);
    this.focus();
    if (winSld) {
//      winSld.focus();
    } else {
        alert("Grrr! Popup blocking may be preventing the slide window from opening.\nIf popup blocking is active, try disabling it to open the window.");
    }
  }
}
//** end big_Window


function bldThn() {
/* Get thumbnail container paragraphs and complete thumbnail attributes.
  2006-04-29
 Updates:
  2006-04-30
  2006-05-26
*/
  var strtInx = curInx;
  var pgphs = document.getElementById("toc").getElementsByTagName("p");
  for (var i = 0; i < pgphs.length - 1; i++) {
    curInx = i;
    shwThn(pgphs[i], i);
  }
  curInx = strtInx;
}
//** end bldThn


function flnmRpl() {
/* Insert file name components
  2006-04
 Updates:
  2009-09-10
*/
  splitFlnme();

  eTxt = sldNme.childNodes[0];
  var rpl = document.createTextNode(flnmName + " " + curImgWd + " x " + curImgHt);
  sldNme.replaceChild(rpl, eTxt);
  sldNme.style.color="#fffcfc";
  eTxt = document.getElementById("sldIdTtl").childNodes[0];
  rpl = document.createTextNode(flnmTtl);
  if (eTxt !== undefined) {
    document.getElementById("sldIdTtl").replaceChild(rpl, eTxt);
  } else {
    document.getElementById("sldIdTtl").appendChild(rpl);
  }

  eTxt = document.getElementById("sldIdLoc").childNodes[0];
  rpl = document.createTextNode(flnmLctn);
  if (eTxt !== undefined) {
    document.getElementById("sldIdLoc").replaceChild(rpl, eTxt);
  } else {
    document.getElementById("sldIdLoc").appendChild(rpl);
  }

  eTxt = document.getElementById("sldIdSpc").childNodes[0];
  rpl = document.createTextNode(flnmSpcr);
  if (eTxt !== undefined) {
    document.getElementById("sldIdSpc").replaceChild(rpl, eTxt);
  } else {
    document.getElementById("sldIdSpc").appendChild(rpl);
  }

  eTxt = document.getElementById("sldIdDte").childNodes[0];
  rpl = document.createTextNode(flnmDte);
  if (eTxt !== undefined) {
    document.getElementById("sldIdDte").replaceChild(rpl, eTxt);
  } else {
    document.getElementById("sldIdDte").appendChild(rpl);
  }
}
//** end flnmRpl


function imgRpl(aNme, aSrc, stWd, stHt) {
/* Replace currently shown image
  2006-04-01
 Updates:
  2006-04-23
  2006-05-13
  2006-05-23
*/
  imgNewUri = aSrc;
  imgNew = aNme;
  elmImg.src = imgNewUri;
  curImgHt = stHt;
  curImgWd = stWd;
  adjCurImg();
  flnmRpl();
}
//** end imgRpl


function imgShw(Inx) {
/* Show another image
  2006-04
 Updates:
  2006-05-27
*/
  if (!ldBsy) { //* Wait for load in progress
    imgNew = sldsArr[Inx];
    curInx = Inx;
    if (!ldImgLd[Inx]) {
      ldBsy = true;
      ldImgAr[Inx].src = uriArr[Inx];
      i = 0;
      tckrStart();
    } else {
      imgRpl(sldsArr[curInx], uriArr[curInx], sldWdtArr[curInx], sldHgtArr[curInx]);
    }
  }
}
//** end imgShw


function ldImgEr() {
/* Image onerror
  2006-05-28
*/
  ldImgErr[curInx] = true;
}
//** end ldImgEr


function ldImgLoad() {
/* Image onload
  2006-05-22
 Updates:
  2006-05-24
  2006-05-27
*/
  ldImgLd[curInx] = true;
  setTimeout(newImg, 200);
}
//** end ldImgLoad


function newImg() {
/* Preload image
  2006-04
 Updates:
  2006-05-27
*/
  elmImg.style.width = "0px";
  ldBsy = false;
  tckrStop();
  imgRpl(sldsArr[curInx], uriArr[curInx], sldWdtArr[curInx], sldHgtArr[curInx]);
}
//** end newImg


function scaleImg() {
/*  Scale image to fit in available screen area
  2006-04-10
  2008-01-23
  2008-02-21
*/
  imgWdScld = curImgWd;
  imgHtScld = curImgHt;
  if (imgMxHt < tnWd) {imgMxHt = 0;}
  var fcHt = imgMxHt / imgHtScld;
  if (fcHt < 1) {
    imgHtScld = imgHtScld * fcHt;
    imgWdScld = imgWdScld * fcHt;
  }
  var fcWd = imgMxWd / imgWdScld;
  if (fcWd < 1) {
    imgWdScld = imgWdScld * fcWd;
    imgHtScld = imgHtScld * fcWd;
  }
  imgWdScld = Math.floor(imgWdScld);  /* 9.8.7 */
  imgHtScld = Math.floor(imgHtScld);  /* 9.8.7 */
}
//** end scaleImg


function shwThn(pgph, j) {
/* Generate thumbnail images and titles from array of slides in Albums.
  2006-04-29
 Updates:
  2007-01-01
  2007-01-25
  2008-01-16
  2008-01-23
  2008-02-21
*/
  imgNewUri = uriArr[j];
  imgNew = sldsArr[j];
  tImg = pgph.getElementsByTagName("img")[0];
  if (tImg) {
    imgWdScld = thnWdtArr[j];
    imgHtScld = thnHgtArr[j];

    var fcWd = tnWd / imgWdScld;
    if (fcWd != 1) {
      fcWd = fcWd > 1.25 ? 1.25 : fcWd;
      imgWdScld = Math.floor(imgWdScld * fcWd);  /* 9.8.7 */
      imgHtScld = Math.floor(imgHtScld * fcWd);  /* 9.8.7 */
    }

    var fcHt = tnHt / imgHtScld;
    if (fcHt < 1) {
      imgWdScld = Math.floor(imgWdScld * fcHt);  /* 9.8.7 */
      imgHtScld = Math.floor(imgHtScld * fcHt);  /* 9.8.7 */
    }
    tImg.style.width = imgWdScld + "px";
    tImg.style.height = imgHtScld + "px";
    tImg.src = "../" + thnFldr + "/" + imgNewUri;
  }

  splitFlnme();

  if (flnmTtl !== "") {tmp = flnmTtl;}
  else if (flnmLctn !== "") {tmp = flnmLctn;}
  else if (flnmDte !== "") {tmp = flnmDte;}
  else if (flnmSeq !== "") {
    var inx = flnmSeq.lastIndexOf("  "); //* if there are two adjacent spaces, part thereafter is used
    if (inx != -1 && inx+2 < flnmSeq.length) {
      tmp = flnmSeq.substring(inx+2, flnmSeq.length);
    } else {
      tmp = flnmSeq;
    }
  }
  else {tmp = "_|_";}

  var spnul = document.createElement("span");
  spnul.setAttribute("class", "lnktxt");   //* works in firefox, not IE7
  spnul.appendChild(document.createTextNode(tmp));
  spnul.style.textDecoration = strTdLnk;  //* IE kludge
  pgph.appendChild(spnul);
}
//** end shwThn


function splitFlnme() {
/* Split file name into components - parameters in order of appearance in file name
  2006-04
 Updates:
  2006-05-02
  2007-02-17
  2007-03-18
  2007-04-05
  2007-04-09
  2007-07-25  Ignore jpeg com consisting of whitespace only
*/
  var blnTtl = false;
  var ttlInx;
  var dlm1;
  var dlm2;

  flnmName = imgNew.substr(imgNew.lastIndexOf("/") + 1, imgNew.length - imgNew.lastIndexOf("/") - 1);
  //* Get rid of parent folder (if present)

  var filnmSpcs = flnmName.replace(/_[nN][tT][nN]/g , "");
  //* Filter out _[nN][tT][nN]
  filnmSpcs = filnmSpcs.replace(/_ntn/ig , "");
  filnmSpcs = filnmSpcs.replace(/_bnr/ig , "");
  filnmSpcs = filnmSpcs.replace(/bnr_/ig , "");

  //* Replace underscore characters with spaces (deprecated)
  //filnmSpcs = filnmSpcs.replace(/_/g , " ");

  flnmSeq = filnmSpcs.substr(0, filnmSpcs.indexOf("~"));
    //* Sequence number

  if (sldTtlArr) {
    blnTtl = true;
    ttlInx = curInx;
    if (ttlInx == -1) {ttlInx = banrInx;}

    var notWhtSpc = /\S+/;
    if (sldTtlArr[ttlInx] !== "" && notWhtSpc.test(sldTtlArr[ttlInx]) == true) {  //* not empty and not all unicode whitespace characters
      //* Title array defined and this image has a built-in title
      //* Replace underscore characters with spaces (deprecated)
      //filnmSpcs = sldTtlArr[ttlInx].replace(/_/g , " ");
      filnmSpcs = sldTtlArr[ttlInx];

      flnmDte = "";
      flnmTtl = "";
      flnmLctn = "";

      dlm1 = filnmSpcs.indexOf("   ");
      if (dlm1 > -1) {
        flnmTtl = filnmSpcs.substr(0, dlm1);
        dlm2 = filnmSpcs.lastIndexOf("   ");
        if (dlm2 > -1) {
          if (dlm2 > dlm1) {  //* 2 delimiters
            flnmDte = filnmSpcs.substr(dlm2 + 3, filnmSpcs.length - (dlm2 + 3) + 1);
            flnmLctn = filnmSpcs.substr(dlm1 + 3, dlm2 - (dlm1 + 3));
          } else {  //* 1 delimiter - second field location
            flnmLctn = filnmSpcs.substr(dlm2 + 3, filnmSpcs.length - (dlm2 + 3) + 1);
          }
        }
      } else {
        flnmTtl = filnmSpcs;
      }

      if ((flnmLctn === "") || (flnmDte === "")) {
        flnmSpcr = "";
      } else {
        flnmSpcr = " " + nbsp;
      }
    } else {
      blnTtl = false;
    }
  }

  if (!blnTtl) {
    flnmTtl = filnmSpcs.substr(filnmSpcs.lastIndexOf("~") + 1, filnmSpcs.lastIndexOf(".") -    filnmSpcs.lastIndexOf("~") - 1);
      //* Title

    var tmp = filnmSpcs.substr(filnmSpcs.indexOf("~") + 1, filnmSpcs.lastIndexOf("~") - filnmSpcs.indexOf("~") - 1);
      //* Portion of file name before Title containing number and Location and Date (or whatever)

    flnmLctn = tmp.substr(0, tmp.indexOf("~"));
      //* Location

    flnmDte = tmp.substr(tmp.indexOf("~") + 1, tmp.length - tmp.indexOf("~"));
      //* Date

    //*  Check for old convention, Location field first then Date field
    var blnLctnDte;
    var blnDteDte;
    var strSwap;

    var rMD = /\d\d\-\d\d/
    var rYr = /\d\d\d\d/
    var rTxt = /[a-z,A-Z]/

    //* Does location field contain a date ?
    var mMD = flnmLctn.substr(flnmLctn.length - 5).match(rMD);
    var mYr = flnmLctn.substr(flnmLctn.length - 5).match(rYr);
    var mTxt = flnmLctn.substr(flnmLctn.length - 5).match(rTxt);
    blnLctnDte = false;
    if (mMD !== null || mYr !== null) {
      blnLctnDte = true;  //*  location fld contains a date, check for a text component
      if (mTxt !== null) {
        blnLctnDte = false;  //*  location field not only a date
      }
    }

    //* Does date field contain a date ?
    mMD = flnmLctn.substr(flnmDte.length - 5).match(rMD);
    mYr = flnmLctn.substr(flnmDte.length - 5).match(rYr);
    mTxt = flnmLctn.substr(flnmDte.length - 5).match(rTxt);
    blnDteDte = false;
    if (mMD !== null || mYr !== null) {
      blnDteDte = true;  //*  date fld contains a date, check for a text component
      if (mTxt !== null) {
        blnDteDte = false;  //*  date field not only a date
      }
    }

    if (blnLctnDte) {  //*  location field contains a "pure" date
      strSwap = flnmDte;
      flnmDte = flnmLctn;
      flnmLctn = strSwap;
    } else {
      if (!blnDteDte) {  //*  date field does not contain a "pure" date
        if (flnmLctn == "") { //*  location field empty
          if (flnmDte != "") { //*  location field empty
            strSwap = flnmDte;
            flnmDte = flnmLctn;
            flnmLctn = strSwap;
          }
        }
      }
    }

    if ((flnmLctn === "") || (flnmDte === "")) {
      flnmSpcr = "";
    } else {
      flnmSpcr = " " + nbsp;
    }
  }

  if (flnmSeq === "" && flnmLctn === ""  && flnmDte === "") {
    var tmp = flnmTtl.match(/\d\d+/);
    if (tmp !== null) {
      flnmSeq = tmp[0];
      flnmTtl = "";
    }
  }
}
//** end splitFlnme


function wndwSize() {
/* Get window internal dimensions and scroll bar width
  2006-04-10
  2008-01-01
*/
  wndwWd = 0;
  wndwHt = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //* Non-IE
    wndwWd = window.innerWidth;
    wndwHt = window.innerHeight;
    wndwUsblWd = wndwWd;
    wndwUsblHt = wndwHt;
  } else if (document.documentElement && (document.documentElement.clientWidth ||    document.documentElement.clientHeight)) {
    //* IE 6+ in 'standards compliant mode'
    wndwWd = document.documentElement.clientWidth;
    wndwHt = document.documentElement.clientHeight;
    wndwUsblWd = wndwWd;  /* 9.8.5 */
    wndwUsblHt = wndwHt;  /* 9.8.5 */
  } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
    //* IE 4 compatible
    wndwWd = document.body.clientWidth;
    wndwHt = document.body.clientHeight;
    wndwUsblWd = wndwWd;  /* 9.8.5 */
    wndwUsblHt = wndwHt;  /* 9.8.5 */
  }
}
//** end wndwSize


var tckTmOt;
var iTc;
var jTc;
var nTc;

function tckrStart() {
/* Start ticker
  2006-05-24
  2006-05-27
*/
  nTc = elmTbTcTd.length;
  iTc = nTc;
  tckTmOt = setTimeout('elmTbTc.style.visibility = "visible"; tckrRun();', 1000);
}
//** end tckrStart


function tckrRun() {
/* Ticker
  2006-05-24
  2006-05-28
  2006-09-24
*/
  jTc = (iTc - 1) % nTc;
  elmTbTcTd[jTc].style.backgroundColor = tckrBkgd;
  jTc = iTc % nTc;
  elmTbTcTd[jTc].style.backgroundColor = tckrClr;
  iTc++;
  tckTmOt = setTimeout(tckrRun, 1000);
  if (ldImgAr[curInx].complete) {
    if (ldImgLd[curInx] || ++i > 1) {
      ldBsy = false;
      tckrStop();
    }
  }
  if (ldImgErr[curInx]) {
    alert("Error loading slide " + (curInx + 1) + " :\n" + sldsArr[curInx]);
    ldBsy = false;
    tckrStop();
  }
}
//** end tckrRun


function tckrStop() {
/* Stop ticker
  2006-05-23
*/
  clearTimeout(tckTmOt);
  jTc = (iTc - 1) % nTc;
  elmTbTcTd[jTc].style.backgroundColor = tckrBkgd;
  elmTbTc.style.visibility = "hidden";
}
//** end tckrStop


function tlbr_Dspl() {
/* Toolbar display
    2007-01-01
    2009-09-12
*/
  tlDspl = tlDspl ? false : true;
  elmTlbr.style.display = tlDspl ? 'block' : 'none';
  elmTlsw.innerHTML = tlDspl ? '[&ndash;]' : '[+]';
  tlbrHt = tlDspl ? tlbrHtShw : 0;
  adjLayout();
}
//** end tlbr_Dspl


