Replace attr("checked") with prop("checked")
And replace $.browser with code from http://chez-syl.fr/2013/02/jquery-1-9-et-browser/