$(document).ready(function()
{

	$(".collapsed_leed_entry").each(function()
    {
		$(this).children(":not(.leed_entry:first)").wrapAll("<div class='collapse_me'></div>");
		$(this).children(".leed_entry:first").append("<span class='collapse_leed_entry'>[ MORE ]</span>");
		$(this).children(".collapse_me").hide();
	});

	$("span.collapse_leed_entry").click(function(event) 
    {
	    event.preventDefault();
        $("span.collapse_leed_entry").not(this).each(function()
        {
		    if ($(this).text() == '[ CLOSE ]')
            {
	            $(this).parent().next("div.collapse_me").slideToggle("normal");
                $(this).fadeOut("fast", function()
                {
                    $(this).fadeIn().text('[ MORE ]');
                    $(this).removeClass('hover');
                    $(this).prev("a > .title").removeClass('hover');
                    $(this).prev("a").removeClass('hover');
                    $(this).prev("a").addClass('none');
                });
            }
        });

	    $(this).parent().next("div.collapse_me").slideToggle("normal");
        $(this).fadeOut("fast", function()
        {
		    if($(this).text() == '[ CLOSE ]')
            {
                $(this).fadeIn().text('[ MORE ]');
                $(this).removeClass('hover');
                $(this).prev("a > .title").removeClass('hover');
                $(this).prev("a").removeClass('hover');
                $(this).prev("a").addClass('none');
            }
		    else 
            {
                $(this).fadeIn().text('[ CLOSE ]');
                $(this).addClass('hover');
                $(this).prev("a > .title").removeClass('hover');
                $(this).prev("a").removeClass('none');
                $(this).prev("a").addClass('hover');
            }
        });
	});
});
