function adm_mailingsSubmit(test) {
	if (test) {
		XPS_elem('mlg_test').value = 1;
		XPS_submit('mailings_form');
	}
	else {
		Effect.BlindUp(
			'mailings_form_container', 
			{ 
				afterFinish: function () { $('mailings_form_messages').update('<div style="font-weight: bold;">&Eacute;&eacute;n moment geduld...</div>'); } 
			}
		);
		XPS_submit('mailings_form');
	}
}

function adm_updateMailingRecipients() {
	var data = {
		city: XPS_elem_value('mlg_city'),
		cityid: XPS_elem_value('mlg_cityid'),
		gender: XPS_elem_value('mlg_gender'),
		age_from: XPS_elem_value('mlg_age_from'),
		age_untill: XPS_elem_value('mlg_age_untill')
	};
	
	WFS_XHR('adm', 'update_mailing_recipients', data, { callback: xhr_callback, icon: 'mailings_form_num_recipients' });
	function xhr_callback(reply) {
		if (!reply) return;
		XPS_elem('mailings_form_num_recipients').update(reply['recipients']['count'] + ' leden zullen de mailing ontvangen.');
	}
}