﻿var titleText = "";
jQuery.noConflict();

function hideToolTip(){
	jQuery('#toolPopup').hide();
	jQuery('#toolPopup').empty();
	jQuery('#toolPopup').css({
		position: 	'absolute',
		top: 		0,
		left: 		0		
	});
}

function showToolTip(left, top){
	var posx = left;
	var posy = top;
	var bodyWidth = jQuery('body').outerWidth();
	var wrapperWidth = jQuery('#wrapper').outerWidth();	
	posx = posx - ((bodyWidth - wrapperWidth ) /2 ) ;
	
	jQuery('#toolPopup').css({
			position: 	'absolute',
			'z-index':    '3000',
			top: 		(posy - 24),
			left: 		(posx +24)		
		});
	jQuery('#toolPopup').show();

}
jQuery(document).ready(function () { 
	jQuery('.titleover').mouseover(function(e) {
			
		titleText = jQuery(this).attr('title');
		jQuery(this).removeAttr('title');
		var popUpContent = '<div class="softpopuptext">' + titleText + '</div>';
		
		jQuery('#toolPopup').html(popUpContent);
		jQuery('#toolPopup').addClass("glossaryPopup");
		
		var item = jQuery(this);
		var offset = item.offset();
		
		showToolTip(offset.left, offset.top)
		
	}).mouseout(function(){
		jQuery(this).attr('title', titleText );
		hideToolTip();	
		
	});
});



/*
function showToolTip(e){
	var posx = 0;
	var posy = 0;
	posx = e.pageX;
	posy = e.pageY;
	posXInnerContent = e.clientX;
	var bodyWidth = jQuery('body').outerWidth();
	var wrapperWidth = jQuery('#wrapper').outerWidth();
		
	posx = posx - ((bodyWidth - wrapperWidth ) /2 ) ;
	
	jQuery('#toolPopup').css({
			position: 	'absolute',
			'z-index':    '3000',
			top: 		(posy - 30),
			left: 		(posx +0)		
		});
	jQuery('#toolPopup').show();

}
*/
/*
jQuery(document).ready(function () { 
	jQuery('.titleover').mouseover(function(e) {
			
		var titleText = jQuery(this).attr('title');
		var popUpContent = '<div class="softpopuptext">' + titleText + '</div>';
		
		jQuery('#toolPopup').html(popUpContent);
		jQuery('#toolPopup').addClass("glossaryPopup");
		
		
		showToolTip(e)
		
	}).mouseout(function(){
		hideToolTip();	
	});
});

*/
