
	/* CSS Example:

		.hover-title
		{
			background-color: #FF6600; color: white; border: 1px solid #4F5C71; padding: 2px;
			position: absolute; left: 0; top: 0; height: 18; visibility: hidden;
			filter: progid:DXImageTransform.Microsoft.BasicImage(opacity=0.8); -moz-opacity: 0.8;
		}
	*/

	HoverTitle = function (elemObj)
	{
		this.ht__title = this.ht__title || this.getAttribute("title");
		this.hovertitle = this.getAttribute("hovertitle");
		this.title = "";
	}

	HoverTitle.HoverAllTitles = true;
	HoverTitle.PopupLayer = null;
	HoverTitle.WindowCoord = [0,0];
	HoverTitle.DefaultWidthMax = 300;
	HoverTitle.DefaultFont = null;
	HoverTitle.DefaultFontSize = null;
	HoverTitle.FixedFont = "Dina, Courier New";
	HoverTitle.FixedFontSize = "8pt";

	HoverTitle.createPopupLayer = function ()
	{
		var doc = top.document;
		var body = doc.body;

		var cssText = window.extractCss(".hover-title");
		HoverTitle.PopupLayer = body.insertBefore(doc.createElement("DIV"), body.childNodes[0]);
		HoverTitle.PopupLayer.style.cssText = cssText;

		window.setTimeout(HoverTitle.saveFontStyle, 500);
	}

	HoverTitle.saveFontStyle = function ()
	{
		HoverTitle.DefaultFont = HoverTitle.PopupLayer.style.fontFamily;
		HoverTitle.DefaultFontSize = HoverTitle.PopupLayer.style.fontSize;
	}

	HoverTitle.prototype.onmouseover = function (e)
	{
		var event = e || window.event;
		var maxWidth = this.getAttribute("hoverwidth") || HoverTitle.DefaultWidthMax;
		var useFixed = this.getAttribute("hoverfixed") || false;

		HoverTitle.PopupLayer.innerHTML = "";
		HoverTitle.PopupLayer.style.visibility = "hidden";

		if (useFixed != false)
		{
			HoverTitle.PopupLayer.style.fontFamily = HoverTitle.FixedFont;
			HoverTitle.PopupLayer.style.fontSize = HoverTitle.FixedFontSize;
		}
		else
		{
			HoverTitle.PopupLayer.style.fontFamily = HoverTitle.DefaultFont;
			HoverTitle.PopupLayer.style.fontSize = HoverTitle.DefaultFontSize;
		}

		HoverTitle.PopupLayer.innerHTML = this.hovertitle || this.ht__title;
		HoverTitle.PopupLayer.style.width = "auto";
		HoverTitle.PopupLayer.style.height = "auto";

		if (HoverTitle.PopupLayer.offsetWidth > maxWidth)
			HoverTitle.PopupLayer.style.pixelWidth = maxWidth;
		else
			HoverTitle.PopupLayer.style.pixelWidth = HoverTitle.PopupLayer.offsetWidth;

	}

	HoverTitle.prototype.onmousemove = function (e)
	{
		var event = e || window.event;
		HoverTitle.PopupLayer.style.visibility = "hidden";
		HoverTitle.PopupLayer.style.left = "0px";
		HoverTitle.PopupLayer.style.top = "0px";

		try
		{
			var doc = top.document;

			var bodyObj = doc.body;
			var bodyHeight = bodyObj.offsetHeight + bodyObj.scrollTop;
			var bodyWidth = bodyObj.offsetWidth + bodyObj.scrollLeft;

			var eventX = event.clientX + HoverTitle.WindowCoord[0];
			var eventY = event.clientY + HoverTitle.WindowCoord[1];

			var targetLeft = (eventX + bodyObj.scrollLeft) + 10;
			var targetTop = (eventY + bodyObj.scrollTop) - HoverTitle.PopupLayer.offsetHeight - 3;

			if ((targetTop + HoverTitle.PopupLayer.offsetHeight) > bodyHeight - 5)
				targetTop -= HoverTitle.PopupLayer.offsetHeight;
			if (targetTop < 0)
				targetTop = 5;

			if ((targetLeft + HoverTitle.PopupLayer.offsetWidth) > bodyWidth - 5)
				targetLeft -= (HoverTitle.PopupLayer.offsetWidth + 30);
			if (targetLeft < 0)
				targetLeft = 5;

			HoverTitle.PopupLayer.style.left = targetLeft + "px";
			HoverTitle.PopupLayer.style.top = targetTop + "px";
			HoverTitle.PopupLayer.style.visibility = "visible";
			HoverTitle.PopupLayer.style.zIndex = 100;
		}
		catch(e)
		{
			window.status = "ERROR: " + e.message + " top: " + top + " top.document: " + top.document + " document: " + document;
		}
	}

	HoverTitle.prototype.onmouseout = function ()
	{
		HoverTitle.PopupLayer.style.visibility = "hidden";
	}

	function initializeHover()
	{
		initializeHovertitles();
		initializeHoverCoordinates();
	}

	function initializeHovertitles()
	{
		var elements = document.getElementsByTagName("*");
		for (var i = 0; i < elements.length; i++)
		{
			if (elements[i].getAttribute("hovertitle") || elements[i].ht__title ||
			   (elements[i].getAttribute("title") && HoverTitle.HoverAllTitles) ||
				 (containsClassName(elements[i], "hovertitle")))
						window.applyPrototypes(elements[i], HoverTitle);
		}

		if (HoverTitle.PopupLayer == null)
			HoverTitle.createPopupLayer();
	}

	function initializeHoverCoordinates()
	{
		HoverTitle.WindowCoord = [0,0];

		var currentWindow = window;
		if (window != window.parent)
		{
			while (currentWindow != top)
			{
				currentWindow = currentWindow.parent;
				var frames1 = currentWindow.document.getElementsByTagName("IFRAME");
				var frames2 = currentWindow.document.getElementsByTagName("FRAME");
				var foundFrame = false;
				for (var i = 0; i < frames1.length; i++)
				{
					if (frames1[i].contentWindow == window)
					{
						HoverTitle.WindowCoord[0] += getLeft(frames1[i]);
						HoverTitle.WindowCoord[1] += getTop(frames1[i]);
						foundFrame = true;
						break;
					}
				}
				if (foundFrame != true)
				{
					for (var i = 0; i < frames2.length; i++)
					{
						if (frames2[i].contentWindow == window)
						{
							HoverTitle.WindowCoord[0] += getLeft(frames2[i]);
							HoverTitle.WindowCoord[1] += getTop(frames2[i]);
							foundFrame = true;
							break;
						}
					}
				}
			}
		}
	}

	window.assignEventHandler("onload", window, initializeHover);
	window.assignEventHandler("onresize", window, initializeHoverCoordinates);

