﻿    // Set the initial height

    var sliderHeight = "55px";


    jQuery(document).ready(function () {
        // Show the slider content
        jQuery('.slider').show();

        jQuery('.slider').each(function () {
            var current = jQuery(this);
            current.attr("box_h", current.height());
        });

        jQuery(".slider").css("height", sliderHeight);
    });

    // Set the initial slider state
    var slider_state = "close";

    function sliderAction() {
        if (slider_state == "close") {
            sliderOpen();
            slider_state = "open"
            jQuery(".slider_menu").html('<a href="#" onclick="return sliderAction();">Hide 3-Day Forecast</a>');
        }
        else if (slider_state == "open") {
            sliderClose();
            slider_state = "close";
            jQuery(".slider_menu").html('<a href="#" onclick="return sliderAction();">Show 3-Day Forecast...</a>');
        }

        return false;
    }

    function sliderOpen() {
        var open_height = jQuery(".slider").attr("box_h") + "px";
        jQuery(".slider").animate({ "height": open_height }, { duration: "fast" });
    }

    function sliderClose() {

        jQuery(".slider").animate({ "height": sliderHeight }, { duration: "slow" });

    }
