

  var piree_cafe_code_len_min_n;
  var piree_cafe_code_len_max_n;

  function piree_cafe_code_check_ajax()
  {

      var check_result_s = '';

      var piree_cafe_n      = $("#piree_cafe_n").val();
      var piree_cafe_code_c = $("#piree_cafe_code_c").val();

      var piree_cafe_code_len_n = piree_cafe_code_c.length;

      piree_cafe_code_len_min_n = $("#piree_cafe_code_len_min_n").val();
      piree_cafe_code_len_max_n = $("#piree_cafe_code_len_max_n").val();

      if ( !$("#piree_cafe_code_c").val() )
      {
// = '[ 카페 코드 ]을 입력해 주세요..';
      }

      if ( piree_cafe_code_len_n < piree_cafe_code_len_min_n )
      {
// = '[ 카페 코드 ]의 글자수를 '+ piree_cafe_code_len_min_n +'자 보다 길게 입력해 주세요..';
      }

      if ( piree_cafe_code_len_max_n < piree_cafe_code_len_n )
      {
// = '[ 카페 코드 ]의 글자수를 '+ piree_cafe_code_len_max_n +'자 보다 짧게 입력해 주세요..';
      }

      if ( check_result_s )
      {
        $("#piree_cafe_code_check_result").html( '<span class="font_4466ff_11">'+ check_result_s +'</span>' );
        return false;
      }

//( "# piree_cafe_code_check_file_url : " + '<span class="font_4466ff_11">"+ check_result_s +"</span>' );

      if ( !check_result_s )
      {

        $.ajax({
          url: piree_cafe_code_check_file_url,
          method: 'POST',
          data: {
            "piree_cafe_n": piree_cafe_n,
            "piree_cafe_code_c": piree_cafe_code_c
          },
        })
        .done(function(data) {

          data = JSON.parse(data);

          if ( data.piree_cafe_code_error_n > 1 )
          {

            check_result_s = '<span style="color:#ff2222">'+ data.piree_cafe_code_result_s +'</span>';

          }
          else
          {

            check_result_s = '<span style="color:#2222ff">'+ data.piree_cafe_code_result_s +'</span>';

          } 

          $("#piree_cafe_code_check_result").html(check_result_s);

        });

//$("#piree_cafe_code_c").focus();

      }

      return false;

  }

  function piree_cafe_name_check_ajax()
  {

      var check_result_s = '';

      var piree_cafe_n      = $("#piree_cafe_n").val();
      var piree_cafe_name_s = $("#piree_cafe_name_s").val();

      if ( !$("#piree_cafe_name_s").val() )
      {
// = '[ 카페 이름 ]을 입력해 주세요..';
      }

//( "# piree_cafe_name_check_file_url : " + '<span class="font_4466ff_11">'+ piree_cafe_name_check_file_url +'</span>' );

      if ( !check_result_s )
      {

        $.ajax({
          url: piree_cafe_name_check_file_url,
          method: 'POST',
          data: {
            "piree_cafe_n": piree_cafe_n,
            "piree_cafe_name_s": piree_cafe_name_s
          },
        })
        .done(function(data) {

          data = JSON.parse(data);

          if ( data.piree_cafe_name_error_n > 1 )
          {

            check_result_s = '<span style="color:#ff2222">'+ data.piree_cafe_name_result_s +'</span>';

          }
          else
          {

            check_result_s = '<span style="color:#2222ff">'+ data.piree_cafe_name_result_s +'</span>';

          } 

          $("#piree_cafe_name_check_result").html(check_result_s);

        });

//$("#piree_cafe_name_s").focus();

      }

      return false;

  }

