
$.fn.x = function(n) {
     var result = null;
     this.each(function() {
         var o = this;
         if (n === undefined) {
             var x = 0;
             if (o.offsetParent) {
                 while (o.offsetParent) {
                     x += o.offsetLeft;
                     o = o.offsetParent;
                 }
             }
             if (result === null) {
                 result = x;
             } else {
                 result = Math.min(result, x);
             }
         } else {
             o.style.left = n + 'px';
         }
     });
     return result;
};

$.fn.y = function(n) {
     var result = null;
     this.each(function() {
         var o = this;
         if (n === undefined) {
             var y = 0;
             if (o.offsetParent) {
                 while (o.offsetParent) {
                     y += o.offsetTop;
                     o = o.offsetParent;
                 }
             }
             if (result === null) {
                 result = y;
             } else {
                 result = Math.min(result, y);
             }
         } else {
             o.style.top = n + 'px';
         }
     });
     return result;
};

$(document).ready(function(){
	$(".flyout_panel").hide();
	
	$(".flyout_panel").bind("mouseleave", function() {
		hideNavigation();
	});
	
	$('#nav_module a img').mouseout(function() {
		$('.flyout_panel').hide();
	});
});

function hideNavigation()
{
	$(".flyout_panel").hide();
}

function showNavigation(navpane_id, parent)
{
	hideNavigation();
	pane = "#flyout" + navpane_id;
	posY = ($(parent).y());
	posX = ($(parent).x());
	// $(pane).corner("round 10px");
	$(pane).show();
	$(pane).css("z-index", "10000");
	$(pane).css("top", posY+"px");
	$(pane).css("left", (posX+210)+"px");
}

