 function TrimStr(str) {
	var rtnValue = str.replace(/(^\s*)|(\s*$)/g, "");
	return rtnValue
 }

 function ByteLen(str) {
	var nLen, i, ch

	nLen = str.length
	nByteLen = 0
	for(i=0;i<nLen;i++) {
		ch = str.charAt(i)
		if(escape(ch).length > 4) {
		   nByteLen += 2
		} else {
		   nByteLen++
		}
	}

	return nByteLen
 }

 function CheckKr1(str) {
    var i, n_count;

    n_count = 0;
	for(i=0;i<str.length;i++) {
	    if(str.charCodeAt(i) >=0 && str.charCodeAt(i) <= 127) {
		   n_count = n_count + 1;
		}
	}

	if(n_count == 0) {
	   return true;
	} else {
	   return false;
	}
 }

 function CheckKr2(str) {
    var i, n_count;

    n_count = 0;
	for(i=0;i<str.length;i++) {
	    if(str.charCodeAt(i) < 0 || str.charCodeAt(i) > 127) {
		   n_count = n_count + 1;
		}
	}

	if(n_count > 0) {
	   return true;
	} else {
	   return false;
	}
 }
