	var xy	=	{
		x		:	0,
		y		:	0,
		counter	:	0,

		init	:	function()
		{
			this.ns4	=	(document.layers)	?	true	:	false;
			this.ie4	=	(document.all)		?	true	:	false;
			if (this.ns4)
			{
				document.captureEvents(Event.MOUSEMOVE);
			}
			document.onmousemove	=	xy.mousemove;

			return true;
		},

		mousemove	:	function(e)
		{
			this.x	=	e.pageX;
			this.y	=	e.pageY;
			tooltip.setXY(this.x,this.y);
			return true;
		},

		get	:	function (type)
		{
			switch (type)
			{
				case 'y':
					return this.y;
				break;

				case 'x':
				default:
					return this.x;
				break;
			}
		},
	};

	var tooltip	=	{
		x		:	0,
		y		:	0,

		init	:	function (type)
		{
			this.type		=	type;
			this.img_url	=	'js/tooltip/images/' + type;
			this.e			=	document.getElementById('popup_div');
			var css_id		=	'tooltip_' + this.type + '_text';
			this.code1		=	'<div style="position: absolute; width: 16px; height: 8px; left: 0px; top: 0px; background: url(' + this.img_url + '/default_message_bg1.png);"></div>' +
			'<div style="position: absolute; width: 16px; height: 8px; right: 0px; top: 0px; background: url(' + this.img_url + '/default_message_bg3.png);"></div>' +
			'<div style="position: absolute; width: 16px; height: 8px; left: 0px; bottom: 0px; background: url(' + this.img_url + '/default_message_bg7.png);"></div>' +
			'<div style="position: absolute; width: 16px; height: 8px; right: 0px; bottom: 0px; background: url(' + this.img_url + '/default_message_bg9.png);"></div>' +
			'<div style="position: absolute; height: 8px; left: 16px; right: 16px; top: 0px; background: url(' + this.img_url + '/default_message_bg2.png);"></div>' +
			'<div style="position: absolute; height: 8px; left: 16px; right: 16px; bottom: 0px; background: url(' + this.img_url + '/default_message_bg8.png);"></div>' +
			'<div style="position: absolute; width: 6px; left: 0px; top: 8px; bottom: 8px; background: url(' + this.img_url + '/default_message_bg4.png);"></div>' +
			'<div style="position: absolute; width: 6px; right: 0px; top: 8px; bottom: 8px; background: url(' + this.img_url + '/default_message_bg6.png);"></div>' +
			'<div style="position: relative; margin-left: 6px; margin-right: 6px; padding-right: 4px; margin-top: 8px; margin-bottom: 8px; background: url(' + this.img_url + '/default_message_bgbg.png);" id="' + css_id + '">';
			this.code2	=	'</div>';
			return true;
		},

		add_text	:	function (id,text)
		{
			var e			=	document.getElementById(id);
			e.onmouseover	=	'tooltip.show(\'' + text + '\');';
			e.onmouseout	=	'tooltip.hide();';
			return true;
		},

		add_text_by_title	:	function (id)
		{
			var e			=	document.getElementById(id);
			var text		=	e.title;
			e.onmouseover	=	'tooltip.show(\'' + text + '\');';
			e.onmouseout	=	'tooltip.hide();';
			return true;
		},

		show	:	function (text)
		{
			var code	=	this.code1 + text + this.code2;
			this.e.innerHTML		=	code;
			this.e.style.display	=	'block';
			x	=	this.x+20 + 'px';
			y	=	this.y+10 + 'px';
			this.e.style.top			=	y;
			this.e.style.left			=	x;
			return true;
		},

		hide	:	function ()
		{
			this.e.style.display	=	'none';
			return true;
		},

		setXY	:	function (x,y)
		{
			x	=	x+20;
			y	=	y+10;
			this.x	=	x;
			this.y	=	y;
			if (this.e.style.display	== 'block')
			{
				this.e.style.top			=	y + 'px';
				this.e.style.left			=	x + 'px';
			}
			return true;
		}
	};
