function checkboxlimit(checkgroup, limit){
	var checkgroup=checkgroup
	var limit=limit
	for (var i=0; i<checkgroup.length; i++){
		checkgroup[i].onclick=function(){
			
			cur_starttime = $(this).attr("starttime");
			clashingtime = false;
			
			var checkedcount=0
			for (var i = 0; i < checkgroup.length; i++) {
				if (checkgroup[i].checked){
					if ($(checkgroup[i]).attr("starttime") == cur_starttime && this.name != checkgroup[i].name) clashingtime = true;
					checkedcount += 1;
				}
			}
		
			if (checkedcount>limit){
				alert("You can only select a maximum of "+limit+" authors for 1 day")
				this.checked=false;
			} else if (clashingtime){
				alert("You have selected two sessions that are occuring at the same time, please choose a different session.");
				this.checked=false;
			}
		}
	}
}

