<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<? $view = $this->layout()->getView(); ?>
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
		<?php $config = Zend_Registry::get("config"); ?>

		<title><?= $config->site->title ?></title>
		<link type="text/css" rel="stylesheet" media="screen" href="<?php echo $this->url(array('action' => 'screen'), 'css') ?>" />
		<link rel="shortcut icon" href="<?= $config->url->base . '/' . $config->site->ico ?>" />

		<script type="text/javascript" src="<?php echo $this->url(array(), 'js') ?>"></script>

		<? if (isset($view->csss)): foreach ($view->csss as $css): ?>
		  <link type="text/css" rel="stylesheet" media="screen" href="<?php echo $this->url(array('type' => 'css', 'media' => $config->template->name, 'name' => $css), 'medias') ?>" />
		<? endforeach; endif; ?>

		<? if (isset($view->javascripts)): foreach ($view->javascripts as $js): ?>
		  <script type="text/javascript" src="<?php echo $this->url(array('type' => 'js', 'media' => $config->template->name, 'name' => $js), 'medias') ?>"></script>
		<? endforeach; endif; ?>

	</head>
	<body>
		<div id="header">
			<div id="shaddow">
				<div id="header-wrapper">
					<div id="logo" style="background: transparent url('<?= $config->url->base . '/' . $config->site->logo ?>') no-repeat 0px 0px;">
						&nbsp;
					</div>
					<div id="main-menu">
						<ul>
							<? if ($this->isLogged): ?>
							<?
								$array = array();
								$array['index'] = T_('Home');
								$array['profile'] = T_('Profile');
								if ($this->isAdmin)
									$array['admin'] = T_('Admin');
								$array['logout'] = T_('Logout') . ' (' . $this->login . ')';
								foreach ($array as $menuLink => $menuLabel): ?>
									<li><a href="<?= $this->url(array('controller' => $menuLink), 'default', true) ?>" <?= ($menuLink == $this->area ? ' id="selected"' : '') ?>><span><?= T_($menuLabel) ?></span></a></li>
								<? endforeach ?>
							<? endif ?>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<div id="container">
			<div id="container-wrapper">
				<? if (!empty($this->layout()->getView()->submenu)): ?>
					<div id="sub-menu">
						<ul>
							<? foreach($this->layout()->getView()->submenu as $item): ?>
								<li>
									<? if (isset($item['href'])): ?>
										<a href="<?= htmlspecialchars($this->url(array('controller' => ''), 'default', true) . $item['href']); ?>">
											<?= htmlspecialchars(T_($item['label'])); ?>
										</a>
									<? elseif (isset($item['url'])): ?>
										<? $route = (isset($item['route']) ? $item['route'] : null); ?>
										<a href="<?= htmlspecialchars($this->url($item['url'], $route, true)); ?>">
											<?= htmlspecialchars(T_($item['label'])); ?>
										</a>
									<? else: ?>
										<h3><?= T_($item['label']); ?></h3>
									<? endif ?>
								</li>
							<? endforeach ?>
						</ul>
					</div>
				<? endif ?>
				<div id="main">
					<?= $this->layout()->content ?>
					<div style="clear:both;"></div>
				</div>
				<div id="hspacer">
					&nbsp;
				</div>
				<div id="footer">
					Footer
	  		</div>
			</div>
		</div>
	</body>
</html>
