<div class="well">
    <div class="span2">{ln_langs}</div>
    <div class="btn-group">
        {items}
        <a class="btn {active}" href="#{id_lan}">{name}</a>
        {/items}
    </div>
</div>

<script type="text/javascript">
    $(function() {
        $('a.btn').click(function() {
            var el = $(this);
            var active = 0;
            if (!el.hasClass('active')) {
                active = 1;
            }
            $.post('{url}', {'id': el.attr('href').replace('#', ''), 'active' : active}, function(data) {
                if (data === '1') {
                    el.toggleClass('active');
                }
            });

            return false;
        });
    });
</script>