// ToolTip V1.12
if (typeof fgcolor == 'undefined')	var fgcolor = "#ccccff";
if (typeof bgcolor == 'undefined')	var bgcolor = "#333399";
if (typeof closecolor == 'undefined')
	var closecolor = "#9999ff";if (typeof capstyle == 'undefined')
	var capstyle = "font-family : Arial;font-size : 12pt;color : #ffffff;";if (typeof textstyle == 'undefined')	var textstyle = "font-family : Verdana;font-size : 8pt;color : #000000;";if (typeof closestyle == 'undefined')	var closestyle = "font-family : Arial;font-size : 12pt;color : #ffffff;text-decoration: none";
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

if (ie4){
	if (navigator.userAgent.indexOf('MSIE 5') > 0)		ie5 = true;
	else
		ie5 = false;
}else
	ie5 = false;

var x = 0, y = 0, sw = 0, cnt = 0, docwidth, tooltipwidth;

if (ns4 || ie4){
	if (ns4)		over = document.overDiv;	else if (ie4)
		over = overDiv.style;	document.onmousemove = mouseMove
	if (ns4)		document.captureEvents(Event.MOUSEMOVE)
}

function tooltipcap(caption, text, sticky, w)
{
	tooltipwidth = w;
	if (sticky)	{
		sw = 1;
		cnt = 0;
		layerWrite("<table width=" + w + " border=0 cellpadding=1 cellspacing=0 bgcolor=\"" + bgcolor + "\"><tr><td><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td style=\"" + capstyle + "\">" + caption + "</td><td align=right><a href=\"/\" onMouseOver=\"hideObject(over);\" style=\"" + closestyle + "\">Close</a>&nbsp;</td></tr></table><table width=100% border=0 cellpadding=2 cellspacing=0 bgcolor=\"" + fgcolor + "\"><tr><td style=\"" + textstyle + "\">" + text + "</td></tr></table></td></tr></table>");
	}	else
		layerWrite("<table width=" + w + " border=0 cellpadding=1 cellspacing=0 bgcolor=\"" + bgcolor + "\"><tr><td><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td style=\"" + capstyle + "\">" + caption + "</td></tr></table><table width=100% border=0 cellpadding=2 cellspacing=0 bgcolor=\"" + fgcolor + "\"><tr><td style=\"" + textstyle + "\">" + text + "</td></tr></table></td></tr></table>");
}
function tooltip(text, w){	tooltipwidth = w;	layerWrite("<table width=" + w + " border=0 cellpadding=1 cellspacing=0 bgcolor=\"" + bgcolor + "\"><tr><td><table width=100% border=0 cellpadding=2 cellspacing=0 bgcolor=\"" + fgcolor + "\"><tr><td style=\"" + textstyle + "\">" + text + "</td></tr></table></td></tr></table>");
}

function nd(){
	if (cnt >= 1)		sw = 0;
	if (ns4 || ie4)	{
		if (sw == 0)			hideObject(over);
		else
			cnt++;
	}
}

function layerWrite(txt){
	if (ns4)	{
		var lyr = document.overDiv.document;
		lyr.write(txt);
		lyr.close();		docwidth = window.innerWidth;		docHeight = window.innerHeight;
		tooltipHeight = lyr.height;	}
	else if (ie4)
	{		document.all["overDiv"].innerHTML = txt;		docwidth = document.body.clientWidth;		docHeight = document.body.clientHeight;
		tooltipHeight = document.all["overDiv"].clientHeight;	}
	if (ns4 || ie4)	{		if (x + tooltipwidth < docwidth)
			px = x;		else if (x - tooltipwidth > 0)
			px = x - tooltipwidth;
		else
			px = 0

		if (y + tooltipHeight < docHeight)
			py = y
		else if (y - tooltipHeight < docHeight)
			py = y - tooltipHeight;
		else
			py = 0

		moveTo(over, px, py);
		showObject(over);
	}
}

function showObject(obj){
	if (ns4)		obj.visibility = "show";
	else if	(ie4)		obj.visibility = "visible";
}

function hideObject(obj){
	if (ns4)		obj.visibility = "hide";
	else if	(ie4)
		obj.visibility = "hidden";	sw = 0;
}

function moveTo(obj, x, y){
	obj.left = x;
	obj.top = y;
}

function mouseMove(e){
	if (ns4)
	{		x = e.pageX;		y = e.pageY;	}
	else if (ie5)
	{		x = event.x + document.body.scrollLeft;		y = event.y + document.body.scrollTop;	}
	else if (ie4)	{
		x = event.x;
		y = event.y;
	}}
