
               /* ................................................. */
               /* file: fnbihpscripts.js                            */
               /* author:Ted O'Hara                                 */
               /* module: CMS/FNBI                                  */
               /* purpose: FNBI specific scripts                    */                       
               /* Created: 08/07/2006                               */
               /* Copyright (C) 2006 bx.com, Inc.                   */
               /* ................................................. */ 
               
if (document.getElementById)
{
  function clearPanes()
    {
      for (var i = 0; i < mainlx.length; i++)
        {
          thisLk = mainlx.item(i);
          thisLk.navepane.style.display = 'none'
          thisLk.className = ''
          thisLk.style.zIndex = ''
          thisLk.onclick = setPane
        }
    } 
  
  function setPane()
    {
      clearPanes()
      this.className = 'on'
      this.style.zIndex = '1000'
      this.navepane.style.display = 'block';
      this.onclick = ''
      return false;
    }
  
  var lxarea = document.getElementById('navtabs')
  var mainlx = lxarea.getElementsByTagName('A')
  for (var i = 0; i < mainlx.length; i++)
    {
      mainlx.item(i).navepane = document.getElementById(mainlx.item(i).id.replace(/tab_/,''))
      mainlx.item(i).onclick = setPane
    }
  mainlx.item(0).onclick()
}

//added 2007 06 20 -rotation image
var rotLk,thisRotArray,hasRotation;
var rotLinkArray = new Array //array of links that actually do rotate
var imagepath = 'images/fnbidynpics/'

//initialization
for (i = 0; i < rotationArray.length ; i++)
  {
    rotLk = document.getElementById('lk_rot_' + i) //reference to link wrapping image
    thisRotArray = rotationArray[i].split('|')//break up outer list
    hasRotation = thisRotArray.length > 1 //determine if we do rotate
    if (hasRotation)// yes, we do
      {
        rotLinkArray[rotLinkArray.length] = rotLk //store link in array
        rotLk.idx = 0;
        rotLk.image = rotLk.firstChild
        rotLk.internalArray = rotationArray[i].split('|')
        rotLk.max = rotLk.internalArray.length -1
      }
  }
  
function doRotation()
  {
    for (var i = 0; i < rotLinkArray.length; i++)
      {
        var currLk = rotLinkArray[i]
        currLk.idx ++
        if (currLk.idx > currLk.max) {currLk.idx = 0}
        var array2use = currLk.internalArray[currLk.idx].split('~')
        var nuSrc = imagepath + array2use[0]
        currLk.image.src = nuSrc
        currLk.image.setAttribute('alt',array2use[1])
        currLk.setAttribute('href',array2use[2])
      }
  }
  
  window.onload = function(){setInterval(doRotation,rotationDelay)}
  
