function popupWindow(no,w,h,x,y)
{
	/*** À§Ä¡¼±Á¤ ***/
	var gap = (_ID('layout_exr')) ? get_objectLeft(_ID('layout_exr')) : 0;
	popup_zIndex++;

	var obj = document.createElement("div");
	obj.setAttribute('id','popupWindow_' + no);
	with (obj.style){
		//border = "1px solid #000000";
		width = w + 2;
		height = 0;
		position = "absolute";
		top = y;
		left = x + gap;
		zIndex = popup_zIndex;
		background = "#ffffff";
		filter = "progid:DXImageTransform.Microsoft.Shadow(color='#505050', Direction=135, Strength=3);";
	}
	obj.onclick = function(){ 
		obj.style.zIndex = ++popup_zIndex;
	} 
	obj.onselectstart = function(){ return false; };
	document.body.appendChild(obj);
	
	var top = document.createElement("div");
	with (top.style){
		//borderBottom = "1px solid #000000";
		//background = "#333333";
		background = "url('../skin/" + tplSkin + "/img/popup_bg.jpg')";
		height = 25;
		color = "#ffffff";
		font = "8pt µ¸¿ò";
		letterSpacing = -1;
		padding = "9px 0 0 8px";
		cursor = "pointer";
	}
	top.onmousedown = downPos;
	top.onmouseup = function(){ isMove = false; }
	//top.onmouseout = function(){ isMove = false; }
	obj.appendChild(top);

	var body = document.createElement("div");
	with (body.style){
		width = w + 2;
		height = h;
		overflow = "hidden";
		borderLeft = "1px solid #545454";
		borderRight = "1px solid #545454";
	}
	obj.appendChild(body);

	new Ajax.Request('../ajax.php',{
		parameters:	'mode=ajaxPopup&no=' + no,
		onComplete: showResponse
	});

	function showResponse(data)
	{
		var ret = data.responseText;
		ret = eval('(' + ret + ')');
		top.innerHTML = ret.title;
		body.innerHTML = ret.contents;

		var close = document.createElement("div");
		with (close.style){
			position = "absolute";
			top = "6px";
			right = "3px";
			color = "#ffffff";
			font = "bold 9px tahoma";
		}
		close.onclick = function(){
			obj.style.left = -999;
		}
		close.innerHTML = "<img src='../skin/" + tplSkin + "/img/popup_close.gif'>";
		top.appendChild(close);
	}

	var bot = document.createElement("div");
	with (bot.style){
		border = "1px solid #000000";
		background = "#555555";
		height = 23;
		color = "#ffffff";
		padding = "0 8px 0 0";
		font = "8pt µ¸¿ò";
		letterSpacing = -1;
		textAlign= "right";
	}
	bot.innerHTML = "<div style='float:right;padding-top:6px'>ÆË¾÷ ±×¸¸º¸±â</div><div style='float:right'><input type=checkbox onclick='popupWindow_close(" + obj.getAttribute('id') + "," + no + ")'></div>";
	obj.appendChild(bot);

	var posX, posY;
	var iciX, iciY;
	var isMove = false;

	function downPos(e){

		isMove = true;
		obj.style.zIndex = ++popup_zIndex;

		posX = event.clientX;
		posY = event.clientY;

		iciX = parseInt(obj.style.left);
		iciY = parseInt(obj.style.top);
		document.onmousemove = movePos;
	}

	function movePos(e){
		if (!isMove) return;
		obj.style.left = iciX + event.clientX - posX;
		obj.style.top = iciY + event.clientY - posY;
		return false;
	}

}

function popupWindow_close(obj,no)
{
	var pw = getCookie('popupWindow');
	var r_pw = pw.split(",");
	if (!r_pw[0]) r_pw = [];
	if (!in_array(no,r_pw)) r_pw.push(no);

	var now = new Date();
	var expire = new Date(now.getTime() + 60*60*24*1000);
	setCookie('popupWindow',r_pw,expire);
	obj.parentNode.removeChild(obj);
}