var state_abbrev=Array(
"AL",
"AK",
"AZ",
"AR",
"CA",
"CO",
"CT",
"DC",
"DE",
"FL",
"GA",
"HI",
"ID",
"IL",
"IN",
"IA",
"KS",
"KY",
"LA",
"ME",
"MD",
"MA",
"MI",
"MN",
"MS",
"MO",
"MT",
"NE",
"NV",
"NH",
"NJ",
"NM",
"NY",
"NC",
"ND",
"OH",
"OK",
"OR",
"PA",
"RI",
"SC",
"SD",
"TN",
"TX",
"UT",
"VT",
"VA",
"WA",
"WV",
"WI",
"WY" );

var state_names= Array(
"Select State",
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"District of Columbia",
"Florida",
"Georgia",
"Hawaii",
"Idaho",
"Illinois",
"Indiana",
"Iowa",
"Kansas",
"Kentucky",
"Louisiana",
"Maine",
"Maryland",
"Massachusetts",
"Michigan",
"Minnesota",
"Mississippi",
"Missouri",
"Montana",
"Nebraska",
"Nevada",
"New Hampshire",
"New Jersey",
"New Mexico",
"New York",
"North Carolina",
"North Dakota",
"Ohio",
"Oklahoma",
"Oregon",
"Pennsylvania",
"Rhode Island",
"South Carolina",
"South Dakota",
"Tennessee",
"Texas",
"Utah",
"Vermont",
"Virginia",
"Washington",
"West Virginia",
"Wisconsin",
"Wyoming" );


var country_names= Array(
"Select Country",
"AFGHANISTAN",
"ALAND ISLANDS",
"ALBANIA",
"ALGERIA",
"AMERICAN SAMOA",
"ANDORRA",
"ANGOLA",
"ANGUILLA",
"ANTARCTICA",
"ANTIGUA AND BARBUDA",
"ARGENTINA",
"ARMENIA",
"ARUBA",
"AUSTRALIA",
"AUSTRIA",
"AZERBAIJAN",
"BAHAMAS",
"BAHRAIN",
"BANGLADESH",
"BARBADOS",
"BELARUS",
"BELGIUM",
"BELIZE",
"BENIN",
"BERMUDA",
"BHUTAN",
"BOLIVIA",
"BOSNIA AND HERZEGOVINA",
"BOTSWANA",
"BOUVET ISLAND",
"BRAZIL",
"BRITISH INDIAN OCEAN TERRITORY",
"BRUNEI DARUSSALAM",
"BULGARIA",
"BURKINA FASO",
"BURUNDI",
"CAMBODIA",
"CAMEROON",
"CANADA",
"CAPE VERDE",
"CAYMAN ISLANDS",
"CENTRAL AFRICAN REPUBLIC",
"CHAD",
"CHILE",
"CHINA",
"CHRISTMAS ISLAND",
"COCOS (KEELING) ISLANDS",
"COLOMBIA",
"COMOROS",
"CONGO",
"CONGO, THE DEMOCRATIC REPUBLIC OF THE",
"COOK ISLANDS",
"COSTA RICA",
"COTE D'IVOIRE",
"CROATIA",
"CUBA",
"CYPRUS",
"CZECH REPUBLIC",
"DENMARK",
"DJIBOUTI",
"DOMINICA",
"DOMINICAN REPUBLIC",
"ECUADOR",
"EGYPT",
"EL SALVADOR",
"EQUATORIAL GUINEA",
"ERITREA",
"ESTONIA",
"ETHIOPIA",
"FALKLAND ISLANDS (MALVINAS)",
"FAROE ISLANDS",
"FIJI",
"FINLAND",
"FRANCE",
"FRENCH GUIANA",
"FRENCH POLYNESIA",
"FRENCH SOUTHERN TERRITORIES",
"GABON",
"GAMBIA",
"GEORGIA",
"GERMANY",
"GHANA",
"GIBRALTAR",
"GREECE",
"GREENLAND",
"GRENADA",
"GUADELOUPE",
"GUAM",
"GUATEMALA",
"GUINEA",
"GUINEA-BISSAU",
"GUYANA",
"HAITI",
"HEARD ISLAND AND MCDONALD ISLANDS",
"HOLY SEE (VATICAN CITY STATE)",
"HONDURAS",
"HONG KONG",
"HUNGARY",
"ICELAND",
"INDIA",
"INDONESIA",
"IRAN, ISLAMIC REPUBLIC OF",
"IRAQ",
"IRELAND",
"ISRAEL",
"ITALY",
"JAMAICA",
"JAPAN",
"JORDAN",
"KAZAKHSTAN",
"KENYA",
"KIRIBATI",
"KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF",
"KOREA, REPUBLIC OF",
"KUWAIT",
"KYRGYZSTAN",
"LAO PEOPLE'S DEMOCRATIC REPUBLIC",
"LATVIA",
"LEBANON",
"LESOTHO",
"LIBERIA",
"LIBYAN ARAB JAMAHIRIYA",
"LIECHTENSTEIN",
"LITHUANIA",
"LUXEMBOURG",
"MACAO",
"MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF",
"MADAGASCAR",
"MALAWI",
"MALAYSIA",
"MALDIVES",
"MALI",
"MALTA",
"MARSHALL ISLANDS",
"MARTINIQUE",
"MAURITANIA",
"MAURITIUS",
"MAYOTTE",
"MEXICO",
"MICRONESIA, FEDERATED STATES OF",
"MOLDOVA, REPUBLIC OF",
"MONACO",
"MONGOLIA",
"MONTSERRAT",
"MOROCCO",
"MOZAMBIQUE",
"MYANMAR",
"NAMIBIA",
"NAURU",
"NEPAL",
"NETHERLANDS",
"NETHERLANDS ANTILLES",
"NEW CALEDONIA",
"NEW ZEALAND",
"NICARAGUA",
"NIGER",
"NIGERIA",
"NIUE",
"NORFOLK ISLAND",
"NORTHERN MARIANA ISLANDS",
"NORWAY",
"OMAN",
"PAKISTAN",
"PALAU",
"PALESTINIAN TERRITORY, OCCUPIED",
"PANAMA",
"PAPUA NEW GUINEA",
"PARAGUAY",
"PERU",
"PHILIPPINES",
"PITCAIRN",
"POLAND",
"PORTUGAL",
"PUERTO RICO",
"QATAR",
"REUNION",
"ROMANIA",
"RUSSIAN FEDERATION",
"RWANDA",
"SAINT HELENA",
"SAINT KITTS AND NEVIS",
"SAINT LUCIA",
"SAINT PIERRE AND MIQUELON",
"SAINT VINCENT AND THE GRENADINES",
"SAMOA",
"SAN MARINO",
"SAO TOME AND PRINCIPE",
"SAUDI ARABIA",
"SENEGAL",
"SERBIA AND MONTENEGRO",
"SEYCHELLES",
"SIERRA LEONE",
"SINGAPORE",
"SLOVAKIA",
"SLOVENIA",
"SOLOMON ISLANDS",
"SOMALIA",
"SOUTH AFRICA",
"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS",
"SPAIN",
"SRI LANKA",
"SUDAN",
"SURINAME",
"SVALBARD AND JAN MAYEN",
"SWAZILAND",
"SWEDEN",
"SWITZERLAND",
"SYRIAN ARAB REPUBLIC",
"TAIWAN",
"TAJIKISTAN",
"TANZANIA, UNITED REPUBLIC OF",
"THAILAND",
"TIMOR-LESTE",
"TOGO",
"TOKELAU",
"TONGA",
"TRINIDAD AND TOBAGO",
"TUNISIA",
"TURKEY",
"TURKMENISTAN",
"TURKS AND CAICOS ISLANDS",
"TUVALU",
"UGANDA",
"UKRAINE",
"UNITED ARAB EMIRATES",
"UNITED KINGDOM",
"UNITED STATES",
"UNITED STATES MINOR OUTLYING ISLANDS",
"URUGUAY",
"UZBEKISTAN",
"VANUATU",
"VENEZUELA",
"VIET NAM",
"VIRGIN ISLANDS, BRITISH",
"VIRGIN ISLANDS, U.S.",
"WALLIS AND FUTUNA",
"WESTERN SAHARA",
"YEMEN",
"ZAMBIA",
"ZIMBABWE"
);


var alphabet = Array(
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z"
);



ns4 = (document.layers) ? true:false;
ie4 = (document.all) ? true:false;

// Used to swap the predefined drop menu into the form
function layerWrite(id,nestref,text) {
        if (navigator.appName == "Netscape") 
        {
          if (ns4)
          {
            var lyr = document.layers[id];
            lyr.open();
            lyr.write(text);
            lyr.close();
          }
          if (document.getElementById)
          {
            x = document.getElementById(id);
	    x.innerHTML = '';
	    x.innerHTML = text;
          }
        }
        else if (navigator.appName == "Microsoft Internet Explorer")
        {
          document.all[id].innerHTML = text;
        }
}

	  
// Used to select the text (drop menu option content) that will be swapped into the form.
//passText_dropmenu is used only by drop menus.
//
  function passText_dropmenu(item) 
  {
//    alert("item=" + item);
    if (item == 1) 
    {
      var HTMLtoInsert  = "<blockquote>" +
      "A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"True\" maxlength=\"255\">" +
      "<br>" +
      "B. <input type=\"text\" name=\"choice2\" size=\"60\" value=\"False\" maxlength=\"255\">" +
      "<br>" +
      "C. <input type=\"text\" name=\"choice3\" size=\"60\" maxlength=\"255\">" +
      "<br>" +
      "D. <input type=\"text\" name=\"choice4\" size=\"60\" maxlength=\"255\">" +
      "<br>" +
      "E. <input type=\"text\" name=\"choice5\" size=\"60\" maxlength=\"255\">" +
      "<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
      "To add another choice, check this box then submit the form</font></blockquote>";
    }
    else if (item == 2) 
    {
      var HTMLtoInsert  = "<blockquote>" +
      "A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"Yes\" maxlength=\"255\">" +
      "<br>" +
      "B. <input type=\"text\" name=\"choice2\" size=\"60\" value=\"No\" maxlength=\"255\">" +
      "<br>" +
      "C. <input type=\"text\" name=\"choice3\" size=\"60\" maxlength=\"255\">" +
      "<br>" +
      "D. <input type=\"text\" name=\"choice4\" size=\"60\" maxlength=\"255\">" +
      "<br>" +
      "E. <input type=\"text\" name=\"choice5\" size=\"60\" maxlength=\"255\">" +
      "<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">To add another choice, check this box then submit the form</font>" +
      "</blockquote>";
    }
	else if (item == 3) {
          var HTMLtoInsert  = "	<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"Strongly Agree\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" value = \"Somewhat Agree\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" value = \"No Opinion\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" value = \"Somewhat Disagree\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" value = \"Strongly Disagree\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";

    }
	else if (item == 4) {
          var HTMLtoInsert  = "	<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"Just Right\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" value = \"Too Short\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" value = \"Too Long\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";

    }
	else if (item == 5) {
          var HTMLtoInsert  = "<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"Just Right\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" value = \"Too Slow\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" value = \"Too Fast\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";

    }
	else if (item == 6) {
          var HTMLtoInsert  = "<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"Just Enough\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" value = \"Not Enough\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" value = \"Too Much\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";


    }
	else if (item == 7) {
          var HTMLtoInsert  = "<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"1\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" value = \"2\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" value = \"3\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" value = \"4\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" value = \"5\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";

    }
	else if (item == 8) {
          var HTMLtoInsert  = "<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"5\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" value = \"4\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" value = \"3\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" value = \"2\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" value = \"1\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";

    }
	else if (item == 9) {
          var HTMLtoInsert  = "<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"A\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" value = \"B\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" value = \"C\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" value = \"D\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" value = \"E\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";

    }
	else if (item == 10) {
          var HTMLtoInsert  = "<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" value=\"Excellent\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" value = \"Very Good\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" value = \"Good\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" value = \"Average\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" value = \"Poor\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";

    }
// 50 States Drop list
	else if (item == 11) {
          var HTMLtoInsert= "<blockquote>";
          var choicecount=1;
          var alpha_count=0;
          var j=0;
          for (i=0; i<state_names.length; i++)
          {

            if (alpha_count == 0)
            {
              alpha_label=alphabet[j];
            }
            else
            {
              alpha_label = alphabet[j] + alpha_count;
            }
    
         
            HTMLtoInsert += alpha_label + ". <input type=\"text\" name=\"choice" + choicecount + "\" size=\"60\" value=\"" + state_names[i] + "\" maxlength=\"255\"> <BR>";
            choicecount++;

            //Increment the alphabet index, OR
            //reset the alphabet index to restart at the beginning of the alphabet if we've 
            //reached the end.
            //A-Z,A1-Z1,A2-Z2,...etc
            if (j < alphabet.length-1)
            {
              j++;
            }
            else //reset alphabet index and increment alpha_count (A-Z,A1-Z1...)
            {
              j=0;
              alpha_count++; //Increment alpha_count each time we restart the alphabet.
            }//if (j < alphabet.length-1)

          
          }//for (i=0; i<state_names.length; i++)
          HTMLtoInsert += "<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";
    }
// World Countries Drop list 
	else if (item == 12) {
          var HTMLtoInsert= "<blockquote>";
          var choicecount=1;
          var alpha_count=0;
          var j=0;
          for (i=0; i<country_names.length; i++)
          {

            if (alpha_count == 0)
            {
              alpha_label=alphabet[j];
            }
            else
            {
              alpha_label = alphabet[j] + alpha_count;
            }


            HTMLtoInsert += alpha_label + ". <input type=\"text\" name=\"choice" + choicecount + "\" size=\"60\" value=\"" + country_names[i] +"\" maxlength=\"255\"> <BR>";
            choicecount++;
            //Increment the alphabet index, OR
            //reset the alphabet index to restart at the beginning of the alphabet if we've 
            //reached the end.
            //A-Z,A1-Z1,A2-Z2,...etc
            if (j < alphabet.length-1)
            {
              j++;
            }
            else //reset alphabet index and increment alpha_count (A-Z,A1-Z1...)
            {
              j=0;
              alpha_count++; //Increment alpha_count each time we restart the alphabet.
            }//if (j < alphabet.length-1)


          }//for (i=0; i<country_names.length; i++)
          HTMLtoInsert += "<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font>" +
"</blockquote>";
    }
    else
    {
      var HTMLtoInsert  = "<blockquote>" +
"A. <input type=\"text\" name=\"choice1\" size=\"60\" maxlength=\"255\">" +
"<br>" +
"B. <input type=\"text\" name=\"choice2\" size=\"60\" maxlength=\"255\">" +
"<br>" +
"C. <input type=\"text\" name=\"choice3\" size=\"60\" maxlength=\"255\">" +
"<br>" +
"D. <input type=\"text\" name=\"choice4\" size=\"60\" maxlength=\"255\">" +
"<br>" +
"E. <input type=\"text\" name=\"choice5\" size=\"60\" maxlength=\"255\">" +
"<br>&nbsp;&nbsp;&nbsp;<input type=\"checkbox\" name=\"anotherchoice\" value=\"1\"><font size=\"-1\">" +
"To add another choice, check this box then submit the form</font></blockquote>";
    }

    layerWrite ("formDiv",null,HTMLtoInsert);

  }//function passText_dropmenu(item)

