<!--
//******************************************************/
//* Contains the source code for the onClick event of  */
//*   the OPTIONS button                               */
//* bth_infmort => dth_infmort 10/29/03 M Thomison     */
//* POPULATION OPTION PAGE NAMING CONVENTION 1/6/04 M THOMISON     */
//* added cancer report  08/20/04   M. Thomison */.
//* added cancer report  08/24/04   M. Thomison */.
//******************************************************/
function optionsWindow()
{
  var URL;
//alert("optionsWindow top");
  var windowTop, windowLeft;
  var popupWindow;

  // ****************************************
  // open options dialog window             *
  // ****************************************
  switch(queryForm.menuSelection.value)
  {
    case "TB2002":
      if (queryForm.county.value == "00" || queryForm.county.value == "18" || queryForm.county.value == "25" || queryForm.county.value == "31"
      || queryForm.county.value == "57") {URL = "opt_tb_1_2002.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:680px; dialogheight:490px; help:no; status:no; edge:sunken");}
      else {URL = "opt_tb_2_2002.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:680px; dialogheight:490px; help:no; status:no; edge:sunken");}
      break;
    case "TB2005":
      if (queryForm.county.value == "00" || queryForm.county.value == "18" || queryForm.county.value == "25" || queryForm.county.value == "31"
      || queryForm.county.value == "57") {URL = "opt_tb_1_2003.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:680px; dialogheight:490px; help:no; status:no; edge:sunken");}
      else {URL = "opt_tb_2_2003.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:680px; dialogheight:490px; help:no; status:no; edge:sunken");}
      break;
    case "PolBirth":
      URL = "opt_pop_birth.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:522px; dialogheight:450px; help:no; status:no; edge:sunken");
      break;
    case "PolSTD":
      URL = "opt_pop_std.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:522px; dialogheight:490px; help:no; status:no; edge:sunken");
      break;
    case "PolTB2002":
      URL = "opt_pop_tb_2002.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:522px; dialogheight:490px; help:no; status:no; edge:sunken");
      break;
    case "PolTB2005":
      URL = "opt_pop_tb_2003.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:522px; dialogheight:490px; help:no; status:no; edge:sunken");
      break;
    case "200":
    case "300":
      URL = "opt_std_gonorrhea_chlamydia.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:600px; dialogheight:520px; help:no; status:no; edge:sunken");
      break;
    case "700":
      URL = "opt_std_syphilis.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:600px; dialogheight:520px; help:no; status:no; edge:sunken");
      break;
    case "Live Births":
      URL = "opt_bth_rate.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:523px; dialogheight:510px; help:no; status:no; edge:sunken");
      break;
    case "Birth Weight Distribution":
//    case 'Birth Weight Distribution Summary':
//    case "Very Low Birth Weight":
//    case "Low Birth Weight":
//    case "Normal Birth Weight":
//    case "High Birth Weight":
//    case "Unknown Birth Weight":
    case "County of Birth":
    case "Entry into Prenatal Care":
//    case 'Entry into Prenatal Care Summary':
//    case 'First Trimester Prenatal Care':
//    case 'Second Trimester Prenatal Care':
//    case 'Third Trimester Prenatal Care':
//    case 'No Prenatal Care':
//    case 'Unknown Prenatal Care':
    case "Gestational Age Distribution":
//    case "Gestational Age Distribution Summary":
//    case "Very Pre-Term":
//    case "Pre-Term":
//    case "Term":
//    case "Post-Term":
    case "Maternal Risk Factors":
    case "Mother Marital Status":
//    case "Mother's Marital Status Summary":
//    case 'Married Status':
//    case 'Unmarried Status':
      URL = "opt_birth.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:523px; dialogheight:425px; help:no; status:no; edge:sunken");
      break;
    case "Method of Delivery":
//    case "Method of Delivery Summary":
//    case "Vaginal Births":
//    case "Vaginal Births After C-Section":
//    case "Cesarean Section Births":
      URL = "opt_birth.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:523px; dialogheight:425px; help:no; status:no; edge:sunken");
      break;
    case "Causes of Death of Infant":
//    case 'Causes of Death of Infant Summary':
//    case 'Maternal Complications':
//    case 'Cord and Placental Complications':
//    case 'Low Birth Weight Deaths':
//    case 'Congenital Malformations':
//    case 'Sudden Infant Death Syndrome':
    case "Infant Mortality":
      URL = "opt_dth_infmort.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:450px; dialogheight:350px; help:no; status:no; edge:sunken");
      break;
    case 'Cancer Deaths':
    case 'Chronic Lower Respiratory Diseases':
    case 'Diabetes Deaths':
    case 'Homicide':
    case 'Leading Causes':
    case 'Pneumonia and Influenza':
    case 'Selected Injuries':
    case 'Suicide':
    case 'Unintentional Injuries':
    case 'Total Resident Deaths':
      URL = "opt_death.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:522px; dialogheight:490px; help:no; status:no; edge:sunken");
      break;
    case "NCHS Population Data":
      URL = "opt_pop_death.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:690px; dialogheight:510px; help:no; status:no; edge:sunken");
      break;
    case 'Cancer Deaths by Year 18 Age Groups':
      URL = "opt_death_age18.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:522px; dialogheight:490px; help:no; status:no; edge:sunken");
      break;
    case 'Cancer Deaths by Year 19 Age Groups':
      URL = "opt_death_age19.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:522px; dialogheight:490px; help:no; status:no; edge:sunken");
      break;
    case 'Invasive Cancers - 11 Age Group Option':
      URL = "opt_cancer_age11.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:760px; dialogheight:640px; help:no; status:no; edge:sunken");
      break;
    case 'Invasive Cancers - 19 Age Group Option':
      URL = "opt_cancer_age19.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:760px; dialogheight:710px; help:no; status:no; edge:sunken");
      break;
    case 'Staged Selected Cancers - 11 Age Group Option':
      URL = "opt_cancer_staged11.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:760px; dialogheight:580px; help:no; status:no; edge:sunken");
      break;
    case 'Staged Selected Cancers - 19 Age Group Option':
      URL = "opt_cancer_staged19.htm";
      optionsArray = window.showModalDialog(URL, optionsArray, "dialogwidth:760px; dialogheight:680px; help:no; status:no; edge:sunken");
      break;
    default:
      alert("Select a report to continue.");
      break;
  }

  // ********************************************
  // PROCESS RETURN VALUES FROM DIALOG WINDOW
  // ****************************************
  //clear all list boxes
  if(queryForm.gender.length > 0)
  {
    for (ii=queryForm.gender.length; ii>=0; ii--)
      queryForm.gender.options[ii] = null;
  }
  if(queryForm.race.length > 0)
  {
    for (ii=queryForm.race.length; ii>=0; ii--)
      queryForm.race.options[ii] = null;
  }
  if(queryForm.ethnicity.length > 0)
  {
    for (ii=queryForm.ethnicity.length; ii>=0; ii--)
      queryForm.ethnicity.options[ii] = null;
  }
  if(queryForm.ageGroup.length > 0)
  {
    for (ii=queryForm.ageGroup.length; ii>=0; ii--)
      queryForm.ageGroup.options[ii] = null;
  }
  if(queryForm.stage.length > 0)
  {
    for (ii=queryForm.stage.length; ii>=0; ii--)
      queryForm.stage.options[ii] = null;
  }
  if(queryForm.diagnosis.length > 0)
  {
    for (ii=queryForm.diagnosis.length; ii>=0; ii--)
      queryForm.diagnosis.options[ii] = null;
  }
  if(queryForm.resultsType.length > 0)
  {
    for (ii=queryForm.resultsType.length; ii>=0; ii--)
      queryForm.resultsType.options[ii] = null;
  }
  if(queryForm.fb.length > 0)
  {
    for (ii=queryForm.fb.length; ii>=0; ii--)
      queryForm.fb.options[ii] = null;
  }
  if(queryForm.sod.length > 0)
  {
    for (ii=queryForm.sod.length; ii>=0; ii--)
      queryForm.sod.options[ii] = null;
  }
  if(queryForm.cancertype.length > 0)
  {
    for (ii=queryForm.cancertype.length; ii>=0; ii--)
      queryForm.cancertype.options[ii] = null;
  }

  // fill list boxes with selected options
  // gender
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Gender")         // if the current entry is "Gender"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.gender.options[jj]=newOption;
      queryForm.gender(jj).selected = true; 
      jj++;
    }
  }
  // race
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Race")         // if the current entry is "Race"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.race.options[jj]=newOption;
      queryForm.race(jj).selected = true; 
      jj++;
    }
  }
  // ethnicity
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Ethnicity")    // if the current entry is "Ethnicity"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.ethnicity.options[jj]=newOption;
      queryForm.ethnicity(jj).selected = true; 
      jj++;
    }
  }
  // age group
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Age Group")    // if the current entry is "Age Group"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.ageGroup.options[jj]=newOption;
      queryForm.ageGroup(jj).selected = true; 
      jj++;
    }
  }
  // stage
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Stage")        // if the current entry is "Stage"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.stage.options[jj]=newOption;
      queryForm.stage(jj).selected = true; 
      jj++;
    }
  }
  // diagnosis
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Diagnosis")    // if the current entry is "Diagnosis"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.diagnosis.options[jj]=newOption;
      queryForm.diagnosis(jj).selected = true; 
      jj++;
    }
  }
  // results type
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Results Type")    // if the current entry is "Results Type"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.resultsType.options[jj]=newOption;
      queryForm.resultsType(jj).selected = true; 
      jj++;
    }
  }
  // cancertype
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Cancer Type")    // if the current entry is "Cancer Type"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.cancertype.options[jj]=newOption;
      queryForm.cancertype(jj).selected = true; 
      jj++;
    }
  }


  // country of birth
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Country of Birth")    // if the current entry is "Country of Birth"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.fb.options[jj]=newOption;
      queryForm.fb(jj).selected = true; 
      jj++;    
    }
  }

  // site of disease
  jj=0;
  for (ii=0; ii<optionsArray.length; ii++)    // loop through options window selections
  {
    if(optionsArray[ii][0] == "Site of Disease")    // if the current entry is "Site of Disease"
    {
      var newOption = new Option(optionsArray[ii][1], optionsArray[ii][3]);
      queryForm.sod.options[jj]=newOption;
      queryForm.sod(jj).selected = true; 
      jj++;
    }
  }
}
//-->
