﻿/**
 * void toggle_subsection(id divId, obj objLink, bool toggle)
 *
 * Displays or hids the subsection
 *
 * @param   divId  The id of the element to hide.  The element must be a <div id="div_id">
 * @param   objLink The element used to call this function.
 * @param   toggle  Indicates if the div should be toggled or just displayed.
 */
function toggle_subsection(divId,objLink,toggle) {
    if(div = document.getElementById(divId)) {
        if(div.style.display == "none" || !toggle) {
            div.style.display = "block";
            objLink.innerHTML = "Hide";
        } else {
            div.style.display = "none";
            objLink.innerHTML = "Show";
        }
    }
}

/**
 * void show_picure(str url, int wid, int ht)
 *
 * Opens a new window to display a picture.
 *
 * @param   url    The url of the image to display
 * @param   wid    The width of the image
 * @param   ht     The height of the image
 */
function show_picture(url, wid, ht) {
    features = "height=" + (ht + 25);
    features += ",width=" + (wid + 25);
    features += ",directories=no";      // do not display directories
    features += ",location=no";         // do not display location bar
    features += ",menubar=no";          // do not display menu bar
    features += ",status=no";           // do not display status bar
    features += ",toolbar=no";          // do not display toolbars
    win = window.open(url,"_blank",features);   
}