jQuery.fn.set_termPopupEvent = function( options ){
	var settings = { debug: false };
	if ( options ){ jQuery.extend(settings, options); }
	this.each(
		function()
		{
			var items   = $(this);
			var element = this;
			var tooltip = 0;

			$(this).hover(
				function(event)
				{
					tooltip = 1;
					setTimeout(function(){if(!tooltip){ return false; }_popupShow(element, event)}, 1000 );
					return false;
				},
				function()
				{
					tooltip = 0;
					$('#termExplanation').hide();
					return false;
				}
			);
			$(this).click(
				function()
				{
					return false;
				}
			);
		}
	);
};

function _popupShow($element, event)
{
	$.post("/faq/glossary/term.php",{ term:$($element).text(),popup:true },function(result){
		if(result.length > 0){
			$offSet = _getOffSet($element, true);
			var $a = $($element);
			$('#termExplanation').html('').html(result).css({
				position : 'absolute',
				top      : $offSet.top + $a.height() + 3 + 'px',
				left     : '20%'
			}).show()
		}
	});


}

jQuery(document).ready(function(){
	$('a.termPopup').set_termPopupEvent();
});
