// Script for displaying the help topictip for the view/comment count boxes
// (Note: can easily be re-used for more help boxes; just define more DIVs
// of class "topictip", with different id)
//
wmtt = null;
var textTD="";
var boxHideIframe="";
document.onmousemove = updateWMTT;
var isMSIS6 = (navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf('Opera') == -1);
var myContentField = document.getElementById('lw-navMyContent');
function updateWMTT(e)
{
    if (wmtt != null)
	{
	    x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	    y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY;
			
		if (wmtt.style.display != "block") {
		wmtt.style.display = "block"
		if (isMSIS6) 
		{
			boxHideIframe.style.display="block"
		}
		}
			var scrollOffset = 0;
		if (isMSIS6)
		{
			scrollOffset = document.documentElement.scrollTop;
		}

		wmtt.style.left = (x - 10) + "px";
		wmtt.style.top 	= (y - (wmtt.offsetHeight ? wmtt.offsetHeight : wmtt.getHeight()) + scrollOffset - 5) + "px";
		if(isMSIS6) 
		{
			boxHideIframe.style.top = (y - (wmtt.offsetHeight ? wmtt.offsetHeight : wmtt.getHeight()) + scrollOffset - 5) + "px";
			boxHideIframe.style.left = (x - 10) + "px";
			boxHideIframe.style.width = "200px";
			boxHideIframe.style.height = wmtt.offsetHeight - 25 + "px";
		}
	}
}
	
function showWMTT(id, textMsg)
{
	wmtt = document.getElementById(id);
		if(isMSIS6 && document.getElementById('topictipid') == null) 
		{
			boxHideIframe = document.createElement("iframe");
			boxHideIframe.setAttribute("id","topictipid");
			boxHideIframe.setAttribute("src","about:blank");
			boxHideIframe.setAttribute("scrolling","no");
			boxHideIframe.setAttribute("frameBorder","0");
			boxHideIframe.style.display = "none";
			boxHideIframe.style.position = "absolute";
			boxHideIframe.style.background = "transparent";
			boxHideIframe.style.scrolling = "auto";
			boxHideIframe.style.zIndex="99";
				if(document.getElementById('topictip')) 
					{
					document.getElementById('topictip').parentNode.insertBefore(boxHideIframe,document.getElementById('topictip'));
					}
		}
			document.getElementById("helpTitle").innerHTML=textMsg;
	if(myContentField)  {
			document.getElementById('lw-navMyContent').style.zIndex=-1;
		}
}

function hideWMTT()
{
	wmtt.style.display = "none";
	if(myContentField)  {
		document.getElementById('lw-navMyContent').style.zIndex="5";
	}
	if(isMSIS6) {
		document.getElementById('topictipid').style.display="none";
	}
	wmtt = null;
}

