
$(document).ready(function(){
    init();
  });
function init(){

}
function init_info(){
  $.getJSON("../../data/getuserlogin.php",
        function(json){
          if (json.mid=="") {alert("請先登入!");location="vip_login.html";}
          else {init_info2(json.mid);}
        });  
}

function form_submit(){
  var k1=$("[checked=true]:input");
  if (k1.val()=="op1"){
    if ($("#c1").val()=="") {alert("請填寫你的帳號!");return false;}
    w1="check=" + $("#c1").val();
  }
  else {
    if ($("#c2").val()=="") {alert("請填寫你的身分證字號!");return false;}
    w1="check=" + $("#c2").val();
  }
  $.getJSON("../../data/send_forget_email.php?" + w1,
        function(json){
          if (json.error=="ok") {$("#form1").submit();}
          else if (json.error==1){alert("沒有此帳號或身份證字號!");}
          else if (json.error==2){alert("EMAIL傳送有問題!");}
          else {alert("傳輸錯誤!" + json.error);}
        });
  return false;
}