<?php
  /**
   * Copyright 2011 Zazavi - http://www.zazavi.com
   * Zazavi is free software released under the terms of the GNU General Public License.
   * You should have received a copy of the license.  If not, see <http://www.gnu.org/licenses/>.
   */
  
  if (!defined("_VALID_PHP"))
      die('Direct access to this location is not allowed.');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $content->getMeta(); ?>
<script language="javascript" type="text/javascript">
var THEMEURL = "<?php echo THEMEURL; ?>";
var SITEURL = "<?php echo SITEURL; ?>";
</script>
<link id="stylesheet" href="<?php echo THEMEURL;?>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo SITEURL;?>/assets/jquery.js"></script>
<script type="text/javascript" src="<?php echo SITEURL;?>/assets/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="<?php echo SITEURL;?>/assets/global.js"></script>
<script type="text/javascript" src="<?php echo SITEURL;?>/assets/tooltip.js"></script>
<script type="text/javascript" src="<?php echo SITEURL;?>/assets/cycle.js"></script>
<link href="<?php echo SITEURL;?>/assets/prettyPhoto.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo SITEURL;?>/assets/jquery.prettyPhoto.js"></script>
<?php $content->getModuleAssets();?>
<script type="text/javascript"> 
// <![CDATA[
$(function(){
	$("#mainmenu ul li:has(ul)").find("span:first").addClass("down");
	$("#mainmenu ul li ul li:has(ul)").find("span:first").removeClass("down");
	$("#mainmenu ul li ul li:has(ul)").find("a:first").addClass("fly");
	$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'facebook'});
});
 $(document).ready(function(){
     $('a.langchange').click(function() {
         var target = $(this).attr('href');
         $('body').addClass('loadbg').fadeOut(1000, function() {
             window.location.href = target;
         });
     return false
     });
	 
      $("a.langchange").click(function() { 
		 $.cookie("LANG_ZAZAVIPRO",$(this).attr('rel'), {expires: 120, path: '/'});
         return false;
      });

 });
 /* Lang Switcher */
$.fn.langSwitcher = function(){
	$(this).click(function(){
		return false;
	});
}
$('#lang-switcher').langSwitcher();
// ]]>
</script>
</head>
<body>
<div class="wrapper">
<!-- Header -->
<div id="header">
  <div class="wrap"> 
    <!-- Login Start -->
    <div id="login-box">
      <?php if($user->logged_in):?>
      <strong><?php echo _WELCOME;?>:</strong>&nbsp; <a href="<?php echo SITEURL;?>/account.php"><?php echo $user->username;?></a><?php if ($user->is_Admin()):?> &bull; <a href="<?php echo SITEURL;?>/admin">Admin Panel</a><?php endif;?> &bull; <a href="<?php echo SITEURL;?>/logout.php"><?php echo _N_LOGOUT;?></a>
      <?php else:?>
      <strong><?php echo _WELCOME;?> <?php echo $user->username;?></strong> &nbsp; &nbsp; <a href="<?php echo SITEURL;?>/register.php"><?php echo _UA_REGISTER;?></a> &bull; <a href="<?php echo SITEURL;?>/login.php"><?php echo _UA_LOGIN;?></a> &bull; <a href="<?php echo SITEURL;?>/login.php"><?php echo _UA_TITLE3;?></a>
      <?php endif;?>
    </div>
    <!--/ Login End --> 
    
    <!-- Livesearch Start -->
    <div id="search-box">
      <form action="" method="post">
        <input name="keywords" type="text" id="inputString" size="50" onclick="disAutoComplete(this);" />
      </form>
      <div id="suggestions"></div>
    </div>
    <!--/ Livesearch End --> 
    
    <?php if($core->show_lang):?>
    <!-- Langswitcher Start -->
    <div id="langswitch"><img src="<?php echo THEMEURL;?>/images/lang-switch.png" alt="" onclick="$('.lang-switcher').slideToggle()"/>
      <div class="lang-switcher" style="display:none">
        <ul>
          <?php foreach($core->langList() as $lang):?>
          <?php if($core->language == $lang['flag']):?>
          <li class="lang-active"><a href="javascript:void(0);"><img src="<?php echo SITEURL;?>/lang/<?php echo $lang['flag'];?>.png" alt="" title="<?php echo $lang['name'];?>"/></a></li>
          <?php else:?>
          <li><a href="<?php echo SITEURL;?>" rel="<?php echo $lang['flag'];?>" class="langchange"><img src="<?php echo SITEURL;?>/lang/<?php echo $lang['flag'];?>.png" alt="" title="<?php echo $lang['name'];?>"/></a></li>
          <?php endif?>
          <?php endforeach;?>
        </ul>
      </div>
    </div>
    <!--/ Langswitcher End -->
    <?php endif;?>
    
    <div class="logo"><a href="<?php echo SITEURL;?>/index.php"><?php echo ($core->logo) ? '<img src="'.SITEURL.'/uploads/'.$core->logo.'" alt="'.$core->company.'" />': $core->company;?></a></div>
    <!-- Main Menu -->
    <div id="mainmenu">
      <?php $mainmenu = $content->getMenuList(); $content->getMenu($mainmenu,0);?>
    </div>
    <!-- Main Menu /--> 
  </div>
</div>
<!-- Header /-->