// 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 = "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('Galima pasirinkti ' + max + ' DVD.\nJei norite pasirinkti šį, teks atsisakyti kažkurio iš jau išrinktų.');}}

function boxtgl(name,max) {
  obj = document.getElementById(name);
  if (obj.checked)
    obj.checked = false
  else {
    obj.checked = true;
    boxchk(obj,max);
  }
}


function hideDVD(obj) {
  if (obj.checked)
  document.getElementById('dvd').style.display='none';
}

function showDVD(obj) {
  if (obj.checked)
  document.getElementById('dvd').style.display='block';
}
