//###################################################################
// 설 명 : 공통 오류 팝업 오픈
//###################################################################
//document.domain="mgwww.dailygame.co.kr";
// 뒤 검은 배경 뺄때 사용 flag 에 true 전달하면 됨.
function dg_CommonLayerOpen_trans(ifrm_url, w, h, flag) {
	dg_CommonLayerOpen(ifrm_url, w, h);
	if(flag) {
		document.getElementById('div_DG_ErrorPopup').style.visibility = 'hidden';
	}
}
// 레이어용 오픈
function dg_CommonLayerOpen(ifrm_url, w, h) {
/* IE 6.0 이하에서 SELECT z-index 달라서 hidden
	var a;
	var svn = document.getElementsByTagName("SELECT");
	for (a=0;a<svn.length;a++) {
		svn[a].style.visibility = 'hidden';
	}
*/
	var bw = document.body.scrollWidth;
	var bh = (document.body.scrollHeight < document.body.clientHeight) ? document.body.clientHeight : document.body.scrollHeight;
	if(bh <= 400) bh = 500;
	document.getElementById('div_DG_ErrorPopup').style.visibility = 'visible';
	document.getElementById('div_DG_ErrorPopup').style.width = bw;
	document.getElementById('div_DG_ErrorPopup').style.height = bh;

	bw = document.body.clientWidth;
	bh = document.body.clientHeight;

	var goURL = ifrm_url;
	var strHTML = '<iframe id="iframe_ErrorPopup" name="iframe_ErrorPopup" width="'+w+'" height="'+h+'" src="'+goURL+'" scrolling="no" marginwidth="0" marginheight="0" frameborder="no" allowtransparency="true"></iframe>';
	document.getElementById('div_DG_ErrorPopup_msg').innerHTML = strHTML;
	bw = (Math.ceil((bw / 2) - (w / 2)) <= 0) ? 0 : Math.ceil((bw / 2) - (w / 2));
	bh = (Math.ceil((bh / 2) - (h / 2) + document.body.scrollTop) <= 0) ? 0 : Math.ceil((bh / 2) - (h / 2) + document.body.scrollTop);
  bh = 331;

	document.getElementById('div_DG_ErrorPopup_msg').style.left = bw;
	document.getElementById('div_DG_ErrorPopup_msg').style.top = bh;
	document.getElementById('div_DG_ErrorPopup_msg').style.width = w;
	document.getElementById('div_DG_ErrorPopup_msg').style.height = h;
	document.getElementById('div_DG_ErrorPopup_msg').style.visibility = 'visible';
	if((navigator.appName == 'Microsoft Internet Explorer')) {
		window.attachEvent('onresize' , dg_ErrorLayerReLoad);
	} else {
		document.addEventListener('resize' , dg_ErrorLayerReLoad, false);
	}

	document.getElementById('div_DG_ErrorPopup').style.visibility = 'hidden';
}
// 레이어용 위치 정리
function dg_ErrorLayerReLoad() {
	if(document.getElementById('div_DG_ErrorPopup_msg').style.visibility == 'visible') {
		var bw = document.body.clientWidth;
		var bh = document.body.clientHeight;
		var w = parseInt(document.getElementById('div_DG_ErrorPopup_msg').style.width.replace('px', ''));
		var h = parseInt(document.getElementById('div_DG_ErrorPopup_msg').style.height.replace('px', ''));

		bw = (Math.ceil((bw / 2) - (w / 2)) <= 0) ? 0 : Math.ceil((bw / 2) - (w / 2));
		bh = (Math.ceil((bh / 2) - (h / 2)) <= 0) ? 0 : Math.ceil((bh / 2) - (h / 2));

		document.getElementById('div_DG_ErrorPopup_msg').style.left = bw;
		document.getElementById('div_DG_ErrorPopup_msg').style.top = bh;
	}
}
// 레이어용 이동
function dg_CommonLayerMove(l, t) {
	if(l > 0) {
		document.getElementById('div_DG_ErrorPopup_msg').style.left = l;
	}
	if(t > 0) {
		document.getElementById('div_DG_ErrorPopup_msg').style.top = t;
	}
}
// 레이어용 추가 이동
function dg_CommonLayerAddMove(l, t) {
	if(l > 0) {
		document.getElementById('div_DG_ErrorPopup_msg').style.left = parseInt(document.getElementById('div_DG_ErrorPopup_msg').style.left.replace('px', '')) + l;
	}
	if(t > 0) {
		document.getElementById('div_DG_ErrorPopup_msg').style.top = parseInt(document.getElementById('div_DG_ErrorPopup_msg').style.top.replace('px', '')) + t;
	}
}
// 레이어용 클로즈
function dg_ErrorLayerClose() {
/* IE 6.0 이하에서 SELECT z-index 달라서 hidden
	var a;
	var svn = document.getElementsByTagName("SELECT");
	for (a=0;a<svn.length;a++) {
		svn[a].style.visibility = 'visible';
	}
*/
	document.getElementById('div_DG_ErrorPopup_msg').innerHTML = '';
	document.getElementById('div_DG_ErrorPopup_msg').style.visibility = 'hidden';
	document.getElementById('div_DG_ErrorPopup').style.visibility = 'hidden';
}
// 레이어용 레이어
document.write('<div id="div_DG_ErrorPopup" name="div_DG_ErrorPopup" style="filter:alpha(opacity:50);-moz-opacity:0.5;opacity:0.5;z-index:1000;background-color:#000000;position:absolute;visibility:hidden;left:0px;top:0px;width:0px;height:0px;"></div>');
document.write('<div id="div_DG_ErrorPopup_msg" name="div_DG_ErrorPopup_msg" style="z-index:1100;background-color:transparent;position:absolute;visibility:hidden;left:0px;top:0px;width:0px;height:0px;"></div>');
