function normalize_phonenum(this_s)
{
    this_s.value = this_s.value.toString().replace(/(0(?:2|[0-9]{2}))([0-9]+)([0-9]{4}$)/,"$1-$2-$3");
}


//정규식을 이용한 방법을 수정한 것




function ck_telephone(this_s)
   {
   //02-281-4248;  --> 9
   //052-281-4248;  --> 10
   //052-2281-4248;  --> 11
   //0522-281-4248;  --> 11
   bs_number = this_s.value.toString();
   bs_number = bs_number.replace(/[^0-9]/g,'');
   bs_number_length = bs_number.length;
   t_limit1 = 2 // 처음 번호까지 거리
   bs_1 = '';
   bs_2 = '';
   t_limit1 = 0;
   if(bs_number_length >= 9){
    ck_1 = bs_number.substr(0, 2);
    if(ck_1 != '02'){ t_limit1 = 3; }else{ t_limit1 = 2; }
   }  
   t_st2 = 0;
   t_limit3 = 4;
   if(bs_number_length < 4) { t_limit3 = bs_number_length;}
   t_st2 = t_limit1;
   t_limit2 = bs_number_length -t_limit3-t_limit1;
   
   t_st3 = bs_number_length - t_limit3; if(t_st3 < 0 ) { t_st3 = 0 ; }
   result = '';
   bs_3 = bs_number.substr(t_st3, t_limit3);
   if(bs_number_length > 4 ){  bs_2 = bs_number.substr(t_st2, t_limit2); }
   if(bs_number_length >= 9  ){  bs_1 = bs_number.substr(0, t_limit1 );  }
   
    if(bs_3.length != 0)
    { result += bs_3; }
    if(bs_2.length != 0)
    { result = bs_2 +'-'+ result; }
    if(bs_1.length != 0)
    { result = bs_1 +'-'+ result; }
   
    this_s.value = result;
   }
 


<input name="u_com_tel" type="text" id="u_com_tel" size="30" maxlength="50"  onChange="ck_telephone(this);" onBlur!!="ck_telephone(this);" >

,