﻿function tooltip()
{
	var sDiv = document.createElement('div');
		sDiv.id ='toolTipHover'
		sDiv.style.position = 'absolute';
		sDiv.style.top = '0px';
		sDiv.style.left = '0px';
		//sDiv.style.border = '1px solid #f00';
		
	var xMousePos;
	var yMousePos;
	var xMousePosMax;
	var yMousePosMax;
	
	var xOffset = 0;
	var height = 100;
	
	document.body.appendChild(sDiv);
	

	if (document.layers)
	{
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = captureMousePosition;
	} 
	else if (document.all || document.getElementById)
	{
		document.onmousemove = captureMousePosition;
	}
	
	function captureMousePosition(e)
	{
		
		if (!e) var e = window.event;
		if (navigator.appName !="Microsoft Internet Explorer")
		{
			xMousePos 		= e.pageX;
			yMousePos 		= e.pageY;
			xMousePosMax 	= window.innerWidth + window.pageXOffset;
			yMousePosMax 	= window.innerHeight + window.pageYOffset;
		}
		else
		{
			xMousePos 		= window.event.x + document.body.scrollLeft;
			yMousePos 		= window.event.y + document.body.scrollTop;
			xMousePosMax 	= document.body.clientWidth + document.body.scrollLeft;
			yMousePosMax 	= document.body.clientHeight + document.body.scrollTop;   
		}
		
		if(sDiv.style.visibility == 'visible')
		{
			sDiv.style.top 	= (yMousePos - (height + 10) ) + 'px';
			sDiv.style.left = (xMousePos + xOffset) + 'px';
		}
	}
	
	function show(flashSource,w,h,xo)
	{
		height = h;
		width = w;
		xOffset = xo;
		
		var so = new SWFObject(flashSource, "toolTip", width, height, "9", "#000000");
		so.useExpressInstall('flashSource');
		so.addParam("wmode", "transparent");
		so.write("toolTipHover");
		
		sDiv.style.width = width + 'px';
		sDiv.style.height = height + 'px';
		
		sDiv.style.visibility = 'visible';

	}
	
	function hide()
	{
		sDiv.style.visibility = 'hidden';
	}
	
    function getMe()
    {
        alert('hey');
    }
	
	hide();
	
	this.show = show;
	this.hide = hide;
}

