var hint = document.createElement("div");
hint.className = "hint";
document.body.appendChild(hint);
hint.innerHTML = "<table cellspacing=0 cellpadding=0><TR><TD width=15><img src=hint_left_top.png><TD background=hint_top.png><TD width=15><img src=hint_right_top.png><TR><TD background=hint_left.png><TD id=hint2 name=hint2 style='color: #ffffff;border: #666666 1px solid;padding: 3px;' background=hint_bg.jpg><TD background=hint_right.png><TR><TD><img src=hint_left_bottom.png><TD background=hint_bottom.png><td><img src=hint_right_bottom.png>";
var timerID = null;
var ff = (navigator.userAgent.indexOf("Gecko")>-1)?true:false;
function hide()
{
	hint.style.display = "none";
}
document.onmousemove=function(e)
{
	var src = (ff)?e.target:event.srcElement;
	
	if(src.title)
	{
		status = src.title;
		hint2.innerHTML = src.title;
		src.title = "";
		with(hint.style)
		{
			if(ff)
			{
				left = e.clientX+5+"px";
				top  = e.clientY+15+"px";
			}
			else
			{
				left = event.clientX+5+"px";
				top  = event.clientY+15+document.body.scrollTop+"px";
			}
			display = "inline";
		}
		src.onmouseout = function()
		{
			src.title = hint2.innerHTML;
			clearTimeout(timerID);
			hint.style.display = "none";
		};
		src.onmousemove = function(e)
		{
			with(hint.style)
			{
				if(ff)
				{
					left = e.clientX+document.body.scrollLeft+5+"px";
					top  = e.clientY+document.body.scrollTop+15+"px";
				}
				else
				{
					left = event.clientX+document.body.scrollLeft+5+"px";
					top  = event.clientY+document.body.scrollTop+15+"px";
				}
			}
		};
		timerID = setTimeout("hide()", 5000);
	}
};
function OpenCenterWindow( sUri, iWidth, iHeight )
{
        var sWindowName = 'win' + Math.floor( Math.random()*1000 )
        var iRealWidth = iWidth ? iWidth : 600
        var iRealHeight = iHeight ? iHeight : screen.height - 300

        var iLeft = Math.round( (screen.width-iRealWidth)/2 )
        var iTop =  Math.round( (screen.height-iRealHeight)/2 ) - 35

        var sWindowOptions = 'status=yes,menubar=no,toolbar=no'
        sWindowOptions += ',resizable=no,scrollbars=no,location=no'
        sWindowOptions += ',width='  + iRealWidth
        sWindowOptions += ',height=' + iRealHeight
        sWindowOptions += ',left='   + iLeft
        sWindowOptions += ',top='       + iTop

        var oWindow = window.open( sUri, sWindowName, sWindowOptions )
        oWindow.focus();
        return oWindow
}


