function submitForm() {
  var ctl = document.getElementById('htxtEnabled'); ctl.value = getControlEnabledState(); document.forms[0].submit();
}

function submitLink(action) {
  var ctl = document.getElementById('htxtGo'); ctl.value = action; submitForm();
}

function Help_popup(url) {
  aWindow = window.open(url, 'popuplink_window', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=430,height=500', false); aWindow.focus();
}

function showButtons() {
  var ctl = document.getElementById('linkPrevious'); if (ctl) ctl.style.display='inline'; ctl = document.getElementById('linkContinue'); if (ctl) ctl.style.display='inline'; return true;
}

function getControlEnabledState() {	
  var collection = document.forms[0].elements; var state = '';
  if (collection) if (collection.length) for (i=0;i<collection.length;i++) if (collection[i].name.charAt(0) == 'q') if (state.indexOf(collection[i].name + '=') == -1)
    if (collection[i].disabled) state+=collection[i].name + '=0;'; else state+=collection[i].name + '=1;'; return(state);
}

function setControlDisabledState(ctlName,state) {	
  var collection = document.getElementsByName(ctlName); if (collection) if (collection.length) for (i=0;i<collection.length;i++) { if (state == true) { 
	if ((collection[i].checked == true) || (collection[i].checked == false)) {if (collection[i].value == '0') collection[i].checked = true; } else collection[i].value = '0'; } 
	collection[i].disabled = state; }}

function getRadioValue(name) {
  var collection = document.getElementsByName(name); if (collection) if (collection.length) for (i=0;i<collection.length;i++) {
    if (collection[i].checked) return(collection[i].value); } else if (collection.checked) return(collection.value); return '';
}
