function fill_list(topicList,target) {
  topic=topicList.options[topicList.selectedIndex].text;
  //alert ('got here: ' + topic);
  frames[target].location.href = "/cgi-bin/broker?_service=doh&_program=dohcode.optlist.sas&_debug=0&topic=" + topic + "&target=" + target;
}

function clearlists() {
 frames["ListVars1"].columnsub.selectedIndex=-1;
 frames["ListVars2"].rowsub.selectedIndex=-1;
}

function deselect_other(target){
  document.all[target].selectedIndex=-1;
}

function checkSelect(targetList){
 n=targetList.length;
 if (n == 0) {return false;}
  for (i=0; i<n; i++) {
   if (targetList.options[i].selected) {return true;}
  }
  return true;
}

function checkCheckbox(target){
 n=target.length;
 if (n == 0) {return false;}
 for (i=0; i<n; i++){
  if (target[i].checked)  {return true;}
 }
 return false;
}

function checkForm(){
 if (checkCheckbox(document.all["year"])==false){
  alert ("You must select at least 1 year.");
  return false;
 }
 else if (document.all["columnsub"].value=="none"){
  alert ("You must select a column variable.");
  return false;
 }
 else if (document.all["rowsub"].value=="none"){
  alert ("You must select a row variable.");
  return false;
 }
 
 else {return true};
}

function check_other1(thislist){
window.parent.brfss.columnsub.value=thislist.options[thislist.selectedIndex].value;
otherlist=window.parent.frames["ListVars2"].rowsub;
if (otherlist.selectedIndex != -1)
{
  //alert (thislist.options[thislist.selectedIndex].value + " = " + otherlist.options[otherlist.selectedIndex].value);
  if (thislist.options[thislist.selectedIndex].value == otherlist.options[otherlist.selectedIndex].value)
  {
    otherlist.selectedIndex=-1;
    window.parent.brfss.rowsub.value="none";
  }
 }
}
