// Limited Selection Checkbox Groups
// copyright Stephen Chapman, 26th July 2005
// you may copy this function provided that you retain the copyright notice


function boxchk(obj,max) {var box = obj.name.substr(0,obj.name.lastIndexOf('_')+1);var cnt=0,i=1;while(obj.form[box+i]) {cnt += obj.form[box+i].checked;i++;}if (cnt > max) {obj.checked = false;alert('Only choose 1 Age Rating.\nTo pick this Age Rating, first unselect the other.');}}

function boxchk2(obj,max) {var box = obj.name.substr(0,obj.name.lastIndexOf('_')+1);var cnt=0,i=1;while(obj.form[box+i]) {cnt += obj.form[box+i].checked;i++;}if (cnt > max) {obj.checked = false;alert('I think 6 genre is enough.\nDont you?');}}

function boxchk3(obj,max) {var box = obj.name.substr(0,obj.name.lastIndexOf('_')+1);var cnt=0,i=1;while(obj.form[box+i]) {cnt += obj.form[box+i].checked;i++;}if (cnt > max) {obj.checked = false;alert('Only choose 1 IMDb Rating.\nTo pick this IMDb Rating, first unselect the other.\n\n6 is 6 to 6.9\n7 is 7 to 7.9\n8 is 8 to 8.9\nAnd 9 is 9+');}}

function boxchk4(obj,max) {var box = obj.name.substr(0,obj.name.lastIndexOf('_')+1);var cnt=0,i=1;while(obj.form[box+i]) {cnt += obj.form[box+i].checked;i++;}if (cnt > max) {obj.checked = false;alert('Only choose 1 Month.\nTo pick this Month, first unselect the other.');}}

function boxchk5(obj,max) {var box = obj.name.substr(0,obj.name.lastIndexOf('_')+1);var cnt=0,i=1;while(obj.form[box+i]) {cnt += obj.form[box+i].checked;i++;}if (cnt > max) {obj.checked = false;alert('Only choose 1 Year.\nTo pick this Year, first unselect the other.');}}
