document.write('<div id="over_item" '
					+ 'style="'
							+ 'padding: 2px;'
							+ 'background-color:#F7F7F7;'
							+ 'border: 1px solid #FF7200;'
							+ 'position: absolute;'
							+ 'display: none;'
							+ 'z-index: 100;'
							+ 'width: auto;'
							+ 'height: auto;'
							+ 'filter: alpha(opacity=100);">'
			+ '</div>');

var img_w		= '';
var img_h		= '';

var overEvent	=
{
	obj		: null,
	style	: null,
	flag	: null,
	html	: '',
	closeT	: '',
	closeB	: '',

	imgShow : function (img, mode)
	{
		this.obj	= document.getElementById('over_item');
		this.style	= this.obj.style;
		this.html	= '';
		this.flag	= false;

		overEvent.closeButton();
		if (img != '')
		{
			this.flag	= true;
			this.html	= '<table border="0" cellpadding="0" cellspacing="0">'
						+ this.closeT
						+ '<tr>'
						+	'<td><a href="javascript:" onClick="javascript:over_item.style.display=\'none\'">'
						+		'<img name="imagename" src="' + img + '" border="0" align="absmiddle">'
						+		'</a>'
						+	'</td>'
						+ '</tr>'
						+ this.closeB
						+ '</table>';
		}
		overEvent.imgShowHide();
		// ÀÌ¹ÌÁö °ªÀÌ ÀÖ´ÂÁö È®ÀÎÇÑ´Ù
		this.obj.innerHTML	= this.html;
		img_w				= (img != '') ? document.images['imagename'].width  : '';
		img_h				= (img != '') ? document.images['imagename'].height : '';
		this.style.pixelLeft= 0;
		this.style.pixelTop	= -10000;

		(mode == true) ? document.onmousemove= overEvent.movePosition : overEvent.layerPosition();
	},

	imgShowHide : function ()
	{
		this.style.display = (this.flag == true) ? '' : 'none';
	},

	movePosition : function ()
	{
		var mouseW	= window.event.clientX;
		var mouseH	= window.event.clientY;
		var scrollW	= document.body.scrollLeft;
		var scrollH	= document.body.scrollTop;
		var bodyW	= document.body.offsetWidth;
		var bodyH	= document.body.offsetHeight;
		var posx	= ((bodyW-mouseW-scrollW) <= img_w) ? (mouseW-img_w-20+scrollW) : (mouseW+20+scrollW);
		var posy	= ((bodyH-mouseH) <= img_h) ? ((scrollH+mouseH)-img_h) : mouseH+scrollH;

		document.getElementById('over_item').style.pixelLeft	= posx;
		document.getElementById('over_item').style.pixelTop		= posy;
	},

	layerPosition : function ()
	{
		var mouseW	= window.event.clientX;
		var mouseH	= window.event.clientY;
		var scrollW	= document.body.scrollLeft;
		var scrollH	= document.body.scrollTop;
		var bodyW	= document.body.offsetWidth;
		var bodyH	= document.body.offsetHeight;
		var posx	= ((bodyW-mouseW-scrollW) <= img_w) ? (mouseW-img_w-20+scrollW) : (mouseW+20+scrollW);
		var posy	= ((bodyH-mouseH) <= img_h) ? ((scrollH+mouseH)-img_h) : mouseH+scrollH;

		document.onmousemove	= '';
		this.style.pixelLeft	= posx;
		this.style.pixelTop		= posy;
	},

	closeButton : function ()
	{
		if (show_magnify_close == 'S')
		{
			switch (show_magnify_close_image_locate)
			{
				case 'right_top' :
					this.closeT	= '<tr><td align="right">'
								+ '<input type="button" value="´Ý±â" onClick="over_item.style.display=\'none\'">'
								+ '</td></tr>';
					break;
				case 'left_top' :
					this.closeT	= '<tr><td>'
								+ '<input type="button" value="´Ý±â" onClick="over_item.style.display=\'none\'">'
								+ '</td></tr>';
					break;
				case 'top_center' :
					this.closeT	= '<tr><td align="center">'
								+ '<input type="button" value="´Ý±â" onClick="over_item.style.display=\'none\'">'
								+ '</td></tr>';
					break;
				case 'bottom_center' :
					this.closeB	= '<tr><td align="center">'
								+ '<input type="button" value="´Ý±â" onClick="over_item.style.display=\'none\'">'
								+ '</td></tr>';
					break;
				case 'left_bottom' :
					this.closeB	= '<tr><td>'
								+ '<input type="button" value="´Ý±â" onClick="over_item.style.display=\'none\'">'
								+ '</td></tr>';
					break;
				case 'right_bottom' :
					this.closeB	= '<tr><td align="right">'
								+ '<input type="button" value="´Ý±â" onClick="over_item.style.display=\'none\'">'
								+ '</td></tr>';
					break;
			}
		}
	}
}

function MM_preloadImages ()
{
	var d = document;
	if (d.images)
	{
		if(!d.MM_p) { d.MM_p=new Array(); }
		var i, j=d.MM_p.length, a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
		{
			if (a[i].indexOf("#")!=0)
			{
				d.MM_p[j]		= new Image;
				d.MM_p[j++].src	= a[i];
			}
		}
	}
}
