/*
	CET Virtual Library™

	Centre for Educational Technology,
	Ramat-Aviv, Israel.
	http://lib.cet.ac.il/

	SMARTTOOLTIP.JS
*/

function on_lexicon_over(el, x, y)
{	
	clearTimeout(timerid);		
	if ( !show_state )	
		timerid = setTimeout ("show_smart_tooltip(" + el.sourceIndex + ", true, " + x + ", " + y + ")", 500);
}

function on_lexicon_out(el)
{
	clearTimeout(timerid);
	setTimeout ("show_smart_tooltip(-1, false, 0, 0)", 50);
}

var timerid = 0
var show_state = false
function show_smart_tooltip (index, is_show, x, y)
{
	var posX, posY
	var txt
	
	show_state = is_show
	var vis = (show_state == true) ? "visible" : "hidden";
	
	if ( index == -1 ) txt = ""
	else
	{
		var el = document.all(new Number(index))
		txt = el.name
	}
	
	
	smarttooltip.style.posTop = x + 19
	smarttooltipback.style.posTop = x + 19
	
	posY = ( y < 340 ) ? 0 : y - 328 ;
	
	smarttooltip.style.posLeft = posY
	smarttooltipback.style.posLeft = posY
	
	smarttooltip.style.visibility = vis
	smarttooltipback.style.visibility = vis
	
	smarttooltip_txt.innerHTML = txt
	smarttooltipback_txt.innerHTML = txt
}