
jQuery('document').ready(function($) {
	var overlay = jQuery('<div>').css({
		position: 'absolute',
		top: $('#main').position().top, // Use document scrollTop so it's on-screen even if the window is scrolled
		left: 0,
		height: $(document).height(), // Span the full document height...
		width: '100%', // ...and full width

		opacity: 0.5, // Make it slightly transparent
		backgroundColor: 'white',
		zIndex: 5000  // Make sure the zIndex is below 6000 to keep it below tooltips!
	}).appendTo($('body')).hide().bind('click', function() {
		$(this).hide();
	});


	$('a.menu-minipanel').bind('mouseover', function() {
		if (!$('.qtip').is(':visible')) {
			overlay.fadeIn();
		}
	});
	$('.qtip, a.menu-minipanel').live('mouseout', function(e) {
		if (!$(e.relatedTarget).is('a.menu-minipanel') && !$(e.relatedTarget).is('div.qtip'))
			overlay.fadeOut();
	});
});
;

