﻿function CufonReplace() {
    Cufon.replace("h2");
    Cufon.replace(".Expandable-Item h3");
}

CufonReplace();

var defaultFontSize = 0.625;

var fontSize = $.cookie("fontSize");

if (fontSize != null)
    document.body.style.fontSize = fontSize + "em";

function setTextSize(change) {
    if (fontSize == null)
        fontSize = 0.625;

    if (change == 0)
        fontSize = 0.625;
    else
        fontSize += change * 0.0625;

    document.body.style.fontSize = fontSize + "em";

    CufonReplace();

    if(fontSize == defaultFontSize)
        $.cookie("fontSize", null);
    else
        $.cookie("fontSize", fontSize);
}

$(function () {

    var hoverConfig = {
        over: function () {
            $(this).children(".Sub-Menu").fadeIn();
        }, // function = onMouseOver callback (REQUIRED)    
        timeout: 500, // number = milliseconds delay before onMouseOut    
        out: function () {
            $(this).children(".Sub-Menu").fadeOut();
        } // function = onMouseOut callback (REQUIRED)    
    };

    $(".Rotating-Banner a[href=/FlashPlayer.aspx]").fancybox({
        'width': 660,
        'height': 430,
        'padding': 0,
        'margin': 0,
        'overlayOpacity' : 0.8,
        'autoScale': false,
        'transitionIn': 'fade',
        'transitionOut': 'none',
        'type': 'iframe'
    });

    $(".Sub-Menu").parent().hoverIntent(hoverConfig);
});
