﻿function FixPrintFonts(tagname)
{
    // only do this if we're not in full-chapter mode
    if (document.location.href.toUpperCase().indexOf('FULL=TRUE') == -1)
    {
        var tags = document.getElementsByTagName(tagname);
        for (var i = 0; i < tags.length; i++)
        {
            tags[i].style.color = 'black';
            tags[i].style.fontFamily = 'arial';
            tags[i].style.fontSize = '9pt';
        }
    }
    else
    {
        var tags = document.getElementsByTagName('h1');
        // skipping the [0] element on purpose
        for (var i = 1; i < tags.length; i++)
        {
            tags[i].style.fontSize = '9pt';
            tags[i].style.fontFamily = 'arial';
        }
    }
}

$(function()
{
    $('a[id$=lnkLanguage]')
    .css({ 'color': 'black', 'text-decoration': 'none', 'cursor': 'default', 'font-size': 'smaller' })
    .text('[No disponible en español]')
    .attr('href', '#')
    .unbind('click');

    $('#printLink').click(function()
    {
        if ($(this).text() == "Print Version")
        {
            $(this).text("Graphic Version");
            $('#divBanner').remove();
            $('#divNav').remove();
            $('#divSearch').remove();
            $('a[id$=hlRCWs]').remove();
            $('#divChapterDispoLinks').remove();
            $('div[id$=pnlPrevNext]').remove();
            $('#divBreadCrumb').remove();

            $('#divContent').css("marginLeft", "0");

            $('a').css({ 'text-decoration': 'none' });
            $('a[id$=lnkLanguage]').css({ 'text-decoration': 'none' });
            $('h1').css({ 'color': '#000000', 'font-family': 'arial', 'font-size': '9pt' });
            $('h2').css({ 'color': '#000000', 'font-family': 'arial', 'font-size': '9pt' });
            $('h3').css({ 'font-family': 'arial', 'font-weight': 'bold' });

        }
        else
        {
            document.location.href = document.location.href.replace('#','');
        }

    });
});
