
//对应 TMeetingAction
var mtReplyActionNone = 0;//maNone
var mtReplyActionAccept = 1;//maAccept
var mtReplyActionRefuse = 2;//maRefuse
var mtReplyActionTentative = 3;//maTentative
var mtReplyActionChange = 4;//maChange
var mtReplyActionCancel = 5;//maCancel

//对应 TAttendeeRole
var mtRoleNone = 0;//arNone
var mtRoleRequest = 1;//arReq
var mtRoleOpt = 2;//arOpt

function doReplyMailMeeting(action, mailid){
	invokeAppFunction('ReplyMailMeeting', {action: action, mailid: mailid});
	//update ui
	$('#mail_meeting_toolbar_area_'+mailid).hide();
}

function registerMailMeetingDelegate(){
	$(document).delegate('.mail_meeting_accept_button', 'click', function(e){
		try{
			var mailid = $(this).parent().attr('mailid');
			doReplyMailMeeting(mtReplyActionAccept, mailid);
		}catch(e){ WriteLog('mail meeting accept', e.message); }
	});
	$(document).delegate('.mail_meeting_tentative_button', 'click', function(e){
		try{
			var mailid = $(this).parent().attr('mailid');
			doReplyMailMeeting(mtReplyActionTentative, mailid);
		}catch(e){ WriteLog('mail meeting tentative', e.message); }
	});
	$(document).delegate('.mail_meeting_refuse_button', 'click', function(e){
		try{
			var mailid = $(this).parent().attr('mailid');
			doReplyMailMeeting(mtReplyActionRefuse, mailid);
		}catch(e){ WriteLog('mail meeting refuse', e.message); }
	});
}