// Flyout: requires  /javascript/jquery/plugins/jQuery.align.js

  var showDetailsTimeout, jqIt;

  jQuery(document).ready(
	function(){	
			jqIt = jQuery('#itemDetail');
			jqIt.css('left','-1000px').css('top','-1000px').hide(); 			 
		}
  );

  function reallyShowDetails(id) {
		jqIt.align('#itemSummary' + id, {x:0,y:0}, 'mc', 'mc') .show();
  }

  function showDetails(id) {
    if (typeof(showDetailsTimeout) != 'undefined') {
      clearTimeout(showDetailsTimeout);
    }
    showDetailsTimeout = setTimeout('reallyShowDetails("' + id + '")', 5);
  }

  function cancelDetails() {
    if (typeof(showDetailsTimeout) != 'undefined') {
      clearTimeout(showDetailsTimeout);
    }
  }

  function hideDetails(event) {

    var jqItOffset = jqIt.offset();
	event = jQuery.event.fix(event);
	var ep = {x:event.pageX, y:event.pageY};
    var dp = {x:jqItOffset.left,y:jqItOffset.top};
    var dd = {w: jqIt.width(),h:jqIt.height()};
    if (ep.x >= dp.x &&
        ep.x <= dp.x + dd.w &&
        ep.y >= dp.y &&
        ep.y <= dp.y + dd.h) 
	{
      return;
    }
    jqIt.hide();
  }


