<?php
global $language;
if (isset($language)) {
    header('Content-type: text/html; charset=' . NLS::getCharset());
    header('Vary: Accept-Language');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<!-- IMP: Copyright 2001-2006, The Horde Project. IMP is under the GPL. -->
<!--   Horde Project: http://horde.org/ | IMP: http://horde.org/imp/    -->
<!--      GNU Public License: http://www.fsf.org/copyleft/gpl.html      -->
<?php
echo (!empty($language)) ? '<html lang="' . strtr($language, '_', '-') . '"' : '<html';
echo (!empty($ie_clientcaps)) ? ' xmlns:IE>' : '>';
?>
<head>
<?php

$page_title = $GLOBALS['registry']->get('name');
if (!empty($title)) $page_title .= ' :: ' . $title;
if (!empty($refresh_time) && !empty($refresh_url)) {
    echo "<meta http-equiv=\"refresh\" content=\"$refresh_time;url=$refresh_url\" />\n";
}
Horde::includeScriptFiles();
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir() ?>/favicon.ico" rel="SHORTCUT ICON" />
<?php if (isset($mailbox_url)): ?>
<link href="<?php echo $mailbox_url ?>" rel="Up" />
<?php else: ?>
<link href="<?php echo Util::addParameter(Horde::applicationUrl('mailbox.php'), 'mailbox', 'INBOX') ?>" rel="Top" />
<?php endif; ?>
<?php if (isset($first_url)): ?>
<link href="<?php echo $first_url ?>" rel="First" />
<?php endif; ?>
<?php if (isset($prev_url)): ?>
<link href="<?php echo $prev_url ?>" rel="Previous" />
<?php endif; ?>
<?php if (isset($next_url)): ?>
<link href="<?php echo $next_url ?>" rel="Next" />
<?php endif; ?>
<?php if (isset($last_url)): ?>
<link href="<?php echo $last_url ?>" rel="Last" />
<?php endif; ?>
<link href="<?php echo Horde::applicationUrl('search.php') ?>" rel="search" />
<?php echo Horde::stylesheetLink('imp', empty($printer_friendly) ? '' : 'print') ?>
<?php if (!empty($ie_clientcaps)): ?><style>IE\:clientcaps {behavior:url(#default#clientcaps)}</style><?php endif; ?>
</head>

<body<?php if (Util::nonInputVar('bodyClass')) echo ' class="' . $bodyClass . '"'; ?>>
<?php if (!empty($ie_clientcaps)): ?><IE:clientcaps ID="objCCaps" /><?php endif; ?>
