/* vim: set tabstop=4 shiftwidth=4 syntax=javascript: */
var url_base			= "";
var url_common_base		= url_base + "/apps";
var url_admin_base		= url_base + "/admin";
var url_apps_base		= url_base + "/apps";

var iebase				= (navigator.userAgent.indexOf("MSIE") > -1)  ? true : false;

 /* String to Integer */
String.prototype.toInteger = function ()
{
    return this.replace(/[^0-9]/g, "") * 1;
};

/* Add Array Object Prototype inArray */
function inArray (getObj, value)
{
    for (var i=0; i<getObj.length; i++) { if (getObj[i] === value) { return true; } }
    return false;
}
/*

Array.prototype.inArray = function (value)
{
    for (var i=0; i<this.length; i++) { if (this[i] === value) { return true; } }
    return false;
};
*/

/* Add Array Object Prototype remove 
Array.prototype.remove = function (value)
{
    for(var i=0; i<this.length; i++)
    {
        if(value == this[i]) { this.splice(i, 1); }
    }
};
 */
function getLocationUrl (getUrl, getTarget)
{
	if (getUrl == "" || getUrl == "undefined") return;
	if (getTarget == "" || getTarget == undefined)
	{
		self.location.href=getUrl;
	}
	else
	{
		opener.location.href=getUrl;
	}
}
function getLoginFirstFocus ()
{
	if (document.all['id'].value != "") document.all['passwd'].focus();
	else document.all['id'].focus();
}
function openWin(uri, target, width, height, scrollbars, resize, pos)
{
	var xy_pos = "";
	if (pos)
	{
		xy_pos  = ",left=" + (Math.round(screen.width/2) - Math.round(width/2));
		xy_pos += ",top="  + (Math.round(screen.height/3) - Math.round(height/3));
	}
	var remote = window.open(uri, target, "width=" + width +
				",height=" + height +
				",scrollbars=" + scrollbars +
				",resizable=" + resize +
				xy_pos +
				",toolbar=no,location=no" +
				",directories=no,mebar=no");
	remote.focus();
//	return remote;
}

function alertWindow (form, title, message)
{
	var url = "./tools/alert.php";

	// ÀÔ·Â ¿À·ù½Ã º¸¿©ÁÙ °æ°íÃ¢
	if (form != false)
	{
		form.focus();
	}

	message	= (title != '') ? title + " : "  + message : message;
	alert(message);	return;

	var new_message = "";
	for (var i = 0; i < message.length; i++)
	{
		// "\n" -> "<BR />"
		if (message.charAt(i) == "\n") new_message = new_message + "<BR />";
		else if (message.charAt(i) == " ") new_message = new_message + "+";
		else if (message.charAt(i) == "%") new_message = new_message + "%25";
		else if (message.charAt(i) == "&") new_message = new_message + "%26";
		else if (message.charAt(i) == "?") new_message = new_message + "%3F";
		else if (message.charAt(i) == "+") new_message = new_message + "%2B";
		else
		{
			new_message = new_message + message.charAt(i);
		}
	}
	new_message	= (title != '') ? title + " : "  + new_message : new_message;

	var alert_window = openWin(url + "?" + "&title=" + title +
								"&message=" + new_message,
								"", 100, 50, "no", "yes", true);
}

function openWinPOST(post_array, uri, target, width, height, scrollbars, resize, pos)
{
	var win = openWin('', target, width, height, scrollbars, resize, pos);
	win.document.open('text/html', 'replace');
	win.document.charset='euc-kr';
	win.document.writeln('<HTML>');
	win.document.writeln('<HEAD>');
	win.document.writeln('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=euc-kr" />');
	win.document.writeln('</HEAD>');
	win.document.writeln('<BODY>');
	win.document.writeln('<FORM NAME="auto_post" METHOD="POST" ACTION="' + uri + '">');
	for (key in post_array) win.document.writeln('<INPUT TYPE="HIDDEN" NAME="' + key + '" VALUE="" />');
	win.document.writeln('</FORM>');
	win.document.writeln('</BODY>');
	win.document.writeln('</HTML>');
	win.document.close();
	var form = win.document.auto_post;
	for (key in post_array) form[key].value = post_array[key];
	form.submit();
	return win;
}

function lengthByte (str)
{
	// IE, ±ÛÀÚ¼ö ÃøÁ¤½Ã 2byte ¹®ÀÚ °¨¾È
	var len = str.length;
	for (var i=0; i<str.length; i++)
	{
		if (str.charCodeAt(i) > 255) len++;
	}
	return len;
}

function lengthByteEtc (str) 
{
	var tmpStr;
	var onechar;
	var tcount = 0;
	tmpStr = new String(str);

	for ( k = 0; k < tmpStr.length; k++ ) 
	{
		onechar = tmpStr.charAt(k);
		if (tmpStr.charCodeAt(k) >= 128) tcount += 2;
		else if (onechar != '\r' && onechar != '\n')
		{
			tcount++;
		}
	}
	return tcount;
}

function substringByte (str, byte)
{
	// IE, 2byte ¹®ÀÚ¸¦ °¨¾ÈÇÏ¿© ¹®ÀÚ¿­ ºÎºÐ ÃßÃâ
	var len = 0;
	var new_str = "";
	for (var i=0; i<str.length; i++)
	{
		len++;
		if (str.charCodeAt(i) > 255) len++;
		if (byte < len) return new_str;
		else new_str += str.charAt(i);
	}
	return new_str;
}

function substringByteCutException (str, byte) 
{
	var tmpStr1 = new String(str);
	var tmpStr2 = '';
	var onechar, leftchar;
	var tcount = 0;

	for (var k=0; k<tmpStr1.length; k++)
	{
		onechar = tmpStr1.charAt(k);
		if (escape(onechar).length > 4 )
		{
			tcount += 2;
		}
		else if (onechar == '\r' || onechar == '\n')
		{
			/* ¿£ÅÍ °ªÀÌ Á¸Àç ÇÒ¶§ ¹®ÀÚ´Â Ãâ·Â ÇÏ³ª Ä«¿îÅÍ´Â Áõ°¡ ÇÏÁö ¾Ê´Â´Ù */
			tmpStr2 = tmpStr2 + onechar;
			continue;
		} 
		else
		{
			tcount++;
		}

		if (tcount > byte)
		{
			break;
		} 
		else
		{ // ¹Ì´Þ½Ã
			tmpStr2 = tmpStr2 + onechar;
		}
	} // for
	return tmpStr2;
}
function firstFieldFocus (form)
{
	// ÇØ´ç ÀÔ·Â¾ç½ÄÀÇ Ã¹¹øÂ° TEXT Ç×¸ñ ¶Ç´Â PASSWORD Ç×¸ñ¿¡
	// ÀÚµ¿À¸·Î Æ÷Ä¿½º¸¦ ³Ö¾îÁÖ´Â ÇÔ¼ö
	if (typeof(form) == 'undefined') return;
	var count = form.elements.length;
	for (var i=0; i<count; i++)
	{
    	if (form.elements[i].type == "text" || form.elements[i].type == "password")
		{
			if (form.elements[i].value.length == 0) form.elements[i].focus();
			return;
		}
	}
}

function getSelected (select, mode)
{
	// ÇöÀç ¼±ÅÃµÈ SELECT Ç×¸ñÀÇ ¼±ÅÃ°ªÀ» ¾ò´Â ÇÔ¼ö
	if (select == null) return null;
	if (mode == "index") return select.selectedIndex;
	else if (mode == "value") return select.options[select.selectedIndex].value;
	else if (mode == "text") return select.options[select.selectedIndex].text;
}
function getSelectedValue (select) { return getSelected(select, "value"); }
function getSelectedText (select) { return getSelected(select, "text"); }
function getSelectedIndex (select) { return getSelected(select, "index"); }

function setSelected (select, mode, value)
{
	// SELECT Ç×¸ñÁß Æ¯Á¤ OPTION Ç×¸ñÀ» ±âº»ÀûÀ¸·Î ¼±ÅÃ(SELECTED)µÇµµ·Ï ÇÏ´Â ÇÔ¼ö
	if (select == null) return false;
	if (mode == "index")
	{
		select.selectedIndex = value;
		return true;
	}
	else
	{
		for (var i=0; i<select.options.length; i++)
		{
			if ((mode == "value" && select.options[i].value == value) || (mode == "text" && select.options[i].text == value))
			{
				select.selectedIndex = i;
				return true;
			}
		}
	}
	return false
}
function setSelectedByValue (select, value) { return setSelected(select, "value", value); }
function setSelectedByText (select, value) { return setSelected(select, "text", value); }
function setSelectedByIndex (select, value) { return setSelected(select, "index", value); }

function checkboxCheck(form, mode)
{
	for (var i=0; i<form.elements.length; i++)
	{
		var e = form.elements[i];
		if (e.type == "checkbox")
		{
			if (mode == 1) e.checked = true;
			if (mode == 2) e.checked = false;
			if (mode == 3) e.checked = !e.checked;
		}
	}
}
function checkboxAllCheck(form) { checkboxCheck(form, 1); }
function checkboxAllUnCheck(form) { checkboxCheck(form, 2); }
function checkboxReverseCheck(form) { checkboxCheck(form, 3); }

/* select ¿¡¼­ option Ãß°¡ 
 * form		=> document.FORM_NAME.SELECT_NAME
 * getTexts	=> option TEXT
 * getVals	=> option VALUE
*/
function addSelectOption (form, getVals, getTexts)
{
	var len = form.options.length;
    form.options[len]    = new Option(getTexts, getVals);
}
/* select ¿¡¼­ option Á¦°Å
 * form		=> document.FORM_NAME.SELECT_NAME
 * getFlag	=> ÃÖ¼Ò ´ÜÀ§¸¦ »èÁ¦ ÇÒ°ÍÀÎ°¡? °ªÀÌ ÀÖÀ¸¸é ºÒ°¡´É
*/
function removeSelectOption (form, getFlag)
{
	var Lens = form.length;
	if (getFlag)
	{
		if (Lens < 2)
		{
			alertWindow("", "", "ÃÖ¼Ò °ªÀº »èÁ¦ ÇÒ¼ö ¾ø½À´Ï´Ù.");
			return false;
		}
	}
    if (form.selectedIndex >= 0) form.options[form.selectedIndex] = null;
    if (form.options.length > 0) form.selectedIndex = 0;
}
function removeSelectOptionAll (form, minIndex)
{
	for (var i=form.options.length-1; i>=minIndex; i--)
	{
		form.options[i] = null;
	}
}
function removeSelectOptionByValue (form, value)
{
	for (var i=form.options.length-1; i>=0; i--)
	{
		if (form.options[i].value == value)
		{
			form.options[i] = null;
			if (form.options.length > 0) form.selectedIndex = 0;
		}
	}
}

/**
 *	»õÃ¢À¸·Î ½ÇÇà ÇÏ°íÀÚ ÇÒ¶§ ¹Ì¸® »õÃ¢ ¶ç¿ì´Â function 
 *	---------------------------------------------------
 *	@param			windowName		new window name
 *					newWidth		new window width value
 *					newHeight		new window height value
 *	@return			boolean
 *	DATE			2003/12/30
 *	made			CHRIS
 */
function openNewWindow (windowName, newWidth, newHeight)
{
	var win = openWin("", windowName, newWidth, newHeight, "NO", "NO", true);
	if (typeof(win) != "object") return false;
	return true;
}

/**
 *	added input element
 *	-------------------------------------
 *	@param			type		tag type
 *					name		tag name
 *					value		tag value
 *	@return			Object
 *	DATE			2004/01/08
 *	made			CHRIS
 */
function makeInputElement (type, name, value)
{
	if (type == null || name == null) alertWindow("", "", "makeInputElement call error");

	var type = type;
	var name = name;
	var value = value;

	var tmp_object = document.createElement("INPUT");
	tmp_object.setAttribute("type", type);
	tmp_object.setAttribute("name", name);
	tmp_object.setAttribute("id", name);
	tmp_object.setAttribute("value", value);
	return tmp_object;
}

/**
 *	IMAGE CHANGE
 *	-----------------------------------------------
 *	@param			imgCode			img code number
 *					imgName			img name
 *	@return			void
 *	DATE			2004/04/28
 */
function getImgChange (imgCode, imgName)
{	
	if (imgCode == null || imgName == null) return;
	eval("document.getElementById(" + imgCode + ").src = '/img/" + imgName + ".gif'");
}

/**
 *	Next Element
 *	-----------------------------------------------------
 *	@param			thisNode		target Node
 *	@return			object
 *	DATE			2004/04/28
 *	made			CHRIS
 *	TODO : ÀÎµ¦½º¿Í ½ºÅÜÀ» Áà¼­ ¾ÕµÚ·Î °Ë»ö °¡´É ÇÏ°Ô ¸¸µéÀÚ..^^;;
 */
function getNextElement (thisNode)
{
	if (typeof(thisNode) != "object") return;

	var pNode = thisNode.parentNode;

	for (var i=0; i<pNode.length; i++)
	{
		if (pNode.elements[i].name == thisNode.name && i < (pNode.length - 1))
		{
			return pNode.elements[i+1];
		}
	}
}

/**
 * INPUT BOX BACKGROUND CLEAR AND CHANGE
 * ---------------------------------------------------
 * @param			getName			INPUT NAME
 *					getNextImg		INPUT BACKGROUND
 * @return			void
 */
function bgClear(getName, getNextImg)
{	
	var urlBackground;

	//if (getNextImg == null) urlBackground = "url('')";
	if (typeof(getNextImg) == 'undefined') urlBackground = "url('')";
	else urlBackground = "url('" + getNextImg + "')";

	document.getElementById(getName).style.backgroundImage = urlBackground;	
}

/**
 *	VALUE °ª¿¡ COMMA(,) Ãß°¡ÇÏ±â
 *	--------------------------------
 *	@param			object			º¯°æÇÒ INPUT TYPE
 *	@return			object			º¯°æµÈ INPUT TYPE
 *	@date			2004/05/13
 *	@made			CHRIS
 */
function addCommaDirect (obj)
{
	var input_str	= obj.getAttribute("value");
	if (input_str == "") return;

	var tmp_array	= new Array();
	tmp_array	= input_str.split(",");
	input_str	= tmp_array.join("");
	input_str	= parseInt(input_str);
	input_str	= input_str.toString();

	var sliceChar	= ",";
	var step		= 3;

	var step_increment	= -1;
	var tmp		= "";
	var retval	= "";
	var str_len	= input_str.length;
	for (var i=str_len; i>=0; i--)
	{
		tmp = input_str.charAt(i);
		//if (tmp == sliceChar) continue;
		if (step_increment%step == 0 && step_increment != 0) retval = tmp + sliceChar + retval;
		else retval = tmp + retval;
		step_increment++;
	}

	obj.setAttribute("value", retval);
}
function objectWriter (getID, obj_type, id, src, width, height, transparent, getTitle, ShowStatusBar, ShowControls)
{
	var getTransparentMsg	= "";
	var getTransparentPMsg	= "";
	if (transparent == '' || typeof transparent == 'undefined') transparent = false;
			
	if (transparent === true)
	{
		getTransparentMsg	= "wmode='transparent'";
		getTransparentPMsg	= "<param name='wmode' value='Transparent' />";
	}		
	obj = [];
	switch (obj_type)
	{
		case "flash":
				obj[obj.length] = "<object id='" + id + "' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='" + width + "' height='" + height + "'>";
				obj[obj.length] = "<param name='movie' value='" + src + "'>";
				obj[obj.length] = "<param name='menu' value='false'>";
				obj[obj.length] = "<param name='quality' value='high'>";		
				if (transparent === true) obj[obj.length] = getTransparentPMsg;		
				obj[obj.length] = "<param name='title' value='" + getTitle + "'>";
				if (transparent === true) obj[obj.length] = "<param name='wmode' value='transparent'>";
				obj[obj.length] = "<embed src='" + src + "' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' width='" + width + "' height='" + height + "' " + getTransparentMsg + "></embed>";
				obj[obj.length] = "</object>";
				obj = obj.join('\n');
		break;
		case "movie":
				ShowStatusBar	= (typeof(ShowStatusBar) == "undefined") ? "false" : ShowStatusBar;
				ShowControls	= (typeof(ShowControls) == "undefined") ? "true" : ShowControls; 
				obj[obj.length] = "<OBJECT classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' id='" + id + "' height='" + height + "' width='" + width + "' align='middle' standby='Loading Windows Media Player components...' VIEWASTEXT>"
				obj[obj.length] = "<param name='allowScriptAccess' value='always' />";
				obj[obj.length] = "<param name='allowNetworking' value='all' />";
				obj[obj.length] = "<param name='enableHtmlAccess' value='true' />";
				obj[obj.length] = "<param name='AllowHtmlPopupwindow' value='true' />";
				obj[obj.length] = "<param name='allowFullScreen' value='true' />";
				obj[obj.length] = "<param name='invokeURLs' value='false' />";
				obj[obj.length] = "<param name='enablehref' value='false' />";
				obj[obj.length] = "<param name='enablejavascript' value='false' />";
				obj[obj.length] = "<param name='nojava' value='true' />";
				obj[obj.length] = "<param name='windowless' value='true' />";
				if (transparent === true) obj[obj.length] = getTransparentPMsg;
				obj[obj.length] = "<PARAM NAME='_cx' VALUE='13229'>";
				obj[obj.length] = "<PARAM NAME='_cy' VALUE='10795'>";
				obj[obj.length] = "<PARAM NAME='FlashVars' VALUE=''>";
				obj[obj.length] = "<PARAM NAME='Movie' VALUE='" + src + "'>";
				obj[obj.length] = "<PARAM NAME='filename' VALUE='" + src + "'>";
				obj[obj.length] = "<PARAM NAME='Play' VALUE='0'>";
				obj[obj.length] = "<PARAM NAME='Loop' VALUE='-1'>";
				obj[obj.length] = "<PARAM NAME='Quality' VALUE='High'>";
				obj[obj.length] = "<PARAM NAME='SAlign' VALUE='LT'>";
				obj[obj.length] = "<PARAM NAME='EnableContextMenu' VALUE='false'>";				
				obj[obj.length] = "<PARAM NAME='Menu' VALUE='false'>";
				obj[obj.length] = "<PARAM NAME='Base' VALUE=''>";
				obj[obj.length] = "<PARAM NAME='Scale' VALUE='NoScale'>";
				obj[obj.length] = "<PARAM NAME='ShowStatusBar' VALUE='" + ShowStatusBar + "'>";
				obj[obj.length] = "<PARAM NAME='ShowControls' VALUE='" + ShowControls + "'>";
				obj[obj.length] = "<PARAM NAME='ShowDisplay' VALUE='false'>";
				obj[obj.length] = "<PARAM NAME='DeviceFont' VALUE='0'>";
				obj[obj.length] = "<PARAM NAME='EmbedMovie' VALUE='0'>";
				obj[obj.length] = "<PARAM NAME='BGColor' VALUE='000000'>";
				obj[obj.length] = "<PARAM NAME='SWRemote' VALUE=''>";
				obj[obj.length] = "<PARAM NAME='MovieData' VALUE=''>";
				obj[obj.length] = "<PARAM NAME='SeamlessTabbing' VALUE='1'>";
				obj[obj.length] = "<PARAM NAME='Profile' VALUE='0'>";
				obj[obj.length] = "<PARAM NAME='ProfileAddress' VALUE=''>";
				obj[obj.length] = "<PARAM NAME='ProfilePort' VALUE='0'>";
				obj[obj.length] = "<PARAM NAME='ShowPositionControls' VALUE='false'>";
				obj[obj.length] = "<embed ";
				obj[obj.length] = "src='" + src + "' ";
				obj[obj.length] = "width='" + width + "' ";
				obj[obj.length] = "height='" + height + "' ";
				obj[obj.length] = "name='" + id + "' ";
				obj[obj.length] = "ShowStatusBar='" + ShowStatusBar + "' ";
				obj[obj.length] = "ShowControls='" + ShowControls + "' ";
				obj[obj.length] = "ShowDisplay='false' ";
				obj[obj.length] = "autostart='true' ";
				obj[obj.length] = "invokeURLs='false' ";
				obj[obj.length] = "allowScriptAccess='always' ";
				obj[obj.length] = "allowFullScreen='true' ";
				obj[obj.length] = "allowNetworking='all' ";
				obj[obj.length] = "enableHtmlAccess='true' ";
				obj[obj.length] = "AllowHtmlPopupwindow='false' ";
				obj[obj.length] = "quality='high' ";
				obj[obj.length] = getTransparentMsg + " ";
				obj[obj.length] = "align='middle' ";
				obj[obj.length] = "type='application/x-shockwave-flash' ";
				obj[obj.length] = "pluginspage='http://www.macromedia.com/go/getflashplayer' ";
				obj[obj.length] = ">";
				obj[obj.length] = "</embed>";
				obj[obj.length] = "</OBJECT>";
				obj = obj.join('\n');
		break;
	}
	if (getID != '' && typeof(document.getElementById(getID)) != 'undefined') document.getElementById(getID).innerHTML = obj;
	else document.write(obj);
}
// ¼±ÅÃ¹Ú½º ÀÏ°ýÃ³¸®
function batchChk (self, obj)
{
	var chkflag	= false;
	if (typeof obj == null || typeof obj == 'undefined')
	{
		alert('¼±ÅÃ Á¤º¸°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.');
		return;
	}
	else
	{
		if (typeof obj.length == 'undefined')
		{
			obj.checked = (obj.checked) ? false : true;
		}
		else
		{
			if (self.type == "checkbox")
			{
				chkflag = self.checked;
				for (var i=0; i<obj.length; i++)
				{
					obj[i].checked = chkflag;
				}
			}
			else
			{
				for (var i=0; i<obj.length; i++)
				{
					if (obj[i].checked == true) { chkflag = true; break; }
				}
				for (var i=0; i<obj.length; i++)
				{
					obj[i].checked = (chkflag) ? false : true;
				}
			}
		}
	}
}

// ¼±ÅÃ¹Ú½º ÀÏ°ýÃ³¸®
function allChkbox (self)
{
	var chkflag	= self.checked;
	var obj		= document.getElementsByTagName("input");
	for (var i=0; i<obj.length; i++)
	{
		if (obj[i].type == "checkbox")
		{
			obj[i].checked = chkflag;
		}
	}
}

function setShowTopMenu(choice, getCount)
{
	if (typeof(getCount) == "undefined" || getCount == "")
	{
		getCount = 6;
	}
	var obj	= null;
	try
	{
		for (var i=1; i<=getCount; i++)
		{
			obj	= eval("document.getElementById('top_menu_sub0" + i + "')");
			if (choice == i)
			{
				obj.style.left	= '0';
				obj.style.display	= 'inline';
			}
			else obj.style.display	= 'none';
		}
	}
	catch(e)
	{
		for (var i=1; i<=getCount; i++)
		{
			obj					= eval("document.getElementById('top_menu_sub0" + i + "')");
			obj.style.display	= 'none';
		}
	}
	
}
function setCloseTopMenu (obj) 
{	
	var element;
	element					= eval("document.getElementById('top_menu_sub0" + obj + "')");
	element.style.display	= 'none';
//	document.getElementById('top_menu_bg').style.display	= "none";
}

function getMessageLengthException (form, getLength, getTitle)
{
    var leng    = (typeof(getLength) == "undefined" || getLength == '') ? 1000 : getLength;
    var leng_han= Math.ceil(leng/2);
        
    var str     = lengthByteEtc(form.value);
	getTitle	= (typeof(getTitle) != "undefined" && getTitle != '') ? getTitle + " " : "";
    if (str > leng)
    {   
        alertWindow(form, '', getTitle + '¸Þ¼¼Áö´Â \n\n[ÇÑ±Û : ' +  leng_han + 'ÀÚ]\n[¿µ¹® ¼ýÀÚ : ' + leng + 'ÀÚ]\n\nÀÌÇÏ·Î ÀÔ·Â ÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
        form.value = substringByteCutException(form.value, leng);
        return false;                                       
    }   
}

function getMessageLength (form, getLength, getTitle)
{
    var leng    = (typeof(getLength) == "undefined" || getLength == '') ? 1000 : getLength;
    var leng_han= Math.ceil(leng/2);
        
    var str     = lengthByte(form.value);
	getTitle	= (typeof(getTitle) != "undefined" && getTitle != '') ? getTitle + " " : "";
    if (str > leng)
    {   
        alertWindow(form, '', getTitle + '¸Þ¼¼Áö´Â \n\n[ÇÑ±Û : ' +  leng_han + 'ÀÚ]\n[¿µ¹® ¼ýÀÚ : ' + leng + 'ÀÚ]\n\nÀÌÇÏ·Î ÀÔ·Â ÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
        form.value = substringByte(form.value, leng);
        return false;                                       
    }   
}

function MM_swapImage() 
{
	//v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_jumpMenu(targ,selObj,restore)
{ 
	//v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}
function MM_swapImgRestore() 
{
	//v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() 
{
	//v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) 
{ //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) 
	{
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function setPng24(obj) 
{
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}

function select_open(popup) {
	if (popup.options[popup.selectedIndex].value != "")
	{
		window.open(popup.options[popup.selectedIndex].value, '_blank');
		popup.selectedIndex=0;
	}
}
function getMovieView (getCode, width, height)
{
	var getUrl	= "/apps/movie_view.php?code=" + getCode;

	openWin(getUrl, '_getMovieView', width, height, 'no', 'no', true)
}

