﻿// Create function which moves slides on click
(function ($) {
    $.fn.moveSlide = function (options) {
        return this.each(function (i) {
            // cache the copy of $(this) - clicked slide
            var slide = $(this);
            if (slide.height() == 39 || slide.attr('id') == 'FlashSlide3') {
                slide.click(function () {
                    slide.stop().animate({
                        height: 201
                    }, 300);
                    // Reference other slides and minimize them
                    slide.siblings('div.FlashSlide').each(
                            function (intIndex) {
                                $(this).stop().animate({
                                    height: 39
                                }, 300); ;
                            });
                });
            }
        });
    };

})($);

$(document).ready(function () {
    $('div.FlashSlide').moveSlide();
});

$(document).ready(function () {

    //On Click Event
    $("#FlashTabsNavigation a").click(function () {

        if ($(this).hasClass('Prev') || $(this).hasClass('Next')) {
            if ($(this).hasClass('Prev')) {
                // Process prev
                var previous = $("#FlashTabsNavigation a.Active").prev("a");

                if (!previous.hasClass('Prev')) previous.click();
            }
            else if ($(this).hasClass('Next')) {
                // Process next
                var next = $("#FlashTabsNavigation a.Active").next();

                if (!next.hasClass('Next')) next.click();
            }
        }
        else {
            $("#FlashTabsNavigation a").removeClass("Active"); //Remove any "active" class
            $(this).addClass("Active"); //Add "active" class to selected tab

            $("#FlashTabsContent div.FTC").css('display', 'none'); //Hide all tab content
            var activeTabID = $(this).attr("href");

            var activeTab = $(activeTabID); //Find the href attribute value to identify the active tab + content
            $(activeTab).css('display', 'block'); //Fade in the active ID content

        }
        return false;
    });

});
