
openMailClubTerm = function(url) {
  window.open(url, '_blank',
    'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,fullscreen=no,width=640,height=480,'
    + 'top=' + (screen.availHeight - 480) / 2 + ', '
    + 'left=' + (screen.availWidth - 640) / 2
  );
}


$(document).ready(function(){

  $(".mail_club_box #btn_mail_club_submit").click(function() {
    $.ajax({
      type: "POST",
      url: "index.php",
      data: ({
        presenter: "SummitTour::WidgetMailClub",
        request: "requestInsertEmail",
        email: $("#edit_mail_club_email").val(),
        confirm: $("#check_mail_club_confirm").get(0).checked
      }),
      dataType: "json",
      error: function(XMLHttpRequest, status, error) {
        alert('status: ' + status + ',\nerror=' + error + '\n');
      },
      success: function(data) {
        alert(data.message);
        if (data.error == 0) {
          $("#edit_mail_club_email").val('');
          $("#check_mail_club_confirm").val(false);
          if (s = $("#campaign_mail_club")) {
            s.hide();
          }
        }
      }
    });
  });


/*
    e = $('#combo_region').get(0);
    e.options.length = 0;
    e.disabled = true;

    e = $('#combo_locality').get(0);
    e.options.length = 0;
    e.disabled = true;

    country_id = $('#combo_country').val();

    if (country_id > 0) {
      $.ajax({
        type: "POST",
        url: "index.php",
        data: ({
          component: "SummitTour::TourSearchResultList",
          request: "requestGetRegionLocalityList",
          country_id: country_id
        }),
        dataType: "json",
        error: function(XMLHttpRequest, status, error) {
          alert('status: ' + status + ',\nerror=' + error + '\n');
        },
        success: function(data) {
          e = $('#combo_region').get(0);
          e.options.length = 0;
          for (key in data.region_list) {
            text = data.region_list[key].title;
            value = data.region_list[key].region_id;
            e.options[e.options.length] = new Option(text, value);
          }
          e.disabled = false;

          e = $('#combo_locality').get(0);
          e.options.length = 0;
          for (key in data.locality_list) {
            text = data.locality_list[key].title;
            value = data.locality_list[key].locality_id;
            e.options[e.options.length] = new Option(text, value);
          }
          e.disabled = false;
        }
      });
    }
  });

*/
});
