﻿	var _lblFloat = null;
	
	var _mouseMoveEvent = null;
	
//	document.onclick = documentClick;
//	
//	function documentClick(aEvent)
//	{
//		_event = aEvent ? aEvent : window.event;
//	}

	document.onmousemove = onMouseMoveEvent;
	
	function onMouseMoveEvent(evt)
	{
		if (evt != null) _mouseMoveEvent = evt;
	}
	
	function startFloatLabel(text, width)
	{
		document.onmousemove = moveLabel;
		
		if (width == null) width = 0;
		
		_floatLabelText = text;
		
		createLabel();
		
		
		function moveLabel(evt)
		{
			onMouseMoveEvent(evt);
			
			if (_lblFloat != null)
			{
				if (_lblFloat.style.posTop != null)
				{
					if (window.event != null)
					{
						if (Prototype.Browser.IE)
						{
							_lblFloat.style.left = (window.event.clientX + document.documentElement.scrollLeft + 15);
							_lblFloat.style.posTop = (window.event.clientY + document.documentElement.scrollTop + 15);
						}
						else
						{
							_lblFloat.style.left = (window.event.clientX + document.body.scrollLeft + 15) + "px";
							_lblFloat.style.posTop = (window.event.clientY + document.body.scrollTop + 15);
						}
					}
				}
				else
				{
					_lblFloat.style.left = (evt.pageX + 15) + "px";
					_lblFloat.style.top = (evt.pageY + 15) + "px";
				}
			}
		}
		
		function createLabel()
		{
			if (_lblFloat == null)
			{
				_lblFloat = document.createElement("div");
			}
			
			_lblFloat.className = "floatLabel";
//			_lblFloat.style.position = "absolute";
//			_lblFloat.style.zIndex = 100000;
//			_lblFloat.style.border = "1px darkgray solid";
//			_lblFloat.style.font = "10pt 굴림, 돋움";
//			_lblFloat.style.backgroundColor = "#E6E6E6";
//			_lblFloat.style.color = "#808080";
//			_lblFloat.style.padding = "3px";
			_lblFloat.innerHTML = _floatLabelText;
			document.body.appendChild(_lblFloat);

//			_lblFloat.style.backgroundAttachment = "fixed";
//			_lblFloat.style.backgroundImage = "url(/images/common/floatlabelbg.gif)";
//			_lblFloat.style.backgroundRepeat = "repeat";
//			_lblFloat.style.backgroundColor = "transparent";
			
			
			if (_lblFloat.style.posTop != null)
			{
				if (window.event != null)
				{
					if (Prototype.Browser.IE)
					{
						_lblFloat.style.left = (window.event.clientX + document.documentElement.scrollLeft + 15);
						_lblFloat.style.posTop = (window.event.clientY + document.documentElement.scrollTop + 15);
					}
					else	// 사파리, 구글크롬
					{
						_lblFloat.style.left = (window.event.clientX + document.body.scrollLeft + 15) + "px";
						_lblFloat.style.posTop = (window.event.clientY + document.body.scrollTop + 15);
					}
				}
			}
			else	// 파이어폭스
			{
				_lblFloat.style.left = (_mouseMoveEvent.pageX + 15) + "px";
				_lblFloat.style.top = (_mouseMoveEvent.pageY + 15) + "px";
			}

			if (width > 0)
			{
				_lblFloat.style.width = width + "px";
			}
		}
	}
	
	function stopFloatLabel()
	{
		try
		{
			document.body.removeChild(_lblFloat);
			document.onmousemove = onMouseMoveEvent;
		}
		catch (err) {}
	}
