//
// Easing / Toggle Fade Hack
//
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
    return -c * ((t = t / d - 1) * t * t * t - 1) + b;
};

jQuery.fn.fadeToggle = function (speed, easing, callback) {
    return this.animate({
        opacity: 'toggle'
    }, speed, easing, callback);
};

$(document).ready(function () {

    //
    // Drop Down Menu
    //
    $("a.informationB").toggle(

    function () {
        $('ul#subNav').fadeIn('800');
    }, function () {
        $('ul#subNav').slideUp('fast');
    });


    //
    // Sub Navigation
    //
    $(function () {

        var tabContainers = $('div#pages > div');

        tabContainers.hide().filter(':first').hide();

        $('.close').hide();

        $('ul#subNav a').click(function () {

            tabContainers.hide();

            tabContainers.filter(this.hash).show();

            $('.close').fadeIn('400');

            $('ul#subNav a').removeClass('selected');

            $(this).addClass('selected');

			$('ul#subNav').fadeOut('800');

            return false;

        })

    });

    //
    // Close Button
    //

    $("a.close").click(function () {
        $('.page').fadeOut();
        $('.close').hide();
        $('ul#subNav').slideUp('fast');

    });

});
