<!DOCTYPE html>

<head>

	<base href="<?php echo $base; ?>" />

	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<title><?php echo $title; ?></title>

	<?php if ($description) { ?>
	<meta name="description" content="<?php echo $description; ?>" />
	<?php } ?>
	
	<?php if ($keywords) { ?>
	<meta name="keywords" content="<?php echo $keywords; ?>" />
	<?php } ?>
	
	<?php if ($icon) { ?>
		<link href="<?php echo $icon; ?>" rel="icon" />
	<?php } ?>

	<?php foreach ($links as $link) { ?>
	<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
	<?php } ?>
	
	<!--[if !lte IE 6]><!-->

	<link rel="stylesheet" type="text/css" href="catalog/view/theme/themeglobalpro/stylesheet/bootstrap.min.css"/>

	<link rel="stylesheet" type="text/css" href="catalog/view/theme/themeglobalpro/stylesheet/stylesheet.css" media="screen"/>

	<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/colorbox/colorbox.css" media="screen" />

	<!--<![endif]-->

	<!--[if lte IE 6]>
	<link rel="stylesheet" href="//universal-ie6-css.googlecode.com/files/ie6.1.1.css" media="screen, projection">
	<![endif]-->

	<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary -->
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
	<script>window.jQuery || document.write(unescape('%3Cscript src="catalog/view/theme/themeglobalpro/js/jquery-1.7.1.min.js"%3E%3C/script%3E'))</script>

	<script src="catalog/view/theme/themeglobalpro/js/modernizr.full.min.js"></script>	
		
	<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
	<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />

	<script type="text/javascript" src="catalog/view/javascript/jquery/colorbox/jquery.colorbox.js"></script>
	
	<script type="text/javascript" src="catalog/view/theme/themeglobalpro/js/jquery.elastislide.js"></script>

	<script type="text/javascript" src="catalog/view/theme/themeglobalpro/js/jquery.cycle.js"></script>

	
	<?php
	// If TG ThemeGlobal Pro Control Panel module is enabled

	if($this->config->get('tg_themeglobal_pro_status')== 1) {

	?>

		<style type="text/css">
				
			body {
			
			<?php if($this->config->get('tg_themeglobal_pro_background_color')!='') { ?>
				background-color: <?php echo $this->config->get('tg_themeglobal_pro_background_color'); ?>;
			<?php } 

			if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') $path_image = HTTPS_IMAGE;
			else $path_image = HTTP_IMAGE;

			if($this->config->get('tg_themeglobal_pro_custom_image')!='') { ?>
				background-image: url("<?php echo $path_image . $this->config->get('tg_themeglobal_pro_custom_image') ?>")!important; ?>;
				background-position: top center;
				background-repeat: no-repeat;
			<?php } else if($this->config->get('tg_themeglobal_pro_custom_pattern')!='') { ?>
				background-image: url("<?php echo $path_image . $this->config->get('tg_themeglobal_pro_custom_pattern') ?>")!important; ?>;
			<?php } else if($this->config->get('tg_themeglobal_pro_pattern_overlay')!='none') { ?>
				background-image: url("catalog/view/theme/themeglobalpro/images/patterns/<?php echo $this->config->get('tg_themeglobal_pro_pattern_overlay'); ?>.png")!important;
			<?php } else { ?>
				background-image: none;
			<?php } ?>

			}
			<?php 
			if($this->config->get('tg_themeglobal_pro_display_shadows')!='') { ?>
				#content-wrapper, #footend { 
					webkit-box-shadow: 0 0 5px rgba(0,0,0,.2); 
					-moz-box-shadow: 0 0 5px rgba(0,0,0,.2); 
					box-shadow: 0 0 5px rgba(0,0,0,.2);
				}
			<?php } ?>

		</style>

	<?php } ?>


	


	<?php echo $google_analytics; ?>


</head>

<body>

<section id="content-wrapper" class="container">

	<header id="header" class="container">

			<div class="row leftlogo">

				<div class="span12">

					

					<div class="row">

						<div id="logo" class="span4">
							<?php if ($logo) { ?>
								<a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a>
							<?php } ?>
						</div> <!-- #logo -->
						
						<div class="span3 offset5 rightbox">
					
							<?php echo $cart; ?>

							<div id="search">
								<div class="searchbox input-append">
									<input type="search" name="filter_name" value="<?php echo $filter_name; ?>" placeholder="<?php echo $text_search; ?>" />
									<button class="btn button-search" type="button"><i class="icon-search"></i></button>
								</div>
							</div>

						

						</div> <!-- .rightbox -->

					</div>
					
					<div class="row">
					
						<div class="span12 toplinks">

							<div id="welcome">
								<?php if (!$logged) { ?>
								<?php echo $text_welcome; ?>
								<?php } else { ?>
								<?php echo $text_logged; ?>
								<?php } ?>
							</div>

						</div>
						
						<div class="span12 toplinks">

							<div id="links" class="hidden-phone">
								<a href="<?php echo $home; ?>"><?php echo $text_home; ?></a>
								<a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a>
								<a href="<?php echo $account; ?>"><?php echo $text_account; ?></a>
								<a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a>
								<a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a>
							</div>

						</div>

					</div>
					
				</div> <!-- .headeroptions -->

			</div> <!-- .row -->

	<?php if ($categories) { ?>
		
		<nav id="mainnav" class="navbar" role="navigation">
			<div class="navbar-inner">
				<div class="row">
				
				<div class="span9">

					<a class="btn btn-navbar btn-large" data-toggle="collapse" data-target=".nav-collapse">
						<span>Menu</span><i class="icon-navbtn"></i>
					</a>

					<div class="nav-collapse">
						<ul class="nav">
							<li><a href="<?php echo $home; ?>" title="<?php echo $text_home; ?>"><i class="icon-home"></i></a></li>
							<?php foreach ($categories as $category) { ?>
								<li <?php if ($category['children']) { ?> class="dropdown"<?php } ?>><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
								<?php if ($category['children']) { ?>
									<ul class="dropdown-menu">
									<?php for ($i = 0; $i < count($category['children']);) { ?>
									<?php if ($category['column'] > 1) { ?>
										<li class="column-menu">
											<ul>
									<?php } ?>
									<?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
									<?php for (; $i < $j; $i++) { ?>
										<?php if (isset($category['children'][$i])) { ?>
											<li>
												<a href="<?php echo $category['children'][$i]['href']; ?>">
													<?php echo $category['children'][$i]['name']; ?>
												</a>
											</li>
										<?php } ?>
									<?php } ?>
									<?php if ($category['column'] > 1) { ?>
											</ul>
										</li>
									<?php } ?>
									<?php } ?>
									</ul>
								<?php } ?>
								</li>
							<?php } ?>
						</ul>
					</div>
				</div>
				
				</div>
			</div>
		</nav><!-- #navbar -->

	<?php } ?>

</header> <!-- #header -->
	