// Generated by CoffeeScript 1.8.0
(function() {
  $(function() {
	  $(".toast").hide();
	  var meetingId=GetQueryString("id");
	  return $("button.am-button").click(function() {
		  if(!isNotNull($("#name")[0], "姓名")){
			  return;
		  }
		  if(!isNotNull($("#companyName")[0], "单位")){
	    	  return;
	      }
	      if(!isNotNull($("#position")[0], "职务")){
	    	  return;
	      }
	      if (!isMobile($("#mobile")[0], "手机号")) {
	        return;
	      } else if (!isEmail($("#email")[0], "邮箱")) {
	        return;
	      }
	      if(!isNotNull($("#weixinId")[0], "微信号")){
	    	  return;
	      }
	       
	      return Ajax({
	    	  url: baseUrl + '/api/meeting/add_appointment.do?meetingId='+meetingId,
	          data: $("#meetingRegist").serialize(),
	          beforeSend: function() {
	              $$.am_toast.innerHTML = tipTpl.loading;
	              return toast.show();
	            },
	          success: function(data) {
	            if (data.status === 200) {
	              getBackUrl();
	              toast.success({msg:"会议预约成功，等待确认！"});
	              setTimeout(function(){
	            	  return location.href="./list.html";
	              },1000);
	            }else{
	          	  wrongMsg(data.message);
	            }
	          }
	      });
	      
	  });
  });
    
}).call(this);
