
function fix_layout()
{
	hh = $('#header').innerHeight();
	th = $('#topmenu').innerHeight();
	cp = parseInt($('#content').css('paddingTop')) + parseInt($('#content').css('paddingBottom'));
	p = hh + th + cp;
	vh = Math.max($(window).innerHeight(), ($('#content').innerHeight() + p));
	
	$('#content').height(vh - p);
	
	// Fix the page shadowing bug here
	$('#page-ds-left').height($('#page').height());
	$('#page-ds-right').height($('#page').height());
}

$(function() {
	// look for dialog boxes and set delayed timeout
	$('.dialog').each(function(i) {
		$(this).animate({opacity: 1.0}, 3000).fadeOut('slow', function() {
			$(this).remove();
		});
	});
	
	// fix the layout (not yet working right, see trac #4)
	// fix_layout();
	
	// tooltips for tags
	$('a.tag').each(function(i) {
		$(this).Tooltip({
			track: true,
			delay: 1,
			showURL: false
		});
	});

    // Look for system messages and fade them in.
    if($(".message").length > 0) {
        $(".message").each(function(i) {
            //$(this).css("display", "block");
            $(this).fadeIn("slow", function() {});
        });
    }
});
