
/***********************************************
 * Link Floatie script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
 * This notice MUST stay intact for legal use
 * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
 ***********************************************/

var floatiewidth="200px"; //default width of floatie in px
var floatieheight="30px"; //default height of floatie in px. Set to "" to let floatie content dictate height.
var floatiebgcolor="lightyellow"; //default bgcolor of floatie

function ietruebody()
{
	return(document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}


function paramexists(what)
{
	return(typeof what!="undefined" && what!="");
}


function GetMouseX(evt)
{
	if(evt.pageX)
		return evt.pageX;
	else if(evt.clientX)
	   return evt.clientX + (document.documentElement.scrollLeft ?
	   document.documentElement.scrollLeft :
	   document.body.scrollLeft);
	else
		return null;
}

function GetMouseY(evt)
{
	if(evt.pageY)
		return evt.pageY;
	else if(evt.clientY)
	   return evt.clientY + (document.documentElement.scrollTop ?
	   document.documentElement.scrollTop :
	   document.body.scrollTop);
	else
		return null;
}


function ShowFPCFloatie(textToDisplay, e, optbgColor, optWidth, optHeight)
{
	var floatobj = document.getElementById("LinkTipDiv");

	floatobj.style.display = "block";
	floatobj.style.backgroundColor = paramexists(optbgColor)? optbgColor : floatiebgcolor;
	floatobj.style.width  = paramexists(optWidth)? optWidth+"px" : floatiewidth;
	floatobj.style.height = paramexists(optHeight)? optHeight+"px" : floatieheight!=""? floatieheight : "";

	floatobj.innerHTML = textToDisplay;
	
	UpdateFPCFloatie(e);
}

function UpdateFPCFloatie(e)
{
	var floatobj = document.getElementById("LinkTipDiv");

	e = window.event? window.event : e;

	var IE = document.all ? true : false;
	if(!IE)
		document.captureEvents(Event.MOUSEMOVE);

	var mouseX = GetMouseX(e);
	var mouseY = GetMouseY(e);

	// catch possible negative values in NS4
	if(mouseX < 0)
		mouseX = 0;
	if(mouseY < 0)
		mouseY = 0;

	var offsetX = 15;
	var offsetY = 5;
	
	var pixelPosX = mouseX + offsetX;
	var pixelPosY = mouseY + offsetY;
	floatobj.style.left = pixelPosX + "px";
	floatobj.style.top = pixelPosY + "px";


	browserdetect = floatobj.filters? "ie" : typeof floatobj.style.MozOpacity=="string"? "mozilla" : "";

	if(browserdetect == "mozilla")
		floatobj.style.MozOpacity = 1;
	else if(browserdetect == "ie")
		floatobj.filters.alpha.opacity = 100;

}


function HideFPCFloatie()
{
	var floatobj = document.getElementById("LinkTipDiv");
	floatobj.style.display = "none";
}


