$(document).ready(function() {
    $("#mm_feed_dropdown").change(function() {
        var sOption = $(this).val();
        $("#mm_search_keyword").val('');
        cooliris.embed.setFeedURL(aMrssSource[sOption]);
    });

    $("#mm_search_form").submit(function() {
        if ($("#mm_search_keyword").val() != "") {
            var sOption  = $("#mm_feed_dropdown").val();
            var sFeedUrl = aMrssSource[sOption] + sprintf(aMrssSearch[sOption], $("#mm_search_keyword").val());
            $("#mm_search_reset").removeAttr("disabled");
            cooliris.embed.setFeedURL(sFeedUrl);
        }
        return false;
    });

    $("#mm_search_reset").click(function() {
        if ($("#mm_search_keyword").val() != "") {
            $("#mm_search_keyword").val('');
            var sOption = $("#mm_feed_dropdown").val();
            $(this).attr("disabled", "disabled");
            cooliris.embed.setFeedURL(aMrssSource[sOption]);
        }
        return false;
    });

});

