/**********************************************************************
** Purpose: Saves the current font size to cookies use later in the site
**
** Params:  none.
**
** Returns: none.
***********************************************************************/
function saveFontSize()
{
    // Set the cookies
    setCookie(vg_fontSizeCookieName_str, vg_currentFontSize_i, null, "/");
    setCookie(vg_fontUnitsCookieName_str, vg_fontUnits_str, null, "/");
}

/**********************************************************************
** Purpose: Changes font size of a particular element with an id
**
** Params:  1. ID of the element
**          2. Required font size (in vg_fontUnits_str)
**
** Returns: n/a
***********************************************************************/
function changeFontSize(vp_id_str, vp_size_i)
{
    if((document.getElementById) && (document.getElementById(vp_id_str)!= null))
    {
        vg_currentFontSize_i = vp_size_i;
        document.getElementById(vp_id_str).style.fontSize = vg_currentFontSize_i + vg_fontUnits_str;
    }
    saveFontSize();
}

/**********************************************************************
** Purpose: Increases font size of a particular element with an id.
**          Javascript is unable to obtain the font size of an element
**          which has had its font size set by css. Therefore, this
**          function assumes vg_currentFontSize_i
**          is set and correct.
**
** Params:  1. ID of the element
**          2. Increment (in vg_fontUnits_str)
**
** Returns: n/a
***********************************************************************/
function increaseFontSize(vp_id_str, vp_increment_i)
{
    if((document.getElementById) && (document.getElementById(vp_id_str)!= null))
    {
        if(vg_currentFontSize_i < 100)
        {
            vg_currentFontSize_i = vg_currentFontSize_i + vp_increment_i;
            document.getElementById(vp_id_str).style.fontSize = vg_currentFontSize_i + vg_fontUnits_str;
        }
    }
    saveFontSize();
}

/**********************************************************************
** Purpose: Decreases font size of a particular element with an id.
**          See increaseFontSize() function for restrictions.
**
** Params:  1. ID of the element
**          2. Decrement (in vg_fontUnits_str)
**
** Returns: n/a
***********************************************************************/
function decreaseFontSize(vp_id_str, vp_decrement_i)
{
    if((document.getElementById) && (document.getElementById(vp_id_str)!= null))
    {
        if((vg_currentFontSize_i - vp_decrement_i) > 50)
        {
            vg_currentFontSize_i = vg_currentFontSize_i - vp_decrement_i;
            document.getElementById(vp_id_str).style.fontSize = vg_currentFontSize_i + vg_fontUnits_str;
        }
    }
    saveFontSize();
}


