// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

Event.observe(window, 'load', function() {
    // Set filter options
    if ($('filter_term_extractor_standard') != 'undefined') {
        set_filter_options();
        Event.observe($('filter_term_extractor_standard'), 'click', function() {
          set_filter_options();
        });
        Event.observe($('filter_term_extractor_custom'), 'click', function() {
          set_filter_options();
        });
    }
});

function set_filter_options() {
    if ($('filter_term_extractor_standard').checked) {
      // Standard option set
      $('filter_extended_matches').checked = false;
      $('filter_extended_matches').disabled = true;
    } else if ($('filter_term_extractor_custom').checked) {
      // Custom option set
      $('filter_extended_matches').disabled = false;
    }
}
