// Tooltip Library
var DH=0;
var an=0;
var al=0;
var ai=0;

if(document.getElementById)
{
	ai=1;DH=1;
}
else
{
	if(document.all)
	{
		al=1;DH=1;
	}
	else
	{
		browserVersion=parseInt(navigator.appVersion);
		if((navigator.appName.indexOf('Netscape')!=-1)&&(browserVersion==4))
		{
			an=1;DH=1;
		}
	}
}

function fd(oi,ws)
{
	if(ws==1)
	{
		if(ai)
			return(document.getElementById(oi).style);
		else
		{
			if(al)
				return(document.all[oi].style);
			else
			{
				if(an)
					return(document.layers[oi]);
			}
		}
	}
	else
	{
		if(ai)
			return(document.getElementById(oi));
		else
		{
			if(al)
				return(document.all[oi]);
			else
			{
				if(an)
					return(document.layers[oi]);
			}
		}
	}
}

function getClientWidth()
{
	if(window.innerWidth!=null)return window.innerWidth;
	if(document.body.clientWidth!=null)return document.body.clientWidth;return(null);
}

function GetTopRelative(parent, child)
{
	var el = document.getElementById(child);
	var top = 0;
	while(el != null && el.id != parent)
	{ 
		top += el.offsetTop;
		el = el.offsetParent;
	}
	return top;
}

function GetLeftRelative(parent, child)
{
	var el = document.getElementById(child);
	var left = 0;
	while(el != null && el.id != parent)
	{ 
		left += el.offsetLeft;
		el = el.offsetParent;
	}
	return left;
}

function popUp(evt,oi)
{
	if(DH)
	{
		ds=fd(oi,1);
		st=ds.display;
		if(st=="block"||st=="inline")
		{
			ds.display="none";
			ds.visibility="hidden";
		}
		else
		{
			ds.display="block";

			if (document.getElementById("AppHelpTopic"))
			{
				ShowHelp();
				hy=GetTopRelative("quotepage", "AppHelpTopic");
				tv=GetTopRelative("quotepage", evt);
				if (tv < hy)
					tv = hy;
				lv=GetLeftRelative("quotepage", "AppHelpTopic");
			}
			if(!an)
			{
				lv+='px';
				tv+='px';
			}
			ds.left=lv;
			ds.top=tv;

			ds.visibility="visible";
		}
	}
}
