<? if ( is_array( $this -> categories ) and count( $this -> categories ) ):?>
<div id="categories-adverts">
  <ul>
    <? foreach ( $this -> categories as $category ):?>
      <li <? if ( ++$i > 5 ):?>class="more hidden"<? endif;?>>
        <a href="/oferty-pracy/<?= \S::seo( $category['name'], true );?>" title="Oferty pracy <?= $category['name'];?>">
          <?= $category['name'];?>
        </a>
      </li>
    <? endforeach;?>
  </ul>
  <? if ( count( $this -> categories ) > 5 ):?>
    <a href="#" class="toggle"><?= \S::lang( 'rozwin' );?></a>
  <? endif;?>
</div>
<? endif; ?>
<script class="footer" type="text/javascript">
  $( function() 
  {
    $( 'body' ).on( click_event, '#categories-adverts .toggle', function() 
    {
      if ( $( this ).hasClass( 'active' ) )
      {
        $( this ).removeClass( 'active' ).html( '<?= \S::lang( 'rozwin' );?>' );
        $( '#categories-adverts .more' ).addClass( 'hidden' );
      }
      else
      {
        $( this ).addClass( 'active' ).html( '<?= \S::lang( 'zwin' );?>' );
        $( '#categories-adverts .more' ).removeClass( 'hidden' );
      }
      return false;
    });
  });
</script>