function trim(s) {
    s += ''; // ¼ýÀÚ¶óµµ ¹®ÀÚ¿­·Î º¯È¯
    return s.replace(/^\s*|\s*$/g, '');
}

/******************
ÁÖ¹Î¹øÈ£ Çü½Ä Ã¼Å© 
******************/
function isJumin( str ) 
{
	var str1, str2, str3, str4, str5, str6, str7;
	var str8, str9, str10, str11, str12, str13;
    var Sum, Chk;
    var Result = false;

    if ( str.length == 13 )
    {
        Result = true;               
        str1 = str.charAt(0);
        str2 = str.charAt(1);
        str3 = str.charAt(2);
        str4 = str.charAt(3);
        str5 = str.charAt(4);
        str6 = str.charAt(5);
        str7 = str.charAt(6);
        str8 = str.charAt(7);
        str9 = str.charAt(8);
        str10 = str.charAt(9);
        str11 = str.charAt(10);
        str12 = str.charAt(11);
        str13 = str.charAt(12);
     
        Sum = ( parseInt(str1) * 2 ) + ( parseInt(str2) * 3 ) +
            ( parseInt(str3) * 4 ) + ( parseInt(str4) * 5 );
        Sum = parseInt(Sum) + ( parseInt(str5) * 6 ) + 
            ( parseInt(str6) * 7 ) + ( parseInt(str7) * 8 );
        Sum = parseInt(Sum) + ( parseInt(str8) * 9 ) + 
            ( parseInt(str9) * 2 ) + ( parseInt(str10) * 3 );
        Sum = Sum + ( parseInt(str11) * 4 ) + 
            ( parseInt(str12) * 5 );

        Chk = Sum % 11;
        Chk = 11 - Chk;

        if ( Chk == 11 )
            Chk = 1;
        else if ( Chk == 10 )
            Chk = 0;

        if ( str13 != Chk )
            Result = false;
    } 
    else
        Result = false;
 
    //alert(Result);
 
    return Result; 
}

/**************
	ÀÌ¸ÞÀÏÃ¼Å©  
**************/
function checkEmail(strEmail) {
	var arrMatch = strEmail.match(/^(\".*\"|[A-Za-z0-9_-]([A-Za-z0-9_-]|[\+\.])*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z0-9][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)+)$/);
	if (arrMatch == null) {
		return false;
	}

	var arrIP = arrMatch[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
		if (arrIP != null) {
			for (var i = 1; i <= 4; i++) {
				if (arrIP[i] > 255) {
					return false;
				}            
			}
		}
	return true;
}

/*-------------------------------------------------------------------------
 f_onlyNumber()
 Spec	  : Only Number
 Argument : 
 Return   : boolean 
 Example  : OnKeypress="f_onlyNumber();"
-------------------------------------------------------------------------*/

function f_onlyNumber()
{
	if (event.keyCode != 13) {
		if((event.keyCode < 48) || (event.keyCode > 57)) {
		alert("¡¼ Ç×¸ñÃ¼Å© ¡½: ¼ýÀÚÇ×¸ñ¿¡ ¹®ÀÚ¸¦ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
		event.returnValue = false;
		}
	}
}

/* ´Þ·Â */
function fn_Calendar(objName) {
	obj = eval(objName);
	
	var ls_Date = new Array();
	var ls_CurVal = obj.value;
	
	ls_Date = window.showModalDialog("/js/Calendar_day.html", ls_CurVal, "dialogTop:"+event.screenY+"; dialogLeft:"+eval(event.screenX-185)+"; dialogWidth:240px; dialogHeight:262px; Raised; resizable: no; status: no");
	
	if (ls_Date != null){
		obj.value = ls_Date;
	}
}