
function setFontSizeSmall() {
    document.body.style.fontSize = '10px';
}

function setFontSizeMedium() {
    document.body.style.fontSize = '12px';
}

function setFontSizeLarge() {
    document.body.style.fontSize = '15px';
}

function initFontSizeWidget() {

    /* Determine the width of the viewport. */
    var clientWidth =
        document.compatMode == "CSS1Compat" ?
            document.documentElement.clientWidth :
                document.body.clientWidth;

    /* If we have a large viewport then auto-increase the font size. */
    if (clientWidth) {
        if (clientWidth > 1400) {
            /* Probably a screen resolution of 1600x1200, or greater. */
            setFontSizeLarge();
        } else if (clientWidth > 1100) {
            /* Probably a screen resolution of 1152x864 or 1280x1024. */
            setFontSizeMedium();
        } else {
            /* Probably a screen resolution of 1024x768, or less. */
        }
    }

    /* Initialize the button for small. */
    var fontSizeSmall = document.getElementById("fontSizeSmall");
    if (fontSizeSmall) {
        fontSizeSmall.onclick = setFontSizeSmall;
        fontSizeSmall.style.cursor = "pointer";
    }

    /* Initialize the button for medium. */
    var fontSizeMedium = document.getElementById("fontSizeMedium");
    if (fontSizeMedium) {
        fontSizeMedium.onclick = setFontSizeMedium;
        fontSizeMedium.style.cursor = "pointer";
    }

    /* Initialize the button for large. */
    var fontSizeLarge = document.getElementById("fontSizeLarge");
    if (fontSizeLarge) {
        fontSizeLarge.onclick = setFontSizeLarge;
        fontSizeLarge.style.cursor = "pointer";
    }

    /* Display the font size widget. */
/*
    var fontSizeWidget = document.getElementById("fontSizeWidget");
    if (fontSizeWidget) {
        fontSizeWidget.style.display = "block";
    }
*/
}
