/*---------------------------------------------------------------------------
 * ÇÑ±¹½Å¿ëÁ¤º¸ ¸¶ÀÌÅ©·¹µðÆ® ÇÁ·ÎÁ§Æ®
 *---------------------------------------------------------------------------
 * @(#)popup.js
 * @author K.Y.W
 * @version 1.0, 2005/10/19
 *
 * 1.Description   : Popup °ü·Ã ÇÔ¼öµé
 * 2.Page Type     : Java Script
 * 3.Update Source :
 *       <2005/10/19><±è¿µ¿ì>:<init version>
 *--------------------------------------------------------------------------*/


/******************************************************************************
 *   BI-META Common JavaScript
 *	 ÆË¾÷ ÇÔ¼öµé
 *
 *   @version 1.0  2005/08/01
 *   [History]
 *    - v1.0 2005/08/01, Meta°³¹ßÆÀ, ÃÖÃÊÀÛ¼º
 *
 *   @author  Copyright (c) 2005 by bi-cns. All Rights Reserved.
 *   @author  Meta°³¹ßÆÀ
 *****************************************************************************/


/**
 * open popup window
 *
 * @param		sURL	url
 * @param		sWidth	window width(optional)
 * @param		sHeight	window height(optional)
 * @return		window	object
 *
 * @example		openWindow('blank.html');
 *              openWindow('blank.html', 200, 100);
 *              var oWin = openWindow('blank.html'); alert(oWin.name);
 */
function openWindow (sURL) {
	var sWidth, sHeight;
	var sFeatures;
	var oWindow;

	sWidth	= 400;
	sHeight	= 300;

	if (arguments[1] != null && arguments[1] != "") sWidth = arguments[1] ;
	if (arguments[2] != null && arguments[2] != "") sHeight = arguments[2] ;

	sFeatures =  "width=" + sWidth + ",height=" + sHeight ;
	sFeatures += ",left=3000,top=3000" ;
	sFeatures += ",directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no";

	oWindow = window.open(sURL, "PopupWindow", sFeatures);
	oWindow.focus();

	// move to screen center
	oWindow.moveTo( (window.screen.availWidth - sWidth) / 2, (window.screen.availHeight - sHeight) / 2);

	return oWindow;
}

/**
 * open popup window
 *
 * @param		vUrl	url
 * @param		vWidth	window width
 * @param		vHeight	window height
 * @param		vName	window Name
 * @param		vOpt	window scroll
 * @return		window	object
 *
 * @example		openNameWindow(200, 400, 'blank.html', myWIn, 1);
 */
function openNameWindow(vWidth, vHeight, vUrl, vName, vOpt) {//ÀÎ½ºÅÏ½ºÀÌ¸§ ÀÖ´Â Ã¢ ¿­±â.
	var mdWindow = null;
	var x = (screen.width - vWidth)/2;
	var y = (screen.height - vHeight)/2;
	var opt;
	if (vOpt == "" || vOpt == null) vOpt = 0;
	opt = 		"width=" + vWidth + ",height=" + vHeight;
	opt = opt + ",scrollbars=" + vOpt + ",toolbar=0,menubars=0,locationbar=0,historybar=0,statusbar=0";
	opt = opt + ",outerWidth=" + vWidth + ",outerHeight=" + vHeight + ",resizable=0";
	opt = opt + ",left=" + x + ",top=" + y;
	opt = opt + ",channelmode=no, titlebar=no";
	var mdWindow = window.open(vUrl, vName, opt, false);
  if(!mdWindow){
    alert("ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä.");
    return false;
  }
  mdWindow.focus();
}
