+<style>
+span.tooltip{ display:none;}
+span.tooltip {
+ position: absolute;
+ right: -0px;
+ top: 20px;
+ width: 200px;
+ color: rgb(113, 157, 171);
+ background: rgb(255, 255, 255);
+ border: 1px solid rgb(113, 157, 171);
+}
+
+:hover > span.tooltip, span.tooltip:hover {
+ display: inline;
+}
+span.before-tooltip {
+ color: #800;
+ font-style: italic;
+ position: relative;
+}
+
+</style>
+<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
+<script text="text/javascript">
+
+var inserts = {
+ '#checkAll': function (e) {
+ e.onchange = function() {
+ $('.check_detail').prop('checked', e.checked)
+ $('.check_detail').trigger('change');
+ }
+ }
+ ,'tr': function(e) {
+ // find if there is a check detail box on link all input to it
+ var tr = $(e);
+ var check = tr.find('.check_detail');
+ if(check.length != 1) return;
+ check = check[0];
+ var jcheck = $(check);
+ var inputs = tr.find('input');
+ inputs.each(function(index, input) {
+ if(input === check) return;
+ $(input).prop('disabled', true)
+ })
+
+ check.onchange = function() {
+ inputs.each(function(index, input) {
+ var on = jcheck.prop('checked')
+ if(input == check) return;
+ $(input).prop('disabled', !on);
+ })
+ };
+ }
+ }
+Behaviour.register(inserts);
+</script>