<nav class="navbar navbar-default pjYpHeader">
	<div class="navbar-header">
		<button type="button" class="navbar-toggle collapsed pjYpBtn pjYpBtnNavTrigger" data-pj-toggle="collapse" data-pj-target="#pjYpNav" aria-expanded="false">
			<span class="sr-only">Toggle navigation</span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
		</button>
	</div><!-- /.navbar-header -->

	<div class="collapse navbar-collapse" id="pjYpNav">
		<ul class="nav navbar-nav pjYpNav">
			<?php
			if ($tpl['option_arr']['o_seo_url'] == 'No')
			{ 
				?>
				<li <?php echo $_GET['action'] == 'pjActionIndex' || $_GET['action'] == 'pjActionPreview' || !isset($_GET['action']) ? 'class="active"' : null; ?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjListings&amp;action=pjActionIndex"><?php __('menu_home');?></a></li>
				<li <?php echo $_GET['action'] == 'pjActionCategory' ? 'class="active"' : null; ?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjListings&amp;action=pjActionCategory"><?php __('menu_categories');?></a></li>
				<li <?php echo $_GET['action'] == 'pjActionMap' ? 'class="active"' : null; ?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjListings&amp;action=pjActionMap"><?php __('menu_map');?></a></li>
				<?php
				if($tpl['option_arr']['o_allow_add_listing'] == 'Yes')
				{ 
					?>
					<li <?php echo $_GET['action'] == 'pjActionAccount' || $_GET['action'] == 'pjActionForgot' ? 'class="active"' : null; ?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjListings&amp;action=pjActionAccount"><?php __('menu_account');?></a></li>
					<?php
				} 
			}else{
				$path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
				$path = $path == '/' ? '' : $path;
				?>
				<li <?php echo $_GET['action'] == 'pjActionIndex' || $_GET['action'] == 'pjActionPreview' || !isset($_GET['action']) ? 'class="active"' : null; ?>><a href="<?php echo $path . '/index.html'; ?>"><?php __('menu_home');?></a></li>
				<li <?php echo $_GET['action'] == 'pjActionCategory' ? 'class="active"' : null; ?>><a href="<?php echo $path . '/categories.html'; ?>"><?php __('menu_categories');?></a></li>
				<li <?php echo $_GET['action'] == 'pjActionMap' ? 'class="active"' : null; ?>><a href="<?php echo $path . '/map.html'; ?>"><?php __('menu_map');?></a></li>
				<?php
				if($tpl['option_arr']['o_allow_add_listing'] == 'Yes')
				{ 
					?>
					<li <?php echo $_GET['action'] == 'pjActionAccount' || $_GET['action'] == 'pjActionForgot' ? 'class="active"' : null; ?>><a href="<?php echo $path . '/account.html'; ?>"><?php __('menu_account');?></a></li>
					<?php
				} 
			}
			?>
		</ul><!-- /.nav navbar-nav pjYpNav -->
		<?php
		if($_GET['action'] != 'pjActionMap')
		{ 
			$action_url =  $_SERVER['PHP_SELF'];
			if ($tpl['option_arr']['o_seo_url'] == 'Yes')
			{
			    $path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
			    $path = $path == '/' ? '' : $path;
			    $action_url = $path . '/index.html';
			}
			?>
			<form name="frmYPSearch" action="<?php echo $action_url; ?>" method="get" class="navbar-form navbar-left pjYpSearch">
				<div class="form-group">
					<?php
					if ($tpl['option_arr']['o_seo_url'] == 'No')
					{
    					?>
    					<input type="hidden" name="controller" value="pjListings" />
    					<input type="hidden" name="action" value="pjActionIndex" />
    					<?php
					}
    				?>
					<input type="hidden" name="listing_search" value="1" />
					<input type="text" name="keyword" value="<?php echo isset($_GET['keyword']) ? $_GET['keyword'] : null;?>" placeholder="<?php __('label_search');?>" class="form-control" />
					<button type="submit" class="btn btn-default pjYpBtn pjYpBtnSearch">
						<span class="glyphicon glyphicon-search"></span>
					</button>
				</div><!-- /.form-group -->
			</form><!-- /.navbar-form navbar-left pjYpSearch -->
			
			<?php
		}
		if (isset($tpl['locale_arr']))
		{ 
			$cnt = count($tpl['locale_arr']);
			if ($cnt > 1)
			{
				$selected_title = '';
				foreach($tpl['locale_arr'] as $k => $locale)
				{
					if($controller->getLocaleId() == $locale['id'])
					{
						$selected_title = pjSanitize::html($locale['title']);
					}
				}
				?>
				<ul class="nav navbar-nav navbar-right pjYpNavLang">
					<li class="dropdown">
						<a href="#" class="dropdown-toggle pjYpBtnNavLangTrigger" data-pj-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $selected_title;?> <span class="caret"></span></a>
		
						<ul class="dropdown-menu pjYpNavLangDropdown">
							<?php
							foreach ($tpl['locale_arr'] as $k => $locale)
							{ 
								?>
								<li><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?controller=pjListings&amp;action=pjActionSetLocale&amp;locale=<?php echo $locale['id']; ?><?php echo isset($_GET['iframe']) ? '&amp;iframe' : NULL; ?>"><?php echo pjSanitize::html($locale['title']);?></a></li>
								<?php
							} 
							?>
						</ul><!-- /.dropdown-menu pjYpNavLangDropdown -->
					</li><!-- /.dropdown -->
				</ul><!-- /.nav navbar-nav navbar-right pjYpNavLang -->
				<?php
			}
		} 
		?>
	</div><!-- /#bs-example-navbar-collapse-1.collapse navbar-collapse -->
</nav><!-- /.navbar navbar-default pjYpHeader -->