Someone want to help trim this function down some? What it does is take a list of checkboxes and if someone selects "ALL" it turns off all the other boxes and checks, if someone selects any other box it turns off "ALL" and allows the others to light up.
$('[EMAIL PROTECTED]').click(function() { temp = this.id.replace("categoryid",""); if (temp == 0) { $('[EMAIL PROTECTED]').attr("checked",""); $('input#categoryid0').attr("checked","checked"); } else { $('input#categoryid0').attr("checked",""); if ($(this).is(":checked")) { $('input#categoryid'+temp).attr("checked","checked"); } else { $('input#categoryid'+temp).attr("checked",""); } } });