var comparisonXslDoc = loadXsl("/la/comparison.xsl");
var currentTd;
function ComparisonOnLoad()
{
	$('.compareTooltip').hover( function() {
  	$('.compareTooltipWrapper').hide().remove();
	var result = XSLTransformToString( comparisonXmlDoc, comparisonXslDoc, { feature_title: this.innerHTML } );
	//alert( $(this.parentNode).html()+" - "+$(this).parent().html()+" - "+this.parentNode.nodeName );
    $(this).parent().append( result );
	var offset = $(this).offset();
    $(this).parent().find('.compareTooltipWrapper').css({top:offset.top+15});
	FixPNGs( document.getElementsByName("pngimage") );
    $('.compareTooltipWrapper').show();
	currentTd = null;
	$('.compareTooltipImgBorde').height( $('.compareTooltipContent').height() );
	  $('.compareTooltipWrapper').hover(
		  function() { currentTd = null; },
		  function() { 
			currentTd = $(this).parent(); 
			setTimeout( "currentTd.find('.compareTooltipWrapper').hide().remove();", 5000 );
		  }
	  );
  },
    function() {
		currentTd = $(this).parent();
		setTimeout( "currentTd.find('.compareTooltipWrapper').hide().remove();", 5000 );
    }
  );
  $('.Compare').hover(
    function() { return; },
	function() {
		$('.compareTooltipWrapper').hide().remove();
	}
  );
}