This uses jquery:
Code:
$(document).ready( resetPosition );
$(window).resize( resetPosition );
$ is a funny-named javascript object created by jquery. It's a function (which is why it can be called: "$(parameter goes here)" and returns another jquery/javascript object, which can be chained to do stuff.
$(document) will return jquery object representing (root element of) the entire document.
The "ready" method (actually function, but it's called in an object-oriented manner) is used to delay execution until the entire thing is loaded (to ensure that all DOM objects are already initialized), so the first line there sets up resetPosition (which is a javascript function declared/defined elsewhere) to run when the page is done loading (from memory, I think that includes loading and rendering all top-level javascript, css, images, ...).
The "resize" method is used to setup callback for when DOM's resize event fires on something (in this case, on the entire window).
(you could also use strings with css locators - $('div.content#b') will match any div elements with class "content" and id "b", etc)
Also, jquery has certain advantage in the area of having been developed by many people to work on various browsers with the same syntax ...
ETA: and here's resetPosition, which uses jquery, itself:
Code:
function resetPosition() {
var topbar = $('#mafiabuttons').height();
$('#content_').css( 'top', topbar + 'px' );
}
That sets the "top" css attribute of element with id "content_" to height of the "mafiabuttons" element. Which is what we need (absolutely positioned elements don't count when allocating space for normal elements, so one has to put in enough margin/padding by hand).