/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



    $(function(){

      var $container = $('#players_container');

      $container.isotope({
        itemSelector : '.player'
      });


      var $optionSets = $('.option-set'),
          $optionLinks = $optionSets.find('a');

      $optionLinks.click(function(){
        var $this = $(this);
        // don't proceed if already selected
        if ( $this.hasClass('selected') ) {
          return false;
        }
        var $optionSet = $this.parents('.option-set');
        $optionSet.find('.selected').removeClass('selected');
        $this.addClass('selected');

        // make option object dynamically, i.e. { filter: '.my-filter-class' }
        var options = {},
            key = $optionSet.attr('data-option-key'),
            value = $this.attr('data-option-value');
        // parse 'false' as false boolean
        value = value === 'false' ? false : value;
        options[ key ] = value;
          // otherwise, apply new options
          $container.isotope( options );

        return false;
      });
$('#players_container').isotope( {filter: '.v'} );

    });
