
// ------------------------------------------------------------
// Basic autosize function
// gets called back on browser resize
//
function loadbody() {
	// get browser size
    if (document.body && document.body.offsetWidth) {
        width = document.body.offsetWidth;
        height = document.body.offsetHeight;
    }

    // hide unshowable stuff
    if ((width-600) < 300) {
    	$('.relread').hide();
        $('.coauthors').hide();
	} else {
        $('.relread').show();
	    $('.coauthors').show();
    }

    // related read is always placed on the right side,
    // with a small margin
    $('.relread').css('padding-right', (width-600)/2 - $('.relread').width() - 40);

    // same for co-authors
    $('.coauthors').css('padding-right', (width-600)/2 - $('.coauthors').width() - 40);

    // research menu, if existing, is placed on the left
    // side
    if ($('#researchmenu')) {
    	$('#researchmenu').css('width', (width-600)/2 - 40);
    	$('.researchlinkon').css('padding-left', (width-600)/2 - 175);
		$('.researchlinkoff').css('padding-left', (width-600)/2 - 175);
    }
};

$(window).resize(function() {
    loadbody();
});

