// ==UserScript==
// @name reallifecomics.com - Menu fix
// @author Robin Zalek (BtEO) 
// @namespace http://www.jellyslab.com/~bteo/ 
// @version 1.1
// @description  Prevents an advert from obscuring the menu on
//			www.reallifecomics.com.
// @ujs:category site: fixes
// @ujs:published 2005-10-09 11:12
// @ujs:modified 2005-10-09 12:12
// @ujs:documentation http://userjs.org/scripts/site/fixes/reallifecomics-menufix 
// @ujs:download http://userjs.org/scripts/download/site/fixes/reallifecomicscom_menu_fix.js 
// @include http://www.reallifecomics.com/*
// ==/UserScript==


/* 
 * This script is granted to the Public Domain
 * Malicious modifications not permitted without removing credits from
 * the script.
 */

// Create listener for first possible moment after DOM is created.
opera.addEventListener('BeforeEvent.load', userJSRealLifeComicsFix, false);
// This assumes the page has loaded fast enough for the advert to exist.
// Should that be a problem, comment the above line (and it's remove counterpart below.)
// And uncomment this line.
//document.addEventListener('load', userJSRealLifeComicsFix, false);

function userJSRealLifeComicsFix (e) {
	// Remove listener so it only runs once.
	opera.removeEventListener('BeforeEvent.load', userJSRealLifeComicsFix, false);

	// Locate banner advert.
	var advert = document.getElementById('banner');
	// Locate element to insert advert before.
	// For a different effect you can try and place it before the 'nav' element.
	var target = document.getElementById('shell');

	// Place the advert (assuming there is one) in it's new location.
	if (advert) void(target.parentNode.insertBefore(advert,target));
	
	// Shift left sidebar down to avoid overlap with left hand menu item.
	if (target=document.getElementById('leftbar')) target.style.marginTop = "60px";
	// Shift right sidebar for symmetry purposes.
	if (target=document.getElementById('rightbar')) target.style.marginTop = "60px";
}