$(function()
{
  $('#check_all').change(function()
  {
    $("input:checkbox[name='states[]']").attr("checked",$(this).is(":checked"));
  });
});
