function showToolTip(IDName, evt, inPosX)
{
	if (isDHTML) //browser supports DHTML 
	{
		var tipDOM = getDOM(IDName + 'Tip', 0);
		var tipDOMStyle = getDOM(IDName + 'Tip', 1);
		var posX = getXCoord(evt);
		var posY = getYCoord(evt);
		var scrollX = getXScroll();
		var scrollY = getYScroll();
		var windowWidth;
		var windowHeight;
		var tooltipWidth;
		var tooltipHeight;

		//get tooltip width
		if (tipDOM.offsetWidth != null)
			tooltipWidth = tipDOM.offsetWidth;
		else if (tipDOM.clip.width != null)
			tooltipWidth = tipDOM.clip.width;

		//get tooltip height
		if (tipDOM.offsetHeight != null)
			tooltipHeight = tipDOM.offsetHeight;
		else if (tipDOM.clip.Height != null)
			tooltipHeight = tipDOM.clip.Height;

		//getWindowWidth
		if (window.innerWidth != null)
			windowWidth = window.innerWidth;
		else if (document.body.clientWidth != null)
			windowWidth = document.body.clientWidth;
		windowWidth -= 20;
		
		//getWindowHeight
		if (window.innerHeight != null)
			windowHeight = window.innerHeight;
		else if (document.body.clientHeight != null)
			windowHeight = document.body.clientHeight;

		if (((windowWidth < posX + tooltipWidth + 10) && isAll ) || ((windowWidth < posX - scrollX + tooltipWidth + 10) && !isAll ))
			posX = posX - tooltipWidth - 20;
		else
			posX = posX + 20;

		if (((windowHeight < posY + tooltipHeight + 20) && isAll ) || ((windowHeight < posY - scrollY + tooltipHeight + 20) && !isAll ))
			posY = posY - tooltipHeight - 20;
		else
			posY = posY + 20;
			
			
		if (inPosX > 0)
			posX = inPosX;
			
		if (tipDOMStyle.left != null)
		{
			tipDOMStyle.left = posX;
			tipDOMStyle.top = posY;
		}
		
		if (tipDOMStyle.pixelLeft != null)
		{
			if(!(inPosX > 0))
				posX += scrollX;
			
			tipDOMStyle.pixelLeft = posX;
			tipDOMStyle.pixelTop = posY + scrollY;
		}
		
		if (tipDOMStyle.offsetLeft != null)
		{
			tipDOMStyle.offsetLeft = posX;
			tipDOMStyle.offsetTop = posY;
		}
		
		tipDOMStyle.visibility = 'visible';
		tipDOMStyle.zIndex = '1';
	}
	else
	{
		return null;
	}
}

function hideToolTip(IDName)
{
	if (isDHTML)
	{
		var tipDOMStyle = getDOM(IDName + 'Tip', 1);
		tipDOMStyle.visibility = 'hidden';
		tipDOMStyle.zIndex = '-1';
	}
}

function getXCoord(evt)
{
	if (evt.x)
		return evt.x;
	else if (evt.pageX)
		return evt.pageX;
}

function getYCoord(evt)
{
	if (evt.y)
		return evt.y;
	else if (evt.pageY)
		return evt.pageY; 
}

function getXScroll()
{
	if (document.body.scrollLeft != null)
		return document.body.scrollLeft;
	else if (window.pageXOffset != null)
		return window.pageXOffset;
}

function getYScroll()
{
	if (document.body.scrollTop != null)
		return document.body.scrollTop;
	else if (window.pageYOffset != null)
		return window.pageYOffset;
}

