var Layer_x, Layer_y, OBJECT = DOM.create('span');
document.body.appendChild(OBJECT);

function MouseDown() {
	Layer_x = event.x - MasterWindow.style.pixelLeft;
	Layer_y = event.y - MasterWindow.style.pixelTop;
}

function MouseMove() {
	if (event.button == 1) {
		var x = MasterWindow.clientLeft + (event.x - Layer_x);
		var y = MasterWindow.clientTop + (event.y - Layer_y);
		MasterWindow.style.pixelLeft = x < 0 ? 0 : x;
		MasterWindow.style.pixelTop = y < 0 ? 0 : y;
	}
}

function wz(width, height, item) {
	var scrollWidth = document.documentElement.scrollWidth;
	var scrollHeight = document.documentElement.scrollHeight;
	var x = Math.floor((scrollWidth - width - document.documentElement.scrollLeft) / 2);
	var y = Math.floor((scrollHeight - height - document.documentElement.scrollTop) / 2);
	if (x < 0) x = 0; if (y < 0) y = 0;
	return item == 'x' ? x : y;
}

function noBorderWindow(Width, Height, bgColor1, bgColor2, Text, TextColor, src, Scroll, dropcolor, tran1, tran2) {
	var temp; if (dropcolor == null) dropcolor = '#CCCCCC';
	if (tran1 == null) tran1 = 100; if (tran2 == null) tran2 = 100;
	var x1 = document.body.clientWidth, y1 = document.body.clientHeight;
	if (x1 < Width) x1 = screen.width; x1 = (x1 - Width) / 2;
	if (y1 < Height) y1 = screen.height; y1 = (y1 - Height * 1.0) / 2;
	x1 = wz(Width, Height, 'x'); y1 = wz(Width, Height, 'y');
	temp = '<div id="MasterWindow" style="position:absolute; left:' + x1 + 'px; top:' + y1 + 'px; width:' + Width + '; height:' + Height + "; z-index:1;\">\r\n";
	temp += '  <table width="' + Width + '" border="0" cellpadding="0" cellspacing="0" bgcolor="' + bgColor1 + "\" id=\"Master_Table\" style=\"font-size: 12px; filter:alpha(opacity=" + tran1 + ');">\r\n';
	temp += '    <tr height="26">\r\n      <td width="15">&nbsp;</td>\r\n';
	temp += '      <td width="' + (Width - 30) + "\" onmousedown=\"Master_Table.bgColor='" + bgColor2 + "'; Master_Table.style.filter='alpha(opacity=" + tran2 + ")'; MouseDown(); setCapture();\" onmouseup=\"Master_Table.bgColor='" + bgColor1 + "'; Master_Table.style.filter='alpha(opacity=" + tran1 + ")'; releaseCapture();\" onmousemove=\"MouseMove();\" style=\"cursor: move;\"><table width=\"" + (Width - 30) + '" height="20" border="0" cellpadding="0" cellspacing="0"><tr><td style="filter:dropshadow(color=' + dropcolor + ',offx=2,offy=2); color:' + TextColor + '; font-family: Dotum;">' + Text + "</td></tr></table></td>\r\n";
	temp += '      <td width="15" style="cursor: hand;" title="¹Ø±Õ"><a href="javascript:;" onmousedown="MasterWindow.style.visibility = \'hidden\';"><img src="x.gif" width="10" height="10" border="0" /></a></td>\r\n    </tr>\r\n    <tr>\r\n';
	temp += '      <td height="' + (Height - 26) + '" colspan="3" align="center" valign="top">';
	temp += '<iframe id="NewWin" name="NewWin" src="' + src + '" scrolling="' + Scroll + '" frameborder="0" width="' + (Width - 2) + '" height="' + (Height - 27) + "\"></iframe></td>\r\n";
	temp += "    </tr>\r\n  </table>\r\n</div>\r\n";
	OBJECT.innerHTML = temp;
}