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