/**********************************************************************
 * Navigation Trixonline
 *
 **********************************************************************/ 
function Browser()
{
    this.IE4plus      = false;
    this.IE51beta     = false;
    this.Gecko        = false;
    this.Gecko09plus  = false;
    this.Gecko09minus = false;
    this.Opera        = false;
    this.Mac          = false;
    this.Version      = 0;
    var sVersion = '';
    var nStart   = 0;
    if (navigator.userAgent.indexOf('Opera') != -1)
    {
        this.Opera = true;
        sVersion = navigator.appVersion;
    }
    else
    {
        nStart = navigator.userAgent.indexOf('Gecko');
        if (nStart != -1)
        {
            this.Gecko = true;
            var nGeckoDate = parseInt(navigator.userAgent.substring(nStart + 6, nStart + 14));
            this.Gecko09plus  = (nGeckoDate >= 20010505);
            this.Gecko09minus = !this.Gecko09plus;
            sVersion = navigator.appVersion;
        }
        else if (document.all)
        {
            this.IE4plus = true;
            sVersion = navigator.userAgent.substring(navigator.userAgent.indexOf('MSIE ') + 5);
            sVersion = sVersion.substring(0, 4);
            if (sVersion == '5.1b') this.IE51beta = true;
            sVersion = sVersion.substring(0, 3);
        }
    }
    this.Version = Math.floor(parseFloat(sVersion) * 10) / 10;
    this.Mac = navigator.appVersion.indexOf('Macintosh') != -1 ? true : false;
    if (this.IE4plus)
    {
        this.DisplayShow = '';
        this.DisplayHide = 'none';
    }
    else
    {
        this.DisplayShow = 'block';
        this.DisplayHide = 'none';
    }
}
var oBrowser = new Browser();
function NavTrixOnline()
{
    this.Frames            = true;
    this.GroupName         = '';
    this.GroupTitle        = '';
    this.HomePage          = 'index.html';
    this.InitiallyOpen     = false;
    this.PreserveState     = true;
    this.RightToLeft       = false; 
    this.ConvertLink       = true;
    this.AutoClose         = false;
    this.AutoCloseCurrent  = false;
    this.ConvertParent     = false;
    this.MatchQueryString  = false;
    this.PageSearch        = new PageSearch();
    this.NodeBlankName     = /Blank/i;
    this.NodeMinusName     = 'Minus';
    this.NodePlusName      = 'Plus';
    this.NodePlusTitle     = 'Open Menu';
    this.NodeMinusTitle    = 'Close Menu';
    this.OpenOnClick       = false;
    this.PointerName       = 'pointer';
    this.PointerBlankName  = 'blank';
    this.PathAsText        = false;
    this.PathSeparator     = '';
    this.Path              = '';
    this._oCurrentMenuItem ;
    this._nCurrentMenuNo   ;
    this._FrameWindow      = 'DetBer';
}
NavTrixOnline.prototype.BeforeLoad        = NavTrixOnline_BeforeLoad;
NavTrixOnline.prototype.AfterLoad         = NavTrixOnline_AfterLoad;
NavTrixOnline.prototype.CloseAll          = NavTrixOnline_CloseAll;
NavTrixOnline.prototype.OpenAll           = NavTrixOnline_OpenAll;
NavTrixOnline.prototype.Locate            = NavTrixOnline_Locate;
NavTrixOnline.prototype.WoBinIch          = NavTrixOnline_WoBinIch;
NavTrixOnline.prototype.LocateFrame       = NavTrixOnline_LocateFrame;
NavTrixOnline.prototype.MoveNext          = NavTrixOnline_MoveNext;
NavTrixOnline.prototype.MovePrevious      = NavTrixOnline_MovePrevious;
NavTrixOnline.prototype.PrepareFrame      = NavTrixOnline_PrepareFrame;
NavTrixOnline.prototype.menuAll           = 'NavTrixOnlineAll';
NavTrixOnline.prototype.menuId            = 'NavTrixOnlineMenu';
NavTrixOnline.prototype.menuBodyId        = 'NavTrixOnlineMenuBody';
NavTrixOnline.prototype.menuItemId        = 'NavTrixOnlineItem';
NavTrixOnline.prototype.menuBoxId         = 'NavTrixOnlineMenuBox';
NavTrixOnline.prototype.menuNodeId        = 'NavTrixOnlineMenuNode';
NavTrixOnline.prototype.pointerId         = 'NavTrixOnlinePointer';
NavTrixOnline.prototype.pathId            = 'NavTrixOnlinePath';
NavTrixOnline.prototype.cookiePrefix      = 'NavTrixOnline_';
NavTrixOnline.prototype.menuNoAttr        = 'menuNo';
NavTrixOnline.prototype.menuNodePathAttr  = 'nodePath';
NavTrixOnline.prototype.menuNodeQueryAttr = 'nodeQuery';
NavTrixOnline.prototype.currentMenuAttr   = 'menuCurrent';
NavTrixOnline.prototype.openMenuAttr      = 'menuOpen';
var NavTrixOnline = new NavTrixOnline();
var xMenu;
var xMenuBody;
var xMenuBox;
var xMenuBoxPlusImage;
var xMenuBoxMinusImage;
var xHref;
var bReady = false;
function NavTrixOnline_BeforeLoad()
{
    if (!oBrowser.IE4plus && !oBrowser.Gecko && !oBrowser.Opera) return;
    var i;
    if (NavTrixOnline.AutoClose == true) NavTrixOnline.PreserveState = false;
    if (NavTrixOnline.GroupTitle.length == 0) NavTrixOnline.GroupTitle = NavTrixOnline.GroupName;
    var oAll = GetFirstElement(document, NavTrixOnline.menuAll, 'span');
    if (!oBrowser.Gecko09minus) oAll.style.display = oBrowser.DisplayHide;
    var bFirstTime = GetGroupLoaded();
    var bLoadOpen = bFirstTime ? NavTrixOnline.InitiallyOpen : false;
    if (bFirstTime) SetGroupLoaded();
    if (!NavTrixOnline.Frames) NavTrixOnline.PageSearch.Initialize(window);
    xMenu = GetElements(document, NavTrixOnline.menuId, 'span');
    xMenuBody = new Array(xMenu.length);
    for (i=0; i < xMenu.length; i++)
    {
        xMenu[i].setAttribute(NavTrixOnline.menuNoAttr, i);
        xMenuBody[i] = GetFirstElement(xMenu[i], NavTrixOnline.menuBodyId, 'span');
        if (xMenuBody[i]) 
        {
            if (bLoadOpen)
            {
                SetMenuCookie(xMenu[i], true);
            }
            else
            {
                if (GetMenuCookie(xMenu[i]) == false)
                {
                    xMenuBody[i].style.display = oBrowser.DisplayHide;
                }
            }
            if (NavTrixOnline.PreserveState == false) SetMenuCookie(xMenu[i], false, true);
        }
    }
    var xItem = GetElements(document, NavTrixOnline.menuItemId, 'a');
    xHref = new Array(xItem.length);
    for (i=0; i < xItem.length; i++)
    {
        xHref[i] = xItem[i].href;
    }
    if (!NavTrixOnline.Frames)
    {
        for (i=0; i < xItem.length; i++)
        {
            oItem = xItem[i];
            if (NavTrixOnline.PageSearch.MatchesLink(oItem) == true)
            {
                NavTrixOnline._oCurrentMenuItem = oItem;
                NavTrixOnline._nCurrentMenuNo   = i;
                _OpenAncestorNodes(oItem)
                _SetItemPointer(NavTrixOnline._oCurrentMenuItem);
                break;
            }
        }
    }
    xMenuBox           = new Array(xMenu.length);
    xMenuBoxPlusImage  = new Array(xMenu.length);
    xMenuBoxMinusImage = new Array(xMenu.length);
    for (i=0; i < xMenu.length; i++)
    {
        xMenuBox[i] = GetFirstElement(xMenu[i], NavTrixOnline.menuBoxId, 'img');
        if (xMenuBox[i])
        {
            xMenuBox[i].setAttribute(NavTrixOnline.menuNoAttr, i);
            xMenuBoxPlusImage[i]      = new Image();
            xMenuBoxPlusImage[i].src  = xMenuBox[i].src.replace(NavTrixOnline.NodeBlankName, NavTrixOnline.NodePlusName);
            xMenuBoxMinusImage[i]     = new Image();
            xMenuBoxMinusImage[i].src = xMenuBox[i].src.replace(NavTrixOnline.NodeBlankName, NavTrixOnline.NodeMinusName);
            _ActivateMenu(i);
        }
    }
    oAll.style.display = oBrowser.DisplayShow;
    bReady = true;
}
function NavTrixOnline_PrepareFrame(oWindow)
{
    NavTrixOnline.PageSearch = new PageSearch();
    NavTrixOnline._FrameWindow = oWindow;
}
function NavTrixOnline_LocateFrame()
{
    if (!oBrowser.IE4plus && !oBrowser.Gecko && !oBrowser.Opera) return;
    if (!bReady) return;
    _ClearItemPointer(NavTrixOnline._oCurrentMenuItem);
    NavTrixOnline.PageSearch.Initialize(NavTrixOnline._FrameWindow);
    var xItem = GetElements(document, NavTrixOnline.menuItemId, 'a');
    if (NavTrixOnline.AutoClose == true)
    {
        for (i=0; i < xMenu.length; i++)
        {
            oMenu     = xMenu[i];
            oMenuBox  = xMenuBox[i];
            oMenuBody = xMenuBody[i];
            if (oMenuBody)
            {
                if (oMenuBody.getAttribute(NavTrixOnline.openMenuAttr) != '1')
                {
                    oMenuBody.style.display = oBrowser.DisplayHide;
                    oMenuBox.src   = xMenuBoxPlusImage[i].src;
                    oMenuBox.title = NavTrixOnline.NodePlusTitle;
                }
                oMenuBody.setAttribute(NavTrixOnline.openMenuAttr, '0');
            }
        }
    }
    if (oBrowser.Gecko09plus) 
    {
        var oAll = GetFirstElement(document, NavTrixOnline.menuAll, 'span');
        oAll.style.display = oBrowser.DisplayHide;
    }
    for (i=0; i < xItem.length; i++)
    {
        oItem     = xItem[i];
        oMenuBox  = xMenuBox[i];
        oMenuBody = xMenuBody[i];
        if (NavTrixOnline.PageSearch.MatchesLink(oItem) == true)
        {
            NavTrixOnline._oCurrentMenuItem = oItem;
            NavTrixOnline._nCurrentMenuNo   = i;
            _OpenAncestorNodes(oItem);
            _SetItemPointer(NavTrixOnline._oCurrentMenuItem);
            break;
        }
    }
    if (oBrowser.Gecko09plus) 
    {
        oAll.style.display = oBrowser.DisplayShow;
    }
    for (i=0; i < xMenu.length; i++)
    {
        _SetMenuBox(i);
    }
    _SetPath(NavTrixOnline._FrameWindow, false);
}
function _OpenAncestorNodes(oItem)
{
    var i;
    for (i=0; i < xMenu.length; i++)
    {
        xMenu[i].setAttribute(NavTrixOnline.currentMenuAttr, '0');
    }
    while (oItem)
    {
        if (oBrowser.Gecko || oBrowser.Opera) oItem = oItem.parentNode;
        if (oBrowser.IE4plus)                 oItem = oItem.parentElement;
        if (oItem)
        {
            if (oItem.id == NavTrixOnline.menuId)
            {
                break;
            }
            else if (oItem.id == NavTrixOnline.menuBodyId)
            {
                oItem.style.display = oBrowser.DisplayShow;
                break;
            }
        }
    }
    while (oItem)
    {
        if (oBrowser.Gecko || oBrowser.Opera) oItem = oItem.parentNode;
        if (oBrowser.IE4plus)                 oItem = oItem.parentElement;
        if (oItem)
        {
            if (oItem.id == NavTrixOnline.menuId)
            {
                SetMenuCookie(oItem, true);
                oItem.setAttribute(NavTrixOnline.currentMenuAttr, '1');
            }
            else if (oItem.id == NavTrixOnline.menuBodyId)
            {
                oItem.style.display = oBrowser.DisplayShow;
            }
        }
    }
}
function _SetItemPointer(oItem)
{
    if (oItem)
    {
        if (oBrowser.IE4plus) 
        {
            oImagePointer = GetFirstElement(oItem.parentElement.parentElement.parentElement, NavTrixOnline.pointerId, 'img');
        }
        else if (oBrowser.Gecko || oBrowser.Opera)
        {
            oImagePointer = GetFirstElement(oItem.parentNode.parentNode.parentNode, NavTrixOnline.pointerId, 'img');
        }
        if (oImagePointer) oImagePointer.src = oImagePointer.src.replace(NavTrixOnline.PointerBlankName, NavTrixOnline.PointerName);
    }
}
function _ClearItemPointer(oItem)
{
    if (oItem)
    {
        if (oBrowser.IE4plus) 
        {
            oImagePointer = GetFirstElement(oItem.parentElement.parentElement.parentElement, NavTrixOnline.pointerId, 'img');
        }
        else if (oBrowser.Gecko || oBrowser.Opera)
        {
            oImagePointer = GetFirstElement(oItem.parentNode.parentNode.parentNode, NavTrixOnline.pointerId, 'img');
        }
        if (oImagePointer) oImagePointer.src = oImagePointer.src.replace(NavTrixOnline.PointerName, NavTrixOnline.PointerBlankName);
    }
}
function _SetMenuBox(nMenu)
{
    if (xMenuBody[nMenu])
    {
        if (GetMenuCookie(xMenu[nMenu]) == true)
        {
            xMenuBox[nMenu].src   = xMenuBoxMinusImage[nMenu].src;
            xMenuBox[nMenu].title = NavTrixOnline.NodeMinusTitle;
        }
        else
        {
            xMenuBox[nMenu].src   = xMenuBoxPlusImage[nMenu].src;
            xMenuBox[nMenu].title = NavTrixOnline.NodePlusTitle;
        }
    }
}
function _ActivateMenu(nMenu)
{
    if (oBrowser.Opera) return;
    var oLink;
    var oSpan;
    var oMenuNode;
    oMenu     = xMenu[nMenu];
    oMenuBox  = xMenuBox[nMenu];
    oMenuBody = xMenuBody[nMenu];
    if (oMenuBody)
    {
        oLink = GetFirstElement(oMenu, NavTrixOnline.menuItemId);
        if (oLink)
        {
            oSpan = oLink;
            while (oSpan.tagName != 'SPAN')
            {
                if (oBrowser.Gecko  || oBrowser.Opera) oSpan = oSpan.parentNode;
                if (oBrowser.IE4plus)                  oSpan = oSpan.parentElement;
            }
            if (oSpan.id == NavTrixOnline.menuNodeId) 
            {
                if (IsJavaScriptURL(oLink.href))
                {
                    oMenu.setAttribute(NavTrixOnline.menuNodePathAttr, oLink.href.toLowerCase());
                }
                else
                {
                    oMenu.setAttribute(NavTrixOnline.menuNodePathAttr, NormalizePathName(oLink.pathname));
                }
                oMenu.setAttribute(NavTrixOnline.menuNodeQueryAttr, NormalizeQueryString(oLink.search));
            }
        }
        oMenuNode = GetFirstElement(oMenu, NavTrixOnline.menuNodeId)
        if (oBrowser.IE4plus)
        {
            oMenuBox.onclick  = NavTrixOnline_MenuBoxClick;
            oMenuNode.onclick = NavTrixOnline_MenuNodeClick;
            oMenuBody.onclick = NavTrixOnline_CancelEventPropagation;
        }            
        else if (oBrowser.Gecko)
        {
            oMenuBox.addEventListener('click',  NavTrixOnline_MenuBoxClick, false);
            oMenuNode.addEventListener('click', NavTrixOnline_MenuNodeClick, false);
            oMenuBody.addEventListener('click', NavTrixOnline_CancelEventPropagation, false);
        }
        if (oBrowser.IE4plus) 
        {
            oMenuBox.style.cursor  = 'hand';
            oMenuNode.style.cursor = 'hand';
        }
        else if (oBrowser.Gecko)
        {
            oMenuBox.style.cursor  = 'pointer';
            oMenuNode.style.cursor = 'pointer';
        }
        _SetMenuBox(nMenu);
    }
}
function NavTrixOnline_AfterLoad()
{
    if (!oBrowser.IE4plus && !oBrowser.Gecko) return;
    var bConvert = (NavTrixOnline.Frames || NavTrixOnline.ConvertLink == false || (!NavTrixOnline.PageSearch._bMatchLocation && NavTrixOnline.ConvertParent == false)) ? false : true;
    _SetPath(window, bConvert);
    if (bConvert)
    {
        if (NavTrixOnline._oCurrentMenuItem )
        {
            if (oBrowser.IE4plus)
            {
                if (oBrowser.IE51beta)
                {
                    return;
                }
                else if (oBrowser.Mac && oBrowser.Version == 5.0)
                {
                    var oSpan = NavTrixOnline._oCurrentMenuItem;
                    while (oSpan.tagName != 'SPAN')
                    {
                        oSpan = oSpan.parentElement;
                    }
                    if (oSpan.id == NavTrixOnline.menuNodeId) return;
                }
                NavTrixOnline._oCurrentMenuItem.outerHTML = '<em class=NavTrixOnlineCurrentPage>' + NavTrixOnline._oCurrentMenuItem.innerHTML + '</em>';
            }
            else if (oBrowser.Gecko || oBrowser.Opera)
            {
                oElement = document.createElement('EM');
                oElement.setAttribute('class', 'NavTrixOnlineCurrentPage');
                var oNode = NavTrixOnline._oCurrentMenuItem.firstChild;
                while (oNode)  
                {
                    oElement.appendChild(oNode.cloneNode(true));
                    oNode = oNode.nextSibling;
                }
                NavTrixOnline._oCurrentMenuItem.parentNode.replaceChild(oElement, NavTrixOnline._oCurrentMenuItem);
            }
        }
    }
}
function _SetPath(oWindow, bConvert)
{
    if (oBrowser.Opera) return;
    var oItem = NavTrixOnline._oCurrentMenuItem;
    var oNode;
    var sPath;
    var bSkip = false;
    if (NavTrixOnline.PathSeparator.length == 0)
    {
        NavTrixOnline.PathSeparator = (NavTrixOnline.RightToLeft) ? '&#160;&lt;&#160;' : '&#160;&gt;&#160;';
    }
    if (oItem)
    {
        if (oItem.id == NavTrixOnline.menuItemId)
        {
            if (bConvert || NavTrixOnline.PathAsText == true)
            {
                if (oBrowser.IE4plus) sPath = oItem.innerText;
                if (oBrowser.Gecko)   sPath = oItem.innerHTML;
            }
            else
            {
                if (oBrowser.IE4plus) sPath = oItem.outerHTML;
                if (oBrowser.Gecko)   sPath = oItem.parentNode.innerHTML;
            }
        }
    }
    if (oItem)
    {
        if (oBrowser.Gecko)   oItem = oItem.parentNode;
        if (oBrowser.IE4plus) oItem = oItem.parentElement;
    }
    while (oItem)
    {
        if (oItem.tagName == 'SPAN' && oItem.id == 'NavTrixOnlineMenuNode') bSkip = true;
        if (oItem.id == NavTrixOnline.menuId)
        {
            oNode = GetFirstElement(oItem, NavTrixOnline.menuNodeId);
            if (oNode)
            {
                if (bSkip)
                {
                    bSkip = false;
                }
                else
                {
                    sPath = _AddPathElement(sPath, _GetPathElement(oNode))
                }
            }
        }
        if (oBrowser.Gecko)   oItem = oItem.parentNode;
        if (oBrowser.IE4plus) oItem = oItem.parentElement;
    }
    if (NavTrixOnline.GroupName.length > 0)
    {
        sPath = _AddPathElement(sPath, NavTrixOnline.GroupTitle);
    }
    NavTrixOnline.Path = sPath;
    var oPath = GetFirstElement(oWindow.document, NavTrixOnline.pathId, 'span');
    if (oPath)
    {
        oPath.innerHTML = sPath;
    }
}
function _GetPathElement(oNode)
{
    var sElement;
    if (NavTrixOnline.PathAsText == true)
    {     
        if (oBrowser.IE4plus)
        {
            sElement = oNode.innerText;
        }
        else if (oBrowser.Gecko)
        {
            if (oNode.firstChild.tagName == 'A')
            {
                sElement = oNode.firstChild.innerHTML;
            }
            else
            {
                sElement = oNode.innerHTML;
            }
        }
    }
    else
    {
        sElement = oNode.innerHTML;
    }
    return sElement;
}
function _AddPathElement(sPath, sElement)
{
    if (NavTrixOnline.RightToLeft)
    {
        return sPath + NavTrixOnline.PathSeparator + sElement;
    }
    else
    {
        return sElement + NavTrixOnline.PathSeparator + sPath;
    }
}
function NavTrixOnline_OpenAll()
{
    if (oBrowser.Opera) return;
    if (oBrowser.Gecko09plus) 
    {
        var oAll = GetFirstElement(document, NavTrixOnline.menuAll, 'span');
        oAll.style.display = oBrowser.DisplayHide;
    }
    for (i=0; i < xMenu.length; i++)
    {
        oMenu     = xMenu[i];
        oMenuBox  = xMenuBox[i];
        oMenuBody = xMenuBody[i];
        if (oMenuBody)
        {
            SetMenuCookie(oMenu, true);
            oMenuBody.style.display = oBrowser.DisplayShow;
            oMenuBox.src   = xMenuBoxMinusImage[i].src;
            oMenuBox.title = NavTrixOnline.NodeMinusTitle;
        }
    }
    if (oBrowser.Gecko09plus)
    {
        oAll.style.display = oBrowser.DisplayShow;
    }
}
function NavTrixOnline_CloseAll()
{
    if (oBrowser.Opera) return;
    if (oBrowser.Gecko09plus) 
    {
        var oAll = GetFirstElement(document, NavTrixOnline.menuAll, 'span');
        oAll.style.display = oBrowser.DisplayHide;
    }
    for (i=0; i < xMenu.length; i++)
    {
        oMenu     = xMenu[i];
        oMenuBox  = xMenuBox[i];
        oMenuBody = xMenuBody[i];
        if (oMenuBody)
        {
            SetMenuCookie(oMenu, false);
            oMenuBody.style.display = oBrowser.DisplayHide;
            oMenuBox.src   = xMenuBoxPlusImage[i].src;
            oMenuBox.title = NavTrixOnline.NodePlusTitle;
        }
    }
    if (oBrowser.Gecko09plus)
    {
        oAll.style.display = oBrowser.DisplayShow;
    }
}
function NavTrixOnline_Locate()
{
    if (oBrowser.Opera) return;
    if (oBrowser.Gecko09plus) 
    {
        var oAll = GetFirstElement(document, NavTrixOnline.menuAll, 'span');
        oAll.style.display = oBrowser.DisplayHide;
    }
    for (i=0; i < xMenu.length; i++)
    {
        oMenu     = xMenu[i];
        oMenuBox  = xMenuBox[i];
        oMenuBody = xMenuBody[i];
        if (oMenuBody)
        {
            if (oMenu.getAttribute(NavTrixOnline.currentMenuAttr) == '1')
            {
                SetMenuCookie(oMenu, true);
                oMenuBody.style.display = oBrowser.DisplayShow;
                oMenuBox.src   = xMenuBoxMinusImage[i].src;
                oMenuBox.title = NavTrixOnline.NodeMinusTitle;
            }
        }
    }
    if (oBrowser.Gecko09plus)
    {
        oAll.style.display = oBrowser.DisplayShow;
    }
}
function NavTrixOnline_MoveNext()
{
    var nItem = NavTrixOnline._nCurrentMenuNo;
    nItem++;
    if (nItem >= xHref.length) nItem = 0;
    if (NavTrixOnline.Frames)
    {
        NavTrixOnline._FrameWindow.document.location = xHref[nItem];
    }
    else
    {
        document.location = xHref[nItem];
    }
}
function NavTrixOnline_MovePrevious()
{
    var nItem = NavTrixOnline._nCurrentMenuNo;
    nItem--;
    if (nItem < 0) nItem = xHref.length - 1;
    if (NavTrixOnline.Frames)
    {
        NavTrixOnline._FrameWindow.document.location = xHref[nItem];
    }
    else
    {
        document.location = xHref[nItem];
    }    
}
function PageSearch()
{
    this._bMatchLocation  = false;
    this.page             = arguments[0];
    this.querystring      = arguments[1];
}
PageSearch.prototype.MatchesLink = PageSearch_MatchesLink;
PageSearch.prototype.MatchesURL  = PageSearch_MatchesURL;
PageSearch.prototype.Initialize  = PageSearch_Initialize;
function PageSearch_Initialize(oWindow)
{
    if (!this.page)
    {
        this._bMatchLocation = true;
        this.page = NormalizePathName(oWindow.location.pathname, NavTrixOnline.HomePage);        
        if (NavTrixOnline.MatchQueryString == true)
        {
            this.querystring = NormalizeQueryString(oWindow.location.search);
        }
    }
}
function PageSearch_MatchesLink(oLink)
{
    if (IsJavaScriptURL(oLink.href))
    {
        var sPathName = oLink.href.toLowerCase();
    }
    else
    {
        if (!oLink.pathname) return false;
        var sPathName = NormalizePathName(oLink.pathname);
    }
    if (this._bMatchLocation)
    {
        if (this.page != sPathName) return false;
        if (this.querystring)
        {
            if (oBrowser.Opera)
            {
                if (this.querystring != NormalizeQueryString(oLink.pathname)) return false;
            }
            else
            {
                if (this.querystring != NormalizeQueryString(oLink.search)) return false;
            }
        }
    }
    else
    {
        if (typeof this.page == 'string')
        {
            if (StringEnds(sPathName, this.page.toLowerCase()) == false) return false;
        }
        else
        {
            if (!this.page.test(sPathName)) return false;
        }
        if (this.querystring)
        {
            if (oBrowser.Opera)
            {
                var sQueryString = NormalizeQueryString(oLink.pathname);
            }
            else
            {
                var sQueryString = NormalizeQueryString(oLink.search);
            }
            if (typeof this.querystring == 'string')
            {
                if (this.querystring.toLowerCase() != sQueryString) return false;
            }
            else
            {
                if (!this.querystring.test(sQueryString)) return false;
            }
        }
    }
    return true;
}
function PageSearch_MatchesURL(sPathName, sQueryString)
{
    if (!this.page) return false;
    if (typeof this.page == 'string')
    {
        if (this.page.toLowerCase() != sPathName) return false;
    }
    else
    {
        if (!this.page.test(sPathName)) return false;
    }
    if (this.querystring)
    {
        if (typeof this.querystring == 'string')
        {
            if (this.querystring.toLowerCase() != sQueryString) return false;
        }
        else
        {
            if (!this.querystring.test(sQueryString)) return false;
        }
    }
    return true;
}
function NavTrixOnline_MenuBoxClick(evt)
{
    var oSource;
    if (oBrowser.IE4plus) oSource = window.event.srcElement;
    if (oBrowser.Gecko)   oSource = evt.currentTarget;
    nMenu = oSource.getAttribute(NavTrixOnline.menuNoAttr);
    _MenuToggle(nMenu, false, false);
}
function NavTrixOnline_MenuNodeClick(evt)
{
    var oSource;
    var sNodePath;
    var sNodeQuery;
    var bOpenOnClick;
    var bThisPage;
    if (oBrowser.IE4plus) oSource = window.event.srcElement;
    if (oBrowser.Gecko)   oSource = evt.currentTarget;
    while (oSource.id != NavTrixOnline.menuId)
    {
        if (oBrowser.Gecko)   oSource = oSource.parentNode;
        if (oBrowser.IE4plus) oSource = oSource.parentElement;
    }
    if (oSource)
    {
        sNodePath  = oSource.getAttribute(NavTrixOnline.menuNodePathAttr);
        sNodeQuery = oSource.getAttribute(NavTrixOnline.menuNodeQueryAttr);
        nMenu = oSource.getAttribute(NavTrixOnline.menuNoAttr);
        var bOpenOnClick = (NavTrixOnline.OpenOnClick && xMenuBody[nMenu].style.display == oBrowser.DisplayHide);
        if (sNodePath)
        {
            bThisPage = NavTrixOnline.PageSearch.MatchesURL(sNodePath, sNodeQuery);
            if (!bOpenOnClick && !bThisPage) 
            {
                return;
            }
        }
        _MenuToggle(nMenu, bOpenOnClick, bThisPage);
    }
}
function _MenuToggle(nMenu, bPreserveOpenOnClick, bThisPage)
{
    var i;
    var oMenu     = xMenu[nMenu];
    var oMenuBox  = xMenuBox[nMenu];
    var oMenuBody = xMenuBody[nMenu];
    if (oMenuBody)
    {
        if (oBrowser.Gecko09plus) 
        {
            var oAll = GetFirstElement(document, NavTrixOnline.menuAll, 'span');
            oAll.style.display = oBrowser.DisplayHide;
        }
        if (oMenuBody.style.display == oBrowser.DisplayHide)
        {
            SetMenuCookie(oMenu, true);
            oMenuBody.style.display = oBrowser.DisplayShow;
            oMenuBox.src   = xMenuBoxMinusImage[nMenu].src;
            oMenuBox.title = NavTrixOnline.NodeMinusTitle;
            if (NavTrixOnline.AutoClose == true)
            {
                SetMenuCookie(oMenu, (bPreserveOpenOnClick && !bThisPage), true);
                for (i=0; i < xMenu.length; i++)
                {
                    if (xMenuBody[i])
                    {
                        xMenuBody[i].setAttribute(NavTrixOnline.openMenuAttr, '0');
                    }
                }
                var oItem = oMenuBody
                while (oItem)
                {
                    if (oItem)
                    {
                        if (oItem.id == NavTrixOnline.menuBodyId)
                        {
                            oItem.setAttribute(NavTrixOnline.openMenuAttr, '1');
                        }
                        if (oBrowser.Gecko)   oItem = oItem.parentNode;
                        if (oBrowser.IE4plus) oItem = oItem.parentElement;
                    }
                }
                for (i=0; i < xMenu.length; i++)
                {
                    if (xMenuBody[i])
                    {
                        if (!((xMenuBody[i].getAttribute(NavTrixOnline.openMenuAttr) == '1') || 
                           ((NavTrixOnline.AutoCloseCurrent == false) && (xMenu[i].getAttribute(NavTrixOnline.currentMenuAttr) == '1'))))
                        {
                            xMenuBody[i].style.display = oBrowser.DisplayHide;
                            xMenuBox[i].src   = xMenuBoxPlusImage[nMenu].src;
                            xMenuBox[i].title = NavTrixOnline.NodePlusTitle;
                        }
                    }
                }
            }
        }
        else
        {
            SetMenuCookie(oMenu, false);
            oMenuBody.style.display = oBrowser.DisplayHide;
            oMenuBox.src   = xMenuBoxPlusImage[nMenu].src;
            oMenuBox.title = NavTrixOnline.NodePlusTitle;
        }
        if (oBrowser.Gecko09plus) 
        {
            oAll.style.display = oBrowser.DisplayShow;
        }
    }
}
function NavTrixOnline_CancelEventPropagation(evt)
{
    if (oBrowser.IE4plus)
    {
        window.event.cancelBubble=true;
    }
    else if (oBrowser.Gecko)
    {
        evt.cancelBubble = true;
    }
}
function SetMenuCookie(oMenu, bValue, bForce)
{
    var sValue = bValue ? '1' : '0';
    if (NavTrixOnline.PreserveState || bForce)
    {
        document.cookie = NavTrixOnline.cookiePrefix + NavTrixOnline.GroupName + '_' + oMenu.getAttribute(NavTrixOnline.menuNoAttr) + '=' + sValue + '; path=/';
    }
    oMenu.setAttribute('menuOpen', sValue);
}
function GetMenuCookie(oMenu)
{
    var bValue = false;
    bValue = document.cookie.indexOf(NavTrixOnline.cookiePrefix + NavTrixOnline.GroupName + '_' + oMenu.getAttribute(NavTrixOnline.menuNoAttr) + '=1') != -1;
    if (!bValue) 
    {
        if (oMenu.getAttribute('menuOpen') == '1') bValue = true;
    }
    return bValue;
}
function SetGroupLoaded()
{
    document.cookie = NavTrixOnline.cookiePrefix + NavTrixOnline.GroupName + '=1; path=/';
}
function GetGroupLoaded()
{
    var bValue = false;
    bValue = document.cookie.indexOf(NavTrixOnline.cookiePrefix + NavTrixOnline.GroupName + '=1') == -1;
    return bValue;
}
function NormalizePathName(sPathName, sDefault)
{
    var sBuffer;
    var nPos;
    nPos = sPathName.indexOf('/');
    if (nPos == 0) 
    {
        sBuffer = sPathName;
    }
    else
    {
        sBuffer = '/' + sPathName;
    }
    if (oBrowser.Opera)
    {
        nPos = sPathName.lastIndexOf('?');
        if (nPos > -1)
        {
            sBuffer = sBuffer.substring(0, nPos);
        }
    }
    if (sBuffer.length == 1)
    {
        if (sDefault)
        {
            sBuffer = sBuffer + sDefault;
        }
    }
    return unescape(sBuffer.replace(/\\/g, '/').toLowerCase());
}
function NormalizeQueryString(sQueryString)
{
    var sBuffer = sQueryString;
    if (sBuffer.length > 0)
    {
        var nPos = sBuffer.indexOf('?');
        if (nPos > -1) 
        {
            sBuffer = sBuffer.substr(nPos + 1);
        }
    }
    return sBuffer.toLowerCase();
}
function IsJavaScriptURL(sString)
{
    return StringStarts(sString.toLowerCase(), 'javascript:')
}
function GetElements(element, id, tagName)
{
    var i;
    var elements = new Array();
    if (oBrowser.IE4plus) 
    {
        if (element.all[id])
        {
            elements = element.all[id];
            if (!elements.length) elements = [element.all[id]];
        }
    }
    else if (oBrowser.Opera)
    {
        var temp = new Array();
        temp = element.getElementsByTagName(tagName);
        for (i=0; i < temp.length; i++)
        {
            if (temp[i].id == id)
            {
                elements.push(temp[i]);
            }
        }
    }
    else if (oBrowser.Gecko)
    {
        _GetElementsDOM2(elements, element, id);
    }
    return elements;
}
function _GetElementsDOM2(elements, element, id)
{
    var i;
    if (element.childNodes)
    {
        for (i=0; i < element.childNodes.length; i++)
        {
            if (element.childNodes[i].id == id)
            {
                elements.push(element.childNodes[i]);
            }
            _GetElementsDOM2(elements, element.childNodes[i], id);
        }
    }
}
function GetFirstElement(element, id, tagName)
{
    var i;
    var reply;
    var elements;
    if (oBrowser.IE4plus)
    {
        if (element.all[id])
        {
            elements = element.all[id];
            if (!elements.length) 
            {
                reply = elements;
            }
            else
            {
                reply = elements[0];
            }
        }
    }
    else if (oBrowser.Opera)
    {
        elements = element.getElementsByTagName(tagName);
        for (i=0; i < elements.length; i++)
        {
            if (elements[i].id == id)
            {
                reply = elements[i];
                break;
            }
        }
    }
    else if (oBrowser.Gecko)
    {
        elements = new Array()
        _GetFirstElementDOM2(elements, element, id);
        reply = elements[0];
    }
    return reply;
}
function _GetFirstElementDOM2(elements, element, id)
{
    var i;
    if (element.childNodes)
    {
        for (i=0; i < element.childNodes.length; i++)
        {
            if (element.childNodes[i].id == id)
            {
                elements.push(element.childNodes[i]);
                break;
            }
            _GetElementsDOM2(elements, element.childNodes[i], id);
            if (elements.length > 0) break;
        }
    }
}
function StringStarts(sString, sEnd)
{
    return (sString.indexOf(sEnd) == 0);
}
function StringEnds(sString, sEnd)
{
    if (sString.length < sEnd.length) return false;
    return (sString.lastIndexOf(sEnd) == sString.length - sEnd.length);
}
function NavTrixOnline_WoBinIch()
{
   NavTrixOnline.CloseAll();
   NavTrixOnline.Locate();
}
