﻿function ftnNavSubMenuClear(oThis)
{
    //#$('#divNavSubMenu').css({ 'display': 'none' });
    //#
    //#c_oUlSubMenu.each(function (i) {
    //#    $(this).css({ 'visibility': 'hidden' });
    //#});
    //$(document).ready(function () {
        c_oThisChildren = oThis;
    //}
}
function ftnNavSubMenuShow(oThis) {
    //#$('#divNavSubMenu').css({ 'display': 'block' });
    //#
    //#oThis.children[1].style.visibility = "visible";
    //$(document).ready(function () {
        ftnCleanUp();

        if (oThis.children.length > 1) {  //Contains <ul> tag...
            $('#divNavSubMenu').css({ 'display': 'block' });

            oThis.children[1].style.visibility = "visible";
        }
    //}
}
function ftnNavMenuOutOfBoundZone() {
    //$(document).ready(function () {
        //02/11/2011 - This if-statement is needed to control the event bubbling...
        if (event.srcElement.tagName == "DIV") {
            if (event.srcElement.id == "divNavMenuOutOfBoundZone")
            {
                //alert(event.srcElement.tagName);
                //Do your stuff here...
                c_sNavSubMenuHideTimeOutId = window.setTimeout("ftnCleanUp()", 1000); //# of second(s) x 1,000 milliseconds per second...
            }
        } else {
            //Nevermind, don't do anything...
        }
    //}
}
function ftnNavMenuInBoundZone() {
    //$(document).ready(function () {
        if (c_sNavSubMenuHideTimeOutId != null) {
            window.clearTimeout(c_sNavSubMenuHideTimeOutId);
        }

        if (c_oThisChildren != null) {
            if (c_oThisChildren.children.length > 1) {  //Contains <ul> tag...
                $('#divNavSubMenu').css({ 'display': 'block' });

                c_oThisChildren.children[1].style.visibility = "visible";
            }
        }
    //}
}
function ftnCleanUp() {
    //$(document).ready(function () {
        $('#ulNavMenu > li > ul').each(function (i) {
            $(this).css({ 'visibility': 'hidden' });
        });
        //oUlNavMenu = document.getElementById("ulNavMenu");

        $('#divNavSubMenu').css({ 'display': 'none' });

        c_oThisChildren = null;
    //}
}
//Load the variables/events...
//$(document).ready(function () {
    //Initialize variables...
    c_sNavSubMenuHideTimeOutId = null;  //02/10/2011 - Drop the "var" keyword to make this JQuery object be global variable...
    c_oThisChildren = null;
//});

//window.clearTimeout();  /* To clear out the running timer from previous web page [just in case], or past website use [To avoid premature timeout when last used in a while], or with browser refresh button... */

