var Customers = {
	ViewNotes: function(customerId)
	{
		$.iModal({
			type: 'ajax',
			url: 'remote.php?remoteSection=customers&w=viewCustomerNotes&customerId='+customerId,
			width: 600
		});
	},

	SaveNotes: function()
	{
		$('.modal-footer .CloseButton').hide();
		$('.modal-footer .LoadingIndicator').show();
		$('.modal-footer .Submit')
			.data('oldValue', $('.modal-footer .Submit').val())
			.attr('disabled', true)
			.val(lang.SavingNotes)
		;
		$.ajax({
			type: 'post',
			url: 'remote.php?remoteSection=customers&w=saveCustomerNotes',
			data: $('#notesForm').serialize(),
			dataType: 'xml',
			success: function(xml)
			{
				$.modal.close();
				if($('message', xml).text()) {
					display_success('CustomerStatus', $('message', xml).text());
				}
			},
			error: function()
			{
				$('.modal-footer .CloseButton').show();
				$('.modal-footer .LoadingIndicator').hide();
				$('.modal-footer .Submit')
					.attr('disabled', false)
					.val($('.modal-footer .Submit').val())
				;
			}
		})
	}
};
