/*** function other_checked() ------------------------------------------------------------- */
function other_checked() {
    form = document.lctE051w;  
        
//        if(form.p_sale_dept[13].checked == false)
//            form.p_sale_dept[13].checked = true;
    if(form.p_sale_dept[12].checked == false)
        form.p_sale_dept[12].checked = true;

        return;
}

/*** function Reset() ------------------------------------------------------------- */
function Reset() {
form = document.lctE051w;

if ( !confirm(js_NoMsg(517,"","","")) )   return;

  form.reset();
}


/* function next_submit() ---------------------------------------------------------------*/
function next_submit() {

    var form    = document.lctE051w ;
    var chk_cnt = 0 ;

    if( form.p_user_prfx.value == '' ) {
        alert( 'Choose the Call!!!' ) ;
        form.p_user_prfx.focus() ;
        return ;
    }

    if( form.p_user_namf.value == '' ) {
        alert( 'Insert a First Name!!!' ) ;
        form.p_user_namf.focus() ;
        return ;
    }

    if( form.p_user_naml.value == '' ) {
        alert( 'Insert a Family Name!!!' ) ;
        form.p_user_naml.focus() ;
        return ;
    }

    if( form.p_jobx_fnct.value == '' ) {
        alert( 'Choose the Job!!!' ) ;
        form.p_jobx_fnct.focus() ;
        return ;
    }

    if( form.p_nato_telx.value == '' ) {
        alert( 'Insert a Country Code!!!' ) ;
        form.p_nato_telx.focus() ;
        return ;
    }

    if( isNumber( form.p_nato_telx ) == false ) {               // ¼ýÀÚ¸¸ µé¾î°¥ ¼ö ÀÖ°Ô
        alert( 'The Country Code is incorrect!!!' ) ;           // isNumber´Â string.js¿¡ ÀÖÀ½
        form.p_nato_telx.focus() ;
        return ;
    }

    if( form.p_ofce_tel1.value == '' ) {
        alert( 'Insert an Area Code!!!' ) ;
        form.p_ofce_tel1.focus() ;
        return ;
    }

    if( isNumber( form.p_ofce_tel1 ) == false ) {               // ¼ýÀÚ¸¸ µé¾î°¥ ¼ö ÀÖ°Ô
        alert( 'The Area Code is incorrect!!!' ) ;              // isNumber´Â string.js¿¡ ÀÖÀ½
        form.p_ofce_tel1.focus() ;
        return ;
    }

    if( form.p_ofce_tel2.value == '' ) {
        alert( 'Insert an Office Phone Number!!!' ) ;
        form.p_ofce_tel2.focus() ;
        return ;
    }

    if( isNumber( form.p_ofce_tel2 ) == false ) {               // ¼ýÀÚ¸¸ µé¾î°¥ ¼ö ÀÖ°Ô
        alert( 'The Office Phone Number is incorrect!!!' ) ;    // isNumber´Â string.js¿¡ ÀÖÀ½
        form.p_ofce_tel2.focus() ;
        return ;
    }

    if( isNumber( form.p_mobi_phon ) == false ) {               // ¼ýÀÚ¸¸ µé¾î°¥ ¼ö ÀÖ°Ô
        alert( 'The Mobile Phone Number is incorrect!!!' ) ;    // isNumber´Â string.js¿¡ ÀÖÀ½
        form.p_mobi_phon.focus() ;
        return ;
    }

    if( form.p_mail_addr.value == '' ) {
        alert( 'Insert an E-mail Address!!!' ) ;
        form.p_mail_addr.focus() ;
        return ;
    }

    if( isEmail( form.p_mail_addr ) == false ) {
        alert( 'The E-mail Address is incorrect!!!' ) ;
        form.p_mail_addr.focus() ;
        return ;
    }

    if( form.p_pass_word.value == '' ) {
        alert( 'Insert a Requested Password!!!' ) ;
        form.p_pass_word.focus() ;
        return ;
    }

    if(form.p_corp_name.value == ''){
      alert('Insert a Company Name!!!');
      form.p_corp_name.focus();
      return;
    }

    if( form.p_corp_add1.value == '' ) {
        alert( 'Insert a Company Address!!!' ) ;
        form.p_corp_add1.focus() ;
        return ;
    }

    if(form.p_city_name.value == ''){
      alert('Insert a City!!!');
      form.p_city_name.focus();
      return;
    }
    
    if(form.p_stat_name.value == ''){
      alert('Insert a State/Province!!!');
      form.p_stat_name.focus();
      return;
    }
    
    if(form.p_nato_code.options[form.p_nato_code.selectedIndex].value == ''){
    alert('Choose the Country!!!');
    form.p_nato_code.focus();
    return;
  }
  
  if(form.p_user_type.options[form.p_user_type.selectedIndex].value == ''){
    alert('Choose the Customer Type!!!');
    form.p_user_type.focus();
    return;
  }

    for(var i=0; i < form.p_sale_dept.length; i++ )
  {
    if(form.p_sale_dept[i].checked == true )
      chk_cnt++;
    }
    if( chk_cnt <= 0 )
    {
        alert('Please select at least one!!!');
  return;
}
    
    
    form.target = 'main';
    form.action='/servlet/lctE051.lctE051x';
    form.submit();
}


