/**
 * ÆË¾÷Ã¢À» ¿øÇÏ´Â À§Ä¡¿¡ »ý¼ºÇÕ´Ï´Ù.
 */
function OpenWindow(url, name, width, height, align, valign, option) 
{
    var x,y;
	var window_option = "width="+width+",height="+height;

	if (option!=null) window_option+=","+option;
    if (align==null) align="center";
    if (valign==null) valign="center";

    if (align=="left") x=0;
    else if (align=="right") x=(screen.width-width);
    else if (align=="center") x=(screen.width-width)/2

    if (valign=="top") y=0;
    else if (valign=="bottom") y=(screen.height-height);
    else if (valign=="center") y=(screen.height-height)/2

    window_option+=",left="+x+",top="+y;

    var win = window.open(url,name,window_option);

	focus();
    win.focus();
	return win;
}


var CheckWin = null;
function openWin(url) {
	CheckWin=window.open(url, 'notice', 'location=no, directories=no, resizable=no, status=no, toolbar=no, menubar=no, width=380, height=260, scrollbars=no')
}

function openWin2(url)	{
	CheckWin=window.open(url, 'notice', 'location=no, directories=no, resizable=no, status=no, toolbar=no, menubar=no, width=599, height=514, scrollbars=yes')
}

function openWin3(url) {
	CheckWin=window.open(url, 'notice', 'location=no, directories=no, resizable=no, status=no, toolbar=no, menubar=no, width=165, height=180, scrollbars=no')
}


/* ZoomÇÏ¸é¼­ ³ªÅ¸³ª´Â ÆË¾÷Ã¢ */
var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;
function zoomBox(evt,zlink,maxw,maxh,tox,toy) {
	if (arguments.length > 2)	{
		zNew=1;
	}
	scrollH = (window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
	maxW = maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
	maxH = maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
	toX = tox?tox:0;
	toY = (toy?toy:0)+scrollH;
	fromX = evt.pageX?evt.pageX:evt.clientX;
	fromY = (evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);
	adjX = toX+evt.screenX-fromX;
	adjY = toY+evt.screenY-fromY;

	if (document.createElement && document.body.appendChild && !zBox) 	{
		zBox=document.createElement("div");
		zBox.style.position = "absolute";
		document.body.appendChild(zBox);
	}
	else if (document.all && !zBox)  	{
		document.all[document.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
		zBox=document.all.zBoxDiv;
	}
	else if (document.layers && !zBox)	{
		zBox = new Layer(maxW);
		zBox.style=zBox;
	}
	zLink = zlink;
	doZoom();
	}
function doZoom() {
	zStep+=1;
	zPct=(10-zStep)/10
	if (document.layers)	{
		zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
		zBox.document.open();
		zBox.document.write("<table width='"+maxW*(1-zPct)+"' height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
		zBox.document.close();
	} else {
		zBox.style.border = "2px solid #999999"; // Å×µÎ¸® ±½±âpx solid Å×µÎ¸® »ö 
		zBox.style.left = toX+zPct*(fromX-toX);
		zBox.style.top = toY+zPct*(fromY-toY);
		zBox.style.width = maxW*(1-zPct);
		zBox.style.height = maxH*(1-zPct);
	}
		zBox.style.visibility = "visible";	
		if (zStep < 10)	{
			setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",30);
		} else {
			zBox.style.visibility='hidden';
			zStep=0;
			if (zLink && !zNew)		{
				location.href=zLink.href;
			} else if (zLink && zNew) { // À©µµ ÀÌ¸§ ÁÖ½Ã¸é 1°³¹Û¿¡ »ç¿ëÇÏÁú ¸øÇÕ´Ï´Ù.
				var w=window.open(zLink.href,'joy114','width='+maxW+',height='+maxH+',left='+adjX+',top='+adjY+',scrollbars=yes');
				zNew=null;
			}
		}
}


/**
 * ÆäÀÌÁö ÀÌµ¿À» ÇÕ´Ï´Ù.
 * @param		delay		ÆäÀÌÁö ÀÌµ¿ Áö¿¬ ½Ã°£ (milliseconds)
 */
function MovePage(str,delay)
{
	if (delay==null) 
		window.location.href=str;
	else 
		window.setInterval("window.location.href='"+str+"'",delay);
}

/* Ç³¼±µµ¿ò¸» °ü·Ã ½ºÅ©¸³Æ® ½ÃÀÛ */
function opt(n, v) {
      for (i = 0 ; i < n.length ; i++) {
          if (n.options[i].value == v) {
              n.options[i].selected = true;
          }
      }
}

function msgposit() {
     message.style.posLeft = event.x + 20 + document.body.scrollLeft;
     message.style.posTop = event.y - 10 + document.body.scrollTop;
}

function msgset(str,str2){
     var text;
     text  = '<table border="0" width="250" cellpadding="5" cellspacing="0" bgcolor="#F5F5FD" style="font-size: 9pt; border: 1px #A2BE4C solid;">';
     text += '<tr><td><b>' + str + '</b><br>' + str2 + '</td></tr></table>';
     message.innerHTML = text;
}

function msghide(){
     message.innerHTML=''
   //message.style.visibility='hidden'
}
/* Ç³¼±µµ¿ò¸» °ü·Ã ½ºÅ©¸³Æ® ³¡ */

