<!--
// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ 
// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå) 

var sendit;

function GetMPlayer(x,y,fn) {
	EmbedStr = "<OBJECT id='MPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' width='" + x + "' height='" + y + "' TYPE='application/x-oleobject' VIEWASTEXT >";
	if(fn)
		EmbedStr += "<param name='FileName' value='" + fn + "'>";
	EmbedStr += "<param name='ShowControls' value='0'>";
	EmbedStr += "<param name='autoStart' value='true'>";
	EmbedStr += "<param name='windowlessVideo' value='false'>";
	EmbedStr += "<param name='uiMode' value='none'>";
	EmbedStr += "<param name='volume' value='100'>";
	EmbedStr += "<param name='stretchToFit' value='true'>";
	EmbedStr += "<param name='autoRewind' value='false'>";
	EmbedStr += "<param name='transparentAtStart' value='true'>";
	EmbedStr += "<param name='enableContextMenu' value='false'>";
	EmbedStr += "</OBJECT>";
	document.write(EmbedStr);
	return;
}

function GetFlash(url,x,y,fn) { 
var EmbedStr;
	EmbedStr = "<object id='" + fn + "' name='" + fn + "' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + x + "' height='" + y + "'>";
	EmbedStr += "<param name='allowScriptAccess' value='always' />";
	EmbedStr += "<param name='movie' value='" + url + "' />";
	EmbedStr += "<param name='quality' value='high' />";
	EmbedStr += "<param name='bgcolor' value='#ffffff' />";
	EmbedStr += "<param name='menu' value='false' />";
	EmbedStr += "<param name='wmode' value='transparent' />";
	EmbedStr += "<param name='allowFullScreen' value='true' />";
	EmbedStr += "<embed id='" + fn + "' name='" + fn + "' src='" + url + "' quality='high' menu='false' wmode='transparent' bgcolor='#ffffff' width='" + x + "' height='" + y + "' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	EmbedStr += "</object>";
	
	document.write(EmbedStr);
	return;
}


function showSelectBoxes(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideSelectBoxes(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}


function goURL(url)
{
	location.href = url;
}


//=================================================================================================================================
// ¿¡µðÅÍ ÀÔ·Â°ª Ã¼Å©
//=================================================================================================================================
function editCheck(obj)
{
	if(!$F(obj))
		return false;
	else
		return true;
	/*
	var oEditor;
	oEditor = FCKeditorAPI.GetInstance(obj) ;
	var div = document.createElement("DIV");
	div.innerHTML = oEditor.GetXHTML();
	if(isNull( div.innerHTML ))
	{
		return false;
		div.innerHTML = "";
	}
	else
		return true;
	*/
}

function isNull( s ) 
{
	if( s == null ) return true; 
	var result = s.replace(/(^\s*)|(\s*$)/g, ""); 
	if(result == "<BR>") result = "";
	if( result )
		return false; 
	else 
		return true; 
}

//=================================================================================================================================
// ÇÊµå°ªÀ¸·Î ¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
// Number Key Only
//=================================================================================================================================
function NKO(obj) {
	// obj : ÇÊµå¸í (ex. document.form.title)
	var checkOK = "0123456789";
	var checkStr = obj.value;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ¼ö ÀÖ½À´Ï´Ù.");
		obj.value = obj.defaultValue;
		obj.focus();
		return;
	}
}


//=================================================================================================================================
// Æ÷ÅÍ½º ÀÚµ¿ ÀÌµ¿
//=================================================================================================================================

function focusMove(obj,len,nxtObj)
{
	if(obj.value.length >= len)
		eval(nxtObj).focus();
}

function search_check(frm)
{
	if(!frm.keyword.value)
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä");
		frm.keyword.focus();
		return false;
	}
}

function isLogin()
{
	if(confirm("·Î±×ÀÎ ÈÄ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù\n\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?"))
		document.footerLoginForm.submit();
}


//=================================================================================================================================
// ÅØ½ºÆ®ÀÇ ¹ÙÀÌÆ®¼ö ÀÚµ¿Ã¼Å©
//=================================================================================================================================
function byte_check(obj,length_limit){
	var length = calculate_msglen(obj.value);
	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÌ¹Ç·Î ÃÊ°úµÈ ±ÛÀÚ¼ö´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		obj.value = obj.value.replace(/\r\n$/, "");
		obj.value = assert_msglen(obj.value, length_limit);
		if($("viewcount"))
			$("viewcount").update(calculate_msglen(obj.value));

		obj.focus();
	}
}

function calculate_msglen(message){
	var nbytes = 0;
	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
			nbytes += 4;
		} else {
			nbytes += 1;
		}
	}
	if($("viewcount"))
		$("viewcount").update(nbytes);
	return nbytes;
}

function assert_msglen(message, maximum){
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	return msg;
}

function pageUpdate(dv,pn,url,par)
{
	var pars = "page=" + pn;
	if (par)
		pars = pars + "&" + par;
	var myAjax = new Ajax.Updater (
		dv,
		url,
		{
			method : "post",
			parameters : pars
		}
	);
}


function SetCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


function DelCookie( name ){
	if(GetCookie(name))
	{
		document.cookie = name + "='';path=/;expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

//¸ÞÀÎ¿¡

function GetCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}

function chkMoney(obj) {
	if(!$(obj).value.isNum())
	{
		$(obj).value = $(obj).value.toNum();
	}
	$(obj).value = parseInt($(obj).value);
	$(obj).value = $(obj).value.toMoney();
}

//=================================================================================================================================
// iFrame ÄÁÅÙÃ÷ ³ôÀÌ ±¸ÇÏ±â, ¸®»çÀÌÁî
//=================================================================================================================================
function IframeResize(id){
    var ifrm = $(id);
    var the_height = ifrm.contentWindow.document.body.scrollHeight+20;
	var the_width = ifrm.contentWindow.document.body.scrollWidth;
	//alert(the_width);
	if(the_height < 1)
		time_id = window.setTimeout("IframeResize('"+id+"')",10);
    ifrm.height = the_height;
}

//=================================================================================================================================
// ÀÌ¹ÌÁö Resize
//=================================================================================================================================

function imgResize(obj,maxWidth)
{
	var w = obj.width;
	var h = obj.height;
	if (w<=0)
		window.setTimeout("imgResize(" + obj + "," + maxWidth + ")",10);
	else 
	{
		if (w > maxWidth)
			obj.width = maxWidth;
	}
}


//=================================================================================================================================
// ÀÌ¹ÌÁö Resize
//=================================================================================================================================

function EditImageResize(obj,maxWidth)
{
	var w = obj.width;
	var h = obj.height;
	if (w<=0) 
		window.setTimeout("EditImageResize("+obj+"," + maxWidth + ")",10);
	else 
	{
		if (w > maxWidth)
			obj.width = maxWidth;
	}
}

//=================================================================================================================================
// ·Î±×ÀÎ Ã¼Å©
//=================================================================================================================================

function loginCheck()
{
	if(!confirm("·Î±×ÀÎ ÈÄ ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù\n\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?"))
		return false;
	document.footerLoginForm.submit();
}



var Editor_Root_Dir = '/htmlEditor/';
var appName = navigator.appName;
var appVersion	= parseFloat(navigator.appVersion.split("MSIE")[1]);
var bitUseEditor;

if(appName != "Microsoft Internet Explorer" || appVersion < 5.5){
	bitUseEditor	= false;
}else{
	bitUseEditor	= true;
}

function uploadCheck()
{
	var f = document.uploadForm;
	var fu = new FormUtil(f);
	if(fu.success())
	{
		$("upButton").update("ÆÄÀÏÀ» µî·ÏÁß ÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä");
		f.submit();
	}
}

function filedel(ele)
{
	$(ele).value = "";
	$(ele + "Info").update ("");
	$(ele + "but").show();
}

function allcheck()
{
	if(document.all.chkbox)
	{
		if(document.all.chkbox.length)
		{
			for(i=0;i<document.all.chkbox.length;i++)
			{
				document.all.chkbox[i].checked = document.all.allchk.checked;
			}
		}
		else
		{
			document.all.chkbox.checked = document.all.allchk.checked;
		}
	}
}


function eleCheck(ele,boxName)
{
	if($(ele).type == "text")
	{
		if(!$F(ele))
		{
			alert(boxName + boxName.josa("À»/¸¦") + " ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä");
			if($(ele).style.display != "none")
				Field.focus(ele);
			return false;
		}
		else
			return true;
	}
}

function postPop (form,url,opt)
{
	var f = eval("document." + form);
	var win = window.open ('', 'postPopup',opt);
	f.target = "postPopup";
	f.method = "post";
	f.action = url;
	f.submit();
	win.focus();
}


function popCenter(w,h)
{
	var wl = (screen.width - w) / 2;
	var wt = (screen.height - h) / 2;
	window.moveTo(wl,wt);
}

function audioON(fn,tname)
{
	if (!top.frames['topFrame'] || !top.frames['mainFrame'] || !top.frames['hidFrame'])
	{
		alert("ÇÁ·¹ÀÓÀÌ Á¸ÀçÇÏÁö ¾Ê¾Æ Àç»ýÇÒ¼ö ¾ø½À´Ï´Ù");
		return false;
	}
	top.topFrame.rows = "*,22";
	top.hidFrame.document.all.MPlayer.FileName = "/UploadFactory/" + fn;
	top.hidFrame.$("mname").update(tname);
	top.hidFrame.$("mps").update ("(Àç»ýÁß)&nbsp;&nbsp;&nbsp;");
}

function retQuery(ars_name)
{
	var Io_result = new Array;
	var Is_url_query = location.search;
	var Io_array1 = new Array;
	var Io_array2 = new Array;
	var i = 0;
	Is_url_query = Is_url_query.slice(1);
	Io_array1 = Is_url_query.split("&");
	for(i=0;i<Io_array1.length;i++)
	{
		Io_array2 = Io_array1[i].split("=");
		Io_result[Io_array2[0]] = Io_array2[i];
	}
	if(Io_result[ars_name] != null)
	{
		return Io_result[ars_name];
	}
	else
	{
		return false;
	}
}


///////////// ¿µ¿ªÀÎ¼â
var initBody;

function beforePrint(){ 
	initBody = document.body.innerHTML; 
	document.body.innerHTML = printContent.innerHTML; 
	} 
function afterPrint(){ 
	document.body.innerHTML = initBody; 
	} 
function printArea() { 
	window.onbeforeprint = beforePrint;  
	window.onafterprint = afterPrint; 
	window.print(); } 


function main_submenu(main_code, subcode) {
	var sub_num, main_num
	main_num=main_code
	sub_num=subcode
	//alert(main_num);
	//alert(sub_num);
	if(main_num=="1"){

		if(sub_num=="1") {
			document.all.Out11.style.display = "";
			document.all.Out12.style.display = "none";
			document.all.Out13.style.display = "none";
			document.all.Out14.style.display = "none";
		
		} else if(sub_num=="2") {
			document.all.Out11.style.display = "none";
			document.all.Out12.style.display = "";
			document.all.Out13.style.display = "none";
			document.all.Out14.style.display = "none";
		
		} else if(sub_num=="3") {
			document.all.Out11.style.display = "none";
			document.all.Out12.style.display = "none";
			document.all.Out13.style.display = "";
			document.all.Out14.style.display = "none";
		
		}else if(sub_num=="4") {
			document.all.Out11.style.display = "none";
			document.all.Out12.style.display = "none";
			document.all.Out13.style.display = "none";
			document.all.Out14.style.display = "";
			
		}  else {
			document.all.Out11.style.display = "";
			document.all.Out12.style.display = "none";
			document.all.Out13.style.display = "none";
			document.all.Out14.style.display = "none";
		}

	}else if(main_num=="2"){
		if(sub_num=="1") {
			document.all.Out21.style.display = "";
			document.all.Out22.style.display = "none";
			document.all.Out23.style.display = "none";
			document.all.Out24.style.display = "none";
		
		} else if(sub_num=="2") {
			document.all.Out21.style.display = "none";
			document.all.Out22.style.display = "";
			document.all.Out23.style.display = "none";
			document.all.Out24.style.display = "none";
		
		} else if(sub_num=="3") {
			document.all.Out21.style.display = "none";
			document.all.Out22.style.display = "none";
			document.all.Out23.style.display = "";
			document.all.Out24.style.display = "none";
		
		}else if(sub_num=="4") {
			document.all.Out21.style.display = "none";
			document.all.Out22.style.display = "none";
			document.all.Out23.style.display = "none";
			document.all.Out24.style.display = "";
			
		}  else {
			document.all.Out21.style.display = "";
			document.all.Out22.style.display = "none";
			document.all.Out23.style.display = "none";
			document.all.Out24.style.display = "none";
		}
	}else if(main_num=="3"){
		if(sub_num=="1") {
			document.all.Out31.style.display = "";
			document.all.Out32.style.display = "none";
			document.all.Out33.style.display = "none";
			document.all.Out34.style.display = "none";
		
		} else if(sub_num=="2") {
			document.all.Out31.style.display = "none";
			document.all.Out32.style.display = "";
			document.all.Out33.style.display = "none";
			document.all.Out34.style.display = "none";
		
		} else if(sub_num=="3") {
			document.all.Out31.style.display = "none";
			document.all.Out32.style.display = "none";
			document.all.Out33.style.display = "";
			document.all.Out34.style.display = "none";
		
		}else if(sub_num=="4") {
			document.all.Out31.style.display = "none";
			document.all.Out32.style.display = "none";
			document.all.Out33.style.display = "none";
			document.all.Out34.style.display = "";
			
		}  else {
			document.all.Out31.style.display = "";
			document.all.Out32.style.display = "none";
			document.all.Out33.style.display = "none";
			document.all.Out34.style.display = "none";
		}
	}else{
			
			document.all.Out11.style.display = "";
			document.all.Out12.style.display = "none";
			document.all.Out13.style.display = "none";
			document.all.Out14.style.display = "none";

			document.all.Out21.style.display = "";
			document.all.Out22.style.display = "none";
			document.all.Out23.style.display = "none";
			document.all.Out24.style.display = "none";

			document.all.Out31.style.display = "";
			document.all.Out32.style.display = "none";
			document.all.Out33.style.display = "none";
			document.all.Out34.style.display = "none";
	
	}
	
}
// -->