function crSel(id, a) {
var s = document.getElementById(id);
if (s) s.parentNode.removeChild(s);
s = document.createElement('select');
s.id = id;
for (var i = 1, m = Number(document.forms[0].elements[a].value) || 0; i < m; ++i)
s.options.add(new Option(i, i));
document.forms[1].appendChild(s);
}
function acceptButClick() {
crSel('horSelID', 1);
crSel('verSelID', 0);
}