<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<div class="module" id="email_list">
  <p class="top"><span></span></p>
  <div class="content">
  <h1>{$lang.email_subscribe}</h1>
  <div class="cont">
    <input type="text" id="user_email" class="input_1" /><br />
    <input type="button" value="{$lang.email_list_ok}" onclick="add_email_list();" class="button_1"/>
    <input type="button"  value="{$lang.email_list_cancel}" onclick="cancel_email_list();" class="button_2"/>
  </div>
  </div>
  <p class="bottom"><span></span></p>
</div>
<script type="text/javascript">
var email = document.getElementById('user_email');
function add_email_list()
{
  if (check_email())
  {
    Ajax.call('user.php?act=email_list&job=add&email=' + email.value, '', rep_add_email_list, 'GET', 'TEXT');
  }
}
function rep_add_email_list(text)
{
  alert(text);
}
function cancel_email_list()
{
  if (check_email())
  {
    Ajax.call('user.php?act=email_list&job=del&email=' + email.value, '', rep_cancel_email_list, 'GET', 'TEXT');
  }
}
function rep_cancel_email_list(text)
{
  alert(text);
}
function check_email()
{
  if (Utils.isEmail(email.value))
  {
    return true;
  }
  else
  {
    alert('{$lang.email_invalid}');
    return false;
  }
}
</script>
