﻿/// <reference path="jquery-1.3.2.js"

function ReadyPageNav() {
    // Close all navigation subnav items (left open if javascript is not active)
    // $('#navigation li ul').hide();

    // If navIsHome hidden input is present, stop
    if ($('#navigation input').size() > 0) return;

    var page;
    
    // If the hidden input navOpen is present, open the specified subnav
    var value = $('#jsNavOpen').val();
    if (value != null && value != "") {
        page = value;
    }
    else {
        page = document.URL.split("/").reverse()[0]; // If unspecified, use the current page
    }
    // Is the current page part of the main nav?
    $("#navigation > ul > li.subnav > a[href='../site/" + page + "']")
        .siblings('ul').show();
    
    // Is the current page part of a subnav list?
    $("li.subnav > ul > li > a[href='../site/" + page + "']")
        .parent().parent().show();
        
}