$(document).ready(function () {
	$("th input[type=checkbox]").change(function() {
		var table = $(this).parent().parent().parent();
		if ($(this).attr("checked")) {
			table.find("input[type=checkbox]").attr("checked", "checked");
		} else {
			table.find("input[type=checkbox]").removeAttr("checked");
		}
	}
	);
});
