	//±âº» ÀÚ¹Ù½ºÅ©¸³Æ®

	// ±âº» ¼³Á¤
	var isDOM = (document.getElementById ? true : false);
	var isIE4 = ((document.all && !isDOM) ? true : false);
	var isNS4 = (document.layers ? true : false);
	var isNS = navigator.appName == "Netscape";

	// ÁöÁ¤µÈ ´ë»óÀ» Ã£´Â´Ù.
	function getRef(id)
	{
		if(isDOM) return document.getElementById(id);
		if(isIE4) return document.all[id];
		if(isNS4) return document.layers[id];
	}

	// ¹®ÀÚ¿­ÀÇ ±æÀÌ
	function strlen(str)
	{
		var len = 0;

		for(i=0; i < str.length; i++)
		{
			var ch = str.charAt(i);
			// 2bytes ¹®ÀÚ
			if(escape(ch).length > 4)
			{
				len += 2;
			}
			// ÁÙ¹Ù²Þ Ç¥½Ã
			else if(ch == '\n')
			{
				if(str.charAt(i-1) != '\r')
					len += 1;
			}
/*
			// HTML ÅÂ±× º¯È¯ (&lt;, &gt;)
			else if(ch == '<' || ch == '>')
			{
				len += 4;
			}
*/
			else
			{
				len += 1;
			}
		}

		return len;
	}

	// Æ¯Á¤±æÀÌÀÌ³»·Î ¹®ÀÚ¿­ ÀÚ¸£±â
	function cut_str(str, limit)
	{
		var new_str = "";
		var len = 0;

		for(i=0; i < str.length; i++)
		{
			var ch = str.charAt(i);
			// 2bytes ¹®ÀÚ
			if(escape(ch).length > 4)
			{
				len += 2;
			}
			// ÁÙ¹Ù²Þ Ç¥½Ã
			else if(ch == '\n')
			{
				if(str.charAt(i-1) != '\r')
					len += 1;
			}
/*
			// HTML ÅÂ±× º¯È¯ (&lt;, &gt;)
			else if(ch == '<' || ch == '>')
			{
				len += 4;
			}
*/
			else
			{
				len += 1;
			}

			if(len > limit)
				break;

			new_str += ch;
		}

		return new_str;
	}

	// ¹öÆ° ¸¸µé±â 
	// <script>button("self.close()", "´Ý±â", "/image/close.gif", "80", "a")</script>
	function button(func, text, icon, width, type)
	{
		if(icon)
			icon = "<img src='" + icon+"' align='absmiddle' border='0'> ";
		else
			icon = "";

		var button_style = "background-color:transparent; color:transparent; cursor:hand; border:none; width:" + width;
		var btn = "";

		if(type == "a")
		{
			// A Type
			btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
			btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
			btn += "    <tr style='height:23px;'>";
			btn += "      <td style='width:5px;' background='/button/button_a_l.gif'></td>";
			btn += "      <td style='font-size:9pt; text-align:center; padding:2 0 0 0;' background='/button/button_a_c.gif'>" + icon + text + "</td>";
			btn += "      <td style='width:5px;' background='/button/button_a_r.gif'></td>";
			btn += "    </tr>";
			btn += "  </table>";
			btn += "</button>";
		}
		else if(type == "b")
		{
			// B Type
			btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
			btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
			btn += "    <tr style='height:22px;'>";
			btn += "      <td style='width:5px;' background='/button/button_b_l.gif'></td>";
			btn += "      <td style='font-size:9pt; text-align:center; padding:2 0 0 0;' background='/button/button_b_c.gif'>" + icon + text + "</td>";
			btn += "      <td style='width:5px;' background='/button/button_b_r.gif'></td>";
			btn += "    </tr>";
			btn += "  </table>";
			btn += "</button>";
		}
		else
		{
			// Default Type
			btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
			btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
			btn += "    <tr style='height:24px;'>";
			btn += "      <td style='width:5px;' background='/button/button_l.gif'></td>";
			btn += "      <td style='font-size:9pt; text-align:center; padding:2 0 0 0;' background='/button/button_c.gif'>" + icon + text + "</td>";
			btn += "      <td style='width:5px;' background='/button/button_r.gif'></td>";
			btn += "    </tr>";
			btn += "  </table>";
			btn += "</button>";
		}

		document.write(btn);
	}

	// ¹Ù·Î°¡±â ¹öÆ° ¸¸µé±â 
	function go_button(url, text, icon, width, type)
	{
		if(url)
		{
			button("document.location.href='" + url + "'", text, icon, width, type);
		}
	}

	// »õÃ¢ ¿­±â
	function open_window(url, title, option)
	{
		window.open(url, title, option);
	}

	// »õÃ¢ ¿­±â
	function newWindow(url, title, option)
	{
		window.open(url, title, option);
	}

	// ¾Ù¹üº¸±â
	function albumWindow(url, title, option)
	{
		window.open(url, title, option + ',top=0,left=0,width=780,height=580,scrollbars=yes,status=yes,resizable');
	}

	// Æ¯Á¤ ÄÚµå Ãâ·Â
	function write_tag(tag)
	{
		document.write(tag);
	}

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	function write_flash(movie, width, height, quality, scale, wmode, FlashVars)
	{
		var tag = "<object width='"+width+"' height='"+height+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0'>";
		tag += "<param name=movie value='"+movie+"'>";

		if(quality != "") tag += "<param name=quality value='"+quality+"'>";
		if(scale != "") tag += "<param NAME=scale VALUE='"+scale+"'> ";
		if(wmode != "") tag += "<param name='wmode' value='"+wmode+"'>";
		if(FlashVars != "") tag += "<param name=FlashVars value='"+FlashVars+"'>";

		tag += "<embed src='"+movie+"' width='"+width+"' height='"+height+"'";
		if(FlashVars != "") tag += " FlashVars='"+FlashVars+"'";
		if(quality != "") tag += " quality='"+quality+"'";
		tag += " pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>";

		tag += "</object>";

		document.write(tag);
	}
