/**
	Biznetpia Framework JavaScript
	Copyright¨Ï 2005 Biznetpia All rights reserved.

	Author : Myung-Gwang Kim
	Homepage : http://www.biznetpia.com
*/
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 && a[i] != ""){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_findObj(n, d) { //v4.010
  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 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 getDateStr(year, month, day, sdate)
{
    var d = new Date(parseInt(sdate.substring(0, 4)) + year, Number(sdate.substring(5, 7))-1 + month, Number(sdate.substring(8, 10))+day, 0, 0, 0, 0);
    
    return d.getYear() + "-" + lpad(d.getMonth()+1, 2, "0") + "-" + lpad(d.getDate(), 2, "0");

}

/*
    ¿äÀÏ°ªÀ» ¸®ÅÏ
    @return int 0 ~ 6 : ÀÏ ~ Åä
*/
function getYoil(sdate)
{
    var d = new Date(parseInt(sdate.substring(0, 4)), Number(sdate.substring(5, 7))-1, Number(sdate.substring(8, 10)), 0, 0, 0, 0);

    return d.getDay();
}

function printStr(str)
{
    document.write(str);
}

function checkTextfield(obj, errorMsg)
{
	if(obj.value.length == 0)
	{
		alert(errorMsg);
		obj.focus();
		return false;
	}
	else return true;
}

function checkRadio(obj, value)
{
    if(obj.length == null)
    {
        if(obj.value == value) obj.checked = true;
    }
    else
    {
        for(var i=0 ; i<obj.length ; i++)
        {
            if(obj[i].value == value) 
            {
                obj[i].checked = true;
                return;
            }
            
        }
    }
}

function checkSelect(obj, errorMsg, errorIndex)
{
	if(obj.selectedIndex == errorIndex)
	{
		alert(errorMsg);
		obj.focus();
		return false;
	}
	else return true;
}

function goURL(url)
{
	location.href = url;
}

function joinArray(arr, separator)
{
    if(arr == null) return "";

    var str = "";
    for(var i=0 ; i<arr.length ; i++)
    {
        if(i != arr.length-1) str += arr[i] + separator;
        else str += arr[i];
    }

    return str;
}

function popupWindow(url, name, width, height)
{
	var w = window.open(
							url, 
							name, 
							"width=" + width + ",height=" + height + ", scrollbars=yes, status=no"
							);
	if(w != null) w.focus();
	return w;
}

function openPopup2(url, name, width, height, top, left, scrollbars, resizable)
{
	if(scrollbars == null) scrollbars = "no";
	if(resizable == null) resizable = "no";
	var w = window.open(
							url, 
							name, 
							"width=" + width + 
							",height=" + height + 
							", scrollbars=" + scrollbars + 
							", status=yes, resizable=" + resizable + 
							", top=" + top + 
							", left=" + left
							);
	if(w != null) w.focus();
	return w;
}

function openPopup(url, name, width, height, scrollbars, resizable)
{
	if(scrollbars == null) scrollbars = "no";
	if(resizable == null) resizable = "no";

	var top = window.screen.Height/2 - height/2 -20;
    var left = window.screen.Width/2 - width/2;

	var w = window.open(
							url, 
							name, 
							"width=" + width + ",height=" + height + ", scrollbars=" + scrollbars + ", status=yes, resizable=" + resizable + 
							", top=" + top + ", left=" + left
							);
	if(w != null) w.focus();
	return w;
}

function msg(m)
{
	alert(m);
}

function checkBusinessNum(vencod){

    var sum = 0;
    var getlist =new Array(10);
    var chkvalue =new Array("1","3","7","1","3","7","1","3","5");

    for (var i=0;i<10;i++){ 
        getlist[i] = vencod.substring(i,i+1);
    }

    for (var i=0;i<9;i++){ 
        sum += getlist[i]*chkvalue[i];
    }
    sum = sum +parseInt((getlist[8]*5)/10) ;
    sidliy = sum%10;
    sidchk = 0;

    if ( sidliy != 0 ) { 
        sidchk = 10 - sidliy; 
    } else { 
        sidchk = 0; 
    }

    if ( sidchk != getlist[9] ) {
        return false;
    }
    return true;
}

function checkTextfieldForEmail(obj, errorMsg) 
{
	var strng = obj.value;
	re1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	re2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
	if( re1.test(strng) || !re2.test(strng) ) 
	{
		if(errorMsg != null && errorMsg != "") 
		{
			alert(errorMsg);
			obj.focus();
		}
		return false;
	}
	else return true;
}

function setCookie( name, value, expiredays ) 
{ 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

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 checkTextfieldForNumber(obj, errorMsg) 
{
	var strng = obj.value;

	if (strng.length==0 || isNaN(strng)) 
	{
		alert(errorMsg);
		obj.focus();
		return false;
	}
	else return true;
}


function checkTextfieldForSSN(obj1, obj2, errorMsg)
{
	if(errorMsg == null) errorMsg = "ÁÖ¹Îµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.";
	if(!checkSSN(obj1.value, obj2.value))
	{
		alert(errorMsg);
		obj1.focus();
		return false;
	}
	else return true;
}

/**
	ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
*/
function checkSSN(idn1, idn2) 
{
	var strng = idn1 + "-" + idn2;
	if(idn2 == null) strng = idn1;

	re = /^[0-9]{6}-?[0-9]{7}$/;
	if (!re.test(strng)) return false;

	strng_new = strng.replace("-","");
	var year   = parseInt(strng_new.substr(0,2),10);
	var month  = parseInt(strng_new.substr(2,2),10);
	var day    = parseInt(strng_new.substr(4,2),10);
	var gender = parseInt(strng_new.charAt(6)  ,10);
	if ( month<1 || month>12 || gender<1 || gender>4 ) return false;

	var arrayOfLasts = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if(month==2) {
		year += (gender<3 ? 1900 : 2000);
		if(leapyear(year)) arrayOfLasts[1] = 29;
	}
	if(day<1 || day>arrayOfLasts[month-1]) return false;

	var tmp = 0;
	for(var n=0; n<12; n++) tmp += (n%8+2) * parseInt(strng_new.charAt(n),10);
	tmp = (11-(tmp%11))%10;
	if (tmp != strng_new.charAt(12)) return false;
	return true;
}

function trim(str) {
	var i = 0;
	var j = 0;
	
	if (str == null || str == "" || str == "undefined")
		return "";
		
	var len = str.length;

	for (i=len - 1; i >= 0; i--) {
		if (str.charAt(i) != " " && str.charCodeAt(i) != 160) break;
	}

	for (j=0; j < i; j++) {
		if (str.charAt(j) != " " && str.charCodeAt(j) != 160) break;
	}

	return str.substring(j, i + 1);
}

function lpad(str, leng, repChar) {
    str = new String(str);
	for(var i=str.length; i<leng; i++) str = repChar + str;
    return str;
}

function rpad(str, leng, repChar) {
    for(var i=str.length; i<leng; i++)
        str=str+repChar;
    return str;
}

function returnMsg(msg, obj, ret)
{
	if(msg != "") alert(msg);
	if(obj != null) obj.focus();
	return ret;
}

function makeComma(checkText)
{
	checkText = new String(parseNumber(checkText));
	var len = checkText.length;
	var str = checkText;
	if(len < 4)
	{
		return str;
	}
	else if (len == 4)
	{
		str = checkText.substr(0,1) + "," + checkText.substr(1,len);
		return str;
	}
	else if(len == 5)
	{
		str = checkText.substr(0,2) + "," + checkText.substr(2,len);
		return str;
	}
	else if(len == 6)
	{
		str = checkText.substr(0,3) + "," + checkText.substr(3,len);
		return str;
	}
	else if(len == 7)
	{
		str = checkText.substr(0,1) + "," + checkText.substr(1,3) + "," + checkText.substr(4,len);
		return str;
	}
	else if(len == 8)
	{
		str = checkText.substr(0,2) + "," + checkText.substr(2,3) + "," + checkText.substr(5,len);
		return str;
	}
	else if(len == 9)
	{
		str = checkText.substr(0,3) + "," + checkText.substr(3,3) + "," + checkText.substr(6,len);
		return str;
	}
	else if(len == 10)
	{
		str = checkText.substr(0,1) + "," + checkText.substr(1,3) + "," + checkText.substr(4,3) + "," + checkText.substr(7,len);
		return str;
	}
	else if(len == 11)
	{
		str = checkText.substr(0,2) + "," + checkText.substr(2,3) + "," + checkText.substr(5,3) + "," + checkText.substr(8,len);
		return str;
	}
	else if(len == 12)
	{
		str = checkText.substr(0,3) + "," + checkText.substr(3,3) + "," + checkText.substr(6,3) + "," + checkText.substr(9,len);
		return str;
	}
	else if(len > 12)
	{
		alert("ÇöÀçÀÔ·ÂµÈ °ªÀ» È®ÀÎÇÏ¼¼¿ä!" + '\n' + "°è»êµÈ °ªÀÌ 1Á¶ÀÌ»óÀÔ´Ï´Ù!");
		return checkText;
	}
}

function remove(str, gubun)
{
	return str.split(gubun).join("");
}

function replace(str, gubun, rep)
{
	return str.split(gubun).join(rep);
}

function getRadioValue(obj)
{
	if(obj.length == undefined) 
	{
		if(obj.checked) return obj.value;
		else return null;
	}

	for(var i=0 ; i<obj.length ; i++)
	{
		if(obj[i].checked) return obj[i].value;
	}

	return null;
}

/**
	checkbox¿¡ checkedµÈ °ªÀ» ¹è¿­ÇüÅÂ·Î ¸®ÅÏ
	Ã¼Å©°¡ 1°³µÇ¾úµç, ±× ÀÌ»óÀÌµç, ÇÏ³ªµµ ¾ÈµÇ¾úµç ¹«Á¶°Ç ¸®ÅÏÇüÀº ¹è¿­ÀÌ´Ù.
*/
function getCheckBoxValue(obj)
{
	var ret = new Array();
	if(obj == null) return ret;

	if(obj.length == undefined) 
	{
		if(obj.checked) ret[0] = obj.value;
	}
	else
	{
		var j=0;
		for(var i=0 ; i<obj.length ; i++) 
		{
			if(obj[i].checked) ret[j++] = obj[i].value;
		}
	}

	return ret;
}


/**
	¶óµð¿À ¹öÆ°ÀÏ¶§ À¯¿ëÇÑ ÇÔ¼ö.
	ÇØ´ç Ç×¸ñÀÌ Ã¼Å©°¡ µÇ¾î ÀÖµç, ¾ÈµÇ¾î ÀÖµç°£¿¡ ¹«Á¶°Ç checked¼Ó¼ºÀ» true·Î ¼³Á¤ÇÑ´Ù.
*/
function check(obj, value)
{
	if(obj == null) return;
	if(obj.length == undefined)
	{
		if(obj.value == value) obj.checked = true;
	}
	else
	{
		for(var i=0 ; i<obj.length ; i++)
		{
			if(obj[i].value == value) 
			{
				obj[i].checked = true;
				return;
			}
		}
	}
}


/**
	Ã¼Å©¹Ú½ºÀÏ¶§ À¯¿ëÇÑ ÇÔ¼ö.
	ÇØ´ç Ç×¸ñÀÌ Ã¼Å©°¡ µÇ¾î ÀÖÀ¸¸é ÇØÁ¦ÇÏ°í, Ã¼Å©¾ÈµÇ¾î ÀÖÀ¸¸é Ã¼Å©ÇÏµµ·Ï ÇÑ´Ù.
*/
function check2(obj, index)
{
	if(obj == null) return;
	if(obj.length == undefined)
	{
		if(index == 0) obj.checked = !obj.checked;
	}
	else
	{
		for(var i=0 ; i<obj.length ; i++)
		{
			if(i == index) 
			{
				obj[i].checked = !obj[i].checked;
				return;
			}
		}
	}
}

/**
	Ã¼Å©¹Ú½º¿¡¼­ Ã¼Å©µÇ¾î ÀÖ´Â ³ðÀº Ã¼Å©ÇØÁ¦ÇÏ°í Ã¼Å© ¾ÈµÈ¾ÖµéÀº Ã¼Å©ÇÑ´Ù.
*/
function checkAll2(obj)
{
	if(obj == null) return;
	if(obj.length == undefined)
	{
		obj.checked = !obj.checked;
	}
	else
	{
		for(var i=0 ; i<obj.length ; i++)
		{
			obj[i].checked = !obj[i].checked;
		}
	}
}

/**
	@params
	name : "id" attribute name
	display : "display" attribute value
*/
function setDisplay(name, display)
{
	var obj = document.all[name];
	if(obj == null) obj = document.frm[name];
	if(obj == null) obj = document.images[name];

	if(obj == null)
	{
		alert("function[setDisplay] ERROR : Object(" + name + ") is NULL!!");
		return;
	}
	
	obj.style.display = display;
}


function leapyear(year) 
{
	if (((year%4 == 0) && (year%100 != 0)) || (year%400 == 0)) return true;
	else return false;
}

function getLastDay(month, year)
{
	var days;
	month = month-1;
	switch (month)
	{
		case 0 : days=31; break;
		case 1 : if (leapyear(year)) days=29;
					else days=28;
					break;
		case 2 : days=31; break; 
		case 3 : days=30; break;
		case 4 : days=31;  break;
		case 5 : days=30;  break;
		case 6 : days=31;  break;
		case 7 : days=31;  break;
		case 8 : days=30;  break;
		case 9 : days=31;  break;
		case 10 : days=30;  break;
		case 11 : days=31;  break;
	}
	return days;
}

function initCombo(obj)
{
	while(obj.options.length > 0)
	{
		obj.options[obj.options.length-1] = null;
	}
}

function addOption(obj, value, text, is_selected)
{
	var index = obj.options.length;
	obj.options[index] = new Option(text, value);
	if(is_selected) obj.options[index].selected = true;

	return obj.options[index];
}

function setText(name, text)
{
	document.getElementById(name).innerHTML = text;
}

function getDisplay(name)
{
	var obj = document.getElementById(name);
	if(obj == null) obj = frm[name];
	if(obj == null) alert("ERROR : '" + name + "' is null !!!");

	return obj.style.display;
}

function checkAll(obj, value)
{
	if(obj == null) return;
	if(obj.length == undefined) 
	{
		obj.checked = value;
		return;
	}

	for(var i=0 ; i<obj.length ; i++)
	{
		obj[i].checked = value;
	}
}

/**
	¶óµð¿À¹öÆ°, Ã¼Å©¹Ú½ºÀÇ Ã¼Å©¿©ºÎ¸¦ È®ÀÎÇÑ´Ù.
*/
function is_checked(obj)
{
	if(obj == null) return false;

	if(obj.length == undefined) return obj.checked;

	for(var i=0 ; i<obj.length ; i++)
	{
		if(obj[i].checked) return true;
	}

	return false;
}

function parseNumber(num)
{
	num = new String(num);
	num = remove(num, ",");
	if (num.length==0 || isNaN(num)) return 0;
	return Number(num);
}

function setReadOnlyAll(form_name, is_readonly)
{
	var formObj = document.forms[form_name];
	var obj, tagName, type;

	for(var i=0 ; i<formObj.elements.length ; i++)
	{
		obj = formObj.elements[i];
		tagName = obj.tagName;
		type = obj.type.toUpperCase();
		if(	tagName == "TEXTAREA" || 
			(tagName == "INPUT" && (type == "PASSWORD" || type == "TEXT")))
		{
			obj.readOnly = is_readonly;
		}
	}
}

function setDisabledAll(form_name, is_disable)
{
	var formObj = document.forms[form_name];
	var obj, tagName, type;

	for(var i=0 ; i<formObj.elements.length ; i++)
	{
		obj = formObj.elements[i];
		tagName = obj.tagName;
		type = obj.type.toUpperCase();
		if(	tagName == "TEXTAREA" || 
			tagName == "SELECT" ||
			(tagName == "INPUT" && (type == "PASSWORD" || type == "TEXT" || type == "FILE" || type == "RADIO" || type == "CHECKBOX")))
		{
			obj.disabled = is_disable;
		}
	}
}

function openModal(url, width, height, arg)
{
	if(arg == null) arg = window;
	var ret = showModalDialog(url, arg, "dialogWidth:" + width + "px; dialogHeight:" + height + "px; center=yes; screenTop=yes; scroll=auto; status=yes; help=yes;");
	return ret;
}

function openModal2(url, width, height, arg)
{
	if(arg == null) arg = window;
	var arr = url.split("?");

	url = frm.document_root.value + "inc/modal.jsp?submit_page=" + arr[0] + "&" + arr[1];
	var ret = showModalDialog(url, arg, "dialogWidth:" + width + "px; dialogHeight:" + height + "px; center=yes; screenTop=yes; scroll=auto; status=yes; help=yes;");
	return ret;
}

/**
	obj°´Ã¼ÀÇ display style¼Ó¼ºÀ» hidden, inline À¸·Î ¼³Á¤ÇÕ´Ï´Ù.
*/
function setVisible(obj, is_show)
{
	var display = "none";
	if(is_show) display = "inline";
	if(obj == null || obj.style == null) 
	{
		alert("ERROR : setVisible()\nÀÎ¼ö obj´Â style¼Ó¼ºÀ» °®Áö ¾Ê°Å³ª NULLÀÔ´Ï´Ù.");
		return;
	}
	obj.style.display = display;
}

function nvl(value, rep)
{
	if(value == null || trim(value) == "") return rep;
	return value;
}

function setVisible2(name, is_show)
{
	var display = "none";
	if(is_show) display = "inline";

	var obj;
	if(document.all[name] == null)
	{
		if(frm[name] == null)
		{
			if(document.images[name] == null)
			{
				alert("ERROR : Method setVisible2(), NAME is " + name + " and is_show is " + is_show);
				return;
			}
			else obj = document.images[name];
		}
		else obj = frm[name];
	}
	else obj = document.all[name];
	
	obj.style.display = display;
}

/**
	ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ObjectÀÇ ´ÙÀ½ Æ÷Ä¿½º Object¸¦ Ã£¾Æ¼­ Æ÷Ä¿½º¸¦ ÀÌµ¿ÇÑ´Ù.
	obj : ±âÁØÀÌ µÇ´Â Object
*/
function nextFocus(obj)
{
    var is_find = false;
    var tagName, type;
    
    for(var i=0 ; i<frm.elements.length ; i++)
    {
        var o = frm.elements[i];

        if(o == obj) 
        {
            is_find = true;
            continue;
        }
        if(is_find)
        {
            tagName = o.tagName.toUpperCase();
            type = o.type.toUpperCase();

            if(o.disabled || (tagName == "INPUT" && type == "HIDDEN") || o.style.display == "hidden") continue;
            try{o.focus();}
			catch(e){continue;}
            break;
        }
    }
}

// ÄÞº¸¹Ú½ºÀÇ ¸ðµç ¾ÆÀÌÅÛÀ» »èÁ¦ÇÑ´Ù.
function deleteAllItem(selectObj)
{
	while(selectObj.length > 0)
	{
		selectObj[selectObj.length-1] = null;
	}
}


/************************************************************

	Framework¿¡¼­ »ç¿ëÇÏ´Â ÇÔ¼öµé

************************************************************/
/**
	TEXTFIELD(INPUT TYPE=text)¿¡ ¼Ó¼ºÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
	- MONEY : ¿À¸¥ÂÊ Á¤·ÄµÇ¸ç ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°í Æ÷Ä¿½º¸¦ ÀÒ¾úÀ» ¶§ 3ÀÚ¸®¸¶´Ù ÄÞ¸¶¸¦ Âï´Â´Ù.
	- NUMBER : ¼ýÀÚ¸¸ ÀÔ·Â°¡´É
	- NUMBER2 : (-)(.)ÀÔ·Â °¡´ÉÇÑ ¼ýÀÚÇüÅÂ
	- RIGHT : ¿À¸¥ÂÊ Á¤·Ä½ÃÅ´
	- CENTER : °¡¿îµ¥ Á¤·Ä½ÃÅ´
	- DATE : ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ¸ç, ÀÏ¹ÝÀûÀÎ ³¯Â¥Æ÷¸ËÀÎ YYYY-MM-DD ÇüÅÂ¸¦ À¯ÁöÇÑ´Ù.
	- ENG : ÇÑ±ÛÀÔ·ÂÀ» ¸øÇÏµµ·Ï ÇÑ±Û¸ðµå¸¦ ºÒ°¡´ÉÇÏ°Ô ¼³Á¤ÇÑ´Ù.
*/
if(document.all != null)
{
    window.browser = "IE";
    window.IE = true;
}
else 
{
    window.browser = "FF";
    window.FF = true;
}
function doNothing()
{
	try
    {
        this.blur();
    }
    catch (err)
    {}
    
}

function init()
{
    var ret = callAlertBox();
	if(!ret) return;
	
	
    for(var i=0 ; i<document.links.length ; i++)
	{
		document.links[i].onfocus = doNothing;
        document.links[i].hideFocus = true;
	}

	_init();
	_init2();  
	
	/*
    for(var i=0 ; i<document.images.length ; i++)
    {
        var img = document.images[i];
        if(img.name.indexOf("list_img") < 0) continue;

        img.w = img.width;
        img.h = img.height;
        var max = 500;
        
        if(img.width >= max) 
        {
            img.width = max;
        }
        
        img.onclick = _preview_img;
        img.style.cursor = "hand";
    }*/

	if(document.getElementById("content_view") != null)
	{	
		var imgs = document.getElementById("content_view").getElementsByTagName("img");
		var maxWidth = 615;

		for (var i=0; i<imgs.length; i++) 
		{
            try{
                if(imgs[i].name.indexOf("bulletin_img") < 0) continue;
                var w = remove(imgs[i].style.width, "px");
                if(w == "") w = imgs[i].width;
                w = parseNumber(w);
                //alert(w);
                if(w > maxWidth)
                {
                    imgs[i].style.width = maxWidth + "px";
                    imgs[i].onclick = _preview_img;
                    imgs[i].style.cursor = "hand";
                }		
            }catch(err){}
		}
	}

	var align = "";
	if(document.frm == null) return;
	for(var i=0 ; i<document.frm.elements.length ; i++)
    {
        obj = document.frm.elements[i];
        if(window.FF) obj.setAttribute('autocomplete','off');
		
		if(obj.tagName == "INPUT") 
		{
			if(obj.type.toUpperCase() == "TEXT")
			{
				if(obj.disabled) obj.style.backgroundColor = "#ebebeb";

				if(obj.getAttribute("RIGHT") != null) obj.style.textAlign = "right";
				if(obj.getAttribute("CENTER") != null) obj.style.textAlign = "center";
				if(obj.getAttribute("MONEY") != null) 
				{
					obj.style.textAlign = "right";
					obj.value = makeComma(remove(obj.value, ","));
					if(obj.value == "") obj.value = "0";
				}
				
				if(
					obj.getAttribute("MONEY") != null || obj.getAttribute("NUMBER")!= null ||
					obj.getAttribute("NUMBER2") != null || obj.getAttribute("DATE") != null
				)
				{
					// ÇÑ±Û¸ðµå½Ã¿¡´Â ¹®ÀÚÀÔ·Â½Ã ÇÊÅÍ¸µÀÌ ºÒ°¡´ÉÇÏ¹Ç·Î ¾Æ¿¹ ÇÑ±Û¸ðµå¸¦ ºÒ°¡´ÉÇÏ°Ô ¸¸µé¾î¼­ ¹®ÀÚÀÔ·ÂÀ» ºÒ°¡´ÉÇÏ°Ô ÇÔ.
					obj.style.imeMode = "disabled";
					if(obj.getAttribute("DATE") != null) 
					{
						obj.title = "19690220 Çü½ÄÀ¸·Î ÀÔ·ÂÇÏ¼¼¿ä.";
						obj.maxLength = 10;
					}
				}

				if(obj.getAttribute("ENG") != null)
				{
					obj.style.imeMode = "disabled";
				}
			}
			
			obj.onfocus = _onfocus;
			obj.onblur = _onblur;
			obj.onkeydown = _onkeydown;
			obj.onfocusout = _onfocusout;
		}
		else if(obj.tagName == "SELECT")
		{
			if(obj.disabled) obj.style.backgroundColor = "#ebebeb";

			obj.onfocus = _onfocus;
			obj.onblur = _onblur;
			obj.onkeydown = _onkeydown;
			obj.onfocusout = _onfocusout;
		}
		else if(obj.tagName == "TEXTAREA")
		{
			if(obj.disabled) obj.style.backgroundColor = "#ebebeb";

            obj.onfocus = _onfocus;
			obj.onblur = _onblur;
			obj.onfocusout = _onfocusout;
		}
	}
}

function _preview_img()
{
	var obj = event.srcElement;
	
	var w = obj.w + 20;
	var h = obj.h;
    var src = obj.src;
    /*if(src.indexOf("http://") == 0 && src.indexOf("/") >= 0) 
    {
        src = remove(src, "http://");
        src = src.substring(src.indexOf("/"));
    }*/

	if(w > 800) w = 800;
	if(h > 600) h = 600;
	var w = openPopup2(window.documentRoot + "inc/image_pop.asp?src=" + src, "img_preview", w, h, 30, 0, "yes", "yes");
    
	//w.document.writeln("<HTML><META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=euc-kr'><TITLE>ÀÌ¹ÌÁö ¹Ì¸®º¸±â</TITLE><BODY LEFTMARGIN=0 TOPMARGIN=0>");
	//w.document.writeln("<A HREF='javascript:self.close();'><IMG SRC='" + src + "' BORDER=0></A>");
	//w.document.writeln("</BODY></HTML>");
}

function callAlertBox()
{
    var msg = "";
    if(document.getElementById("message") != null) msg = document.getElementById("message").innerHTML;
    if(msg != "") alert(msg);
    
    if(document.frm == null) return true;

	return true;
}

function _mouseover_img()
{
	this.s = this.src;
	if(this.src.indexOf("_over") < 0) 
	{
		this.selected = true;
		return;
	}

	this.src = remove(this.src, '_over');
}

function _mouseout_img()
{
	if(this.selected) return;
	this.src = this.s;
}

/**
	focus¸¦ ÀÒ¾úÀ»¶§ Ã³¸®µÇ´Â ÀÌº¥Æ® ÇÚµé·¯.
	onblurº¸´Ù ¸ÕÀú Ã³¸®µÈ´Ù.
*/
function _onfocusout(event)
{
	var obj = null;
    
    if(window.browser == "FF")
    {
        obj = event.currentTarget;
    }
    else
    {
        event = window.event;
        obj = event.srcElement;
    }
	
	_onfocusout1(obj);

	if(obj.getAttribute("MONEY") != null) 
	{
		obj.value = makeComma(remove(obj.value, ","));
		if(obj.value == "") obj.value = "0";
	}

	if(obj.getAttribute("DATE") != null)
	{
		var value = obj.value;
		if(value == "") return;

		if(obj.getAttribute("REQUIRED") != null)
		{
			var v = obj.value.split("-").join("");
			if(v.length != 8)
			{
				alert("³¯Â¥ Çü½Ä¿¡ ¸ÂÃç¼­ ÀÔ·ÂÇÏ¼¼¿ä. \n¿ù,ÀÏÀº ¹Ýµå½Ã µÎ±ÛÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
				obj.focus();
				return;
			}
		}

		obj.value = obj.value.split("-").join("");
		obj.value = obj.value.substring(0, 4) + "-" + obj.value.substring(4, 6) + "-" + obj.value.substring(6, 8);
	}

	if(obj.getAttribute("MINLENGTH") != null)
	{
		var minLength = obj.getAttribute("MINLENGTH");
		if(obj.value != "" && trim(obj.value).length < minLength)
		{
			alert("ÃÖ¼ÒÇÑ " + minLength + "±ÛÀÚÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
			event.returnValue = false;
			obj.focus();
		}
	}

	
}

function _onkeydown(event)
{
	var obj = null;
    
    if(window.browser == "FF")
    {
        obj = event.currentTarget;
    }
    else
    {
        event = window.event;
        obj = event.srcElement;
    }
	_onkeydown1(obj);

	
	var iKey = event.keyCode;
	
	// Copy, Cut, Paste ÀÛµ¿Àº Çã¿ëÇÔ.
	if((iKey == 88 || iKey == 67 || iKey == 86) && event.ctrlKey)
	{
		event.returnValue = true;
		return;
	}

	if(iKey == 13)
	{
		if(obj.tagName == "SELECT" || (obj.tagName == "INPUT" && (obj.type == "text" || obj.type == "password")))
		{
			_onenterdown(event, obj);
			event.returnValue = false;
			return;
		}
	}
	
	var s = String.fromCharCode(iKey);
	//alert(iKey);

	if(iKey != 32)
	{
		if((iKey >= 34 && iKey <= 40) || iKey == 45 || iKey == 46 || iKey == 32 || iKey == 8) return;
		if(iKey == 25 || iKey == 17) return;
	}

	if(	obj.getAttribute("NUMBER") != null || 
		obj.getAttribute("MONEY") != null || 
		obj.getAttribute("DATE") != null)
	{
		if(iKey >= 96 && iKey <= 105) 
		{
			event.returnValue = true;
			return;
		}

		if (s >= 0 && s <= 9) event.returnValue = true;
		else event.returnValue = false;
		//alert(event.returnValue);
	}
	else if(obj.getAttribute("NUMBER2") != null)
	{
		if((iKey >= 96 && iKey <= 105) || iKey == 109) 
		{
			event.returnValue = true;
			return;
		}

		if ((s >= 0 && s <= 9) || iKey == 189 || iKey == 190) event.returnValue = true;
		else event.returnValue = false;
	}

	var type = obj.type.toUpperCase();
	if(obj.tagName == "INPUT")
	{
		if(type == "TEXT" || type == "PASSWORD")
		{
			if(iKey == 27) 
			{
				var preValue = obj.preValue;
				if(preValue == null) preValue = "";
				obj.value = preValue;
			}
		}
	}
}

function _onenterdown(event)	// ¿£ÅÍÅ° ÀÔ·Â½Ã¿¡ È£ÃâµÊ
{
	var obj = null;
    
    if(window.browser == "FF")
    {
        obj = event.currentTarget;
    }
    else
    {
        event = window.event;
        obj = event.srcElement;
    }
	_onenterdown1(obj);
	_onenterdown2(obj);

	if(obj.type == "text" || obj.type == "password") 
	{
		event.returnValue = false;
		return;
	}
}

function _onblur(event)
{
	var obj = null;
    
    if(window.browser == "FF")
    {
        obj = event.currentTarget;
    }
    else
    {
        event = window.event;
        obj = event.srcElement;
    }
	_onblur1(obj);
	_onblur2(obj);
}

var preValue;
function _onfocus(event)
{
	var obj = null;
    if(window.browser == "FF")
    {
        obj = event.currentTarget;
    }
    else
    {
        event = window.event;
        obj = event.srcElement;
    }
    

	//alert("focus : " + obj.name);
	//return;
	_onfocus1(obj);
	_onfocus2(obj);
	
	if(obj.getAttribute("MONEY") != null) obj.value = remove(obj.value, ",");
	if((obj.tagName == "INPUT" && (obj.type.toUpperCase() == "TEXT" || obj.type.toUpperCase() == "PASSWORD")) || obj.tagName == "TEXTAREA") 
	{
		
		obj.preValue = obj.value;

		if(obj.getAttribute("DESELECTED") != null || obj.tagName == "TEXTAREA") return;
		obj.select();
	}
}
function _onkeydown1(){}
function _onfocus1(){}
function _onfocus2(obj){}
function _onblur1(){}
function _onblur2(obj){}
function _onfocusout1(obj){}
function _onenterdown1(obj){}
function _onenterdown2(obj){}


function _init(){}
function _init2(){}

function selectRow(index)
{
	if(frm.index != null) frm.index.value = index;
	check(frm["chk[]"], index);
	_selectRow(index);
}

function _selectRow(index){}
/**
	form °´Ã¼ ÀÚµ¿Ã¼Å© & trimÀÚµ¿À¸·Î ÇØÁÜ.
	moneyÅ¸ÀÔÀº ÀÚµ¿À¸·Î ½°Ç¥(,) Á¦°ÅÇØÁÜ
*/
function _validate(frm)
{
	var obj;
    var value;
    var is_required;
	//var highlight_color = "#FFDDFF";
	var highlight_color = "";

	if(frm == null) return true;
	for(var i=0 ; i<frm.elements.length ; i++)
    {
        obj = frm.elements[i];
		if((obj.tagName == "INPUT" && (obj.type.toUpperCase() == "TEXT" || obj.type.toUpperCase() == "PASSWORD")) ||
			obj.tagName == "TEXTAREA" ||
			obj.tagName == "SELECT"
		) 
		{
			//obj.style.backgroundColor = "";
		}
	}
    
    for(var i=0 ; i<frm.elements.length ; i++)
    {
        obj = frm.elements[i];
		value = obj.value;
        
        if(obj.getAttribute("REQUIRED") != null) is_required = true;
		else is_required = false;

        if(!is_required) continue;

        var msg = trim(obj.getAttribute("MSG"));
        if(msg == "") msg = "ÇÊ¼ö Ç×¸ñÀÔ´Ï´Ù.";

		var minLength = obj.getAttribute("MINLENGTH");

        //alert(obj.type);
		if(obj.tagName == "INPUT")
        {
            if(obj.getAttribute("EMAIL") != null)
			{
				if(value == "")
				{
					alert(msg);
					obj.focus();
					//obj.style.backgroundColor = highlight_color;
					return false;
				}

				if(!checkTextfieldForEmail(obj))
				{
					alert("ÀÌ¸ÞÀÏ Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù.");
					obj.focus();
					//obj.style.backgroundColor = highlight_color;
					return false;
				}
			}

			if(obj.getAttribute("DATE") != null)
			{
				var str = remove(value, "-");
				if(str.length != 8)
				{
					alert("YYYY-MM-DD Çü½ÄÀ¸·Î ÀÔ·ÂÇÏ¼¼¿ä.\n¿¹) 2005-05-25");
					obj.focus();
					//obj.style.backgroundColor = highlight_color;
					return false;
				}
			}

			if(obj.getAttribute("MONEY") != null || obj.getAttribute("NUMBER") != null)
			{
				if(value == "0")
				{
					alert(msg);
					obj.focus();
					//obj.style.backgroundColor = highlight_color;
					return false;
				}
			}
			
			if(obj.type.toUpperCase() == "TEXT" || obj.type.toUpperCase() == "PASSWORD")
            {
                if(trim(value) == "")
                {
                    alert(msg);
                    obj.focus();
                    //obj.style.backgroundColor = highlight_color;
					return false;
                }

				
				if(minLength != null)
				{
					if(trim(value).length < minLength)
					{
						alert("ÃÖ¼Ò " + minLength + "±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
						obj.focus();
						//obj.style.backgroundColor = highlight_color;
						return false;									
					}
				}
            }
            else if(obj.type.toUpperCase() == "RADIO")
            {
				obj = frm[obj.name];
				var ret = getRadioValue(obj);
				if(ret == null)
                {
					msg = trim(obj[0].getAttribute("MSG"));
                    if(msg == "") msg = "ÇÊ¼ö Ç×¸ñÀÔ´Ï´Ù.";
                    
                    alert(msg);
					return false;
                }
            }
			obj.value  = trim(value);
        }
        else if(obj.tagName == "SELECT")
        {
            if(obj.selectedIndex < 0)
			{
				alert(msg);
                obj.focus();
                //obj.style.backgroundColor = highlight_color;
				return false;
			}

			value = obj[obj.selectedIndex].value;
            if(value == "")
            {
                alert(msg);
                obj.focus();
                //obj.style.backgroundColor = highlight_color;
				return false;
            }
        }
		else if(obj.tagName == "TEXTAREA")
		{
			if(trim(value) == "")
			{
				alert(msg);
				obj.focus();
				//obj.style.backgroundColor = highlight_color;
				return false;
			}

			if(minLength != null)
			{
				if(trim(value).length < minLength)
				{
					alert("ÃÖ¼Ò " + minLength + "±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
					obj.focus();
					//obj.style.backgroundColor = highlight_color;
					return false;									
				}
			}
		}
    }

	
	return true;
}



function do_nothing()
{
	return;
}

function setGridText(gridName, row, col, value, doc)
{
	if(doc == null) doc = document;
	
	var obj = frm[gridName + row + "_" + col];
	if(obj != null) 
	{
		obj.value = value;
		
	}
	else
	{
		obj = doc.all[gridName + "_text" + row + "_" + col];
		if(obj != null) obj.innerHTML = value;
	}

	if(obj == null) 
	{
		alert("ERROR : setGridText()\ngridName : " + gridName + "\n" + 
				"row : " + row + "\n" + 
				"col : " + col);
		throw "error";
	}
}

function getGridText(gridName, row, col, doc)
{
	if(doc == null) doc = document;
	
	var value;
	var obj = frm[gridName + row + "_" + col];
	if(obj == null) obj = doc.all[gridName + "_text" + row + "_" + col];
	else value = obj.value;
	
	if(obj == null) 
	{
		alert("ERROR : getGridText()\ngridName : " + gridName + "\n" + 
				"row : " + row + "\n" + 
				"col : " + col);
		throw "error";
	}

	if(frm[gridName + row + "_" + col] == null) value = obj.innerHTML;

	return value;
}

function getGridCellObject(gridName, row, col, doc)
{
	if(doc == null) doc = document;
	
	var obj = frm[gridName + row + "_" + col];
	if(obj == null) obj = doc.all[gridName + "_text" + row + "_" + col];

	return obj;
}

function getGridRow(gridName, row, doc)
{
	var ret = new Array();
	
	for(var i=0 ; i<50 ; i++)
	{
		if(getGridCellObject(gridName, row, i, doc) == null) break;
		ret[i] = getGridText(gridName, row, i, doc);
	}

	return ret;
}

function setMultipart(is_multi)
{
	if(!is_multi) document.frm.encoding = "";
	else document.frm.encoding = "multipart/form-data";
}

function submitForm2(target, action, is_get)
{
	var formObj = document.frm;
	target = nvl(target, "_self");

	document.frm.target = target;
	document.frm.action = action;
	for(var i=0 ; i<document.frm.elements.length ; i++)
    {
        var obj = document.frm.elements[i];
		if(obj.disabled) 
		{
			obj.disabled = false;
			obj.disabled2 = true;
		}
		
		if(obj.tagName == "INPUT") 
		{
			if(obj.getAttribute("MONEY") != null) obj.value = remove(obj.value, ",");
		}
	}

	if(is_get == true) document.frm.method = "get";
	else document.frm.method = "post";
	
	document.frm.submit();

	for(var i=0 ; i<document.frm.elements.length ; i++)
    {
        var obj = document.frm.elements[i];
		if(obj.disabled2) 
		{
			obj.disabled = true;
		}
		
		if(obj.tagName == "INPUT") 
		{
			if(obj.getAttribute("MONEY") != null) obj.value = makeComma(obj.value);
		}
	}
}

function openModalCalendar(test, root)
{
   if(navigator.userAgent.indexOf("MSIE") != -1)
   {
	   if(test.disabled) return;
     //xpos  		= event.screenX-155;
     //ypos  		= event.screenY+10;
     var ret 	= window.showModalDialog(root + "inc/calendar.asp?fieldvalue="+test.value,"c1", 'dialogHeight:255px;dialogWidth:220px;status:yes; help:no; scroll:no; center:yes');
     if (ret)
     	test.value = ret;
   }
}

/**
	ÀÔ·Â¹ÞÀº ¹®ÀÚ¿­ÀÇ byte¼ö¸¦ °è»ê.
*/
function getStrBytes(val)
{
      // ÀÔ·Â¹ÞÀº ¹®ÀÚ¿­À» escape() ¸¦ ÀÌ¿ëÇÏ¿© º¯È¯ÇÑ´Ù.
      // º¯È¯ÇÑ ¹®ÀÚ¿­ Áß À¯´ÏÄÚµå(ÇÑ±Û µî)´Â °øÅëÀûÀ¸·Î %uxxxx·Î º¯È¯µÈ´Ù.
      var temp_estr = escape(val);
      var s_index   = 0;
      var e_index   = 0;
      var temp_str  = "";
      var cnt       = 0;

      // ¹®ÀÚ¿­ Áß¿¡¼­ À¯´ÏÄÚµå¸¦ Ã£¾Æ Á¦°ÅÇÏ¸é¼­ °¹¼ö¸¦ ¼¾´Ù.
      while ((e_index = temp_estr.indexOf("%u", s_index)) >= 0)  // Á¦°ÅÇÒ ¹®ÀÚ¿­ÀÌ Á¸ÀçÇÑ´Ù¸é
      {
        temp_str += temp_estr.substring(s_index, e_index);
        s_index = e_index + 6;
        cnt ++;
      }

      temp_str += temp_estr.substring(s_index);

      temp_str = unescape(temp_str);  // ¿ø·¡ ¹®ÀÚ¿­·Î ¹Ù²Û´Ù.

      // À¯´ÏÄÚµå´Â 2¹ÙÀÌÆ® ¾¿ °è»êÇÏ°í ³ª¸ÓÁö´Â 1¹ÙÀÌÆ®¾¿ °è»êÇÑ´Ù.
      return ((cnt * 2) + temp_str.length);
}

/**
	·Î±×ÀÎ »óÅÂ¸¦ Ã¼Å©ÇÔ
	no_msg
		true : ÆäÀÌÁö ·ÎµùÁß..., ·Î±×ÀÎÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù µîÀÇ ¸Þ¼¼Áö Ã¢ÀÌ ³ªÅ¸³ªÁö ¾Ê°Ô ÇÑ´Ù.
		false || null : ÀÚµ¿À¸·Î ¸Þ¼¼Áö Ã¢À» º¸¿©Áà ¸Þ¼¼Áö¸¦ º¸¿©ÁÜ.
*/
function checkLogin(no_msg)
{
	if(login.document.frm == null)
	{
		if(no_msg != true) alert("ÆäÀÌÁö ·Îµù ÁßÀÔ´Ï´Ù. Àá½ÃÈÄ¿¡ ´Ù½Ã ½ÃµµÇØÁÖ¼¼¿ä.");
		return;
	}
	
	if(login.document.frm.is_login.value != "true")
    {
        if(no_msg != true) alert("·Î±×ÀÎ ÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù");
        //submitForm2("_self", frm.document_root.value + "member/login.jsp");
        return false;
    }
	return true;
}


// WISE ÇÁ·Î±×·¥(»ç¿ëÀÚ)¿¡¼­ ½ÅÃ» Á¤º¸¸¦ XMLÇüÅÂ·Î ÀüÈ¯½ÃÄÑÁØ´Ù.
// ¹Ýµå½Ã ORDER¶ó´Â ¼Ó¼ºÀÌ ÅÂ±×¿¡ ÀÖ¾î¾ß ÇÏ¸ç, ORDER¼Ó¼º¿¡ 1ÀÌ»óÀÇ °íÀ¯ ¹øÈ£°¡ ÁöÁ¤µÇ¾î¾ß ÇÑ´Ù.
function getXml()
{
	var str = "<?xml version=\"1.0\" encoding=\"euc-kr\"?>\n";
    str += "<info>\n";
    for(var i=0 ; i<frm.elements.length ; i++)
    {
        var obj = frm.elements[i];
        if(obj.getAttribute("ORDER") == null) continue;
        if(obj.name == "") continue;

        var name = obj.name;
        var value = obj.value;
        var postfix = nvl(obj.getAttribute("POSTFIX"), "");
        var prefix = nvl(obj.getAttribute("PREFIX"), "");
        var order = nvl(obj.getAttribute("ORDER"), "");
        str += "    <field name=\"" + name + "\"";
        str += " prefix=\"" + prefix + "\"";
        str += " postfix=\"" + postfix + "\" order=\"" + order + "\">";
        str += "<![CDATA[\n";
        str += value;
        str += "\n]]>";
        str += "</field>\n";
    }
    str += "</info>\n";

	return str;
}


function printSubSwf(web_root, index)
{
    var swf = "serv" + index + ".swf";
    if(index == 8) swf = "serv7.swf";

    document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" WIDTH="771" HEIGHT="121">                    <PARAM NAME="movie" VALUE="../fla/' + swf + '">                    <PARAM NAME="quality" VALUE="high">                    <param name="wmode" value="transparent">                     <EMBED SRC="../fla/' + swf + '" QUALITY="high" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash" WIDTH="771" HEIGHT="121"></EMBED>                </OBJECT>');
}

var _idNum = 1;
function printSwf2(url, width, height, idName) {

    if(idName == null) idName = "swf" + _idNum++;

	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id='" + idName + "' ");
	document.write("codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'");
	document.write("WIDTH='"+width+"' HEIGHT='"+height+"' id='main' ALIGN='left'>");
	document.write("<PARAM NAME=movie VALUE='"+url+"'>");
	document.write("<PARAM NAME=quality VALUE=high>");
	document.write("<PARAM NAME=scale VALUE=noscale>");
	document.write("<PARAM NAME=salign VALUE=LT>");
	document.write("<PARAM NAME=wmode VALUE=transparent>");
	document.write("<PARAM NAME=bgcolor VALUE=#FFFFFF>");
	document.write("<EMBED src='"+url+"' quality=high scale=noscale salign=LT wmode=transparent bgcolor=#FFFFFF  WIDTH='"+width+"' HEIGHT='"+height+"' NAME='main' ALIGN='left'");
	document.write("TYPE='application/x-shockwave-flash' PLUGINSPAGE='https://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>");
}


function printSwf(src, width, height, idName)
{
    if(idName == null) idName = "swf" + _idNum++;

    if(!isNaN(width)) width = width + "px";
    if(!isNaN(height)) height = height + "px";

    document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
    document.writeln('codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
    document.writeln('style="width:' + width + '; height:' + height + ';" id="' + idName + '" align="middle" >');
    document.writeln('<param name="allowScriptAccess" value="always" />');
    document.writeln('<param name="movie" value="' + src + '" />');
    document.writeln('<param name="quality" value="high" />');
    document.writeln('<param name="wmode" value="transparent" />');
    document.writeln('<param name="bgcolor" value="#ffffff" />');
    document.writeln('<embed swLiveConnect="true" name="' + idName + '" src="' + src + '" wmode="transparent" quality="high" bgcolor="#ffffff" style="width:' + width + '; height:' + height + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />');
    document.writeln('</object>');
}

function go_swf1_menu(index)
{
    var href = "";
    if(index == 1) href = "intro/way.jsp";
    else if(index == 2) href = "intro/med_gui.jsp";
    else if(index == 3) href = "reserv/reserv.jsp";

    if(href != "") location.href = href;
}

function submitForm3(winObj, action)
{
	var frm = document.frm;
	if(winObj == null) winObj = window;

    var str = "";
    var value = "";
    var skipObjNames = new Array();
	for(var i=0 ; i<document.frm.elements.length ; i++)
    {
        var obj = document.frm.elements[i];
		if(obj.disabled) 
		{
			obj.disabled = false;
			obj.disabled2 = true;
		}
		
		if(obj.tagName == "INPUT")
		{
			if(obj.getAttribute("MONEY") != null) obj.value = remove(obj.value, ",");
		}

        if(obj.name == null || (obj.name.indexOf("sc_") != 0 && obj.name.indexOf("pk_") != 0)) continue;
        if(skipObjNames[obj.name]) continue;

        if(obj.type.toUpperCase() == "RADIO") 
        {
            value = getRadioValue(obj);
            skipObjNames[obj.name] = true;
        }
        else if(obj.type.toUpperCase() == "CHECKBOX") 
        {
            var arr = getCheckBoxvalue(obj);
            for(var i=0 ; i<arr.length ; i++)
            {
                str += obj.name + "=";
                str += arr[i] + "&";
            }
            skipObjNames[obj.name] = true;
            continue;
        }
        else
        {
            value = obj.value;
        }

        if(value == null || obj.value == "") continue;

        str += obj.name + "=";
        str += value + "&";
	}

    if(document.frm.actEvent != null && document.frm.actEvent.value != "") str += "actEvent=" + document.frm.actEvent.value + "&";
    if(document.frm.page != null && document.frm.page.value != "") str += "page=" + document.frm.page.value + "&";

    if(str != "") 
    {
        winObj.location.href = action + "?" + str;
    }
    else winObj.location.href = action;

	for(var i=0 ; i<document.frm.elements.length ; i++)
    {
        var obj = document.frm.elements[i];
		if(obj.disabled2) 
		{
			obj.disabled = true;
		}
		
		if(obj.tagName == "INPUT") 
		{
			if(obj.getAttribute("MONEY") != null) obj.value = makeComma(obj.value);
		}
	}
}

function removeTag(xStr)
{
    var regExp = /<\/?[^>]+>/gi;
    xStr = xStr.replace(regExp,"");
    return xStr;
}

//¹®ÀÚ¿­À» ÀÚ¸¥ÈÄ post°ªÀÌ ÀÖÀ¸¸é ºÙÀÌ°í ¾øÀ¸¸é ...À» ºÙÈù´Ù.
function cutStr(str,limit, post)
{
    if(post == null) post = "...";

    if(str.length > limit)
    {
        str = str.substring(0, limit-post.length);
        str = str + post;
    }

    return str;

}


//ÇÇÆÇ Ãß°¡ µÇ´Â ºÎºÐ ½ºÅ©¸³Æ®
//Æ¼ÄÏ¿¹¸Å 
function tiketLink()
{
	location.href = window.documentRoot + "ticket/01.asp";
}

//»ó´Ü¿¡ ³ªÇÁ Æ÷ÇÔÇÑ ¸µÅ©
function goTopPage(seq)
{
	if(seq == 1) location.href = "http://supporter.pifan.com/" ;
	else if(seq == 2) window.open(window.historyUrl + "/default.asp?f_num=11");
	else if(seq == 3) window.open(window.pressUrl);
	else if(seq == 4) window.open("http://club.cyworld.com/pifan2008");
	else if(seq == 5) location.href = "http://www.pifan.com/naff2008/" ;
}

function goPage(seq)
{
	//alert("ÁØºñÁßÀÔ´Ï´Ù.");
	if(seq == 1) top.location.href = "http://www.pifan.com/index.asp" ;
	else if(seq == 2) top.location.href = "http://supporter.pifan.com/" ;
	else if(seq == 3) window.open("http://press.pifan.com");
	else if(seq == 4) window.open("http://club.cyworld.com/pifan2008");
	else if(seq == 5) top.location.href = "http://www.pifan.com/naff2008/" ;
}

function goPage2(seq)
{
	//alert("ÁØºñÁßÀÔ´Ï´Ù.");
	if(seq == 1) openPopup("http://www.pifan.com/etc/03.asp", "footer03", "539", "490");
	else if(seq == 2) openPopup("http://www.pifan.com/etc/01.asp", "footer01", "539", "490");
	else if(seq == 3) openPopup("http://www.pifan.com/etc/02.asp", "footer02", "300", "210");
	else if(seq == 4) top.location.href = "http://www.pifan.com/intro/06.asp";
}


function top_menu(seq)
{
	var root = window.documentRoot;
	var engRoot = window.engRoot;
    var url = "";
    if(seq == "1") url = root + "intro/01.asp";
    else if(seq == "2") url = root + "program/program_list.asp?sc_category_seq=1";
    else if(seq == "3") url = root + "guide/01.asp";
    else if(seq == "4") url = root + "news/01_list.asp";
    else if(seq == "5") url = root + "community/01_list.asp";
    else if(seq == "6") url = root + "mania/01.asp";

    else if(seq == "01") url = engRoot + "01_about/01.asp";
    else if(seq == "02") url = engRoot + "02_film/program_list.asp?sc_category_seq=1";
    else if(seq == "03") url = engRoot + "03_event/01.asp";
    else if(seq == "04") url = engRoot + "04_screen/01.asp";

    else if(seq == "05") url = engRoot + "05_news/01_list.asp";
    else if(seq == "06") url = engRoot + "06_infor/01.asp";

    location.href = url ;
}

//»õ·Î¿î Å¾ ¸Þ´º ¸µÅ©
function topMenuLink(seq)
{
	//alert(seq);
	var root = window.documentRoot;
	var engRoot = window.engRoot;
    var url = "";
    if(seq == "1") url = root + "intro/01.asp";
	if(seq == "11") url = root + "intro/01.asp";
	if(seq == "12") url = root + "intro/02.asp";
	if(seq == "13") url = root + "intro/07.asp";
	if(seq == "14") url = root + "intro/08.asp";
	if(seq == "16") url = root + "intro/03.asp";
	if(seq == "17") url = root + "intro/04.asp";
	if(seq == "18") url = root + "intro/05.asp";
	if(seq == "15") url = root + "intro/09.asp";
	if(seq == "19") { busPop(); return;}
	if(seq == "110") url = root + "intro/06.asp";
	
	//»ó¿µÀÛ ¼Ò°³
	if(seq == "2") url = root + "program/program_list.asp?sc_category_seq=1";
	if(seq == "21") url = root + "program/program_list.asp?sc_category_seq=1";
	if(seq == "22") url = root + "program/program_list.asp?sc_category_seq=2";
	if(seq == "23") url = root + "program/program_list.asp?sc_category_seq=3";
	if(seq == "24") url = root + "program/program_list.asp?sc_category_seq=4";
	if(seq == "25") url = root + "program/program_list.asp?sc_category_seq=5";
	if(seq == "26") url = root + "program/program_list.asp?sc_category_seq=6";
	if(seq == "27") url = root + "program/program_list.asp?sc_category_seq=7";
	if(seq == "28") url = root + "program/program_list.asp?sc_category_seq=8";
	if(seq == "29") url = root + "program/program_list.asp?sc_category_seq=9";
	if(seq == "210") url = root + "program/program_list.asp?sc_category_seq=10";
	if(seq == "211") url = root + "program/program_list.asp?sc_category_seq=25";
	if(seq == "212") url = root + "program/program_list.asp?sc_category_seq=13";
	if(seq == "213") url = root + "program/program_list.asp?sc_category_seq=19";
	if(seq == "214") url = root + "program/program_list.asp?sc_category_seq=22";
	if(seq == "215") url = root + "program/program_list.asp?sc_category_seq=24";
	if(seq == "216") url = root + "program/program_search.asp";
	

	//Çà»ç¾È³»
	if(seq == "3") url = root + "guide/01.asp";
	if(seq == "31") url = root + "guide/01.asp";
	if(seq == "32") url = root + "guide/02.asp";
	if(seq == "33") url = root + "guide/03.asp";
	if(seq == "34") url = root + "guide/05.asp";
	if(seq == "35") url = root + "guide/06.asp";
	if(seq == "36") url = root + "guide/07.asp";
	if(seq == "37") url = root + "guide/04.asp";
	if(seq == "38") url = root + "guide/08.asp";
	if(seq == "39") url = root + "guide/09.asp";
	//if(seq == "310") {return;}

	//ÇÇÆÇ ´º½º
	if(seq == "4") url = root + "news/01_list.asp";
	if(seq == "41") url = root + "news/01_list.asp";
	if(seq == "42") url = root + "news/02_list.asp";
	if(seq == "43") url = root + "news/03_list.asp";
	if(seq == "44") {return;}
	
	//Ä¿¹Â´ÏÆ¼
	if(seq == "5") url = root + "community/01_list.asp";
	if(seq == "51") url = root + "community/01_list.asp";
	if(seq == "57") url = root + "community/04_list.asp";
	if(seq == "52") url = root + "community/02_list.asp";
	if(seq == "53") {return;}
	if(seq == "54") url = root + "community/06.asp";
	if(seq == "55") {window.open("http://club.cyworld.com/pifan2008"); return;}	
	if(seq == "56") url = root + "community/05.asp";
	
	//¸Å´Ï¾Æ¼­ºñ½º
	if(seq == "6") url = root + "mania/01.asp";
	if(seq == "61") url = root + "mania/01.asp";
	if(seq == "62") url = root + "mania/02_1.asp";
	if(seq == "63") url = root + "mania/04.asp";
	if(seq == "64") url = root + "mania/05.asp";
	if(seq == "65") url = root + "mania/06.asp";

    location.href = url ;
}

//¼ÅÆ²¹ö½º¸µÅ©
function busPop()
{
	openPopup(window.documentRoot + "intro/bus.asp", "busPop", "720", "760", "yes");
	return;
}

//¿µ¹® »ó´Ü ÀÚ¹Ù½ºÅ©¸³Æ®
function engHeader(seq)
{
	if(seq == "1") openPopup(window.engRoot + "contact/01_pop.asp", "popp01", "600", "520");
	else if(seq == "2") alert("coming soon");
	else if(seq == "3") location.href = window.documentRoot + "index.asp";
	else if(seq == "4") location.href = window.documentRoot + "naff/";
	else if(seq == "5") window.open(window.historyUrl + "/default.asp?f_num=11");
	else if(seq == "6") window.open(window.pressUrl + "/eng/");
}

//¿µ¹® naff

function eng_banner_link(index)
{
	if(index == "1")
	{
		download333.location.href = window.pifanUrl + "/uploads/NAFF2008+It+Project+Application+eng.zip";
	}
	else if(index == "2")
	{
		download333.location.href = window.pifanUrl + "/uploads/fantasticFilmSchoolForm.zip";
	}
}

//±¹¹® ³ªÇÁ
function kor_banner_link(index)
{
	if(index == "1")
	{
		download333.location.href = window.pifanUrl + "/uploads/NAFF2008+It+Project+Application+kor.zip";
	}
	else if(index == "2")
	{
		download333.location.href = window.pifanUrl + "/uploads/fantasticFilmSchoolForm.zip";
	}
}

//ºí·Î±× ¹Ù·Î°¡±â
function fantasticfilmschool()
{
	window.open("http://fantasticfilmschool.tistory.com");
}


function family_menu(seq)
{
	var root = window.documentRoot ;
	var url = "";
	if(seq == "1") location.href = window.supporterUrl ;
	else if(seq == "2") window.open(window.historyUrl + "/default.asp?f_num=11");
	else if(seq == "3") alert("ÁØºñÁßÀÔ´Ï´Ù.");
	else if(seq == "4") window.open("http://club.cyworld.com/pifan2008");
}

//±¹¹®¼­Ä¡
function flash_search(name)
{
	if(name == "" || name == "undefined")
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		return;
	}
	else
	{
		//alert("ÁØºñÁßÀÔ´Ï´Ù.");
		location.href = window.documentRoot + "program/program_search.asp?sc_cond=title&sc_str=" + escape(name) ;
	}
}
//¿µ¹®¼­Ä¡
function flash_search_eng(name)
{
	if(name == "" || name == "undefined")
	{
		alert("Input Search");
		return;
	}
	else
	{
		location.href = window.documentRoot + "eng/02_film/program_search.asp?sc_cond=title_eng&sc_str=" + escape(name) ;
		//alert("coming soon");
	}
}

//°³ÀÎº¸È£ ¾Æ·¡ ÇªÅÍ ºÎºÐ ÀÚ¹Ù½ºÅ©¸³Æ®
function footer01()
{
	openPopup(window.documentRoot + "etc/01.asp", "footer01", "539", "490");
}

//ÀÌ¿ë¾à°ü
function footer02()
{
	openPopup(window.documentRoot + "etc/03.asp", "footer03", "539", "490");
}

//ÀÌ¸ÞÀÏ ¼ö½Å°ÅºÎ
function footer03()
{
	openPopup(window.documentRoot + "etc/02.asp", "footer02", "300", "210");
}


//Æ¼°Ù¸µÅ© ·Î±×ÀÎ
function pageLogin(url)
{
	//location.href = window.ticketlinkUrl + "interface/pifan08/login/login2.jsp?url=" + url;
	location.href = window.documentRoot + "login/login.asp?url=" + url;
}

//·Î±×¾Æ¿ô
function pageLogout()
{
	location.href = window.documentRoot + "logout2.asp";
}

//È¸¿ø°¡ÀÔ
function pageJoin()
{
	location.href = window.documentRoot + "login/join.asp";
}

//¸¶ÀÌÆäÀÌÁö
function pageMypifan()
{
	location.href = window.documentRoot + "mypifan/01.asp";
}