
function fillstate(){ 
 // this function is used to fill the state list on load
includeOption(document.adpost.state, "1", "ALABAMA", "");
includeOption(document.adpost.state, "2", "ALASKA", "");
includeOption(document.adpost.state, "3", "ARIZONA", "");
includeOption(document.adpost.state, "4", "ARKANSAS", "");
includeOption(document.adpost.state, "5", "CALIFORNIA", "");
includeOption(document.adpost.state, "6", "COLORADO", "");
includeOption(document.adpost.state, "7", "CONNECTICUT", "");
includeOption(document.adpost.state, "8", "DELAWARE", "");
includeOption(document.adpost.state, "9", "DISTRICT OF COLUMBIA", "");
includeOption(document.adpost.state, "10", "FLORIDA", "");
includeOption(document.adpost.state, "11", "GEORGIA", "");
includeOption(document.adpost.state, "12", "HAWAII", "");
includeOption(document.adpost.state, "13", "IDAHO", "");
includeOption(document.adpost.state, "14", "ILLINOIS", "");
includeOption(document.adpost.state, "48", "IOWA", "");
includeOption(document.adpost.state, "15", "KANSAS", "");
includeOption(document.adpost.state, "16", "KENTUCKY", "");
includeOption(document.adpost.state, "17", "LOUISIANA", "");
includeOption(document.adpost.state, "18", "MAINE", "");
includeOption(document.adpost.state, "19", "MARYLAND", "");
includeOption(document.adpost.state, "20", "MASSACHUSETTS", "");
includeOption(document.adpost.state, "21", "MICHIGAN", "");
includeOption(document.adpost.state, "22", "MINNESOTA", "");
includeOption(document.adpost.state, "23", "MISSISSIPPI", "");
includeOption(document.adpost.state, "24", "MISSOURI", "");
includeOption(document.adpost.state, "25", "MONTANA", "");
includeOption(document.adpost.state, "26", "NEBRASKA", "");
includeOption(document.adpost.state, "27", "NEVADA", "");
includeOption(document.adpost.state, "49", "NEW HAMPSHIRE", "");
includeOption(document.adpost.state, "28", "NEW JERSEY", "");
includeOption(document.adpost.state, "29", "NEW MEXICO", "");
includeOption(document.adpost.state, "30", "NEW YORK", "");
includeOption(document.adpost.state, "31", "NORTH CAROLINA", "");
includeOption(document.adpost.state, "32", "NORTH DAKOTA", "");
includeOption(document.adpost.state, "33", "OHIO", "");
includeOption(document.adpost.state, "34", "OKLAHOMA", "");
includeOption(document.adpost.state, "35", "OREGON", "");
includeOption(document.adpost.state, "36", "PENNSYLVANIA", "");
includeOption(document.adpost.state, "37", "RHODE ISLAND", "");
includeOption(document.adpost.state, "38", "SOUTH CAROLINA", "");
includeOption(document.adpost.state, "39", "SOUTH DAKOTA", "");
includeOption(document.adpost.state, "40", "TENNESSEE", "");
includeOption(document.adpost.state, "41", "TEXAS", "");
includeOption(document.adpost.state, "42", "UTAH", "");
includeOption(document.adpost.state, "43", "VERMONT", "");
includeOption(document.adpost.state, "44", "VIRGINIA", "");
includeOption(document.adpost.state, "45", "WASHINGTON", "");
includeOption(document.adpost.state, "50", "WEST VIRGINIA", "");
includeOption(document.adpost.state, "46", "WISCONSIN", "");
includeOption(document.adpost.state, "47", "WYOMING", "");

}

function Selectcity(){
// ON selection of state this function will work

removeOptions(document.adpost.city);
includeOption(document.adpost.city, "", "city", "");

if(document.adpost.state.value == '1'){
includeOption(document.adpost.city,"1", "Anniston Army Depot");
includeOption(document.adpost.city,"2", "Fort Rucker");
includeOption(document.adpost.city,"3", "Maxwell/Gunter AFB");
includeOption(document.adpost.city,"4", "Mobile Coast Guard");
includeOption(document.adpost.city,"5", "Redstone Arsenal");
}
if(document.adpost.state.value == '2'){
includeOption(document.adpost.city,"6", "Eilson AFB");
includeOption(document.adpost.city,"7", "Richardson");
includeOption(document.adpost.city,"8", "Fort Greeley");
includeOption(document.adpost.city,"9", "Fort Wainright");
includeOption(document.adpost.city,"10", "Kodiak Coast Guard");
includeOption(document.adpost.city,"11", "Elmendorf AFB Fort");
}
if(document.adpost.state.value == '3'){
includeOption(document.adpost.city,"12", "Davis-Motham");
includeOption(document.adpost.city,"13", "Fort Huachuka");
includeOption(document.adpost.city,"14", "Luke AFB");
includeOption(document.adpost.city,"15", "Mcas Yuma");
}
if(document.adpost.state.value == '4'){
includeOption(document.adpost.city,"16", "Fort Chaffee");
includeOption(document.adpost.city,"17", "Little Rock AFB");
includeOption(document.adpost.city,"18", "Pine Bluff Arsenal");
}
if(document.adpost.state.value == '5'){
includeOption(document.adpost.city,"19", "Beale AFB");
includeOption(document.adpost.city,"20", "Camp Pendelton");
includeOption(document.adpost.city,"21", "China Lake");
includeOption(document.adpost.city,"22", "Coronado");
includeOption(document.adpost.city,"23", "Edwards AFB");
includeOption(document.adpost.city,"24", "El Centro");
includeOption(document.adpost.city,"25", "Fort Hunter");
includeOption(document.adpost.city,"26", "Fort Irwin");
includeOption(document.adpost.city,"27", "Fort Macarthur");
includeOption(document.adpost.city,"28", "Leemoore Nas");
includeOption(document.adpost.city,"29", "Los Angeles");
includeOption(document.adpost.city,"30", "March");
includeOption(document.adpost.city,"31", "Mc Clellan");
includeOption(document.adpost.city,"32", "Miramar");
includeOption(document.adpost.city,"33", "Moffet Federal Airfield");
includeOption(document.adpost.city,"34", "Nas North Island");
includeOption(document.adpost.city,"35", "NB Point Loma");
includeOption(document.adpost.city,"36", "Oakland Army Base");
includeOption(document.adpost.city,"37", "Point Mugu");
includeOption(document.adpost.city,"38", "Point Hueneme");
includeOption(document.adpost.city,"39", "San Diego Area");
includeOption(document.adpost.city,"40", "Seal Beach");
includeOption(document.adpost.city,"41", "Travis AFB");
includeOption(document.adpost.city,"42", "Twenty Nine Palms");
includeOption(document.adpost.city,"43", "Vandenberg AFB");
}

if(document.adpost.state.value == '6'){
includeOption(document.adpost.city,"44", "Air Force Academy");
includeOption(document.adpost.city,"45", "Buckeley AFB");
includeOption(document.adpost.city,"46", "Fort Carson");
includeOption(document.adpost.city,"47", "Petersen AFB");
includeOption(document.adpost.city,"48", "Schriver AFB");
}
if(document.adpost.state.value == '7'){
includeOption(document.adpost.city,"49", "Camp Hartely");
includeOption(document.adpost.city,"50", "New London");
includeOption(document.adpost.city,"51", "USCG Academy");
}
if(document.adpost.state.value == '8'){
includeOption(document.adpost.city,"52", "Dover AFB");
}

if(document.adpost.state.value == '9'){
includeOption(document.adpost.city,"53", "Bolling AFB");
includeOption(document.adpost.city,"54", "Fort MC Nair");
includeOption(document.adpost.city,"55", "Walter Reed");
}

if(document.adpost.state.value == '10'){
includeOption(document.adpost.city,"56", "Campe Blanding");
includeOption(document.adpost.city,"57", "Clearwater CG");
includeOption(document.adpost.city,"58", "Cory Station");
includeOption(document.adpost.city,"59", "Elgin AFB");
includeOption(document.adpost.city,"60", "Macdill");
includeOption(document.adpost.city,"61", "Miami");
includeOption(document.adpost.city,"62", "Nas Jacksonville");
includeOption(document.adpost.city,"63", "Nas Pensacola");
includeOption(document.adpost.city,"64", "NB Key West");
includeOption(document.adpost.city,"65", "NB Panama City");
includeOption(document.adpost.city,"66", "NS Mayport");
includeOption(document.adpost.city,"67", "Orlando");
includeOption(document.adpost.city,"68", "Patrick AFB");
includeOption(document.adpost.city,"69", "South Com");
includeOption(document.adpost.city,"70", "Tyndal");
includeOption(document.adpost.city,"71", "Whiting Field");
}

if(document.adpost.state.value == '11'){
includeOption(document.adpost.city,"72", "Camp Merrill");
includeOption(document.adpost.city,"73", "Dobbins AFB");
includeOption(document.adpost.city,"74", "Fort Benning");
includeOption(document.adpost.city,"75", "Fort Gordon");
includeOption(document.adpost.city,"76", "Fort MC Pherson");
includeOption(document.adpost.city,"77", "Fort Stewart");
includeOption(document.adpost.city,"78", "Hunter AAF");
includeOption(document.adpost.city,"79", "Moody AFB");
includeOption(document.adpost.city,"80", "Nas Altanta");
includeOption(document.adpost.city,"81", "NSB Kings Bay");
includeOption(document.adpost.city,"82", "Robins AFB");
}

if(document.adpost.state.value == '12'){
includeOption(document.adpost.city,"83", "Camp Smith");
includeOption(document.adpost.city,"84", "Fort Schafter");
includeOption(document.adpost.city,"85", "Hickam AFB");
includeOption(document.adpost.city,"86", "MCBH Kanehoe Bay");
includeOption(document.adpost.city,"87", "NS Barking Sands");
includeOption(document.adpost.city,"88", "Pearl Harbor");
includeOption(document.adpost.city,"89", "Schoefield Barracks");
includeOption(document.adpost.city,"90", "Tripler Med Center");
includeOption(document.adpost.city,"91", "US Coast Guard Base");
includeOption(document.adpost.city,"92", "Base-Honolulu");
includeOption(document.adpost.city,"93", "Wheeler Army Airfiled");
}

if(document.adpost.state.value == '13'){
includeOption(document.adpost.city,"94", "Mountain Home AFB");
}

if(document.adpost.state.value == '14'){
includeOption(document.adpost.city,"95", "NTC Great Lakes");
includeOption(document.adpost.city,"96", "Rock Island Arsenal");
includeOption(document.adpost.city,"97", "Scott AFB");
}
if(document.adpost.state.value == '15'){
includeOption(document.adpost.city,"98", "Fort Levenworth");
includeOption(document.adpost.city,"99", "Fort Riley");
includeOption(document.adpost.city,"100", "MC Connel AFB");
}

if(document.adpost.state.value == '16'){
includeOption(document.adpost.city,"101", "Fort Campbell");
includeOption(document.adpost.city,"102", "Fort Knox");
}

if(document.adpost.state.value == '17'){
includeOption(document.adpost.city,"103", "Barkksdale AFB");
includeOption(document.adpost.city,"104", "Bellechassee AFB");
includeOption(document.adpost.city,"105", "Camp Beauregard");
includeOption(document.adpost.city,"106", "Fort Polk");
}

if(document.adpost.state.value == '18'){
includeOption(document.adpost.city,"107", "Bangor Ang");
includeOption(document.adpost.city,"108", "Camp Keyes");
includeOption(document.adpost.city,"109", "Nas Brunswick");
includeOption(document.adpost.city,"110", "Portsmouth NS");
includeOption(document.adpost.city,"111", "Portsmouth NSY");
includeOption(document.adpost.city,"112", "Rockland CGS");
includeOption(document.adpost.city,"113", "South Portland CGG");
}

if(document.adpost.state.value == '19'){
includeOption(document.adpost.city,"114", "Aberdeen Proving");
includeOption(document.adpost.city,"115", "Andres AFB");
includeOption(document.adpost.city,"116", "Annapolis NS");
includeOption(document.adpost.city,"117", "Bethesda NMC");
includeOption(document.adpost.city,"118", "Curtis Bay");
includeOption(document.adpost.city,"119", "Fort Detrick");
includeOption(document.adpost.city,"120", "Fort Meade");
includeOption(document.adpost.city,"121", "Indian Head NSWC");
includeOption(document.adpost.city,"122", "Nas Patuxent");
includeOption(document.adpost.city,"123", "US Naval Academy");
}
if(document.adpost.state.value == '20'){
includeOption(document.adpost.city,"124", "Boston");
includeOption(document.adpost.city,"125", "Hanscom AFB");
includeOption(document.adpost.city,"126", "Otis/ANG");
includeOption(document.adpost.city,"127", "Westover AFB");
}

if(document.adpost.state.value == '21'){
includeOption(document.adpost.city,"128", "Battle Creek");
includeOption(document.adpost.city,"129", "Camp Grayling");
includeOption(document.adpost.city,"130", "Detroit CG");
includeOption(document.adpost.city,"131", "Group");
includeOption(document.adpost.city,"132", "Selfridge");
}
if(document.adpost.state.value == '22'){
includeOption(document.adpost.city,"133", "Duluth ANG");
}

if(document.adpost.state.value == '23'){
includeOption(document.adpost.city,"134", "Camp Shelby");
includeOption(document.adpost.city,"135", "Columbus");
includeOption(document.adpost.city,"136", "Gulfport Biloxi");
includeOption(document.adpost.city,"137", "Keesler AFB");
includeOption(document.adpost.city,"138", "Nas Meridian");
includeOption(document.adpost.city,"139", "Nas Pascagoula");
}
if(document.adpost.state.value == '24'){
includeOption(document.adpost.city,"140", "Fort Leaonard Wood");
includeOption(document.adpost.city,"141", "Whiteman AFB");
}

if(document.adpost.state.value == '25'){
includeOption(document.adpost.city,"142", "Mainstrom");
}

if(document.adpost.state.value == '26'){
includeOption(document.adpost.city,"143", "Offut AFB");
}

if(document.adpost.state.value == '27'){
includeOption(document.adpost.city,"144", "Fallon NAS");
includeOption(document.adpost.city,"145", "Nellis AFB");
}

if(document.adpost.state.value == '28'){
includeOption(document.adpost.city,"146", "Cape May");
includeOption(document.adpost.city,"147", "Earle NWS");
includeOption(document.adpost.city,"148", "Fort DIX");
includeOption(document.adpost.city,"149", "Fort Monmouth");
includeOption(document.adpost.city,"150", "Lakehurst");
includeOption(document.adpost.city,"151", "Picatinny Arsenal");
}

if(document.adpost.state.value == '29'){
includeOption(document.adpost.city,"152", "Cannon AFB");
includeOption(document.adpost.city,"153", "Holloman AFB");
includeOption(document.adpost.city,"154", "Kirtland AFB");
includeOption(document.adpost.city,"155", "White Sands");
}
if(document.adpost.state.value == '30'){
includeOption(document.adpost.city,"156", "Camp Smith");
includeOption(document.adpost.city,"157", "Fort Drum");
includeOption(document.adpost.city,"158", "Fort Hamilton");
includeOption(document.adpost.city,"159", "Fort Totten");
includeOption(document.adpost.city,"160", "NY Coast Guard");
includeOption(document.adpost.city,"161", "Niagra Falls");
includeOption(document.adpost.city,"162", "Saratoga Milton");
includeOption(document.adpost.city,"163", "Stewart ANGB");
includeOption(document.adpost.city,"164", "West Point");
}
if(document.adpost.state.value == '31'){
includeOption(document.adpost.city,"165", "Camp Lejune");
includeOption(document.adpost.city,"166", "Cherry Point");
includeOption(document.adpost.city,"167", "Elizabeth City");
includeOption(document.adpost.city,"168", "New River");
includeOption(document.adpost.city,"169", "Pope AFB");
includeOption(document.adpost.city,"170", "Seymour Johnson AFB");
}
if(document.adpost.state.value == '32'){
includeOption(document.adpost.city,"171", "Ellesworth AFB");
}

if(document.adpost.state.value == '33'){
includeOption(document.adpost.city,"172", "Wright Patterson AFB");
}

if(document.adpost.state.value == '34'){
includeOption(document.adpost.city,"173", "Altus");
includeOption(document.adpost.city,"174", "Fort Sill");
includeOption(document.adpost.city,"175", "Tinker AFB");
includeOption(document.adpost.city,"176", "Vance AFB");
}

if(document.adpost.state.value == '35'){
includeOption(document.adpost.city,"177", "Astoria CGG");
includeOption(document.adpost.city,"178", "Klamath Falls");
includeOption(document.adpost.city,"179", "Kingsley ANG");
includeOption(document.adpost.city,"180", "North Bend CGG");
}

if(document.adpost.state.value == '36'){
includeOption(document.adpost.city,"181", "Fort Indian Town Gap");
includeOption(document.adpost.city,"182", "Willow Grove");
}

if(document.adpost.state.value == '37'){
includeOption(document.adpost.city,"183", "Newport NS");
}

if(document.adpost.state.value == '38'){
includeOption(document.adpost.city,"184", "Charleston AFB");
includeOption(document.adpost.city,"185", "Fort Jackson");
includeOption(document.adpost.city,"186", "MCAS Beaufort");
includeOption(document.adpost.city,"187", "Parris Island");
includeOption(document.adpost.city,"188", "Shaw AFB");
}

if(document.adpost.state.value == '39'){
includeOption(document.adpost.city,"189", "Elsworth AFB");
}

if(document.adpost.state.value == '40'){
includeOption(document.adpost.city,"190", "Arnold AFB");
includeOption(document.adpost.city,"191", "Fort Campbell");
includeOption(document.adpost.city,"192", "NSA Midsouth");
}

if(document.adpost.state.value == '41'){
includeOption(document.adpost.city,"193", "Brooks");
includeOption(document.adpost.city,"194", "Dyess");
includeOption(document.adpost.city,"195", "Ellington Field");
includeOption(document.adpost.city,"196", "Fort Bliss");
includeOption(document.adpost.city,"197", "Fort Hood");
includeOption(document.adpost.city,"198", "Fort Sam Houston");
includeOption(document.adpost.city,"199", "Fort Worth");
includeOption(document.adpost.city,"200", "Goodfellow AFB");
includeOption(document.adpost.city,"201", "Ingleside");
includeOption(document.adpost.city,"202", "Kingsville");
includeOption(document.adpost.city,"203", "Lackland AFB");
includeOption(document.adpost.city,"204", "Laughland AFB");
includeOption(document.adpost.city,"205", "Nas Corpus Christi");
includeOption(document.adpost.city,"206", "Randolph AFB");
includeOption(document.adpost.city,"207", "San Antonio Bases");
includeOption(document.adpost.city,"208", "Sheppard AFB");
}

if(document.adpost.state.value == '42'){
includeOption(document.adpost.city,"209", "Dugway");
includeOption(document.adpost.city,"210", "Hill AFB");
}

if(document.adpost.state.value == '43'){
includeOption(document.adpost.city,"211", "Camp Johnson");
}
if(document.adpost.state.value == '44'){
includeOption(document.adpost.city,"212", "Dahlgren");
includeOption(document.adpost.city,"213", "Fort A.P. Hill");
includeOption(document.adpost.city,"214", "Fort Belvoir");
includeOption(document.adpost.city,"215", "Fort Eustis");
includeOption(document.adpost.city,"216", "Fort Lee");
includeOption(document.adpost.city,"217", "Fort Pickett");
includeOption(document.adpost.city,"218", "Fort Storey");
includeOption(document.adpost.city,"219", "Langeley AFB");
includeOption(document.adpost.city,"220", "Nat.recon Office");
includeOption(document.adpost.city,"221", "Norfolk");
includeOption(document.adpost.city,"222", "Oceana Nas");
includeOption(document.adpost.city,"223", "Pentagon");
includeOption(document.adpost.city,"224", "Portsmouth");
includeOption(document.adpost.city,"225", "Quantico");
includeOption(document.adpost.city,"226", "Yorktown Area");
}

if(document.adpost.state.value == '45'){
includeOption(document.adpost.city,"227", "Bremerton");
includeOption(document.adpost.city,"228", "CG Headquarters");
includeOption(document.adpost.city,"229", "Everitt");
includeOption(document.adpost.city,"230", "Fairchild");
includeOption(document.adpost.city,"231", "MC Cord");
includeOption(document.adpost.city,"232", "Washington NS");
includeOption(document.adpost.city,"233", "Whidbey Island NAS");
}

if(document.adpost.state.value == '46'){
includeOption(document.adpost.city,"234", "Fort MC Coy");
includeOption(document.adpost.city,"235", "Volk Field");
}

if(document.adpost.state.value == '47'){
includeOption(document.adpost.city,"236", "F.E. Warren");
}
if(document.adpost.state.value == '48'){
includeOption(document.adpost.city,"0", "No Listing");
}
if(document.adpost.state.value == '49'){
includeOption(document.adpost.city,"0", "No Listing");
}
if(document.adpost.state.value == '50'){
includeOption(document.adpost.city,"0", "No Listing");
}
}
////////////////// 

function removeOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function includeOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}
