

// ÆûÀÌµ¿(ÀÚ¸®¼ö Ã¼Å©)
function moveField(field_val,next_field,maxlen)
{
	if(field_val.length==maxlen)
	{
		next_field.focus();
	}  
}

// ¼ýÀÚ¸¸ ÀÔ·Â¹Þ°Ô ÇÔ /*¿Ï·á
function onlyNum()
{
	if ((event.keyCode < 48) || (event.keyCode > 57)) event.returnValue = false;
	return true;
}

//textbox null °ª Ã¼Å© 
function isNull( theField, s)
{
	if (theField.value == "" || theField.value == null || formatSpace(theField.value) == "")
	{
		alert( s + "À»(¸¦) ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theField.focus();
		//theField.select();
		//if(al) alert( s + "À»(¸¦) ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		return(false);
	}else{
		return(true);
	}
}

//checkbox Ã¼Å©¿©ºÎ 2005-04-01
function isCheck( theField, s)
{
	if(theField[0].checked==false&&theField[1].checked==false){
		alert( s + "À»(¸¦) ¼±ÅÃÇÏ½Ê½Ã¿ä.");
		return(false);
	}else return(true);
}


// null °ª Ã¼Å© /*¿Ï·á
function isNullInReadOnly( theField, s)
{
	if (theField.value == "" || theField.value == null || formatSpace(theField.value) == "")
	{
		alert( s + "À»(¸¦) ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		//theField.select();
		//if(al) alert( s + "À»(¸¦) ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		return(false);
	}

	return(true);
}


// null Ã¼Å©, ¼ýÀÚ-ÀÚ¸´¼ö Ã¼Å© ( ÇÊµå¸í,¸Þ¼¼Áö,±æÀÌ ) /*¿Ï·á
function checkLengthInteger(theField, s, len)
{
//	isNull(theField, s);
	if(!isNull(theField, s))
	{
		return false;
	}
	//alert(s+" ÀÚ¸®¼ö Check")
	if(isNaN(theField.value))
	{
		alert( s+"¿¡´Â ¼ýÀÚ¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theField.focus();
		theField.select();
		return(false);
	}

	if (theField.value.length != len)
	{
		alert( s+"´Â "+len+"±ÛÀÚ ÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		theField.focus();
		theField.select();
		return(false);
	}

	return(true);
}
/*
function checkLengthInteger(theField, s, len, al)
{
	isNull(theField, s, al);
	
	//alert(s+" ÀÚ¸®¼ö Check")
	if(isNaN(theField.value))
	{
		theField.focus();
		theField.select();
		return(false);
	}

	if (theField.value.length != len)
	{
		theField.focus();
		theField.select();
		return(false);
	}

	return(true);
}
*/

//null Ã¼Å© ¹× ¼ýÀÚÀÎÁö ¿©ºÎ Ã¼Å©
function checkInteger(theField, s)
{
	if(!isNull(theField, s))
	{
		return false;
	}
	//alert(s+" ÀÚ¸®¼ö Check")
	if(isNaN(theField.value))
	{
		alert( s+"¿¡´Â ¼ýÀÚ¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theField.focus();
		theField.select();
		return(false);
	}
	return(true);
}

//¼ýÀÚ¸¸ ÀÔ·ÂÇÏµµ·Ï 
function OnlyNumber(theField, s){
	if(isNaN(theField.value))
	{
		alert( s+"¿¡´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theField.value="";
		theField.focus();
		theField.select();
		return false;
	}
}

//¼ýÀÚÀÎÁö ¿©ºÎ Ã¼Å©
function YesNullcheckInteger(theField, s)
{
	if(isNaN(theField.value))
	{
		//alert( s+"¿¡´Â ¼ýÀÚ¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theField.focus();
		theField.select();
		//return false;
	}
}

function checkIntegerValue(theValue, s)
{
	if(theValue == null || theValue == "")
	{
		alert(s+"¸¦(À») ÀÔ·ÂÇÏ½Ê½Ã¿ä");
		return false;
	}
		if(isNaN(theValue))
	{
		alert( s+"¿¡´Â ¼ýÀÚ¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theField.focus();
		theField.select();
		return(false);
	}
	return true;
}
/*
function checkInteger(theField, s, al)
{
	isNull(theField, s, al);
	
	//alert(s+" Number Check")
	if(isNaN(theField.value))
	{
		theField.focus();
		theField.select();
		return(false);
	}

	return(true);
}
*/
function chkresno(resno) {
	var check = false;
	
	// ÁÖ¹Î¹øÈ£ÀÇ ÇüÅÂ¿Í 7¹øÂ° ÀÚ¸®(¼ºº°) À¯È¿¼º °Ë»ç
	fmt = /^\d{6}-[1234]\d{6}$/;
	if (!fmt.test(resno)) {
	 return check;
	}

	// ³¯Â¥ À¯È¿¼º °Ë»ç
	birthYear = (resno.charAt(7) <= "2") ? "19" : "20";
	birthYear += resno.substr(0, 2);
	birthMonth = resno.substr(2, 2) - 1;
	birthDate = resno.substr(4, 2);
	birth = new Date(birthYear, birthMonth, birthDate);

	if ( birth.getYear() % 100 != resno.substr(0, 2) ||
	   birth.getMonth() != birthMonth ||
	   birth.getDate() != birthDate) {
	 return check;
	}

	// Check Sum ÄÚµåÀÇ À¯È¿¼º °Ë»ç
	buf = new Array(13);
	for (i = 0; i < 6; i++) buf[i] = parseInt(resno.charAt(i));
	for (i = 6; i < 13; i++) buf[i] = parseInt(resno.charAt(i + 1));

	multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
	for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);

	if ((11 - (sum % 11)) % 10 != buf[12]) {
	 return check;
	}

	return true;
}
// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å© ( Æû ) /*¿Ï·á
function checkRegNo(firstNo, secondNo)
{
	var chk = (checkLengthInteger (firstNo,"ÁÖ¹Îµî·Ï¹øÈ£ Ã¹¹øÂ°",6) && checkLengthInteger(secondNo,"ÁÖ¹Îµî·Ï¹øÈ£ µÎ¹øÂ°",7));
	var chk2 = chkresno(firstNo.value+'-'+secondNo.value);
    var chk3 = CheckFgnNo(firstNo.value+''+secondNo.value);
	//alert(chk3);
	if(!(chk2 || chk3))
	{
		firstNo.focus();
		alert("ÁÖ¹Îµî·Ï ¹øÈ£¿¡ ¿À·ù°¡ ÀÖ½À´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä.");
	}
	return (chk && (chk2 || chk3));
}
/*
function checkRegNo(firstNo, secondNo, al)
{
	var chk = (checkLengthInteger (firstNo,"ÁÖ¹Îµî·Ï¹øÈ£ Ã¹¹øÂ°",6, al) && checkLengthInteger(secondNo,"ÁÖ¹Îµî·Ï¹øÈ£ µÎ¹øÂ°",7, al));
	return (chk);
}
*/

// Àç¿Ü±¹ÀÎ ¹øÈ£ Ã¼Å©
function CheckFgnNo(fgnno) {
        var sum=0;
        var odd=0;

        buf = new Array(13);

        for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); }
        odd = buf[7]*10 + buf[8];

        if(odd%2 != 0) { return false; }
        if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) {
                return false;
        }

        multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];

        for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); }
        sum = 11 - (sum%11);

        if(sum >= 10) { sum -= 10; }
        sum += 2;
        if(sum >= 10) { sum -= 10; }
        if(sum != buf[12]) { return false }

        return true;
}

// ¹ýÀÎµî·Ï¹øÈ£ Ã¼Å© ( Æû ) /*¿Ï·á
function checkCorpNo(firstNo, secondNo)
{
	var chk = (checkLengthInteger (firstNo,"¹ýÀÎ¹øÈ£ Ã¹¹øÂ°",6) && checkLengthInteger(secondNo,"¹ýÀÎ¹øÈ£ µÎ¹øÂ°",7));
	return (chk);

}
/*
function checkCorpNo(firstNo, secondNo, al)
{
	var chk = (checkLengthInteger (firstNo,"¹ýÀÎ¹øÈ£ Ã¹¹øÂ°",6, al) && checkLengthInteger(secondNo,"¹ýÀÎ¹øÈ£ µÎ¹øÂ°",7, al));
	return (chk);
}
*/
// »ç¾÷ÀÚ¹øÈ£ Ã¼Å©
function checkBusinessNo(firstNo, secondNo, thirdNo)
{
	var chk = (checkLengthInteger(firstNo,"»ç¾÷ÀÚ¹øÈ£ Ã¹¹øÂ°",3) && checkLengthInteger(secondNo,"»ç¾÷ÀÚ¹øÈ£ µÎ¹øÂ°",2) && checkLengthInteger(thirdNo,"»ç¾÷ÀÚ¹øÈ£ ¼¼¹øÂ°",5));
	//if(chk)
	//{
	//	chk = validBusNo(firstNo, secondNo, thirdNo);
	//}
	return (chk);
}
/*
function checkBusinessNo(firstNo, secondNo, thirdNo, al)
{
	var chk = (checkLengthInteger(firstNo,"»ç¾÷ÀÚ¹øÈ£ Ã¹¹øÂ°",3, al) && checkLengthInteger(secondNo,"»ç¾÷ÀÚ¹øÈ£ µÎ¹øÂ°",2, al) && checkLengthInteger(thirdNo,"»ç¾÷ÀÚ¹øÈ£ ¼¼¹øÂ°",5, al));
	return (chk);
}
*/
// ÀüÈ­¹øÈ£ Ã¼Å© ( Æû ) /*¿Ï·á
function checkTelNo(firstNo, secondNo, thirdNo)
{
	if(firstNo.value.substring(0, 1) != '0')
	{
		firstNo.focus();
		alert("À¯È¿ÇÑ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
		return;
	}
	var chk = (checkInteger(firstNo,"ÀüÈ­¹øÈ£ Ã¹¹øÂ°") && checkInteger(secondNo,"ÀüÈ­¹øÈ£ µÎ¹øÂ°") && checkLengthInteger(thirdNo,"ÀüÈ­¹øÈ£ ¼¼¹øÂ°",4));
	return (chk);
}
/*
function checkTelNo(firstNo, secondNo, thirdNo, al)
{
	var chk = (checkInteger(firstNo,"ÀüÈ­¹øÈ£ Ã¹¹øÂ°", al) && checkInteger(secondNo,"ÀüÈ­¹øÈ£ µÎ¹øÂ°", al) && checkLengthInteger(thirdNo,"ÀüÈ­¹øÈ£ ¼¼¹øÂ°",4, al));
	return (chk);
}
*/

// ÆÑ½º¹øÈ£ Ã¼Å© ( Æû ) /*¿Ï·á
function checkFaxNo(firstNo, secondNo, thirdNo)
{
	if(firstNo.value.substring(0, 1) != '0')
	{
		firstNo.focus();
		alert("À¯È¿ÇÑ ÆÑ½º¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
		return;
	}
	var chk = (checkInteger(firstNo,"ÆÑ½º¹øÈ£ Ã¹¹øÂ°") && checkInteger(secondNo,"ÆÑ½º¹øÈ£ µÎ¹øÂ°") && checkLengthInteger(thirdNo,"ÆÑ½º¹øÈ£ ¼¼¹øÂ°",4));
	return (chk);
}

function checkMobile(firstNo, secondNo, thirdNo)
{
	if(firstNo.value.substring(0, 1) != '0')
	{
		firstNo.focus();
		alert("À¯È¿ÇÑ ÈÞ´ëÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
		return;
	}
	var chk = (checkInteger(firstNo,"ÈÞ´ëÀüÈ­¹øÈ£ Ã¹¹øÂ°") && checkInteger(secondNo,"ÈÞ´ëÀüÈ­¹øÈ£ µÎ¹øÂ°") && checkLengthInteger(thirdNo,"ÈÞ´ëÀüÈ­¹øÈ£ ¼¼¹øÂ°",4));
	return (chk);
}
/*
function checkFaxNo(firstNo, secondNo, thirdNo, al)
{
	var chk = (checkInteger(firstNo,"ÆÑ½º¹øÈ£ Ã¹¹øÂ°", al) && checkInteger(secondNo,"ÆÑ½º¹øÈ£ µÎ¹øÂ°", al) && checkLengthInteger(thirdNo,"ÆÑ½º¹øÈ£ ¼¼¹øÂ°",4, al));
	return (chk);
}
*/


   /*ÀÔ·Â°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)¸¸À¸·Î µÇ¾îÀÖ´ÂÁö Ã¼Å© */
    function containsCharsOnly(val, chars)
    {
        for (var inx=0;  inx<val.length;  inx++)
        {
           if (chars.indexOf(val.charAt(inx)) == -1)
               return false;
        }
        return true;
   }
   
   /*ÀÔ·Â°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å© */
    function containsChars(val, chars)
    {
  
        for (var inx=0;  inx<val.length;  inx++)
        {
  
           if (chars.indexOf(val.charAt(inx)) != -1)
           	  return false;
        }
        return true;
   }


   /* value ¼ýÀÚ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©*/
   function isNumCheck(val)
   {
       return containsCharsOnly(val, "0123456789");
   }

   /* value ¼ýÀÚ, "-"·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©*/
   function isNumBarCheck(val)
   {
       return containsCharsOnly(val, "-0123456789");
   }

   /* value ¿µ¹®ÀÚ, ¼ýÀÚ, "@", ".","-","_" ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©*/
   function isMailCharCheck(val)
   {
       return containsCharsOnly(val, ".@0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_");
   }

   /* value ¿µ¹®ÀÚ, ¼ýÀÚ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©*/
   function isEngNumCheck(val)
   {
       return containsCharsOnly(val, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
   }

   /* value ¿µ¹®ÀÚ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©*/
   function isEnglishCheck(val)
   {
        return containsCharsOnly(val, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
   }

   function validMemberId(varVal)
    {
		if(varVal.value.length == 0)
		{
			alert(" ¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
			varVal.focus();
			return false;
		}
		
		if(varVal.value == 'ADMIN' ||varVal.value == 'admin')
		{
			alert("ADMIN ¾ÆÀÌµð´Â »ç¿ëÇÏ½Ç ¼ö ¾ø´Â ¾ÆÀÌµðÀÔ´Ï´Ù.");
			return false;
		}

		if( !isEngNumCheck(varVal.value) ||  varVal.value.length<4 || varVal.value.length >10)
		{
			alert(" ¾ÆÀÌµð´Â ¿µ¹®ÀÌ³ª ¼ýÀÚ 4ÀÚÀÌ»ó 10ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
			varVal.focus();
			return false;
		}
		
		return true;
    }

    function validPwd(varVal1, varVal2, varVal3)
    {
		if(varVal1.value.length == 0)
		{
			alert(" ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
			varVal1.focus();
			return false;
		}
		
		//if(!isEnglishCheck(varVal1.value) || !isNumCheck(varVal1.value)  ||  varVal1.value.length<5 || varVal1.value>10)
		if(!isEngNumCheck(varVal1.value)) 
		{
			alert(" ºñ¹Ð¹øÈ£´Â ¿µ¹®ÀÌ³ª ¼ýÀÚ 4ÀÚÀÌ»ó 10ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
			varVal1.focus();
			return false;
		}

		if(varVal1.value.length<4 || varVal1.value.length>10)
		{
			alert(" ºñ¹Ð¹øÈ£´Â ¿µ¹® ¶Ç´Â ¼ýÀÚ¸¸À» »ç¿ëÇÏ¿© 4ÀÚÀÌ»ó 10ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
			varVal1.focus();
			return false;
		}
		
		if(varVal1.value != varVal2.value)
		{
			alert(" ºñ¹Ð¹øÈ£¿Í ºñ¹Ð¹øÈ£È®ÀÎÀÌ ÀÏÄ¡ÇÏÁö¾Ê½À´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ê½Ã¿ä.");
			varVal2.focus();
			return false;
		}
		
	    /*
		if(varVal1.value == varVal3.value)
		{
			alert(" ¾ÆÀÌµð¿Í ºñ¹Ð¹øÈ£°¡ °°½À´Ï´Ù. ´Ù¸¥ ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä..");
			varVal1.value="";
			varVal2.value="";
			varVal1.focus();
			return false;
		}
		*/
		
		return true;
    }

	function validPwd2(varVal1, varVal3)
    {
		if(varVal1.value.length == 0)
		{
			alert(" ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
			varVal1.focus();
			return false;
		}
		
		if(!isEngNumCheck(varVal1.value)  ||  varVal1.value.length<4 || varVal1.value.length >10)
		{
			alert(" ºñ¹Ð¹øÈ£´Â ¿µ¹®, ¼ýÀÚÁ¶ÇÕ 4ÀÚÀÌ»ó 10ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
			varVal1.focus();
			return false;
		}
		
	    /*
		if(varVal1.value == varVal3.value)
		{
			alert(" ¾ÆÀÌµð¿Í ºñ¹Ð¹øÈ£°¡ °°½À´Ï´Ù. ´Ù¸¥ ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä..");
			varVal1.focus();
			return false;
		}
		*/
		return true;
    }

	function validPwd3(varVal1, varVal2)
	{
		if(varVal1.value.length == 0)
		{
			alert(" ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
			varVal1.focus();
			return false;
		}

//		if(!isEngNumCheck(varVal1.value)  ||  varVal1.value.length<5 || varVal1.value.length >10)
//		{
//			alert(" ºñ¹Ð¹øÈ£´Â ¿µ¹®, ¼ýÀÚÁ¶ÇÕ 5ÀÚÀÌ»ó 10ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
//			varVal1.focus();
//			return false;
//		}
		if(varVal1.value != varVal2.value)
		{
			alert(" ºñ¹Ð¹øÈ£¿Í ºñ¹Ð¹øÈ£È®ÀÎÀÌ ÀÏÄ¡ÇÏÁö¾Ê½À´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ê½Ã¿ä.");
			varVal2.focus();
			return false;
		}
		
		return true;
	}


function emailCheck (emailStr) {

	if(emailStr==null||emailStr==""){
		alert("ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		return false;
	}
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var matchArray=emailStr.match(emailPat)

	if (matchArray==null) {
		alert("À¯È¿ÇÑ ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù (. Ã¼Å©)")
		return false
	}
	var user=matchArray[1]
	var domain=matchArray[2]
	if (user.match(userPat)==null) {
		alert("ÀÌ¸ÞÀÏ °èÁ¤ÀÌ Æ²¸³´Ï´Ù.")
		return false
	}

	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
			  for (var i=1;i<=4;i++) {
				if (IPArray[i]>255) {
					alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ Æ²·È½À´Ï´Ù")
					return false
				}
		}
		return true
	}

	// Domain is symbolic name
	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		alert("µµ¸ÞÀÎ¸íÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù")
		
//		event.srcElement.focus();		
		return false
	}

	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || 
		domArr[domArr.length-1].length>3) {
	   // the address must end in a two letter or three letter word.
	   alert("µµ¸ÞÀÎ¸íÀÇ ¸¶Áö¸· ±ÛÀÚ´Â 3±ÛÀÚ°Å³ª 2ÀÚ¸®ÀÇ ±¹°¡ÄÚµå ÀÔ´Ï´Ù")

//       event.srcElement.focus();	   
	   return false
	}

	// Make sure there's a host name preceding the domain.
	if (len<2) {
	   var errStr="ÀÌÁÖ¼ÒÀÇ È£½ºÆ®¸íÀÌ ¾ø½À´Ï´Ù."
	   alert(errStr)
//  	   event.srcElement.focus();	   
	   return false
	}

	// If we've gotten this far, everything's valid!
	return true;
}

function FormatNumber4(num)
{
	return num.replace(/-/gi,"");
}

function formatSpace(str)
{
	return str.replace(/ /gi,"");
}

function checkDate(field)
{
	var msg = "³¯Â¥ ÀÔ·Â Çü½ÄÀ» 2002-06-12¿Í \n°°ÀÌ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä";
	if(field.value != null && field.value != "")
	{
		if(field.value.length != 10)
		{
			alert(msg);
			field.focus();
			field.select();
			return ;
		}
		if(isNaN(field.value.substring(0, 4)) || isNaN(field.value.substring(5, 7)) || isNaN(field.value.substring(8, 10)))
		{
			alert(msg);
			field.focus();
			field.select();
			return false;
		}
		if(field.value.charAt(4)!="-" || field.value.charAt(7)!="-")
		{
			alert(msg);
			field.focus();
			field.select();
			return false;
		}
	}
	return true;
}

/* »ç¾÷ÀÚµî·Ï  ¹øÈ£ Ã¼Å©ÇÏ±â */
function validBusNo(varNo1, varNo2, varNo3)
{
	var varBusNo = varNo1.value + varNo2.value + varNo3.value;
	var varVal = 0;
	var chrWeight = new Array(1,3,7,1,3,7,1,3);

	for(var i=0; i<8; i++)
	{
		varVal = varVal + eval(varBusNo.charAt(i)) * eval(chrWeight[i]);
	}

	var varTemp = eval(varBusNo.charAt(8))*5;

	varVal= varVal + parseInt(varTemp/10) + parseInt(varTemp%10);

	varVal= parseInt(varVal%10);

	if(varVal != 0) varVal = 10 - varVal;
	
	if(varVal != varBusNo.charAt(9))
	{
		alert("Àß¸øµÈ »ç¾÷ÀÚ µî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½ÃÈ®ÀÎÇÏ½Ê½Ã¿ä.");
		varNo1.value = "";
		varNo2.value = "";
		varNo3.value = "";
		varNo1.focus();
		return false;
	}        
	return true;		
}


/* »ç¾÷ÀÚµî·Ï  ¹øÈ£ Ã¼Å©ÇÏ±â */
function validBusNo1(varNo1)
{
	var varBusNo = varNo1.value;
	var varVal = 0;
	var chrWeight = new Array(1,3,7,1,3,7,1,3);

	for(var i=0; i<8; i++)
	{
		varVal = varVal + eval(varBusNo.charAt(i)) * eval(chrWeight[i]);
	}

	var varTemp = eval(varBusNo.charAt(8))*5;

	varVal= varVal + parseInt(varTemp/10) + parseInt(varTemp%10);

	varVal= parseInt(varVal%10);

	if(varVal != 0) varVal = 10 - varVal;
	
	if(varVal != varBusNo.charAt(9))
	{
		alert("Àß¸øµÈ »ç¾÷ÀÚ µî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½ÃÈ®ÀÎÇÏ½Ê½Ã¿ä.");
		varNo1.value = "";
		varNo1.focus();
		return false;
	}        
	return true;		
}
/*-----------------------------------------------------------------------------------------------*/
/* FUNCTION ID : isDecimal                                                                       */
/* ±â       ´É : ¼ýÀÚ¿©ºÎ                                                                        */
/* Æ¯ ÀÌ »ç Ç× :                                                                                 */
/*-----------------------------------------------------------------------------------------------*/
function isDecimal(number)
{
	if(number>=0 && number<=9) return true;
	else return false;
}

/*-----------------------------------------------------------------------------------------------*/
/* FUNCTION ID : LeapYear                                                                        */
/* ±â       ´É : À±³â¿©ºÎ                                                                        */
/* Æ¯ ÀÌ »ç Ç× :                                                                                 */
/*-----------------------------------------------------------------------------------------------*/
function LeapYear(year)
{
	if (year % 4 == 0)
		if  (year % 100 == 0)
			 if  (year % 400 == 0)
                  return 2;
			 else return 1;
		else return 2;
	return 1;
}


/*-----------------------------------------------------------------------------------------------*/
/* FUNCTION ID : dateCourse                                                                      */
/* ±â       ´É : ³¯Â¥ÀÔ·Â                                                                        */
/* Æ¯ ÀÌ »ç Ç× :                                                                                 */
/*-----------------------------------------------------------------------------------------------*/
var daytab1 = new Array("31","28","31","30","31","30","31","31","30","31","30","31")
var daytab2 = new Array("31","29","31","30","31","30","31","31","30","31","30","31")
function dateCourse(source)
{
	if(window.event.keyCode == 8)return ;
    // ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô Ã³¸®
    for(var i=0; i<source.value.length; i++)
        if(!isDecimal(source.value.charAt(i)))
           source.value = source.value.substring(0,i) + source.value.substring(i+1,source.value.length);

    if (source.value.length > 8)
        source.value = source.value.substring(0,8);

    switch(source.value.length)
    {
        case 1: break;
        case 2: break;
        case 3: break;
        case 4: source.value = source.value + "-"; break;
        case 5: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,5);break;
        case 6: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-";break;
        case 7: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,7);break;
        case 8: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,8);break;
    }

    if (source.value.length < 10)
        return false;

    var year  = source.value.substring(0,4);
    var month = source.value.substring(5,7);
    var day   = source.value.substring(8,10);

    if (month < 1 || month > 12)
    {
        alert("(year-month-day) : [" + year + "-" + month + "-" + day + "]" + "\n\nÀÏÀÚ(¿ù) ÀÔ·Â ¿À·ùÀÔ´Ï´Ù. ´Ù½ÃÀÔ·ÂÇÏ¼¼¿ä.  ");
        source.value = "";
        source.focus();
        return false;
    }

    if (LeapYear(year) == 1)
    {
        if (daytab1[month-1] < day)
        {
            alert("(year-month-day) : [" + year + "-" + month + "-" + day + "]" + "\n\nÀÏÀÚ(ÀÏ) ÀÔ·Â ¿À·ùÀÔ´Ï´Ù. ´Ù½ÃÀÔ·ÂÇÏ¼¼¿ä.  ");
            source.value = "";
            source.focus();
            return false;
        }
    }
    else
    {
        if (daytab2[month-1] < day)
        {
            alert("(year-month-day) : [" + year + "-" + month + "-" + day + "]" + "\n\nÀÏÀÚ(ÀÏ) ÀÔ·Â ¿À·ùÀÔ´Ï´Ù. ´Ù½ÃÀÔ·ÂÇÏ¼¼¿ä.  ");
            source.value = "";
            source.focus();
            return false;
        }
    }
	return true;
}

function imgViewPop(url){
	ws = "toolbar=no,menubar=no,location=yes,resizable=yes,scrollbars=yes";	
	window.open("../../include/imgViewer.jsp?url="+url, "WIN", ws);	
}

//ÆÄÀÏÃ·ºÎ ¼¿ Ãß°¡----------------
function  putCell01(rowsObj, cell_num , value , width , align )
{
   if(width != 0)rowsObj.cells(cell_num).width = width;
   if(align != "")rowsObj.cells(cell_num).align = align;
   rowsObj.cells(cell_num).innerHTML = value;
}

function  makeRow01(makeIndex)
{

	oTable = tbl;
	oRows = oTable.insertRow();	// 1°³ÀÇ ROW¸¦ Ãß°¡ÇÑ´Ù(ROWÆ÷ÀÎÅÍ´Â Ãß°¡µÈ Æ÷ÀÎÅÍ°¡ µÈ´Ù).
	oRows.style.align = 'center';	// ROWÀÇ ±âº»È¯°æÀ» ¼³Á¤ÇÑ´Ù.

	var i;
	for(i = 0; i < makeIndex; i++)		// ÀÔ·Â¹ÞÀº makeIndexÅ©±â ¸¸Å­ CellÀ» »ý¼ºÇÑ´Ù.
	{
		oRows.insertCell()
	}
	return oRows;
}

function  Insert_Row()	//¼öÇà½Ã 1°³¶óÀÎ Ãß°¡
{
	var rowcnt = document.mainForm.file_no.value; //Ãß°¡ÇÒÇà¼ö
	var div = document.mainForm.div.value;
	var index  = 0 ; //¿ÀºêÁ§Æ®¼ø¹ø

	lMax = tbl.rows.length;

	for(i=0;i<lMax;i++)
	{
		tbl.deleteRow();
	}		

	if(rowcnt == 0) return;

	for(i=0; i<rowcnt; i++)
	{
		var tRow = makeRow01(3); //ÇÑ row »ý¼º 10 cell »ý¼º

		index = tRow.rowIndex + 1;
		next_index = index+1;

		var file = eval("document.mainForm.org_file"+index);

		//element00  =  index;
		element00 = "<img src='/kor/images/common/bt_"+index+"icon.gif' width='12' height='14' align='absmiddle'>"
		element01  = " <INPUT type=file name=file"+index+" class='small2' size=35 style='background-color: #F7F7F7;'>";
		//element02  =  "ÇöÀçÆÄÀÏ : "+ file.value;
		if (div=="U"){
			element02  = file.value;
		}else{
			element02 = ""
		}	   
		putCell01(tRow ,   0   , element00 ,  10  ,  "center");
		putCell01(tRow ,   1   , element01 ,  350  ,  "center");
		putCell01(tRow ,   2   , element02 ,  250  ,  "left");
	}//end for

   return;
}
function  Insert_Row2()	//¼öÇà½Ã 1°³¶óÀÎ Ãß°¡
{
	var rowcnt = document.mainForm.file_no.value; //Ãß°¡ÇÒÇà¼ö
	var index  = 0 ; //¿ÀºêÁ§Æ®¼ø¹ø

	lMax = tbl.rows.length;

	for(i=0;i<lMax;i++)
	{
		tbl.deleteRow();
	}		

	if(rowcnt == 0) return;

	for(i=0; i<rowcnt; i++)
	{
		var tRow = makeRow01(3); //ÇÑ row »ý¼º 10 cell »ý¼º

		index = tRow.rowIndex + 1;
		next_index = index+1;
		var file = eval("document.mainForm.org_file"+index);

		//element00  =  index;
		element00 = "<img src='img/bt_"+index+"icon.gif' width='12' height='14' align='absmiddle'>"
		element01  = " <INPUT type=file name=file"+index+" size='70' style='background-color: #F7F7F7;'>";

		//element02  =  "ÇöÀçÆÄÀÏ : "+ file.value;
		element02  = file.value;
	   
		putCell01(tRow ,   0   , element00 ,  10  ,  "center");
		putCell01(tRow ,   1   , element01 ,  350  ,  "center");
		putCell01(tRow ,   2   , element02 ,  250  ,  "left");
	}//end for

   return;
}
/*ÇÃ·¡½¬ »ðÀÔ ÀÚ¹Ù½ºÅ©¸³Æ®*/
function insertFlash(swf, width, height, bgcolor, id, flashvars, title)
{
	var strFlashTag = new String();

	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
		strFlashTag += 'id="' + id + '" title="' + title + '" width="' + width + '" height="' + height + '">';
		strFlashTag += '<param name="movie" value="' + swf + '"/>';

		if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
		strFlashTag += '<param name="quality" value="best"/>';
		strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
		strFlashTag += '<param name="menu" value="false"/>';
		strFlashTag += '<param name="salign" value="LT"/>';
		strFlashTag += '<param name="scale" value="noscale"/>';
		strFlashTag += '<param name="wmode" value="transparent"/>';
		strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
		strFlashTag += '</object>';
	}
	else
	{


		strFlashTag += '<embed src="' + swf + '" ';
		strFlashTag += 'quality="best" ';
		strFlashTag += 'bgcolor="' + bgcolor + '" ';
		strFlashTag += 'width="' + width + '" ';
		strFlashTag += 'height="' + height + '" ';
		strFlashTag += 'menu="false" ';
		strFlashTag += 'scale="noscale" ';
		strFlashTag += 'id="' + id + '" ';
		strFlashTag += 'salign="LT" ';
		strFlashTag += 'wmode="transparent" ';
		strFlashTag += 'allowScriptAccess="sameDomain" ';
		if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
		strFlashTag += 'type="application/x-shockwave-flash" ';
		strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
		strFlashTag += '</embed>';
	}

	document.write(strFlashTag);
}

function insertFlash2(swf, width, height, bgcolor, id, flashvars, title,noobj)
{
	var strFlashTag = new String();


	strFlashTag += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="' + id + '" title="' + title + '" width="' + width + '" height="' + height + '" align="middle">';
	strFlashTag += '<param name="movie" value="' + swf + '" />';
	strFlashTag += '<param name="quality" value="best"/>';
	strFlashTag += '<param name="flashvars" value="'+flashvars+'" />';
	strFlashTag += '<param name="allowFullScreen" value="false" />';
	strFlashTag += '<param name="quality" value="high" />';
	strFlashTag += '<param name="wmode" value="transparent" />';
	strFlashTag += '<param name="scale" value="noscale"/>';
	strFlashTag += '<param name="bgcolor" value="#ffffff" />';
	strFlashTag += '<object type="application/x-shockwave-flash" data="' + swf + '" id="' + id + '_noobj" title="' + title + '" width="' + width + '" height="' + height + '">';
	strFlashTag += '<param name="flashvars" value="'+flashvars+'" />';
	strFlashTag += '<param name="quality" value="best"/>';
	strFlashTag += '<param name="menu" value="false"/>';
	strFlashTag += '<param name="salign" value="LT"/>';
	strFlashTag += '<param name="scale" value="noscale"/>';
	strFlashTag += '<param name="wmode" value="transparent"/>';
	strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';

	strFlashTag += noobj.innerHTML;
	strFlashTag += '</object>';
	strFlashTag += '</object>';
	 

	document.write(strFlashTag);
}
function goLink(url,tar){
	if(tar=="_self"){
	document.location.href=url;
	}else if(tar=="_blank"){
	window.open(url,'','');
	}else{
	document.location.href=url;
	}

}

function goMain(){
	document.location.href="/user/outlineMain.do?knd=2";

}
function IE_HtmlRewrite(objParent) {
	if (window.ActiveXObject && objParent) {
		objParent.innerHTML = objParent.innerHTML;
	}
}

function Popup(url,pnama,w,h,t,l,s){

	window.open(url,pnama,"width="+w+",height="+h+",top="+t+",left="+l+",scrollbars="+s+",status=no");

}


/* °æ°íÃ¢ */
function Walert(msg){
	alert(msg);
}
/* °æ°íÃ¢ */



/* È­¸é È®´ë Ãà¼Ò ½ÃÀÛ IE Àü¿ë */
 var nowZoom = 100; // ÇöÀçºñÀ²
 var maxZoom = 200; // ÃÖ´ëºñÀ²(500À¸·ÎÇÏ¸é 5¹è Ä¿Áø´Ù)
 var minZoom = 80; // ÃÖ¼ÒºñÀ²



 //È­¸é Å°¿î´Ù.
 function zoomIn() {
  if (nowZoom < maxZoom) {
   nowZoom += 10; //25%¾¿ Ä¿Áø´Ù.
  } else {
   return;
  }

  document.body.style.zoom = nowZoom + "%";
 }


 //È­¸é ÁÙÀÎ´Ù.
 function zoomOut() {
  if (nowZoom > minZoom) {
   nowZoom -= 10; //25%¾¿ ÀÛ¾ÆÁø´Ù.
  } else {
   return;
  }

  document.body.style.zoom = nowZoom + "%";
 }

function QuickMove(Quick){

	if (Quick)
	{
		document.getElementById("border").style.display="none";
		document.getElementById("title").style.display="none";
		document.getElementById("title2").style.display="block";

	}else{
		document.getElementById("border").style.display="block";
		document.getElementById("title").style.display="block";
		document.getElementById("title2").style.display="none";
	}
}

/* ±ÛÀÚ È®´ë Ãà¼Ò ¸ðµç ºê¶ó¿ìÁ® °ø¿ë */
// cookie µî·Ï
function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) +
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

// cookie »èÁ¦
function delCookie (name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
  //ÆäÀÌÁö ¸®·Îµå
  document.location.reload();
}

var firstCall = true;

function changeFontsize(fSize, increment) {
	if (firstCall) {
		firstCall = false;
		if (increment != "") {
			changeFontsize('12', '');
		}
	}
	if (document.getElementsByTagName) {
	var getElement = document.getElementsByTagName("*");
	var eachElement, currentFontSize, fontIncrease, newFontSize;
	for (i=0; i<getElement.length; i++) {
		eachElement = getElement[i];
		if (increment != "") {
			currentFontSize = parseInt(eachElement.style.fontSize);
			fontIncrease = parseInt(increment);
			newFontSize = currentFontSize + fontIncrease;
		}
		else if (fSize != "") {
			newFontSize = parseInt(fSize);
		}
		if (getElement[i].tagName == "LI") {
			eachElement.style.lineHeight = Math.round(newFontSize*1.2) + "px";
		} else {
			eachElement.style.lineHeight = Math.round(newFontSize*1.5) + "px";
		}
		if (fSize != "") {
			switch(getElement[i].tagName) {
				case "H2": newFontSize += 3; break;
				case "H3": newFontSize += 2; break;
				case "H4": newFontSize += 1; break;
				case "H5": newFontSize += 1; break;
				case "H6": newFontSize += 1;
			}
		}
		eachElement.style.fontSize = newFontSize + "px";
		setCookie('fontSize', newFontSize);
	}
}
}


function srolltop(){

	location.href="#wrapperAll";

}

/* ÇÁ¸°Æ® ÆË¾÷ */
function printContents(tit){
	var ww = "700";
	var hh = "577";
	var obj=document.getElementById("contents");
	document.footerform.titles.value=tit;
	document.footerform.contents.value=obj.innerHTML;

	var Printwin = window.open("","printContentsWindow","width="+ww+",height="+hh+",status=0,scrollbars=yes");
	document.footerform.submit();
}

/* ÇÁ¸°Æ® ÆË¾÷ */
function printContentsEN(tit){
	var ww = "678";
	var hh = "577";
	


	var win = window.open("/ehp/print_pop.jsp?titles="+tit,"printContentsWindow","width="+ww+",height="+hh+",menubar=0,scrollbars=no");
	//win.document.iframes.document.body.innerHTML="3333";
}



/* ÀÌ¸ÞÀÏ ÀÚµ¿ÀÔ·Â */
var disBg='#DBDBDB';

function chgEmail(txt,sel,current){
	if (typeof sel=='undefined')
	{
		return;
	}
	if (current)
	{
		for (i=0; i<sel.length; i++)
		{
			if (sel[i].value==current)
			{
				sel.selectedIndex=i;
				break;
			}
		}

		if (sel.selectedIndex==0) sel.selectedIndex=sel.length-1;
	}
	//else txt.value=sel.value;


	if (sel.selectedIndex<sel.length-1)
	{
		txt.readOnly=true;
		txt.style.backgroundColor=disBg;
		txt.value=sel.value;
	}
	else
	{
		txt.readOnly=false;
		//txt.style.backgroundColor='';
		if(txt.className=='ccc'){
			txt.style.backgroundColor='';
			txt.value='';
		}
	}
}



/*Åä±Û(µ¡±ÛÇü, ´©¸®²Û °Ô½ÃÆÇ)*/
function ViewDiv(id,tmp){

 if(tmp=="1"){

  eval("health_btn0" + id + "").style.display="none";
  eval("health_close0" + id + "").style.display="block";
  eval("show_health0" + id + "").style.display="block";

 }else{
  eval("health_btn0" + id + "").style.display="block";
  eval("health_close0" + id + "").style.display="none";
  eval("show_health0" + id + "").style.display="none";
 }

}



/*Åä±Û(¸®ÇÃ °Ô½ÃÆÇ)*/
function ViewDivRe(id,tmp){

 if(tmp=="1"){

  eval("health_btnRe0" + id + "").style.display="none";
  eval("health_closeRe0" + id + "").style.display="block";
  eval("show_healthRe0" + id + "").style.display="block";

 }else{
  eval("health_btnRe0" + id + "").style.display="block";
  eval("health_closeRe0" + id + "").style.display="none";
  eval("show_healthRe0" + id + "").style.display="none";
 }

}


/*´Þ·Â½ÃÀÛ*/
function ViewDivCalendar(id,tmp){

 if(tmp=="1"){

  eval("search_calendar").style.display="none";
  eval("search_calendar").style.display="block";
  eval("search_calendar").style.display="block";

 }else{
  eval("search_calendar").style.display="block";
  eval("search_calendar").style.display="none";
  eval("search_calendar").style.display="none";
 }

}

/*´Þ·ÂÁ¾·á*/
function ViewDivCalendar01(id,tmp){

 if(tmp=="1"){

  eval("search_calendar01").style.display="none";
  eval("search_calendar01").style.display="block";
  eval("search_calendar01").style.display="block";

 }else{
  eval("search_calendar01").style.display="block";
  eval("search_calendar01").style.display="none";
  eval("search_calendar01").style.display="none";
 }

}



/* ShowHideLayers */
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function GnbRoll(size){
	if(document.getElementById("gnb_main")){
		document.getElementById("gnb_main").style.height=size + "px";
		document.getElementById("gnb_flash").style.height=size + "px";
		document.getElementById("gnb_flash_noobj").style.height=size + "px";
	}else{
		document.getElementById("gnb").style.height=size + "px";
		document.getElementById("gnb_flash").style.height=size + "px";
		document.getElementById("gnb_flash_noobj").style.height=size + "px";
	}
}

function LayerDown(){
		document.getElementById("footer_buttons2").style.display="none";
		document.getElementById("footer_buttons1").style.display="block";
		document.getElementById("main_footer_menu").style.bottom="-98px";

	/*


	if(parseInt(document.getElementById("main_footer_menu").style.bottom) > -98){
		document.getElementById("main_footer_menu").style.bottom = (parseInt(document.getElementById("main_footer_menu").style.bottom) + 0.3 * (-102 - parseInt(document.getElementById("main_footer_menu").style.bottom))) + "px";
		window.setTimeout("LayerDown()",3);
	}else{
		document.getElementById("footer_buttons2").style.display="none";
		document.getElementById("footer_buttons1").style.display="block";
		document.getElementById("main_footer_menu").style.bottom="-98px";
		return;
	}
	*/
}
function LayerUp(){	
		document.getElementById("footer_buttons1").style.display="none";
		document.getElementById("footer_buttons2").style.display="block";
		document.getElementById("main_footer_menu").style.bottom="61px";
	/*
	if(parseInt(document.getElementById("main_footer_menu").style.bottom) < 0){
		document.getElementById("main_footer_menu").style.bottom = (parseInt(document.getElementById("main_footer_menu").style.bottom) + 0.3 * (0-parseInt(document.getElementById("main_footer_menu").style.bottom))) + "px";
		window.setTimeout("LayerUp()",3);
	}else{
		document.getElementById("footer_buttons1").style.display="none";
		document.getElementById("footer_buttons2").style.display="block";
		document.getElementById("main_footer_menu").style.bottom="0px";
	}
	*/
}


/*png »ç¿ë ÀÚ¹Ù½ºÅ©¸³Æ®*/
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 setFlashDivY(y){
	document.getElementById("flashLayer").style.top=y + "px";
}

function setFlashDivH(h){
	document.getElementById("flashLayer").style.height=h;
}



function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}



//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function tb_show(na,na2,na3){

	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	overHeight = arrayPageSize[1] + arrayPageScroll[1];
	document.getElementById("overlays").style.height=overHeight + "px";
	document.getElementById("overlays").style.display="block";

	aboutLeft = (arrayPageSize[0] - 864) / 2;

	//document.getElementById("about").style.left=aboutLeft + "px";

}

function tb_remove(){
	document.getElementById("overlays").style.display="none";
}

function Tot_search(qu){
	fo=document.footerform;
	fo.query.value=qu;
	fo.submit();
}

function overlays_resize(){
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	overHeight = arrayPageSize[1] + arrayPageScroll[1];
	document.getElementById("overlays").style.height=overHeight + "px";
}


function LinkSelectS(){
	if(document.foform.LinkSelect.value!=""){
	window.open(document.foform.LinkSelect.value,'','');
	}
}
function LinkSelect2(obj){
	document.location.href=obj[obj.selectedIndex].value;
}



function SWFLoader() {
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	
	var classId = new String;
    var codeBase = new String;
	var pluginSpage = new String;
	var embedType = new String;	
	var allParameter = new String;	
	
	var src = new String;
	var width = new String;
	var height = new String;
	var id = new String;
	var title = new String;
	var layer = new String;
	var arg = new String;
	var altText = new String;
	var wmode = new String;

	this.init = function ( w, h, s, a ) {
		width = w; 
		height = h; 
		src = s; 
		arg = a; 
		wmode = 'transparent'; 

		classId = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
		codeBase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
		pluginSpage = 'http://www.macromedia.com/go/getflashplayer';
		embedType = 'application/x-shockwave-flash';

		parameter += "<param name='allowScriptAccess' value='always'>\n";
		parameter += "<param name='allowFullScreen' value='false'\n>";
		parameter += "<param name='movie' value='"+ s + "'>\n";
		parameter += "<param name='quality' value='best'/>\n";
		parameter += "<param name='base' value='.'>\n";
		parameter += "<param name='scale' value='noscale'/>\n";
		parameter += "<param name='expressinstall' value='Scripts/expressInstall.swf' />\n";
	}
	
	this.parameter = function ( param, value ) {
		 parameter += "<param name='"+param +"' value='"+ value + "'>\n";
	}

	this.wmode = function ( value ) {
		wmode = value;
	}

	this.id = function ( value ) {
		id = value;
	}
	this.title = function ( value ) {
		title = value;
	}

	this.shocknone = function ( value ) {
		altText = value;
	}

	this.layer = function ( value ) {
		if(value == undefined) {
			layer = "";
		} else {
			layer = value;
		}
	}

	this.show = function () {
		obj = '<object id="'+id+'" width="'+width+'" height="'+height+'" title="'+title+'" classid="'+classId+'" codebase="'+codeBase+'">\n'+
			parameter +
			'<param name="wmode" value="'+wmode+'">\n'+
			'<!--[if !IE]>-->\n' +
			'<object type="application/x-shockwave-flash" data="' + src + '" width="' + width + '" height="' + height + '" name="' + id + '">\n' +
				parameter +
				'<param name="wmode" value="'+wmode+'">\n'+
			'<!--<![endif]-->\n' +
				'<div class="alt-content alt-' + id + '2">' + altText + '</div>\n' +
			'<!--[if !IE]>-->\n' +
			'</object>\n' +
			'<!--<![endif]-->\n' +
		'</object>';

		if(layer == "") {
			document.write(obj);

		}else{
			var div = document.getElementById( layer);
			div.style.display = "";
			div.innerHTML = obj;
		}
	}
}

