var last_tip_id = "";
var can_hide_tip = true;
var cursor_on_tip = "";

function showtip_control (v, this_handler) 
{	
	if (document.all[v]) 
	{
		document.all[v].style.zIndex = 100;

		var sw = document.body.clientWidth;
		var sh = document.body.clientHeight;
		var dw = document.all[v].clientWidth;
		var dh = document.all[v].clientHeight;
		
		var pos = getElementPosition(this_handler);
		cx = pos.left + pos.width;
		cy = pos.top - document.body.scrollTop;
		
		if (sw < cx+dw+10) cx=sw-dw-10;
		if (sh < cy+dh+10) cy=sh-dh-10;
		
		document.all[v].style.top=cy+document.body.scrollTop+5;
		document.all[v].style.left=cx+document.body.scrollLeft+5;

		document.all[v].style.visibility = 'visible';
	}
}

function showtip (v, sec_param, this_handler, mode) 
{		
	if (document.all[v]) 
	{
		document.all[v].style.zIndex = 100;
		
		var sw = document.body.clientWidth;
		var sh = document.body.clientHeight;
		var dw = document.all[v].clientWidth;
		var dh = document.all[v].clientHeight;
		
		if (isNetscape4 || isMozilla) {
			var cx = mousex;
			var cy = mousey - document.body.scrollTop;
		}
		else {
			var cx = self.event.clientX;
			var cy = self.event.clientY;
		}
		
		if (sw < cx+dw+10) cx=sw-dw-10;
		if (sh < cy+dh+10) cy=sh-dh-10;
				
		//if ( mode == 'search' )
		//document.all[v].style.top=cy+document.body.scrollTop + 5;
		//else
		document.all[v].style.top=cy+document.body.scrollTop + 5;
		
		document.all[v].style.left=cx+document.body.scrollLeft + 5;
		document.all[v].style.visibility='visible';
	}

	if (sec_param)	{
		this_handler.href = sec_param;
	}
}

function showtip_firm (v, sec_param, this_handler, mode, delay) 
{		
	cursor_on_tip = v;
	if ( last_tip_id != "" )
	{
		if (document.all[last_tip_id]) 
		{
			document.all[last_tip_id].style.visibility='hidden';
		}
	}
	
	if (document.all[v]) 
	{
		document.all[v].style.zIndex = 100;
		
		var sw = document.body.clientWidth;
		var sh = document.body.clientHeight;
		var dw = document.all[v].clientWidth;
		var dh = document.all[v].clientHeight;
		
		if (isNetscape4 || isMozilla) {
			var cx = mousex;
			var cy = mousey - document.body.scrollTop;
		}
		else {
			var cx = self.event.clientX;
			var cy = self.event.clientY;
		}
		
		if (sw < cx+dw+10) cx=sw-dw-10;
		if (sh < cy+dh+10) cy=sh-dh-10;
		
		if ( mode == 'search' )
			document.all[v].style.top=cy+document.body.scrollTop - 75;
		else
			document.all[v].style.top=cy+document.body.scrollTop + 5;
		
		document.all[v].style.left=cx+document.body.scrollLeft + 5;
		setTimeout('showtip_firm_internal2("'+v+'")', delay);
	}

	if (sec_param)
	this_handler.href = sec_param;
	
	last_tip_id = v;
}

function showtip_firm_internal2(v) 
{
	if ( cursor_on_tip == v )
	document.all[v].style.visibility='visible';
}

function hidetip (v) 
{	
	if (document.all[v]) {
		document.all[v].style.visibility='hidden';
	}
}

function hidetip_firm (v) 
{	
	cursor_on_tip = "";
	setTimeout('hidetip_new("'+v+'")', 250);
	//hidetip_new(v);
}

function hidetip_new (v) 
{
	if (document.all[v]) {
		if ( can_hide_tip == true )
		document.all[v].style.visibility='hidden';
	}
}

function hide_deny() {
	can_hide_tip = false;
}

function hide_allow( tid ) {
	can_hide_tip = true;
	setTimeout('hidetip_new("'+tid+'")', 500);
}

function tip_move()
{
	
}