jQuery(document).ready(function($){

  $(document).on('click mouseenter', '.sifency-ia-item', function(e){
    var $item    = $(this);
    var $wrapper = $item.closest('.sifency-ia-wrapper');

    if(!$wrapper.length) return;

    var settings = { trigger:'click' };
    try {
      var raw = $wrapper.data('ia-settings');
      if(raw){ $.extend(settings, raw); }
    } catch(err){}

    var triggerEvent = (settings.trigger === 'hover') ? 'mouseenter' : 'click';

    if(e.type === triggerEvent){
      if(!$item.hasClass('active')){
        $wrapper.find('.sifency-ia-item').removeClass('active');
        $item.addClass('active');
      }
    }
  });

});
