var headingFont = {
    src: '/Content/Fonts/fontin.swf'//,
    //ratios: [7, 1.32, 11, 1.31, 13, 1.24, 14, 1.25, 19, 1.23, 27, 1.2, 34, 1.19, 42, 1.18, 47, 1.17, 48, 1.18, 69, 1.17, 74, 1.16, 75, 1.17, 1.16]
    };
sIFR.activate(headingFont);

$(document).ready(function () {
    setHeights();

    $("#PageContainer").fadeIn("fast", function () {
        $(this).css("zoom", '');
        var myBorder = RUZEE.ShadedBorder.create({ corner: 8, shadow: 16 });
        myBorder.render('Header');
        myBorder.render('ContentContainer');
        $("#MainMenu").corner();
        setCustomFonts();
    });
    $(window).resize(function () {
        setHeights();
    });
});

function OnContentLoaded(context) {
    setCustomFonts();
    $('#ClientList').listnav({
        includeAll: true,
        showCounts: false
    });
    setFaqHandlers();
    setHeights();
}

function setFaqHandlers() {
/*
    $('.faq').find('dd').hide();
    $('.faq').find("dt").click(function () {
        $(this).next().toggle();
    });
    */
}

function setCustomFonts() {
    sIFR.replace(headingFont, {
        selector: 'h1',
        css: [
            '.sIFR-root { font-size:32px; font-weight:normal; text-align: center; color: #46592A; }'
            ],
        wmode: 'transparent'
    });
    sIFR.replace(headingFont, {
        selector: 'h2',
        css: [
            '.sIFR-root { font-size:18px; font-weight:normal; text-align: left; color: #46592A; }'
            ],
        wmode: 'transparent'
    });
    sIFR.replace(headingFont, {
        selector: 'h3',
        css: [
            '.sIFR-root { font-size:16px; font-weight:normal; text-align: left; color: #46592A; }'
            ],
        wmode: 'transparent'
    });
    sIFR.replace(headingFont, {
        selector: '#ContactList dt',
        css: [
            '.sIFR-root { font-size:16px; font-weight:normal; text-align: right; color: #46592A; }'
            ],
        wmode: 'transparent'
    });
}

function setHeights() {
    var windowHeight = $(window).height();
    var contentHeight = windowHeight - 260;
    if (contentHeight > 0) {
        $("#ContentContainer").css('min-height', contentHeight + 'px');
        var verbiageHeight = contentHeight - 60;
        if (verbiageHeight > 0) {
            $(".Verbiage").height(verbiageHeight + 'px');
        }
        var clientListHeight = contentHeight - 105;
        if (clientListHeight > 0) {
            $("#ClientList").height(clientListHeight + 'px');
        }
    }
}


