// Set the initial height
var sliderHeight = "80px";

$(document).ready(function() {
    // Show the slider content
    $('.slider').show();

    $('.slider').each(function() {
        var current = $(this);
        current.attr("box_h", current.height());
    });

    $(".slider").css("height", sliderHeight);
});

function sliderAction(id) {
    if ($("#" + id + ".slider_menu a").html() == "More...") {
        sliderOpen(id);
        $("#" + id + ".slider_menu a").html("Close");
    }
    else if ($("#" + id + ".slider_menu a").html() == "Close") {
        sliderClose(id);
        $("#" + id + ".slider_menu a").html("More...");
    }

    return false;
}

function sliderOpen(id) {
    var open_height = $("#" + id + ".slider").attr("box_h") + "px";
    $("#" + id + ".slider").animate({ "height": open_height }, { duration: "slow" });
}

function sliderClose(id) {
    $("#" + id + ".slider").animate({ "height": sliderHeight }, { duration: "slow" });
}
