﻿//------------------------------------------------------------------------------
// Text Size...
//------------------------------------------------------------------------------

function resizeText(multiplyer)
{
    // Resize Page Font...

    try
    {
        if (document.body.style.fontSize == "")
        {
            // No Size Set, Set Default...
            document.body.style.fontSize = "1.0em";
        }

        if (multiplyer == 0)
        {
            // Reset To 1.oem...
            document.body.style.fontSize = "1.0em";
        }
        else
        {
            // Change Text Size...

            // Get Numerical Value From Fint Size...
            var fontTokens = document.body.style.fontSize.split("e");
            var fontSize = parseFloat(fontTokens[0]);

            // Calculate Next Fint Size...
            var newSize = (fontSize + (multiplyer * 0.1)).toFixed(1);

            if ((newSize <= 1.4) && (newSize >= 1.0))
            {
                // Cap Largest Font At 1.4em And Smallest At 1.0em...

                document.body.style.fontSize = newSize + "em";
            }
        }

        // Create Text Size Cookie...
        createCookie("hmrn_text_size", document.body.style.fontSize, 7);
    }
    catch (e)
    {
        alert(e.message);
    }
}

//------------------------------------------------------------------------------

function loadTextCookie()
{
    // Load Text Size Cookie...
    document.body.style.fontSize = readCookie("hmrn_text_size");
}

//------------------------------------------------------------------------------
