function fc_chk_byte(aro_name,ari_max) {
var ls_str = aro_name.value; // 이벤트가 일어난 컨트롤의 value 값
var li_str_len = ls_str.length; // 전체길이
// 변수초기화
var li_max = ari_max; // 제한할 글자수 크기
var i = 0; // for문에 사용
var li_byte = 0; // 한글일경우는 2 그밗에는 1을 더함
var li_len = 0; // substring하기 위해서 사용
var ls_one_char = ""; // 한글자씩 검사한다
var ls_str2 = ""; // 글자수를 초과하면 제한할수 글자전까지만 보여준다.
for(i=0; i< li_str_len; i++)
{
// 한글자추출
ls_one_char = ls_str.charAt(i);
// 한글이면 2를 더한다.
if (escape(ls_one_char).length > 4)
{
li_byte += 2;
}
// 그밗의 경우는 1을 더한다.
else
{
li_byte++;
}
// 전체 크기가 li_max를 넘지않으면
if(li_byte <= li_max)
{
li_len = i + 1;
}
}
word_count.innerText = li_byte;
// 전체길이를 초과하면
if(li_byte > li_max)
{
alert('字数超出' + li_max + "字节的限制");
ls_str2 = ls_str.substr(0, li_len);
aro_name.value = ls_str2;
word_count.innerText = li_max;
}
aro_name.focus();
}
function getStrLength(aro_name){
var ls_str = aro_name.value;
var li_str_len = ls_str.length;
for(i=0; i< li_str_len; i++)
{
// 한글자추출
ls_one_char = ls_str.charAt(i);
// 한글이면 2를 더한다.
if (escape(ls_one_char).length > 4)
{
li_byte += 2;
}
// 그밗의 경우는 1을 더한다.
else
{
li_byte++;
}
}
return li_byte;
}
function delPic() {
var r=confirm("您确定要删除吗?");
if(r==true){
document.getElementById("fly_img").value = '';
document.getElementById("fly_ext").value = '';
document.getElementById("viewPhotoUrl").value = '';
document.getElementById("fly_status").innerHTML = '
';
}else if(r==false){
}
}
// 20080716 수정
function mobileLetterLayer(el) {
var target1 = document.getElementById("emoticonLayer");
var target2 = document.getElementById("spCharLayer");
if(el == "emoticonLayer") {
target2.style.display = "none"
if(target1.style.display == "none") target1.style.display = "block";
else target1.style.display = "none";
}else if (el == "spCharLayer") {
target1.style.display = "none"
if(target2.style.display == "none") target2.style.display = "block";
else target2.style.display = "none";
}
}
/**初始化表情*/
function initTabMenu(tabContainerID,action_exp) {
var tabContainer = document.getElementById(tabContainerID);
var tabAnchor = tabContainer.getElementsByTagName("a");
var i = 0;
for(i=0; i 4) {
nbTemp += 2;
}else if (curChar='\r') {
nbTemp++;
}
if(nbTemp <= 140)
maxTempLen = i;
}
if(nbTemp > 140) {
alert("字数超出140字节限制.\r");
return;
}
if (txtFly.value == txtFly.defaultValue)
{
txtFly.value = '';
}
txtFly.value = txtFly.value + specialtxt;
fc_chk_byte_Other(txtFly,140);
}
function fc_chk_byte_Other(aro_name,ari_max) {
var ls_str = aro_name.value; // 이벤트가 일어난 컨트롤의 value 값
var li_str_len = ls_str.length; // 전체길이
// 변수초기화
var li_max = ari_max; // 제한할 글자수 크기
var i = 0; // for문에 사용
var li_byte = 0; // 한글일경우는 2 그밗에는 1을 더함
var li_len = 0; // substring하기 위해서 사용
var ls_one_char = ""; // 한글자씩 검사한다
var ls_str2 = ""; // 글자수를 초과하면 제한할수 글자전까지만 보여준다.
for(i=0; i< li_str_len; i++)
{
// 한글자추출
ls_one_char = ls_str.charAt(i);
// 한글이면 2를 더한다.
if (escape(ls_one_char).length > 4)
{
li_byte += 2;
}
// 그밗의 경우는 1을 더한다.
else
{
li_byte++;
}
// 전체 크기가 li_max를 넘지않으면
if(li_byte <= li_max)
{
li_len = i + 1;
}
}
var word_count = document.getElementById('word_count');
word_count.innerText = li_byte;
// 전체길이를 초과하면
if(li_byte > li_max)
{
alert('字数超出' + li_max + "字节的限制");
ls_str2 = ls_str.substr(0, li_len);
aro_name.value = ls_str2;
word_count.innerText = li_max;
}
aro_name.focus();
}