$(document).ready( function() {
	// enable master checkbox to toggle all other checkboxes
	$("#master-checkbox").bind("click", function() {
		controller = this;
		$("#result-table").find("input:checkbox").not(this).each(function(){
			this.checked = controller.checked;
		});

	});
	
	// deactive click on checkbox
	$("#result-table tr.odd td, #result-table tr.even td").find("input:checkbox").bind("click", function(){
		this.checked = !this.checked;
	});
	
	 // allow row selection
	$("#result-table tr.odd, #result-table tr.even").click( function(event){
		// stop click event, if table cell contains checkbox
				$(this).find("input:checkbox").each(function(){
					this.checked = !this.checked;
				});
	});
	
});
