function enAb(theObject) {
theObject.disabled = false;
if (theObject.nodeName == 'INPUT' && theObject.type == 'text' || theObject.nodeName == 'SELECT') theObject.style.backgroundColor = '#fff';
}

function disAb(theObject) {
theObject.disabled = true;
if (theObject.nodeName == 'INPUT' && theObject.type == 'text' || theObject.nodeName == 'SELECT') theObject.style.backgroundColor = '#ddd';
}

function itemIndex(r) {
for (var i = 0; i < r.length; i++) { if (r[i].checked == true) {return i} }
return -1;
}

function reqEnAb(obj) {
  if (obj) obj.className = 'required';
}

function reqDisAb(obj) {
  if (obj) obj.className = null;
}