var count = 0;

function submit_check(maxcount) {
	if (maxcount != 1) {
		//チェックボックスのとき
		var count = 0;
		for (i=1; i<=5; i++) {
			var cb = document.forms[0]["q0"+i];
			if (cb != null && cb.checked)
				count++;
		}
		if (count != maxcount) {	
			alert("Select any "+ maxcount +" options.");			
			return;
		}
		document.forms[0].submit();			
	} else {
		//ラジオボタンのとき
		targets = document.forms[0].q01;
		for (var i=0; i<targets.length; i++) {
				if (targets[i].checked) {
					//alert(i);
					document.forms[0].submit();
					return;
				}
		}
		alert("Select any "+ maxcount +" option.");
	}
}

