<!-- BEGIN [% component.name %] -->
    <!-- new user messages -->
    [% IF c.authen.username; # skip if logged / timed out
        args = [];
        args.push('service='  _ c.cfg('settings').item('_centre') );
        args.push('username=' _ c.authen.username);
        args.push('tt='       _ template.name);
        args.push('url='      _ app_url);
    %]
        <script language="javascript" type="text/javascript">
			setInterval("seek_new_message()", 10 * 60 * 1000); // 10 mins - in millisecs
			function seek_new_message() {
				$('#new_msg').load("/script/cgi/new_messages.cgi?[% args.join(';') %]")
			}
		</script>
		<div id="new_msg" class="warning"></div>
    [% END %]

    <!-- stash messages -->
    [% IF c.stash.status_msg %]
        <p class="message">[% c.stash.status_msg %]</p>
    [% END %]

    [% IF c.stash.error_msg %]
        <p class="error">ERROR: [% c.stash.error_msg %]</p>
    [% END %]

    <!-- flash messages -->
    [% IF using_cap_flash; # using MessageStack instead & disabled to prevent c.flash producing undef msgs
        # PROCESS dumper.tt dump = c.flash.dump;
        # FOREACH type IN [ 'info', 'warning', 'error' ];
            # IF c.flash.has_key(type);
                # FOREACH message IN c.flash.get(type) -%]
                <p class="[% type %]">
                    [% type | upper %]: [% message %]
                </p>
                [% # END %]
            [% # END %]
        [% # END %]
    [% END %]

    [% # CAP::MessageStack:
        # INCLUDE dumper.tt dump = CAP_Messages;
        FOREACH CAP_Messages;
            NEXT UNLESS
                class.match('info')  ||
                class.match('error') ||
                class.match('warning'); # any others handled in local templates
        %]
        <p class="[% class %]">
            [% class | upper %]: [% message %]
        </p>
    [% END %]
<!-- END [% component.name %] -->
