//call in any case
$(document).ready(function () {
    $('#header_panel').css("display", $.cookie('manifesto'));
  
    //manifesto
    $('#manifesto').click(function () {
        $('#header_panel').toggle("slow", function () {

            $.cookie('manifesto', $('#header_panel').css("display"), { expires: 7, path: '/' });

        });
    });

    //make all articles clickable
    $("article").hover(
		function () {
		    $(this).css('backgroundColor', '#F1F1F1');
		},
		function () {
		    $(this).css('backgroundColor', '#FFF');
		}
	);
    $(".articleContent").click(function () {
        window.location = $(this).find("a").attr("href");
        return false;
    });


    fixHeights();

});

function fixHeights() {
    $('#allArticles li').each(function () {
        tallest = 140;
        $(this).children('article').each(function () {
            thisHeight = jQuery(this).height();
            if (thisHeight > tallest) {
                tallest = thisHeight;
            }
        });
        $(this).children('article').height(tallest);
        $(this).children('article').each(function () {
            $(this).children('.articleContent').height(tallest - ($(this).children('.tools').height() + $(this).children('footer').height() + 44)); //44 - padding
        });

      

    });
  

}

