<? if ( is_array( $this -> firms ) and count( $this -> firms ) ):?>
<div id="firms-adverts">
  <ul>
    <? foreach ( $this -> firms as $firm ):?>
      <li <? if ( ++$i > 5 ):?>class="more hidden"<? endif;?>>
        <form method="GET" action="/oferty-pracy">
          <input type="hidden" name="filtr" value="true">
          <input type="hidden" name="k" value="<?= htmlspecialchars( $firm['firm_name_profile'] );?>">
          <a href="#" onclick="$( this ).parent( 'form' ).submit(); return false;">
            <?= $firm['firm_name_profile'];?>
          </a>
        </form>
      </li>
    <? endforeach;?>
  </ul>
  <? if ( count( $this -> firms ) > 5 ):?>
    <a href="#" class="toggle"><?= \S::lang( 'rozwin' );?></a>
  <? endif;?>
</div>
<? endif; ?>
<script class="footer" type="text/javascript">
  $( function() 
  {
    $( 'body' ).on( click_event, '#firms-adverts .toggle', function() 
    {
      if ( $( this ).hasClass( 'active' ) )
      {
        $( this ).removeClass( 'active' ).html( '<?= \S::lang( 'rozwin' );?>' );
        $( '#firms-adverts .more' ).addClass( 'hidden' );
      }
      else
      {
        $( this ).addClass( 'active' ).html( '<?= \S::lang( 'zwin' );?>' );
        $( '#firms-adverts .more' ).removeClass( 'hidden' );
      }
      return false;
    });
  });
</script>