﻿

   function changeimage(imgID, imgURL) {
        document.getElementById(imgID).src = imgURL;
    }

    // Global menu element handle:
    ///////////////////////////////////////
    var LiveMenu = null;

    // Global menu timeout handle:
    ///////////////////////////////////////
    var Timeout_ID = null;

    var debug = '';

    /* This function is called to open a drop-down menu if it's not already
    open, closing any other menus that might be open. */

    function menuOver(MenuID) {
        // debug = debug+'menuOver'+MenuID+"\n";
        // If DOM1 supported and element exists ...
        if ((document.getElementById) && (document.getElementById(MenuID) != null)) {
            // If this menu is already open ...
            if (LiveMenu == document.getElementById(MenuID)) {
                // Do not close it
                clearTimeout(Timeout_ID);
            }
            // Another might still be open ...
            else {
                // If another menu is open ...
                if (LiveMenu != null) {
                    // Do not wait, shut it now
                    clearTimeout(Timeout_ID);
                    hideNow();
                }
            }
            document.getElementById(MenuID).style.zIndex = 10;
            // This is the new 'live' menu, make it visible
            LiveMenu = document.getElementById(MenuID);
            // LiveMenu.style.visibility is
            // initially empty in IE5 until
            // it is assigned by these
            // functions, so must check that
            // it's not null before proceeding...
            if ((LiveMenu.style) && (LiveMenu.style.visibility != null)) {
                LiveMenu.style.visibility = 'visible';
            }
        }
    }

    /* This function keeps a menu it open if it's already open, but does
    nothing if there's no menu open. The idea is that when you move down from
    the link to the menu that has just been opened, this is called to keep it
    open. */

    function stayOpen(MenuID) {
        // debug = debug+'stayOpen'+MenuID+"\n";
        // If menuOver has not been called or the menu is hidden, do nothing
        document.getElementById(MenuID).style.zIndex = 10;
        if ((LiveMenu == null) || ((LiveMenu.style) && (LiveMenu.style.visibility) && (LiveMenu.style.visibility == 'hidden'))) return;
        else menuOver(MenuID);
    }

    function menuOut(MenuID) {
        // debug = debug+'menuOut'+MenuID+"\n";
        // If DOM1 supported and a menu is open ...
        if ((document.getElementById) && (document.getElementById(MenuID) != null)) {
            // Get the current live menu
            LiveMenu = document.getElementById(MenuID);
            // Prepare to shut it in 250 milliseconds
            Timeout_ID = window.setTimeout('hideNow();', 250);
        }
    }

    function showElement(id) {
        var ws = document.getElementById(id);
        if (!ws)
            return;
        ws.style.display = '';
    }
    // Called by menu handlers to shut
    // previous menu immediately
    ///////////////////////////////////////
    function hideNow() {
        // debug = debug+'hideNow'+"\n";
        if ((LiveMenu.style) && (LiveMenu.style.visibility)) {
            LiveMenu.style.visibility = 'hidden';
        }
    }

    function show_confirm(msg) {
        var r = confirm(msg);
        if (r == true) {
            return true;
        }
        else {
            return false;
        }
    }


    function HideDiv(MenuID) {
        var box = document.getElementById(MenuID);
        if (box) {
            box.style.visibility = 'hidden';
        }
    }
        
        
        
        
        
        
      
