<!--
/******************************************************************************************************************
(함수)지정한 문자열만큼만 입력받기				checkByte_Length( objEle, intMax, bShow, strShow_SizeId )
유효성 체크 (아이디)										check_Id( objEle, nMin, nMax, bRequired, cMsgTitle )
유효성 체크 (비밀번호)									check_Pwd( objEle, objEle_re, nMin, nMax, bRequired, cMsgTitle )
유효성 체크 (제한적인 문자만 사용)				check_LimitString( objEle, nMin, nMax, bRequired, cValueType, cMsgTitle )
유효성 체크 (모든 문자 사용가능)					check_AllString( objEle, nMin, nMax, bRequired, cMsgTitle )
유효성 체크 (이메일)										check_Email( objEle,  bRequired, cMsgTitle, bDaumMaill )
유효성 체크 (주민등록번호)							check_Jumin( objEle1,  objEle2, bRequired, cMsgTitle )
유효성 체크 (사업자번호)								check_Saupja( objEle1,  objEle2, objEle3, bRequired, cMsgTitle )
유효성 체크 (법인번호)								check_CorpNumber( objEle1,  objEle2, bRequired, cMsgTitle )
유효성 체크 (전화번호)									check_Phone( objEle1,  objEle2, objEle3, bRequired, cPhoneType, cMsgTitle )
유효성 체크 (날짜)											check_Date( objEle, bRequired, cMsgTitle )
유효성 체크 (파일 확장자 체크)						check_FileExt(objEle, usableFileExts, cMsgTitle)
******************************************************************************************************************/


/*==========================================================================
*	전역 변수
*==========================================================================*/
var nMax_Repeat = 3;																					// 반복문자의 최대 허용값
var arrId_FilterList = new Array("admin", "master", "manager", "test", "tester");	// 아이디 필터링 리스트


/**
*	TO DO : 지정한 문자열만큼만 입력받기
*	Param	: objEle
*	Param	: intMax
*	Param	: bShow         		(입력되는 문자열의 크기를 보여줄것인지의 여부)
*	Param	: strShow_SizeId	(입력되는 문자열의 크기를 보여줄 Form Element)
*
*	Return	: 없음
*
*	사용예제
* 		<textarea name="content" onpropertychange="javascript:checkByte_Length(this, 10, false, '');"></textarea>
* 		<textarea name="content" onpropertychange="javascript:checkByte_Length(this, 10, true, 'lblLength');"></textarea>
**/
function checkByte_Length( objEle, intMax, bShow, strShow_SizeId )
{
	var objEle_Show;
	if ( bShow && !IsEmpty(strShow_SizeId) )
	{
		objEle_Show = eval("document.getElementById('"+ strShow_SizeId +"')");
	}

    var i = 0;
    var nTotalByte     	= 0;
    var nTotalByte_Old	= 0;
    var cOneChar;
    var cTempString;

    while( i < objEle.value.length )
    {
        cOneChar = objEle.value.charAt(i);
    
        if ( escape(cOneChar).length > 4 )
        {
            nTotalByte += 2;
        }
        else
        {
            nTotalByte ++;
        }

        if ( nTotalByte > intMax )
        {
            alert("You exceeded the feasible range input.");
        
            cTempString = objEle.value.substr(0,i);
            objEle.value = cTempString;
            nTotalByte = nTotalByte_Old;
            break;
        }

        nTotalByte_Old = nTotalByte;
        i++;
    }

	if ( typeof(objEle_Show) == "object" )
	{
		if (objEle_Show.type == "text")
		{
			objEle_Show.value = nTotalByte;					// text
		} else {
			objEle_Show.innerText = nTotalByte;			// span
		}
	}
}



/**
*	TO DO 	: 유효성 체크 (아이디)
*	Param	: objEle
*	Param	: nMin			(입력 최소길이)
*	Param	: nMax			(입력 최대길이)
*	Param	: bRequired	(필수체크 여부)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_Id( form.id, 4, 12, true, '아이디' ) == false )	return;
**/
function check_Id( objEle, nMin, nMax, bRequired, cMsgTitle )
{
	if ( typeof(objEle) != "object" )   return false;
	
	var strValue 	= getTrim( objEle.value, "A" );
	if ( bRequired == false && strValue != "" )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue) )
		{
			alert("Please type in the "+ cMsgTitle +" value");
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 입력가능문자 체크
		if ( !IsValueType(strValue, "EN2") )
		{
			alert("There is a figure not allowed in the "+ cMsgTitle +" input value.");
			objEle.value = "";
			objEle.focus();
			return false;
		}
		
		// 입력길이 체크
		if ( !IsLength(strValue, nMin, nMax) )
		{
			alert("When inputting"+ cMsgTitle +", enter in between " + nMin + " to " + nMax + " digits.");		
			objEle.value = "";
			objEle.focus();
			return false;
		}
		
		// 금지단어 필터링 체크
		if ( IsWord_Filter(strValue, arrId_FilterList) )
		{
			alert("You cannot use as an "+ cMsgTitle +" input value.");
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 연속문자 체크
		if ( IsRepeat(strValue,  nMax_Repeat) )
		{
			alert("You cannot use repeating digits more than "+ nMax_Repeat +" times when inputting "+ cMsgTitle +" values.");			
			objEle.value = "";
			objEle.focus();
			return false;
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (비밀번호)
*	Param	: objEle
*	Param	: objEle_re
*	Param	: nMin			(입력 최소길이)
*	Param	: nMax			(입력 최대길이)
*	Param	: bRequired	(필수체크 여부)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_Pwd( form.pwd[0],  form.pwd[1], 4, 12, true, '비밀번호' ) == false )	return;
**/
function check_Pwd( objEle, objEle_re, nMin, nMax, bRequired, cMsgTitle )
{
	if ( typeof(objEle) != "object" )   		return false;
	if ( typeof(objEle_re) != "object" )   	return false;
	
	var strValue 	= getTrim( objEle.value, "A" );
	if ( bRequired == false && strValue != "" )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue) )
		{
			alert("Please type in the "+ cMsgTitle +" value");
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 입력가능문자 체크
		if ( !IsValueType(strValue, "PWD") )
		{
			alert("There is a figure not allowed in the "+ cMsgTitle +"input value.");			
			objEle.value = "";
			objEle.focus();
			return false;
		}
		
		// 입력길이 체크
		if ( !IsLength(strValue, nMin, nMax) )
		{
			alert("When inputting"+ cMsgTitle +", enter in between " + nMin + " to " + nMax + " digits." );
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 연속문자 체크
		if ( IsRepeat(strValue,  nMax_Repeat) )
		{
			alert("You cannot use repeating digits more than "+ nMax_Repeat +" times when inputting "+ cMsgTitle +" values." );
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 혼합문자 체크
		if ( !IsMix_String(strValue, true) )		//비밀번호는 특문을 포함할 수 있지만 반드시 포함할 필요는 없다. 단지 체크를 위해 true 전달
		{
			alert("The "+ cMsgTitle +" input value must have alphabets and numbers.");
			
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 동일정보 체크		
		if ( !IsEqual( strValue, objEle_re.value ) )
		{
			alert("The "+ cMsgTitle +" input values and the "+ cMsgTitle +" confirmation input value does not match.");
			
			objEle_re.value = "";
			objEle.value = "";
			objEle.focus();
			return false;
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (제한적인 문자만 사용)
*	Param	: objEle
*	Param	: nMin			(입력 최소길이)
*	Param	: nMax			(입력 최대길이)
*	Param	: bRequired	(필수체크 여부)
*	Param	: cValueType	(입력가능문자 형식)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_LimitString( form.name, 4, 12, true, 'HE', '이름' ) == false )	return;
**/
function check_LimitString( objEle, nMin, nMax, bRequired, cValueType, cMsgTitle )
{
	if ( typeof(objEle) != "object" )   return false;
	var strValue;

	switch ( cValueType.toUpperCase() )
	{
		case "HENB"	:
		case "HB"		:	// HENB, HBEB, EB 등은 공백을 허용하므로 패스
		case "EB"		:	strValue = objEle.value;							break;
		default			:	strValue = getTrim( objEle.value, "A" );	break;
	}
	
	if ( bRequired == false && strValue != "" )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue) )
		{
			alert("Please type in the "+ cMsgTitle +" value");
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 입력가능문자 체크
		if ( !IsValueType(strValue, cValueType) )
		{
			alert("There is a figure not allowed in the "+ cMsgTitle +"input value.");
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 입력길이 체크
		if ( !IsLength(strValue, nMin, nMax) )
		{
			alert("When inputting"+ cMsgTitle +", enter in between " + nMin + " to " + nMax + " digits." );
			objEle.value = "";
			objEle.focus();
			return false;
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (모든 문자 사용가능)
*	Param	: objEle
*	Param	: nMin		(입력 최소길이)
*	Param	: nMax		(입력 최대길이)
*	Param	: bRequired	(필수체크 여부)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_AllString( form.content, 4, 4000, true, '내용' ) == false )	return;
**/
function check_AllString( objEle, nMin, nMax, bRequired, cMsgTitle )
{
	if ( typeof(objEle) != "object" )   return false;
	
	var strValue 	= objEle.value;
	if ( bRequired == false && strValue != "" )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue) )
		{
			alert("Please type in the "+ cMsgTitle +" value");
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 입력길이 체크
		if ( !IsLength(strValue, nMin, nMax) )
		{
			alert("When inputting"+ cMsgTitle +", enter in between " + nMin + " to " + nMax + " digits." );
			objEle.value = "";
			objEle.focus();
			return false;
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (이메일)
*	Param	: objEle
*	Param	: bRequired	(필수체크 여부)
*	Param	: cMsgTitle
*	Param	: bDaumMaill	(한메일 허용 여부)
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_Email( form.email,  true, '이메일', true ) == false )	return;
**/
function check_Email( objEle,  bRequired, cMsgTitle, bDaumMaill )
{
	if ( typeof(objEle) != "object" )   return false;
	
	var strValue = getTrim( objEle.value, "A" );
	if ( bRequired == false && strValue != "" )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue) )
		{
			alert("Please type in the "+ cMsgTitle +" value");
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 이메일 유효성 체크
		if ( !IsEmail( strValue ) )
		{
			alert(cMsgTitle + "format is incorrect.");
			objEle.value = "";
			objEle.focus();
			return false;
		}
		
		if ( bDaumMaill )
		{
			if ( !IsMail_Daum(strValue) )
			{
				alert("You cannot use Daum Mail (Hanmail) as an "+ cMsgTitle +" input value." );				
				objEle.value = "";
				objEle.focus();
				return false;
			}
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (주민등록번호)
*	Param	: objEle1
*	Param	: objEle2
*	Param	: bRequired	(필수체크 여부)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_Jumin( form.jumin[0],  form.jumin[1], true, '주민등록번호' ) == false )	return;
**/
function check_Jumin( objEle1,  objEle2, bRequired, cMsgTitle )
{
	if ( typeof(objEle1) != "object" )   return false;
	if ( typeof(objEle2) != "object" )   return false;
	
	var strValue1 	= getTrim( objEle1.value, "A" );
	var strValue2 	= getTrim( objEle2.value, "A" );
	
	if ( bRequired == false && (strValue1 != "" ||strValue2 != "" ) )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue1) )
		{
			alert("Type in the "+ cMsgTitle +" front digit.");
			
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( IsEmpty(strValue2) )
		{
			alert("Type in the "+ cMsgTitle +" last digit.");			
			objEle2.value = "";			
			objEle2.focus();
			return false;
		}

		// 입력길이 체크
		if ( !IsLength(strValue1, 6, 6) )
		{
			alert("The "+ cMsgTitle +" first digit is a 6 digit number." );			
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( !IsLength(strValue2, 7, 7) )
		{
			alert("The "+ cMsgTitle +" last digit is a 7 digit number." );			
			objEle2.value = "";
			objEle2.focus();
			return false;
		}

		// 입력가능문자 체크
		if ( !IsValueType(strValue1, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( !IsValueType(strValue2, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle2.value = "";
			objEle2.focus();
			return false;
		}

		// 주민등록번호 유효성 체크
		if ( !IsJuminNumber( strValue1+strValue2 ) )
		{
			alert(cMsgTitle + "format is incorrect.");
			objEle1.value = "";
			objEle2.value = "";
			objEle1.focus();
			return false;
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (사업자번호)
*	Param	: objEle1
*	Param	: objEle2
*	Param	: objEle3
*	Param	: bRequired	(필수체크 여부)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_Saupja( form.saupja[0],  form.saupja[1],  form.saupja[2], true, '사업자번호' ) == false )	return;
**/
function check_Saupja( objEle1,  objEle2, objEle3, bRequired, cMsgTitle )
{
	if ( typeof(objEle1) != "object" )   return false;
	if ( typeof(objEle2) != "object" )   return false;
	if ( typeof(objEle3) != "object" )   return false;
	
	var strValue1 	= getTrim( objEle1.value, "A" );
	var strValue2 	= getTrim( objEle2.value, "A" );
	var strValue3 	= getTrim( objEle3.value, "A" );
	
	if ( bRequired == false && (strValue1 != "" ||strValue2 != "" || strValue3 != "") )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue1) )
		{
			alert("Type in the "+ cMsgTitle +" front digit.");
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( IsEmpty(strValue2) )
		{
			alert("Type in the "+ cMsgTitle +" middle digit value.");
			objEle2.value = "";
			objEle2.focus();
			return false;
		}
		if ( IsEmpty(strValue3) )
		{
			alert("Type in the "+ cMsgTitle +" last digit.");
			objEle3.value = "";
			objEle3.focus();
			return false;
		}

		// 입력길이 체크
		if ( !IsLength(strValue1, 3, 3) )
		{
			alert("The "+ cMsgTitle +" first digit is a 3 digit number."  );
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( !IsLength(strValue2, 2, 2) )
		{
			alert("The "+ cMsgTitle +" middle digit is made with a 2 digit number."); 
			objEle2.value = "";
			objEle2.focus();
			return false;
		}
		if ( !IsLength(strValue3, 5, 5) )
		{
			alert("The "+ cMsgTitle +" last digit is a 5 digit number." );
			objEle3.value = "";
			objEle3.focus();
			return false;
		}

		// 입력가능문자 체크
		if ( !IsValueType(strValue1, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( !IsValueType(strValue2, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle2.value = "";
			objEle2.focus();
			return false;
		}
		if ( !IsValueType(strValue3, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle3.value = "";
			objEle3.focus();
			return false;
		}

		// 사업자번호 유효성 체크
		if ( !IsSaupjaNumber( strValue1+strValue2+strValue3 ) )
		{
			alert(cMsgTitle + "format is incorrect.");
			objEle1.value = "";
			objEle2.value = "";
			objEle3.value = "";
			objEle1.focus();
			return false;
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (법인번호)
*	Param	: objEle1
*	Param	: objEle2
*	Param	: bRequired	(필수체크 여부)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_CorpNumber( form.saupja[0],  form.saupja[1],  true, '법인번호' ) == false )	return;
**/
function check_CorpNumber( objEle1,  objEle2, bRequired, cMsgTitle )
{
	if ( typeof(objEle1) != "object" )   return false;
	if ( typeof(objEle2) != "object" )   return false;
	
	var strValue1 	= getTrim( objEle1.value, "A" );
	var strValue2 	= getTrim( objEle2.value, "A" );
	
	if ( bRequired == false && (strValue1 != "" ||strValue2 != "") )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue1) )
		{
			alert("Type in the "+ cMsgTitle +" front digit.");
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( IsEmpty(strValue2) )
		{
			alert("Type in the "+ cMsgTitle +" last digit.");
			objEle2.value = "";
			objEle2.focus();
			return false;
		}

		// 입력길이 체크
		if ( !IsLength(strValue1, 6, 6) )
		{
			alert("The "+ cMsgTitle +" first digit is a 6 digit number." );
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( !IsLength(strValue2, 7, 7) )
		{
			alert("The "+ cMsgTitle +" last digit is a 7 digit number." );
			objEle2.value = "";
			objEle2.focus();
			return false;
		}

		// 입력가능문자 체크
		if ( !IsValueType(strValue1, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value."); 
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( !IsValueType(strValue2, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle2.value = "";
			objEle2.focus();
			return false;
		}

		// 법인번호 유효성 체크
		if ( !IsCorpNumber( strValue1+strValue2 ) )
		{
			alert(cMsgTitle + "format is incorrect.");
			objEle1.value = "";
			objEle2.value = "";
			objEle1.focus();
			return false;
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (전화번호)
*	Param	: objEle1
*	Param	: objEle2
*	Param	: objEle3
*	Param	: bRequired	(필수체크 여부)
*	Param	: cPhoneType (P:일반전화, M:휴대폰)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_Phone( form.phone[0],  form.phone[1],  form.phone[2], true, 'P', '전화번호' ) == false )	return;
*		if ( check_Phone( form.hp[0],  form.hp[1],  form.hp[2], true, 'M', '휴대전화번호' ) == false )	return;
**/
function check_Phone( objEle1,  objEle2, objEle3, bRequired, cPhoneType, cMsgTitle )
{
	if ( typeof(objEle1) != "object" )   return false;
	if ( typeof(objEle2) != "object" )   return false;
	if ( typeof(objEle3) != "object" )   return false;
	
	var strValue1	= (objEle1.type == "select-one") ? getSelected_Value(objEle1) : getTrim( objEle1.value, "A" );
	var strValue2 = getTrim( objEle2.value, "A" );
	var strValue3 = getTrim( objEle3.value, "A" );
	
	if ( objEle1.type == "select-one" )
	{
		if ( bRequired == false && (strValue2 != "" || strValue3 != "") )	bRequired = true;
	}
	else
	{
		if ( bRequired == false && (strValue1 != "" ||strValue2 != "" || strValue3 != "") )	bRequired = true;
	}

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue1) )
		{
			alert("Type in the "+ cMsgTitle +" front digit.");
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( IsEmpty(strValue2) )
		{
			alert("Type in the "+ cMsgTitle +" middle digit value.");
			objEle2.value = "";
			objEle2.focus();
			return false;
		}
		if ( IsEmpty(strValue3) )
		{
			alert("Type in the "+ cMsgTitle +" last digit.");
			objEle3.value = "";
			objEle3.focus();
			return false;
		}

		// 입력길이 체크
		if ( !IsLength(strValue1, 2, 3) )
		{
			alert("For the "+ cMsgTitle +" front digit please type in as a 2-3 digit number." ); 
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( !IsLength(strValue2, 3, 4) )
		{
			alert("Please type in the "+ cMsgTitle +" middle digit with 3 to 4 numbers." ); 
			objEle2.value = "";
			objEle2.focus();
			return false;
		}
		if ( !IsLength(strValue3, 4, 4) )
		{
			alert("The "+ cMsgTitle +" last digit is a 4 digit number." );
			objEle3.value = "";
			objEle3.focus();
			return false;
		}

		// 입력가능문자 체크
		if ( !IsValueType(strValue1, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle1.value = "";
			objEle1.focus();
			return false;
		}
		if ( !IsValueType(strValue2, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle2.value = "";
			objEle2.focus();
			return false;
		}
		if ( !IsValueType(strValue3, "N") )
		{
			alert("There is a figure that is not a number in the "+ cMsgTitle +"input value.");
			objEle3.value = "";
			objEle3.focus();
			return false;
		}

		// 전화번호 유효성 체크
		if ( !IsPhone( strValue1+"-"+strValue2+"-"+strValue3, cPhoneType ) )
		{
			alert(cMsgTitle + "format is incorrect.");

			if ( objEle1.type == "select-one" )
			{
				objEle1.options[0].selected = true;
			}
			else
			{
				objEle1.value = "";
			}
			objEle2.value = "";
			objEle3.value = "";
			objEle1.focus();
			return false;
		}
	}

	return true;
}


/**
*	TO DO 	: 유효성 체크 (날짜)
*	Param	: objEle
*	Param	: bRequired	(필수체크 여부)
*	Param	: cMsgTitle
*
*	Return	: Boolean
*
*	사용예제
*		if ( check_Date( form.regDate, true, '날짜' ) == false )	return;
**/
function check_Date( objEle, bRequired, cMsgTitle )
{
	if ( typeof(objEle) != "object" )   return false;
	var strValue = getTrim( objEle.value, "A" );
	
	if ( bRequired == false && strValue != "" )	bRequired = true;

	if ( bRequired )
	{
		// 널값체크
		if ( IsEmpty(strValue) )
		{
			alert("Please type in the "+ cMsgTitle +" value");
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 입력길이 체크
		if ( !IsLength(strValue, 10, 10) )
		{
			alert("Please "+ cMsgTitle +" type 10 digits using numbers and hyphens."); 
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 입력가능문자 체크
		if ( !IsValueType(strValue, "N-") )
		{
			alert("You may only use numbers and hyphens for "+ cMsgTitle +" input value."); 
			objEle.value = "";
			objEle.focus();
			return false;
		}

		// 날짜의 유효성 체크
		var arrDate = strValue.split("-");
		
		if ( !IsDate(arrDate[0], arrDate[1], arrDate[2] ) )
		{
			alert(cMsgTitle + "format is incorrect.");
			objEle.value = "";
			objEle.focus();
			return false;
		}
	}

	return true;
}

/**
*	유효성 체크 (파일 확장자 체크)	
*	
* @Param	: objEle (폼 오브젝트)
* @Param	: usableFileExts	(사용가능한 확장자들)
* @Param	: cMsgTitle (유효하지 않을 시 나타낼 메세지)
*
* @Return	: Boolean
*
*	사용예제
*		if ( check_FileExt( form.fileName, 'jpg, jpeg, gif, png', '이미지 파일을 첨부하여 주십시요.' ) == false )	return;
**/
function check_FileExt(objEle, usableFileExts, cMsgTitle)
{
	var fileExt = "";
	var isValidFileExt = false;
	
	if( IsEmpty(objEle.value) )
	{
		alert(cMsgTitle);
		objEle.focus();
		return false;
	}
	
	var filePointer = objEle.value.lastIndexOf('.');
	fileExt = objEle.value.substring(filePointer + 1, objEle.value.length);
	fileExt = fileExt.toLowerCase();
	
	if( IsEmpty(usableFileExts) )
	{
		alert("Please establish a filename extension that is functional.");
		return false;
	}
	else
	{
		var arrUsableFileExt = usableFileExts.split(",");
		
		for( var i = 0; i < arrUsableFileExt.length; i++)
		{
		
			if( fileExt == getTrim(arrUsableFileExt[i], 'B'))
			{
				isValidFileExt = true;
				break;
			}
		}
		
		if( !isValidFileExt)
		{
			alert("Invalid file.\n\n Please attach again as a ["+ usableFileExts +"].");
			objEle.focus();
			return false;
		}
	}
	
	return isValidFileExt;
}
//-->
