
 
//*****************************************************************************
// Do not remove this notice.
//
// Copyright 2002 by Mike Hall.
// See http://www.brainjar.com for terms of use.
//*****************************************************************************

function synchTab(frameName) {

    var elList, i;
    var temp1, temp2;

    // Exit if no frame name was given.

    if (frameName == null)
        return;
//   alert(frameName);
    // Check all links.

    elList = document.getElementsByTagName("A");
//    alert("length " + elList.length);
    for (i = 0; i < elList.length; i++) {
//        temp1 = elList[i].target;
//        temp2 = frameName;
//        // Check if the link's target matches the frame being loaded.
//        alert(" test " + i + ": " + temp1 + " " + temp2);
        if (elList[i].target == frameName) {
//            alert("add " + elList[i].target);
            // If the link's URL matches the page being loaded, activate it.
            // Otherwise, make sure the tab is deactivated.
//            alert("ehref " + elList[i].href + " frame " + window.frames[frameName].location.href);

            if (elList[i].href == window.frames[frameName].location.href) {
                elList[i].className += " activeTab";
                elList[i].blur();
            }
            else
                removeName(elList[i], "activeTab");
        }
    }
}
 
function removeName(el, name) {
 
  var i, curList, newList;
//  alert("remove" + el.className); 
 if (el.className == null)
    return;
 
  // Remove the given class name from the element's className property.
 
  newList = new Array();
  curList = el.className.split(" ");
  for (i = 0; i < curList.length; i++)
    if (curList[i] != name)
      newList.push(curList[i]);
  el.className = newList.join(" ");
}
 

