<header class="navbar navbar-default pjJlHeader">
	<div class="navbar-header">
		<button type="button" class="navbar-toggle collapsed pjJlNavTrigger" data-toggle="collapse" data-target="#pjJlNav" aria-expanded="false">
			<span class="sr-only"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
		</button>
	</div><!-- /.navbar-header -->
	<?php
	if (isset($tpl['locale_arr']))
	{ 
		if(count($tpl['locale_arr']) > 1)
		{
			$selected_title = '';
			$selected_flag = '';
			foreach($tpl['locale_arr'] as $k => $locale)
			{
				if($controller->getLocaleId() == $locale['id'])
				{
					$selected_title = pjSanitize::html($locale['title']);
					$selected_flag = PJ_INSTALL_URL . PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file'];
				}
			} 
			?>
			<div class="nav navbar-nav navbar-right pjJlLanguage">
				<div class="btn-group" role="group">
					<button type="button" class="btn btn-default dropdown-toggle pjJlLanguageTrigger" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
						<img src="<?php echo $selected_flag;?>" alt="" />
						<?php echo $selected_title;?>
						<span class="caret"></span>
					</button>
		
					<ul class="dropdown-menu pjJlNavLanguage">
						<?php
						foreach($tpl['locale_arr'] as $k => $locale)
						{
							?>
							<li>
								<a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?controller=pjLoad&amp;action=pjActionSetLocale&amp;locale=<?php echo $locale['id']; ?><?php echo isset($_GET['iframe']) ? '&amp;iframe' : NULL; ?>">
									<img src="<?php echo PJ_INSTALL_URL . PJ_FRAMEWORK_LIBS_PATH; ?>pj/img/flags/<?php echo $locale['file']; ?>" alt="" />
									<?php echo pjSanitize::html($locale['title']);?>
								</a>
							</li>
							<?php
						} 
						?>
					</ul><!-- /.dropdown-menu pjJlNavLanguage -->
				</div><!-- /.btn-group -->
			</div><!-- /.nav navbar-nav navbar-right pjJlLanguage -->
			<?php
		}
	} 
	?>

	<nav class="collapse navbar-collapse navbar-left pjJlNav" id="pjJlNav">
		<ul class="nav navbar-nav">
			<?php
			if ($tpl['option_arr']['o_seo_url'] == 'No')
			{ 
				?>
				<li<?php echo $_GET['action'] == 'pjActionJobs' ? ' class="active"' : NULL;?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionJobs" class="btn btn-main"><?php __('front_menu_home');?></a></li>
				<li<?php echo $_GET['action'] == 'pjActionSearch' ? ' class="active"' : NULL;?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionSearch" class="btn btn-main"><?php __('front_menu_search');?></a></li>
				
				<?php
				if(!isset($_SESSION[$controller->defaultCandidate]))
				{
					?>
					<li<?php echo $_GET['action'] == 'pjActionLogin' ? ' class="active"' : NULL;?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionLogin" title="<?php __('front_menu_login');?>"><?php __('front_menu_login');?></a></li>
					<li<?php echo $_GET['action'] == 'pjActionRegister' ? ' class="active"' : NULL;?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionRegister" title="<?php __('front_menu_register');?>"><?php __('front_menu_register');?></a></li>
					<?php
				}else{
					?>
					<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionLogout" title="<?php __('front_menu_logout');?>"><?php __('front_menu_logout');?></a></li>
	                <li<?php echo $_GET['action'] == 'pjActionProfile' ? ' class="active"' : NULL;?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionProfile" title="<?php __('front_menu_profile');?>"><?php __('front_menu_profile');?></a></li>
					<?php
				}
			}else{
				$path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
				$path = $path == '/' ? '' : $path;
				if(empty($tpl['option_arr']['o_job_page']))
				{
					?>
					<li<?php echo $_GET['action'] == 'pjActionJobs' ? ' class="active"' : NULL;?>><a href="<?php echo PJ_INSTALL_URL . 'preview.php'; ?>" class="btn btn-main"><?php __('front_menu_home');?></a></li>
					<?php
				}else{
					if(isset($_GET['from_preview']))
					{
						?>
						<li<?php echo $_GET['action'] == 'pjActionJobs' ? ' class="active"' : NULL;?>><a href="<?php echo PJ_INSTALL_URL . 'preview.php'; ?>" class="btn btn-main"><?php __('front_menu_home');?></a></li>
						<?php
					}else{
						?>
						<li<?php echo $_GET['action'] == 'pjActionJobs' ? ' class="active"' : NULL;?>><a href="<?php echo $tpl['option_arr']['o_job_page']; ?>" class="btn btn-main"><?php __('front_menu_home');?></a></li>
						<?php
					}
				} 
				?>
				<li<?php echo $_GET['action'] == 'pjActionSearch' ? ' class="active"' : NULL;?>><a href="<?php echo $path . '/job-search.html'; ?>" class="btn btn-main"><?php __('front_menu_search');?></a></li>
				<?php
				if(!isset($_SESSION[$controller->defaultCandidate]))
				{
					?>
					<li<?php echo $_GET['action'] == 'pjActionLogin' ? ' class="active"' : NULL;?>><a href="<?php echo $path . '/job-login.html'; ?>" title="<?php __('front_menu_login');?>"><?php __('front_menu_login');?></a></li>
					<li<?php echo $_GET['action'] == 'pjActionRegister' ? ' class="active"' : NULL;?>><a href="<?php echo $path . '/job-register.html'; ?>" title="<?php __('front_menu_register');?>"><?php __('front_menu_register');?></a></li>
					<?php
				}else{
					?>
					<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionLogout" title="<?php __('front_menu_logout');?>"><?php __('front_menu_logout');?></a></li>
	                <li<?php echo $_GET['action'] == 'pjActionProfile' ? ' class="active"' : NULL;?>><a href="<?php echo $path . '/job-profile.html'; ?>" title="<?php __('front_menu_profile');?>"><?php __('front_menu_profile');?></a></li>
					<?php
				}
			}
			?>
		</ul><!-- /.nav navbar-nav -->
	</nav><!-- /#pjJlNav.collapse navbar-collapse navbar-left pjJlNav -->
</header><!-- /.navbar navbar-default pjJlHeader -->