// ¾ÆÀÌÇÁ·¡ÀÓ
function iframe_autoresize(arg) {
    arg.height = eval(arg.name+".document.body.scrollHeight");
}


// °øÁö ÆË¾÷Ã¢À» ¶ç¿î´Ù.
function popUpWindow(htmlvalue,names, width, Height, scrollbar) { 
	if(scrollbar == "") scrollbar='yes';
	window.open (htmlvalue, names, "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars="+ scrollbar+", resizable=no, copyhistory=no, width=" + width + ", height=" + Height);
}

function open_window2(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}


// ÀÚ½ÅÀº ´ÝÈ÷°í ÀÚ½ÅÀ» ¿­Àº ÆäÀÌÁö´Â ÀÌµ¿½ÃÅ²´Ù.
function win_Close_openerGo(gourl) {
	opener.window.location=gourl;
	window.close();
}

// »õÃ¢À» ¶ç¿ì°í ÀÚ½ÅÀº ´ÝÈù´Ù.
function win_newopen_Close(gourl) {
	window.open (gourl, "_blank");
	window.close();
}


//»õÃ¢¶ç¿ì±â  
function open_window(URL, target, w, h, s) {  
    if(s) s = 'yes';  
    else s = 'no';  
    var its = window.open(url,target,'width='+w+',height='+h+',top=0,left=0,scrollbars='+s);  
    its.focus();  
}  

//»õÃ¢¶ç¿ì±â 2
function newWindow(htmlvalue) { 
	window.open (htmlvalue, "_blank");
}

// »çÀÌÆ®¸¦ ÀÌµ¿ ½ÃÄÑÁØ´Ù.
function goURL(gURL,message) {
	
	if(message != "") {
		if(confirm(message)) {
			location.href=gURL;
			return;
		} else {
			return;
		}
	}
	
	document.location=gURL;
}

/**
 * ºê¶ó¿ìÀúÀÇ ¹öÀüÀ» Ã¼Å©ÇÕ´Ï´Ù.
 */
function GetBrowser()
{
	var tempDocument = window.document;

	if (tempDocument.all && tempDocument.getElementById) // ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ 5.x
	{ 
		return 1;
	}
	else if (tempDocument.all && !tempDocument.getElementById) // ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ 4.x
	{ 
		return 2;
	}
	else if (tempDocument.getElementById && !tempDocument.all) // ³Ý½ºÄÉÀÌÇÁ 6
	{ 
		return 3;
	}
	else if (tempDocument.layers) // ³Ý½ºÄÉÀÌÇÁ 4.x
	{	 
		return 4;
	}
}

/**
 * ÆË¾÷Ã¢À» ¿øÇÏ´Â À§Ä¡¿¡ »ý¼ºÇÕ´Ï´Ù.
 */
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;
}

/**
 * À©µµ¿ì°¡ ¿­·ÁÀÖ´ÂÁö Ã¼Å©ÇÕ´Ï´Ù.
 */
function isAliveWindow(win)
{
	if (!win.closed) return true;
	else return false;
}

/**
 * »ç¿îµå¸¦ µéÀ»¼ö ÀÖ´ÂÁö È¯°æÀÎÁö Ã¼Å©ÇÕ´Ï´Ù. (IEÀü¿ë)
 */
function EnableSound()
{
  document.write("<OBJECT ID='Player64' CLASSID='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' STYLE='display:none'></OBJECT>");
  return Player64.IsSoundCardEnabled();
}

/**
 * ¸®¾óÇÃ·¹ÀÌ¾î(RealPlayer) ¼³Ä¡ ¿©ºÎ Ã¼Å©ÇÕ´Ï´Ù.
 */
function EnableRealPlayer()
{
	var nRealMode=0;
	var nRealPlayer5=0;
	var nRealPlayer4=0;
	var nRealPlayerG2=0;

	if (window.document.all) // IE
	{
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('nRealPlayerG2 = (NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n');
		document.write('nRealPlayer5 = (NOT IsNull(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)")))\n');
		document.write('nRealPlayer4 = (NOT IsNull(CreateObject("RealVideo.RealVideo(tm) ActiveX Control (32-bit)")))\n');
		document.write('</SCRIPT\> \n');
	}
	else // NS
	{
		var numPlugins = navigator.plugins.length;
		for (var i = 0; i < numPlugins; i++)
		{
			plugin = navigator.plugins[i];
			if (plugin.name.substring(0,10)=="RealPlayer")
			{
				nRealMode=1;
			}
		}
	}

	if (nRealMode || nRealPlayerG2 || nRealPlayer5 || nRealPlayer4) 
		return true;
	else 
		return false;
}

/**
 * ÆäÀÌÁö ÀÌµ¿À» ÇÕ´Ï´Ù.
 * @param		delay		ÆäÀÌÁö ÀÌµ¿ Áö¿¬ ½Ã°£ (milliseconds)
 */
function MovePage(str,delay)
{
	if (delay==null) 
		window.location.href=str;
	else 
		window.setInterval("window.location.href='"+str+"'",delay);
}

/**
 * ÇöÀç È÷½ºÅä¸® ¿£Æ®¸®¿¡ ÆäÀÌÁö¸¦ ÀÐ¾îµéÀÔ´Ï´Ù. (µÚ·Î°¡±â ¹öÆ° ºñÈ°¼ºÈ­)
 */
function ReplacePage(str,delay)
{
	if (delay==null) 
		window.location.replace(str);
	else 
		window.setInterval("window.location.replace('"+str+"')",delay);
}

/**
 * ÇöÀç ÆäÀÌÁö »õ·Î °íÄ§
 */
function ReloadPage(delay)
{
if (delay==null) 
		window.location.reload();
	else 
		window.setInterval("window.location.reload()",delay);
}

/**
 * ¹®ÀÚ¿­À» Å¬¸³º¸µå¿¡ º¹»çÇÕ´Ï´Ù. (IEÀü¿ë)
 */
function CopyToClip(str) 
{
	if (window.document.all) // IEÀÏ¶§
		window.clipboardData.setData('Text',str);
}

/**
 * ºê¶ó¿ìÀúÀÇ ½ÃÀÛÆäÀÌÁö º¯°æÃ¢À» ¶ç¿ó´Ï´Ù. (IEÀü¿ë)
 */
function SetHomePage(url) 
{
	window.document.write("<SPAN ID='objHomePage' STYLE='behavior:url(#default#homepage); display:none;' >s</SPAN>");
	window.document.all.objHomePage.setHomePage(url);
}

/**
 * ºê¶ó¿ìÀúÀÇ Áñ°ÜÃ£±â Ãß°¡Ã¢À» ¶ç¿ó´Ï´Ù. (IEÀü¿ë)
 */
function AddFavorite(url, homename) 
{
	window.external.AddFavorite(url, homename);
}

/**
 * ¸ð´ÏÅÍ ÇØ»óµµ¸¦ ±¸ÇÕ´Ï´Ù.
 */
function GetWindowResolution() 
{
	if (window.screen)
	{
		var returnArray = new Array(2);
		returnArray[0] = window.screen.width;
		returnArray[1] = window.screen.height;
		return returnArray;
	}
	else return false;
}

/**
 * »ç¿ëÀÚÀÇ »ö»ó ¼³Á¤À» ±¸ÇÕ´Ï´Ù.
 * @return		»ö»óºñÆ®¼ö¸¦ ¹ÝÈ¯ÇÕ´Ï´Ù. ( 8ºñÆ® : 256»ö, 16ºñÆ® : ÇÏÀÌÄÃ·¯ , 24ºñÆ® : Æ®·çÄÃ·¯ )
 */
function GetWindowColor() 
{
	if (window.screen)
	{
		return screen.colorDepth;
	}
}

/**
 * ºê¶ó¿ìÀúÀÇ Á¦¸ñÇ¥½ÃÁÙÀ» ¼³Á¤ÇÕ´Ï´Ù.
 */
function SetWindowTitle(str) 
{
	document.title = str;
}

/**
 * ºê¶ó¿ìÀúÀÇ Á¦¸ñÇ¥½ÃÁÙÀÇ ¹®ÀÚ¿­À» ¹ÝÈ¯ÇÕ´Ï´Ù.
 */
function GetWindowTitle() 
{
	return document.title;
}

/**
 * ºê¶ó¿ìÀúÀÇ »óÅÂÇ¥½ÃÁÙÀ» ¼³Á¤ÇÕ´Ï´Ù.
 */
function SetStatusTitle(str) 
{
	window.status = str;
}

/**
 * ºê¶ó¿ìÀúÀÇ »óÅÂÇ¥½ÃÁÙÀÇ ¹®ÀÚ¿­À» ¹ÝÈ¯ÇÕ´Ï´Ù.
 */
function GetStatusTitle() 
{
	return window.status;
}