/*  JavaScript Popup Window object library, version 1.0.0
 *  (c) 2006-2007 MinHo, Park
 *
 *  string.lib is freely distributable under the terms of an MIT-style license.
 *  For details, see the CherryNet web site: http://www.cherrynet.co.kr/dev/
 *
/*----------------------------------------------------------------------------*/

var _popup_lib_window;

function popup_window(url,name,width,height,scrollbars,resizable) {
	_popup_lib_window=window.open(url,name,'scrollbars='+scrollbars+',resizable='+resizable+',width='+width+',height='+height);
	_popup_lib_window.focus();
	return _popup_lib_window;
}

function CenterWindow(href,WinName,w,h,scroll,resize) {
	var PosLeft;
	var PosTop;

	PosLeft = (window.screen.width/2) - (w/2 + 10);
	PosTop = (window.screen.height/2) - (h/2 + 50);

//	scroll = 0;

	if(window.screen.width<w+10){
		PosLeft = 0;
		w = window.screen.width - 10;
		scroll = 1;
	}

	if(window.screen.height<h+60){
		PosTop = 0;
		if(window.screen.width>w+10){
			w +=15;
		}

		h = window.screen.height - 60;
		scroll = 1;
	}

	var objWin = window.open(href,WinName,"status,height=" + h + ",width=" + w + ", scrollbars=" + scroll + ",resizable=" + resize + ",left=" + PosLeft + ",top=" + PosTop + ",screenX=" + PosLeft + ",screenY=" + PosTop + ",status=no");
	if(objWin == null){
		alert("팝업창이 차단되었습니다.\n\n팝업창 차단 설정을 해제하여주십시요.\n\n팝업창 차단 설정은\n웹페이지 상단에 나타나는 [알림 표시줄]에서 설정이 가능합니다.\n\n또는 [도구 > 인터넷옵션 > 개인정보 > 팝업차단 > 설정]에서\n설정이 가능합니다.");
	}

	return objWin;
}
