// JavaScript Document

function menubarlink(page)
{
	if (page != menu_bar_page_name)
	{
		window.location = page;
	}
}

function copyrightfix()
{
	$('#apDiv3').css('top', $('#apDiv2').bounds().bottom+30);
}

//
// jquery stuff
//

(function() {
   jQuery.fn['bounds'] = function () {
     var bounds = {  left: Number.POSITIVE_INFINITY, 
                      top: Number.POSITIVE_INFINITY,
                    right: Number.NEGATIVE_INFINITY, 
                   bottom: Number.NEGATIVE_INFINITY};

     this.each(function (i,el) {
                 var elQ = $(el);
                 var off = elQ.offset();
                 off.right = off.left + $(elQ).width();
                 off.bottom = off.top + $(elQ).height();

                 if (off.left < bounds.left)
                   bounds.left = off.left;

                 if (off.top < bounds.top)
                   bounds.top = off.top;

                 if (off.right > bounds.right)
                   bounds.right = off.right;

                 if (off.bottom > bounds.bottom)
                   bounds.bottom = off.bottom;

               });
     return bounds;
   }
 })();

