[% site_settings = c.cfg('settings') %]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>[% site_settings.application_name %]</title>
      [% IF not_using_composite.css # 'IF NOT' to generate css dynamically in /src/css %]
 		<style type="text/css">
            [% # PROCESS css/lims.css %]
            [% # PROCESS default.css %]
            [% # PROCESS overrides.css %]
            [% # PROCESS querylog.css %]
            [% # PROCESS rollover.css %]
        </style>
      [% ELSE %]

        <link rel="stylesheet" type="text/css" href="[% c.query.url(base=1)
			# loads css for test suite %]/css/lims.css?v1.10" />
        <link rel="stylesheet" type="text/css" media="screen" charset="utf-8"
			href="/css/autosuggest_inquisitor.css" />
		<link type="text/css" media="print" rel="stylesheet"
			href="/css/print.css?v1.1" />
		<link rel="stylesheet" type="text/css" href="/css/font-awesome.min.css" />
        <link rel="stylesheet" type="text/css" href="/css/local.css" />
        [% centre = site_settings.item('_centre'); # initialise unless exists:
            UNLESS addcss; addcss = []; END; addcss.push("${centre}.css");
        %]
		[% FOREACH css IN addcss # if local css required %]
		  <link rel="stylesheet" type="text/css" href="/css/[% css %]" />
		[% END %]
      [% END %]

        <script type="text/javascript" src="/js/common.js"></script>
        <script type="text/javascript" src="/js/FormValidator.min.js"></script>
        [% PROCESS site/js/jquery.tt # ensures loaded just once %]

      [% IF template.meta_refresh; interval = template.meta_refresh %]
        <meta http-equiv="refresh" content="[% interval %]">
        <script type="text/javascript" src="/js/jquery.countdown.js"></script>
        <script type="text/javascript">
            $(function () {
                $('#refresh').countdown({
                    until: +[% interval %], format: 's', compact: true });
            });
        </script>
      [% END %]
        [% IF c.config('use_cgi_ajax'); INCLUDE site/js/ajax.tt; END %]
     </head>

    <body[% IF body_attr; ' ' _ body_attr; END # optionally passed by caller %]>

	[% UNLESS skip_wrappers %]
		<div id="header">[% PROCESS site/header.tt %]</div>
	[% END %]

    [% # PROCESS dumper.tt dump = c.flash %]
    [% # PROCESS dumper.tt dump = c.query.param('destination') %]
    [% # PROCESS dumper.tt dump = c.query.self_url %]
    [% # PROCESS dumper.tt dump = destination_url %]

    <div id="wrapper">
        <div id="content">
            [% PROCESS site/status.tt # error, warning & info msgs %]
            [% content %]
        </div>
    </div>

	[% UNLESS skip_wrappers %]
		<div id="footer">[% PROCESS site/footer.tt %]</div>
	[% END %]

    [% IF c.user_can('do_admin') %]
        <div id='pjxdebugrequest'></div>
    [% END %]
    </body>
</html>
