﻿$(".Slide-Toggle-Item").each(function () {
    var entry = $(this);
    entry.data("height", entry.height());
    entry.css({ height: "0px" });
});

$(".Slide-Toggle").click(function () {
    var slide = $(this);
    var entry = slide.next(".Slide-Toggle-Item");

    if (entry.data("show") == undefined)
        entry.data("show", false);

    if (entry.data("show")) {
        entry.animate({ height: "0px" }, "slow");
        $(this).removeClass("Expanded");
        entry.data("show", false);
    }
    else {
        entry.animate({ height: entry.data("height") }, "slow");
        entry.data("show", true);
        $(this).addClass("Expanded");
    };
});
