function checkForm()
{   var f = document.regist.new_domain;
    var s = document.regist.select;
    var alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    var numeric = '1234567890';
 
    
     if (f.value.length < 2)
     {   alert ("µµ¸ÞÀÎ¸íÀº 2ÀÚ ÀÌ»óÀ¸·Î ±¸¼ºµË´Ï´Ù.");
         f.focus();
         return false;
     }
     if ( (s.selectedIndex == 5) && (f.value.length < 3) )
     {   alert ("'PE.KR' µµ¸ÞÀÎ¸íÀº 3ÀÚ ÀÌ»óÀ¸·Î ±¸¼ºµË´Ï´Ù.");
         f.focus();
         return false;
     }
     
     if (f.value.substring(0,1) == '-')
     {   alert ("µµ¸ÞÀÎ ¸íÀº '-'·Î ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù.");
         f.focus();
         return false;
     }
     if (f.value.substring(f.value.length-1,f.value.length) == '-')
     {   alert ("µµ¸ÞÀÎ ¸íÀº '-'·Î ³¡³¯ ¼ö ¾ø½À´Ï´Ù.");
         f.focus();
         return false;
     }
     if (checknorm(f,  'µµ¸ÞÀÎ¸í', numeric+alpha+'-', 62))
         return false;
 
     if (s.selectedIndex < 3)
         document.regist.action = 'http://domain.gabia.co.kr/regist_internic_step1.jsp';
     else if (s.selectedIndex == 4)
         document.regist.action = 'http://domain.gabia.co.kr/servlet/regist_krnic_or_step1';
     else if (s.selectedIndex == 5)
         document.regist.action = 'http://domain.gabia.co.kr/servlet/regist_krnic_pe_step1';
     else
         document.regist.action = 'http://domain.gabia.co.kr/servlet/regist_krnic_co_step1';
 
     document.regist.submit();
     return true;
 
}
 

function checknorm(target, cmt, astr, lmax)
{
  var i;
  var t = target.value;
 
  if (astr.length >= 1) {
          for (i=0; i<t.length; i++)
                  if(astr.indexOf(t.substring(i,i+1))<0) {
        alert(cmt + "Àº ¿µ¹®, ¼ýÀÚ, '-' ·Î¸¸ ±¸¼ºµË´Ï´Ù.");
        target.focus()
        return true
      }
  }
        return false
}
