﻿/* JQuery Toggle */
$(document).ready(function () {
    $(".Toggle_Content").hide();

    $("a.toggle").click(function () {
        $(this).parent('.toggle_description_alt').siblings('.Toggle_Content').slideToggle("slow", showclose);
        return false;
    });

    $("a.close_toggle").click(function () {
        $(this).siblings('.Toggle_Content').slideUp("slow");
        $(this).css("display", "none");
        $(this).siblings('.toggle_description_alt').children('a.toggle').html('Read More');
        return false;
    });


    // Used to scroll down to, and then show, the appropriate section on the page
    $('a[href*="#"].learn_more').live('click', function (event) {
        event.preventDefault();
        var link = this;
        $.smoothScroll({
            scrollTarget: link.hash
        });

        $(link.hash).children(".Toggle_Content").slideDown(1000);
    });
});

function showclose() {
    if ($(this).css("display") == "block") {
        $(this).siblings('a.close_toggle').css("display", "block");
        $(this).siblings('.toggle_description_alt').children('a.toggle').html('<img src="img/buttons/close.png">');
    } else {
        $(this).siblings('a.close_toggle').css("display", "none");
        $(this).siblings('.toggle_description_alt').children('a.toggle').html('Read More');
    }
}
