/*************************************************************************** 
 * filename : FFWindow.js<br>
 * window��� �ڹٽ�ũ��Ʈ<br>
 *
 * @version	: 1.0
 * @author	: Copyright (c) 2001 by free270. All Rights Reserved.
****************************************************************************/


var  WINDOW_ALIGN_CENTER			= 5;
var  WINDOW_ALIGN_RIGHT_TOP		= 9;
var  WINDOW_ALIGN_LEFT_TOP		= 7;
var  WINDOW_ALIGN_RIGHT_BOTTOM	= 3;
var  WINDOW_ALIGN_LEFT_BOTTOM	= 1;

/**
 * window.open() �Լ�� �����ϸ� ���� â�� 'ġ�� ��d�� �� �� �ִ�.
 * @param align   : d�Ĺ��('�� d�� �Ǿ� �ִ� WINDOW_ALIGN_CENTER,WINDOW_ALIGN_RIGHT_TOP.... �� ����ϸ� �ȴ�.)
 * @param url     : ���̰��� �ϴ� URL
 * @param winname : )���� �̸�(form submit���� target; �ٶ��� �ʿ��� �̸��̰���)
 * @param swidth  : â�� width (option8�� �ټ� �ְ��� ����ϱ� ���Ҷ� �׳� ����)
 * @param sheight : â�� height(option8�� �ټ� �ְ��� ����ϱ� ���Ҷ� �׳� ����)
 * @param option  : ex) "fullscreen=yes,toolbar=no"
 *                  fullscreen  = yes/no
 *                  channelmode = yes/no
 *                  toolbar		= yes/no
 *                  location	= yes/no
 *                  directories = yes/no
 *                  status	    = yes/no
 *                  menubar		= yes/no
 *                  scrollbars	= yes/no
 *                  resizable	= yes/no
 *                  top			= number (������� ������)
 *                  left		= number (������� ������)
 */
function FFWindowOpen(align,url,winname,swidth,sheight,option){
	if(align == WINDOW_ALIGN_CENTER)
		return openCenter(url,winname,swidth,sheight,option); 
	else if (align == WINDOW_ALIGN_RIGHT_TOP)
		return openRightTop(url,winname,swidth,sheight,option); 
	else if (align == WINDOW_ALIGN_LEFT_TOP)
		return openLeftTop(url,winname,swidth,sheight,option);
}


function FFWindowAlign(align,swidth,sheight){
	//...
}


function FFresizeTo(width,height){
	window.resizeTo(width, height); 
	width = width - (document.body.clientWidth -  width); 
	height = height - (document.body.clientHeight -  height); 
	window.resizeTo(width, height); 
}




///////////////////////////////////////////////////////////////////////
//�Ʒ� �Լ��: ��b ȣ������ ���� '�� �ִ� �Լ�� �������

function alignCenter(swidth,sheight){
	if(swidth == null){
		swidth = self.width;
	}
	if(sheight==null){
		sheight = self.height;
	}
	self.focus();
	var sx=screen.availWidth/2-swidth/2;
	var sy=screen.availHeight/2-sheight/2;
	this.resizeTo(swidth,sheight);
	self.moveTo(sx,sy)
}
function alignLeftTop(swidth,sheight){
	if(swidth == null){
		swidth = self.width;
	}
	if(sheight==null){
		sheight = self.height;
	}
	self.focus();
	var sx=0;
	var sy=20;
	this.resizeTo(swidth,sheight);		
	self.moveTo(sx,sy)
}
function openCenter(url,winname,swidth,sheight,option){
	var sx=screen.availWidth/2-swidth/2;
	var sy=screen.availHeight/2-sheight/2;
	var obj
	if(option==null) option = "";
	obj = open(url,winname, "width="+swidth+" ,height="+sheight+",top="+sy+",left="+sx+","+option);	
	return obj
}
function openRightTop(url,winname,swidth,sheight,option){
	var sx=screen.availWidth-swidth - 15
	var sy=20;//screen.availHeight-sheight;
	var obj
	if(option==null) option = "";
	obj = open(url,winname, "width="+swidth+" ,height="+sheight+",top="+sy+",left="+sx+","+option);	
	return obj
}
function openLeftTop(url,winname,swidth,sheight,option){
	var sx=0;
	var sy=20;//screen.availHeight-sheight;
	var obj
	if(option==null) option = "";
	obj = open(url,winname, "width="+swidth+" ,height="+sheight+",top="+sy+",left="+sx+","+option);	
	return obj
}


//��� ���̾�α� ��f
/*
function InsertTable() {
  var pVar = ObjTableInfo;
  var args = new Array();
  var arr = null;
   
  // Display table information dialog
  args["NumRows"] = ObjTableInfo.NumRows;
  args["NumCols"] = ObjTableInfo.NumCols;
  args["TableAttrs"] = ObjTableInfo.TableAttrs;
  args["CellAttrs"] = ObjTableInfo.CellAttrs;
  args["Caption"] = ObjTableInfo.Caption;
  
  arr = null;
  
  arr = showModalDialog( "../WebEdit/instable.htm",
                             args,
                             "font-family:Verdana; font-size:12; dialogWidth:36em; dialogHeight:25em");
  if (arr != null) {
  
    // Initialize table object
    for ( elem in arr ) {
      if ("NumRows" == elem && arr["NumRows"] != null) {
        ObjTableInfo.NumRows = arr["NumRows"];
      } else if ("NumCols" == elem && arr["NumCols"] != null) {
        ObjTableInfo.NumCols = arr["NumCols"];
      } else if ("TableAttrs" == elem) {
        ObjTableInfo.TableAttrs = arr["TableAttrs"];
      } else if ("CellAttrs" == elem) {
        ObjTableInfo.CellAttrs = arr["CellAttrs"];
      } else if ("Caption" == elem) {
        ObjTableInfo.Caption = arr["Caption"];
      }
    }
    tbContentElement.ExecCommand(DECMD_INSERTTABLE,OLECMDEXECOPT_DODEFAULT, pVar);  
  }
}
*/
