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

$(function() {
    $('#search_keyword').click(function() {
      if($(this).val() == 'Keyword'){
        $(this).val('');
      }
      return false;
    });
});

$(function() {
    $('#compare_selected_button').click(function() {
      i=0;
      jQuery.each($('#compare_selected_form input.check'), function(){
        if (this.checked) {
          i++;
        }
      })
      
      if (i >= 2){
        $('#compare_selected_form').submit();
      } else {
        alert('Select at least two products');
      }
      return false;
    });
});
