    <div class="top-bar">
      <div class="container">
        <div class="row">
            <div class="col-md-12 holder">
            <?php render_widget('top_bar_contact'); ?>

            

            <?php render_widget('top_bar_social'); ?>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="header">
      <div class="container">
        <div class="row main-header">
          <div class="col-md-4 col-sm-12 logo-panel">
            <h3><a href="<?php echo site_url();?>"><img src="<?php echo get_site_logo();?>" alt="Logo" style="height:63px"></a></h3>
          </div>
          <div class="col-md-8 col-sm-12 panel-right ad-block-top">
            <img src="http://placehold.it/1200x120/ebb717/ffffff?text=Download+Free+Script+PersianScript.ir" alt="Ad1" class="img-responsive">
          </div>
        </div>
      </div>
    </div>    

    <div class="menu">
        <div class="container">
          <nav class="navbar navbar-default">
            <div class="container-fluid">
              <!-- Brand and toggle get grouped for better mobile display -->
              <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#site-menu" 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>

              <!-- Collect the nav links, forms, and other content for toggling -->
              <div class="collapse navbar-collapse" id="site-menu">
                <ul class="nav navbar-nav">
                  <?php
                            $CI = get_instance();
                            $CI->load->model('admin/page_model');
                            $CI->page_model->init();
                        ?>



                        <?php 
                            $alias = (isset($alias))?$alias:'';
                            foreach ($CI->page_model->get_menu() as $li) 
                            {
                                if($li->parent==0)
                                $CI->page_model->render_top_menu($li->id,0,$alias);
                            }
                        ?>

                        <li class="has-sub dropdown">
                            <a aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" class="dropdown-toggle" href="#">
                              <?php echo lang_key('categories');?><span class="caret"></span></a>
                            <ul class="dropdown-menu">
                            <?php
                            $CI = get_instance();
                            $CI->load->model('show/post_model');
                            $parent_categories = $CI->post_model->get_all_parent_categories();
                            foreach ($parent_categories->result() as $category) {
                              $category_url = category_news_url($category->id,$category->title);
                            ?>    
                              <li class=" -child">
                                  <a href="<?php echo $category_url;?>"><?php echo $category->title;?></a>
                              </li>
                            <?php 
                            }
                            ?>
                            </ul>
                        </li>

                        <li class="has-sub dropdown">
                            <a aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" class="dropdown-toggle" href="#">
                              <?php echo lang_key('news_sources');?><span class="caret"></span></a>
                            <ul class="dropdown-menu">
                            <?php
                            $CI = get_instance();
                            $CI->load->model('admin/content_model');
                            $sources = $CI->content_model->get_all_sources();
                            foreach ($sources->result() as $source) {
                              $source_news_url = source_news_url($source->id,$source->source_name);
                            ?>    
                              <li class=" -child">
                                  <a href="<?php echo $source_news_url;?>"><?php echo $source->source_name;?></a>
                              </li>
                            <?php 
                            }
                            ?>
                            </ul>
                        </li>

                        
                        <?php if(!is_loggedin()){?>
                        <?php if(get_settings('global_settings','enable_signup','Yes')=='Yes'){?>
                        <li class="">
                            <a class="signup" href="<?php echo site_url('account/signupform');?>"><?php echo lang_key('signup')?></a>
                        </li>
                        <?php }?>

                        <li class="">
                            <a class="signin" href="#"><?php echo lang_key('signin');?></a>
                        </li>
                        <?php }else{ ?>
                        <?php if(is_admin() || is_moderator()){?>
                        <li class="">
                            <a class="signup" href="<?php echo site_url('admin');?>"><?php echo lang_key('user_panel');?></a>
                        </li>
                        <?php }?>
                        <li class="">
                            <a class="signup" href="<?php echo site_url('account/logout');?>"><?php echo lang_key('logout');?></a>
                        </li>
                        <?php }?>
                </ul>
                
              </div><!-- /.navbar-collapse -->
            </div><!-- /.container-fluid -->
          </nav>
          <?php require'marquee_view.php';?>
          <div class="header-separator">
        </div>
    </div>
    