var NS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5);

var listBackup = new Array();

var county_quad = new Array(
        [51,"Addison",201],
        [83,"Adolph",202],
        [97,"Adolph",202],
        [41,"Adrian",203],
        [97,"Adrian",203],
        [25,"Alderson",204],
        [63,"Alderson",204],
        [89,"Alderson",204],
        [63,"Alleghany",205],
        [97,"Alton",206],
        [39,"Alum Creek",207],
        [43,"Alum Creek",207],
        [25,"Alvon",208],
        [5,"Amherstdale",209],
        [45,"Amherstdale",209],
        [109,"Amherstdale",209],
        [53,"Amonate",210],
        [53,"Anawalt",211],
        [13,"Annamoriah",212],
        [87,"Annamoriah",212],
        [105,"Annamoriah",212],
        [19,"Ansted",213],
        [67,"Ansted",213],
        [25,"Anthony",214],
        [23,"Antioch",215],
        [57,"Antioch",215],
        [51,"Apple Grove",216],
        [51,"Arlee",217],
        [79,"Arlee",217],
        [81,"Arnett",218],
        [109,"Arnett",218],
        [13,"Arnoldsburg",219],
        [87,"Arnoldsburg",219],
        [65,"Artemas",220],
        [25,"Asbury",221],
        [11,"Athalia",222],
        [55,"Athens",223],
        [17,"Auburn",224],
        [21,"Auburn",224],
        [85,"Auburn",224],
        [1,"Audra",225],
        [97,"Audra",225],
        [27,"Augusta",226],
        [77,"Aurora",227],
        [93,"Aurora",227],
        [53,"Baileysville",228],
        [109,"Baileysville",228],
        [27,"Baker",229],
        [31,"Baker",229],
        [39,"Bancroft",230],
        [79,"Bancroft",230],
        [11,"Barboursville",231],
        [45,"Barnabus",232],
        [59,"Barnabus",232],
        [55,"Bastian",233],
        [81,"Beckley",234],
        [19,"Beckwith",235],
        [51,"Beech Hill",236],
        [1,"Belington",237],
        [83,"Belington",237],
        [5,"Belle",238],
        [39,"Belle",238],
        [65,"Bellegrove",239],
        [73,"Belmont",240],
        [73,"Bens Run",241],
        [95,"Bens Run",241],
        [15,"Bentree",242],
        [19,"Bentree",242],
        [39,"Bentree",242],
        [67,"Bentree",242],
        [75,"Bergoo",243],
        [101,"Bergoo",243],
        [31,"Bergton",244],
        [33,"Berlin",245],
        [41,"Berlin",245],
        [97,"Berlin",245],
        [37,"Berryville",246],
        [9,"Bethany",247],
        [69,"Bethany",247],
        [83,"Beverly East",248],
        [83,"Beverly West",249],
        [39,"Big Chimney",250],
        [43,"Big Creek",251],
        [45,"Big Creek",251],
        [17,"Big Isaac",252],
        [33,"Big Isaac",252],
        [41,"Big Isaac",252],
        [3,"Big Pool",253],
        [65,"Big Pool",253],
        [103,"Big Run",254],
        [23,"Blackbird Knob",255],
        [93,"Blackbird Knob",255],
        [61,"Blacksville",256],
        [93,"Blackwater Falls",257],
        [39,"Blue Creek",258],
        [55,"Bluefield",259],
        [83,"Bowden",260],
        [53,"Bradshaw",261],
        [53,"Bramwell",262],
        [55,"Bramwell",262],
        [11,"Branchland",263],
        [43,"Branchland",263],
        [77,"Brandonville",264],
        [71,"Brandywine",265],
        [1,"Brownton",266],
        [33,"Brownton",266],
        [91,"Brownton",266],
        [77,"Bruceton Mills",267],
        [97,"Buckhannon",268],
        [27,"Burlington",269],
        [57,"Burlington",269],
        [99,"Burnaugh",270],
        [13,"Burning Springs",271],
        [87,"Burning Springs",271],
        [105,"Burning Springs",271],
        [7,"Burnsville",272],
        [21,"Burnsville",272],
        [21,"Burnt House",273],
        [85,"Burnt House",273],
        [49,"Businessburg",274],
        [85,"Cairo",275],
        [41,"Camden",276],
        [67,"Camden on Gauley",277],
        [101,"Camden on Gauley",277],
        [49,"Cameron",278],
        [27,"Capon Bridge",279],
        [27,"Capon Springs",280],
        [75,"Cass",281],
        [83,"Cass",281],
        [83,"Cassity",282],
        [97,"Cassity",282],
        [11,"Catlettsburg",283],
        [99,"Catlettsburg",283],
        [39,"Cedar Grove",284],
        [7,"Cedarville",285],
        [21,"Cedarville",285],
        [17,"Center Point",286],
        [95,"Center Point",286],
        [103,"Center Point",286],
        [1,"Century",287],
        [33,"Century",287],
        [97,"Century",287],
        [43,"Chapmanville",288],
        [45,"Chapmanville",288],
        [59,"Chapmanville",288],
        [37,"Charles Town",291],
        [39,"Charleston East",289],
        [39,"Charleston West",290],
        [65,"Cherry Run",292],
        [51,"Cheshire",293],
        [51,"Chester",294],
        [7,"Chloe",295],
        [13,"Chloe",295],
        [15,"Chloe",295],
        [21,"Chloe",295],
        [87,"Chloe",295],
        [71,"Circleville",296],
        [33,"Clarksburg",297],
        [15,"Clay",298],
        [15,"Clendenin",299],
        [39,"Clendenin",299],
        [39,"Clio",300],
        [87,"Clio",300],
        [5,"Clothier",301],
        [45,"Clothier",301],
        [75,"Clover Lick",302],
        [1,"Colebank",303],
        [77,"Colebank",303],
        [93,"Colebank",303],
        [107,"Coolville",304],
        [19,"Corliss",305],
        [25,"Corliss",305],
        [67,"Corliss",305],
        [25,"Cornstalk",306],
        [35,"Cottageville",307],
        [51,"Cottageville",307],
        [71,"Cow Knob",309],
        [101,"Cowen",308],
        [81,"Crab Orchard",310],
        [63,"Craig Springs",311],
        [67,"Craigsville",312],
        [101,"Craigsville",312],
        [57,"Cresaptown",313],
        [53,"Crumpler",314],
        [55,"Crumpler",314],
        [109,"Crumpler",314],
        [57,"Cumberland",315],
        [77,"Cuzzart",316],
        [19,"Danese",317],
        [23,"Davis",318],
        [77,"Davis",318],
        [93,"Davis",318],
        [53,"Davy",319],
        [109,"Davy",319],
        [19,"Dawson",320],
        [25,"Dawson",320],
        [89,"Dawson",320],
        [59,"Delbarton",321],
        [25,"Denmar",322],
        [75,"Denmar",322],
        [101,"Diana",323],
        [71,"Doe Hill",324],
        [5,"Dorothy",325],
        [19,"Dorothy",325],
        [39,"Dorothy",325],
        [81,"Dorothy",325],
        [25,"Droop",326],
        [75,"Droop",326],
        [25,"Duo",327],
        [75,"Durbin",328],
        [83,"Durbin",328],
        [29,"East Liverpool North",329],
        [29,"East Liverpool South",330],
        [81,"Eccles",331],
        [75,"Edray",332],
        [105,"Elizabeth",333],
        [107,"Elizabeth",333],
        [15,"Elkhurst",334],
        [39,"Elkhurst",334],
        [83,"Elkins",335],
        [1,"Ellamore",336],
        [83,"Ellamore",336],
        [97,"Ellamore",336],
        [73,"Ellenboro",337],
        [85,"Ellenboro",337],
        [95,"Ellenboro",337],
        [35,"Elmwood",338],
        [51,"Elmwood",338],
        [79,"Elmwood",338],
        [7,"Erbacon",339],
        [101,"Erbacon",339],
        [5,"Eskdale",340],
        [39,"Eskdale",340],
        [57,"Evitts Creek",341],
        [47,"Fairmont East",342],
        [61,"Fairmont East",342],
        [91,"Fairmont East",342],
        [33,"Fairmont West",343],
        [47,"Fairmont West",343],
        [91,"Fairmont West",343],
        [25,"Falling Spring",344],
        [99,"Fallsburg",345],
        [19,"Fayetteville",346],
        [1,"Fellowsville",347],
        [77,"Fellowsville",347],
        [93,"Fellowsville",347],
        [55,"Flat Top",348],
        [81,"Flat Top",348],
        [89,"Flat Top",348],
        [17,"Folsom",349],
        [33,"Folsom",349],
        [95,"Folsom",349],
        [103,"Folsom",349],
        [63,"Forest Hill",350],
        [89,"Forest Hill",350],
        [25,"Fork Mountain",351],
        [67,"Fork Mountain",351],
        [101,"Fork Mountain",351],
        [71,"Fort Seybert",352],
        [25,"Fort Spring",353],
        [63,"Fort Spring",353],
        [71,"Franklin",354],
        [77,"Friendsville",355],
        [51,"Gallipolis",356],
        [63,"Gap Mills",357],
        [39,"Garretts Bend",358],
        [43,"Garretts Bend",358],
        [79,"Garretts Bend",358],
        [53,"Gary",359],
        [7,"Gassaway",360],
        [19,"Gauley Bridge",361],
        [39,"Gauley Bridge",361],
        [67,"Gauley Bridge",361],
        [35,"Gay",362],
        [87,"Gay",362],
        [53,"Gilbert",363],
        [59,"Gilbert",363],
        [109,"Gilbert",363],
        [15,"Gilboa",364],
        [67,"Gilboa",364],
        [7,"Gilmer",365],
        [21,"Gilmer",365],
        [41,"Gilmer",365],
        [85,"Girta",366],
        [105,"Girta",366],
        [25,"Glace",367],
        [63,"Glace",367],
        [47,"Gladesville",368],
        [61,"Gladesville",368],
        [77,"Gladesville",368],
        [91,"Gladesville",368],
        [83,"Glady",369],
        [49,"Glen Easton",370],
        [3,"Glengary",371],
        [65,"Glengary",371],
        [21,"Glenville",372],
        [11,"Glenwood",373],
        [51,"Glenwood",373],
        [47,"Glover Gap",374],
        [103,"Glover Gap",374],
        [27,"Gore",375],
        [23,"Gorman",376],
        [57,"Gorman",376],
        [83,"Goshen",377],
        [97,"Goshen",377],
        [101,"Goshen",377],
        [1,"Grafton",378],
        [91,"Grafton",378],
        [47,"Grant Town",380],
        [61,"Grant Town",380],
        [13,"Grantsville",379],
        [21,"Grantsville",379],
        [65,"Great Cacapon",381],
        [75,"Green Bank",382],
        [23,"Greenland Gap",383],
        [63,"Greenville",384],
        [89,"Greenville",384],
        [5,"Griffithsville",385],
        [43,"Griffithsville",385],
        [7,"Hacker Valley",386],
        [41,"Hacker Valley",386],
        [97,"Hacker Valley",386],
        [101,"Hacker Valley",386],
        [43,"Hager",387],
        [11,"Hamlin",388],
        [43,"Hamlin",388],
        [79,"Hamlin",388],
        [65,"Hancock",389],
        [27,"Hanging Rock",390],
        [71,"Harman",391],
        [83,"Harman",391],
        [93,"Harman",391],
        [37,"Harpers Ferry",392],
        [85,"Harrisville",393],
        [27,"Headsville",394],
        [57,"Headsville",394],
        [3,"Hedgesville",395],
        [5,"Henlawson",396],
        [45,"Henlawson",396],
        [7,"Herold",397],
        [15,"Herold",397],
        [67,"Herold",397],
        [75,"Hightown",398],
        [75,"Hillsboro",399],
        [81,"Hinton",400],
        [89,"Hinton",400],
        [45,"Holden",401],
        [59,"Holden",401],
        [23,"Hopeville",402],
        [71,"Hopeville",402],
        [83,"Hopeville",402],
        [93,"Hopeville",402],
        [47,"Hundred",403],
        [61,"Hundred",403],
        [103,"Hundred",403],
        [11,"Huntington",404],
        [99,"Huntington",404],
        [11,"Hurricane",405],
        [43,"Hurricane",405],
        [51,"Hurricane",405],
        [79,"Hurricane",405],
        [53,"Iaeger",406],
        [63,"Interior",407],
        [3,"Inwood",408],
        [37,"Inwood",408],
        [13,"Ivydale",409],
        [15,"Ivydale",409],
        [87,"Ivydale",409],
        [25,"Jerrys Run",410],
        [5,"Julian",411],
        [39,"Julian",411],
        [43,"Julian",411],
        [1,"Junior",412],
        [83,"Junior",412],
        [105,"Kanawha",413],
        [107,"Kanawha",413],
        [37,"Keedysville",414],
        [35,"Kenna",415],
        [39,"Kenna",415],
        [79,"Kenna",415],
        [35,"Kentuck",416],
        [87,"Kentuck",416],
        [59,"Kermit",417],
        [99,"Kermit",417],
        [39,"Kettle",418],
        [87,"Kettle",418],
        [57,"Keyser",419],
        [53,"Keystone",420],
        [109,"Keystone",420],
        [43,"Kiahsville",421],
        [99,"Kiahsville",421],
        [77,"Kingwood",422],
        [57,"Kitzmiller",423],
        [9,"Knoxville",424],
        [29,"Knoxville",424],
        [61,"Lake Lynn",425],
        [77,"Lake Lynn",425],
        [25,"Lake Sherwood",426],
        [75,"Lake Sherwood",426],
        [71,"Laneville",427],
        [83,"Laneville",427],
        [93,"Laneville",427],
        [27,"Largent",428],
        [65,"Largent",428],
        [11,"Lavalette",429],
        [99,"Lavalette",429],
        [77,"Lead Mine",430],
        [93,"Lead Mine",430],
        [55,"Lerona",431],
        [89,"Lerona",431],
        [81,"Lester",432],
        [109,"Lester",432],
        [27,"Levels",433],
        [25,"Lewisburg",434],
        [63,"Lindside",435],
        [7,"Little Birch",436],
        [67,"Little Birch",436],
        [101,"Little Birch",436],
        [107,"Little Hocking",437],
        [49,"Littleton",438],
        [103,"Littleton",438],
        [35,"Liverpool",439],
        [87,"Liverpool",439],
        [105,"Liverpool",439],
        [25,"Lobelia",440],
        [75,"Lobelia",440],
        [101,"Lobelia",440],
        [15,"Lockwood",441],
        [67,"Lockwood",441],
        [45,"Logan",442],
        [57,"Lonaconing",443],
        [87,"Looneyville",444],
        [5,"Lorado",445],
        [45,"Lorado",445],
        [109,"Lorado",445],
        [31,"Lost City",446],
        [31,"Lost River State Park",447],
        [99,"Louisa",448],
        [107,"Lubeck",449],
        [13,"MacFarlan",450],
        [85,"MacFarlan",450],
        [105,"MacFarlan",450],
        [5,"Madison",451],
        [59,"Majestic",452],
        [49,"Majorsville",453],
        [45,"Mallory",454],
        [59,"Mallory",454],
        [109,"Mallory",454],
        [15,"Mammoth",455],
        [39,"Mammoth",455],
        [45,"Man",456],
        [59,"Man",456],
        [47,"Mannington",457],
        [61,"Mannington",457],
        [107,"Marietta",458],
        [75,"Marlinton",459],
        [3,"Martinsburg",460],
        [37,"Martinsburg",460],
        [61,"Masontown",461],
        [77,"Masontown",461],
        [59,"Matewan",462],
        [109,"Matheny",463],
        [55,"Matoaka",464],
        [23,"Maysville",465],
        [81,"McGraws",466],
        [109,"McGraws",466],
        [19,"Meadow Bridge",467],
        [25,"Meadow Bridge",467],
        [89,"Meadow Bridge",467],
        [19,"Meadow Creek",468],
        [81,"Meadow Creek",468],
        [89,"Meadow Creek",468],
        [23,"Medley",469],
        [31,"Medley",469],
        [57,"Medley",469],
        [85,"Middlebourne",470],
        [95,"Middlebourne",470],
        [3,"Middleway",471],
        [37,"Middleway",471],
        [23,"Milam",472],
        [31,"Milam",472],
        [71,"Milam",472],
        [83,"Mill Creek",473],
        [13,"Millstone",474],
        [21,"Millstone",474],
        [99,"Milo",475],
        [11,"Milton",476],
        [75,"Mingo",477],
        [83,"Mingo",477],
        [75,"Minnehaha Springs",478],
        [71,"Moatstown",479],
        [71,"Monterey",480],
        [19,"Montgomery",481],
        [39,"Montgomery",481],
        [1,"Montrose",482],
        [83,"Montrose",482],
        [93,"Montrose",482],
        [31,"Moorefield",483],
        [61,"Morgantown North",484],
        [61,"Morgantown South",485],
        [77,"Morgantown South",485],
        [49,"Moundsville",486],
        [35,"Mount Alto",487],
        [51,"Mount Alto",487],
        [33,"Mount Clare",488],
        [67,"Mount Nebo",489],
        [11,"Mount Olive",490],
        [51,"Mount Olive",490],
        [79,"Mount Olive",490],
        [23,"Mount Storm",491],
        [57,"Mount Storm",491],
        [23,"Mount Storm Lake",492],
        [93,"Mount Storm Lake",492],
        [27,"Mountain Falls",493],
        [25,"Mountain Grove",494],
        [75,"Mountain Grove",494],
        [83,"Mozark Mountain",495],
        [93,"Mozark Mountain",495],
        [23,"Mozer",496],
        [31,"Mozer",496],
        [71,"Mozer",496],
        [5,"Mud",497],
        [43,"Mud",497],
        [45,"Mud",497],
        [109,"Mullens",498],
        [75,"Mustoe",499],
        [45,"Myrtle",500],
        [59,"Myrtle",500],
        [55,"Narrows",501],
        [63,"Narrows",501],
        [59,"Naugatuck",502],
        [31,"Needmore",503],
        [11,"Nestlow",504],
        [43,"Nestlow",504],
        [99,"Nestlow",504],
        [1,"Nestorville",505],
        [25,"Nettie",506],
        [67,"Nettie",506],
        [35,"New Haven",508],
        [51,"New Haven",508],
        [49,"New Martinsville",509],
        [103,"New Martinsville",509],
        [95,"New Matamoras",510],
        [17,"New Milton",511],
        [41,"New Milton",511],
        [77,"Newburg",507],
        [15,"Newton",512],
        [39,"Newton",512],
        [87,"Newton",512],
        [7,"Newville",513],
        [101,"Newville",513],
        [7,"Normantown",514],
        [13,"Normantown",514],
        [21,"Normantown",514],
        [19,"Oak Hill",515],
        [81,"Oak Hill",515],
        [77,"Oakland",516],
        [55,"Oakvale",517],
        [45,"Oceana",518],
        [109,"Oceana",518],
        [55,"Odd",519],
        [81,"Odd",519],
        [109,"Odd",519],
        [23,"Old Fields",520],
        [27,"Old Fields",520],
        [31,"Old Fields",520],
        [57,"Old Fields",520],
        [27,"Oldtown",521],
        [71,"Onego",522],
        [31,"Orkney Springs",523],
        [7,"Orlando",524],
        [41,"Orlando",524],
        [61,"Osage",525],
        [17,"Oxford",526],
        [85,"Oxford",526],
        [75,"Paddy Knob",527],
        [95,"Paden City",528],
        [103,"Paden City",528],
        [63,"Paint Bank",529],
        [71,"Palo Alto",530],
        [53,"Panther",531],
        [107,"Parkersburg",532],
        [83,"Parsons",533],
        [93,"Parsons",533],
        [53,"Patterson",534],
        [27,"Patterson Creek",535],
        [57,"Patterson Creek",535],
        [27,"Paw Paw",536],
        [65,"Paw Paw",536],
        [19,"Pax",537],
        [39,"Pax",537],
        [81,"Pax",537],
        [87,"Peniel",538],
        [17,"Pennsboro",539],
        [85,"Pennsboro",539],
        [95,"Pennsboro",539],
        [23,"Petersburg East",540],
        [31,"Petersburg East",540],
        [23,"Petersburg West",541],
        [71,"Petersburg West",541],
        [7,"Peterson",542],
        [21,"Peterson",542],
        [41,"Peterson",542],
        [55,"Peterstown",543],
        [63,"Peterstown",543],
        [89,"Peterstown",543],
        [85,"Petroleum",544],
        [105,"Petroleum",544],
        [107,"Petroleum",544],
        [1,"Philippi",545],
        [91,"Philippi",545],
        [83,"Pickens",546],
        [97,"Pickens",546],
        [101,"Pickens",546],
        [5,"Pilot Knob",547],
        [45,"Pilot Knob",547],
        [81,"Pilot Knob",547],
        [109,"Pilot Knob",547],
        [95,"Pine Grove",548],
        [103,"Pine Grove",548],
        [53,"Pineville",549],
        [109,"Pineville",549],
        [55,"Pipestem",550],
        [89,"Pipestem",550],
        [39,"Pocatalico",551],
        [79,"Pocatalico",551],
        [51,"Pomeroy",552],
        [35,"Pond Creek",553],
        [107,"Pond Creek",553],
        [95,"Porters Falls",554],
        [103,"Porters Falls",554],
        [35,"Portland",555],
        [63,"Potts Creek",556],
        [19,"Powellton",557],
        [39,"Powellton",557],
        [49,"Powhatan Point",558],
        [99,"Prichard",559],
        [19,"Prince",560],
        [81,"Prince",560],
        [55,"Princeton",561],
        [17,"Pullman",562],
        [85,"Pullman",562],
        [39,"Quick",563],
        [25,"Quinwood",564],
        [67,"Quinwood",564],
        [5,"Racine",565],
        [39,"Racine",565],
        [99,"Radnor",566],
        [19,"Rainelle",567],
        [25,"Rainelle",567],
        [43,"Ranger",568],
        [99,"Ranger",568],
        [73,"Raven Rock",569],
        [35,"Ravenswood",570],
        [71,"Reddish Knob",571],
        [87,"Reedy",572],
        [105,"Reedy",572],
        [55,"Rhodell",573],
        [81,"Rhodell",573],
        [109,"Rhodell",573],
        [25,"Richwood",574],
        [67,"Richwood",574],
        [27,"Ridge",575],
        [65,"Ridge",575],
        [23,"Rig",576],
        [31,"Rig",576],
        [27,"Rio",577],
        [31,"Rio",577],
        [35,"Ripley",578],
        [47,"Rivesville",579],
        [61,"Rivesville",579],
        [41,"Roanoke",580],
        [97,"Roanoke",580],
        [51,"Robertsburg",581],
        [79,"Robertsburg",581],
        [97,"Rock Cave",582],
        [35,"Rockport",583],
        [105,"Rockport",583],
        [107,"Rockport",583],
        [35,"Romance",584],
        [39,"Romance",584],
        [87,"Romance",584],
        [27,"Romney",585],
        [57,"Romney",585],
        [25,"Ronceverte",586],
        [63,"Ronceverte",586],
        [7,"Rosedale",587],
        [13,"Rosedale",587],
        [15,"Rosedale",587],
        [21,"Rosedale",587],
        [33,"Rosemont",588],
        [91,"Rosemont",588],
        [103,"Round Bottom",589],
        [37,"Round Hill",590],
        [77,"Rowlesburg",591],
        [93,"Rowlesburg",591],
        [25,"Rucker Gap",592],
        [25,"Rupert",593],
        [39,"Saint Albans",594],
        [79,"Saint Albans",594],
        [93,"Saint George",595],
        [17,"Salem",596],
        [33,"Salem",596],
        [83,"Samp",597],
        [101,"Samp",597],
        [35,"Sandyville",598],
        [77,"Sang Run",599],
        [73,"Schultz",600],
        [85,"Schultz",600],
        [107,"Schultz",600],
        [39,"Scott Depot",601],
        [79,"Scott Depot",601],
        [27,"Sector",602],
        [31,"Sector",602],
        [81,"Shady Spring",603],
        [89,"Shady Spring",603],
        [75,"Sharp Knob",604],
        [83,"Sharp Knob",604],
        [101,"Sharp Knob",604],
        [3,"Shepherdstown",605],
        [37,"Shepherdstown",605],
        [33,"Shinnston",606],
        [47,"Shinnston",606],
        [17,"Shirley",607],
        [95,"Shirley",607],
        [71,"Sinks of Gandy",608],
        [75,"Sinks of Gandy",608],
        [83,"Sinks of Gandy",608],
        [35,"Sissonville",609],
        [39,"Sissonville",609],
        [79,"Sissonville",609],
        [101,"Skelt",610],
        [17,"Smithburg",611],
        [13,"Smithville",612],
        [21,"Smithville",612],
        [85,"Smithville",612],
        [71,"Snowy Mountain",613],
        [75,"Snowy Mountain",613],
        [75,"Snyder Knob",614],
        [83,"Snyder Knob",614],
        [107,"South Parkersburg",615],
        [87,"Spencer",616],
        [27,"Springfield",617],
        [57,"Springfield",617],
        [71,"Spruce Knob",618],
        [75,"Spruce Knob",618],
        [83,"Spruce Knob",618],
        [37,"Stephenson",619],
        [9,"Steubenville East",620],
        [9,"Steubenville West",621],
        [3,"Stotlers Crossroads",622],
        [65,"Stotlers Crossroads",622],
        [7,"Strange Creek",623],
        [15,"Strange Creek",623],
        [67,"Strange Creek",623],
        [71,"Sugar Grove",624],
        [67,"Summersville",625],
        [19,"Summersville Dam",626],
        [67,"Summersville Dam",626],
        [75,"Sunrise",627],
        [7,"Sutton",628],
        [15,"Swandale",629],
        [67,"Swandale",629],
        [5,"Sylvester",630],
        [39,"Sylvester",630],
        [23,"Table Rock",631],
        [77,"Table Rock",631],
        [3,"Tablers Station",632],
        [89,"Talcott",633],
        [21,"Tanner",634],
        [13,"Tariff",635],
        [87,"Tariff",635],
        [53,"Tazewell North",636],
        [77,"Terra Alta",637],
        [1,"Thornton",638],
        [77,"Thornton",638],
        [91,"Thornton",638],
        [71,"Thornwood",639],
        [75,"Thornwood",639],
        [19,"Thurmond",640],
        [81,"Thurmond",640],
        [9,"Tiltonsville",641],
        [69,"Tiltonsville",641],
        [67,"Tioga",642],
        [101,"Tioga",642],
        [43,"Trace",643],
        [45,"Trace",643],
        [59,"Trace",643],
        [99,"Trace",643],
        [25,"Trout",644],
        [63,"Union",645],
        [71,"Upper Tract",646],
        [17,"Vadis",647],
        [21,"Vadis",647],
        [41,"Vadis",647],
        [49,"Valley Grove",648],
        [69,"Valley Grove",648],
        [83,"Valley Head",649],
        [107,"Valley Mills",650],
        [77,"Valley Point",651],
        [47,"Wadestown",652],
        [61,"Wadestown",652],
        [63,"Waiteville",653],
        [7,"Walkersville",654],
        [41,"Walkersville",654],
        [97,"Walkersville",654],
        [33,"Wallace",655],
        [47,"Wallace",655],
        [103,"Wallace",655],
        [87,"Walton",656],
        [53,"War",657],
        [27,"Wardensville",658],
        [31,"Wardensville",658],
        [99,"Wayne",659],
        [59,"Webb",660],
        [99,"Webb",660],
        [101,"Webster Springs",661],
        [75,"Webster Springs SE",662],
        [101,"Webster Springs SE",662],
        [25,"Webster Springs SW",663],
        [67,"Webster Springs SW",663],
        [101,"Webster Springs SW",663],
        [9,"Weirton",664],
        [29,"Weirton",664],
        [53,"Welch",665],
        [109,"Welch",665],
        [29,"Wellsville",666],
        [11,"West Hamlin",668],
        [43,"West Hamlin",668],
        [33,"West Milford",669],
        [41,"West Milford",669],
        [17,"West Union",671],
        [95,"West Union",671],
        [57,"Westernport",667],
        [33,"Weston",670],
        [41,"Weston",670],
        [53,"Wharncliffe",672],
        [59,"Wharncliffe",672],
        [5,"Wharton",673],
        [49,"Wheeling",674],
        [69,"Wheeling",674],
        [3,"White Hall",675],
        [25,"White Sulphur Springs",676],
        [5,"Whitesville",677],
        [81,"Whitesville",677],
        [71,"Whitmer",678],
        [83,"Whitmer",678],
        [15,"Widen",679],
        [67,"Widen",679],
        [75,"Wildell",680],
        [83,"Wildell",680],
        [49,"Wileyville",681],
        [103,"Wileyville",681],
        [5,"Williams Mountain",683],
        [25,"Williamsburg",682],
        [59,"Williamson",684],
        [3,"Williamsport",685],
        [73,"Willow Island",686],
        [85,"Willow Island",686],
        [107,"Willow Island",686],
        [43,"Wilsondale",687],
        [59,"Wilsondale",687],
        [99,"Wilsondale",687],
        [79,"Winfield",688],
        [19,"Winona",689],
        [25,"Winona",689],
        [67,"Winona",689],
        [11,"Winslow",690],
        [43,"Winslow",690],
        [99,"Winslow",690],
        [31,"Wolf Gap",691],
        [33,"Wolf Summit",692],
        [75,"Woodrow",693],
        [31,"Woodstock",694],
        [27,"Yellow Spring",695],
        [31,"Yellow Spring",695]);

function hasOptions(obj) {
	if (obj!=null && obj.options!=null) { return true; }
	return false;
	}

function selectAllOptions(obj) {
	if (!hasOptions(obj)) { return; }
	for (var i=0; i<obj.options.length; i++) {
		obj.options[i].selected = true;
		}
	}

function removeMatching(objA, objB)
{
    if (!hasOptions(obj)) { return; }
    for(var i=0; i<objA.options.length; i++)
    {
        for(var j=0; j<objB.options.length; j++)
        {
            if(objA.options[i].value == objB.options[j].value)
            {
                deleteOption(objB, j);
            }
        }
    }
}

function sortSelect(obj)
{
	var o = new Array();
	for (var i=0; i<obj.length; i++) {
		o[o.length] = new Option(obj.options[i].text, obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;
		}
	if (o.length==0) { return; }
	o = o.sort(
		  function(a,b) {
			if ((a.text+"") < (b.text+"")) { return -1; }
			if ((a.text+"") > (b.text+"")) { return 1; }
			return 0;
          }
		);

	for (var i=0; i<o.length; i++) {
		obj.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
		listBackup[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
		}
}

function addOption(theSel, theText, theValue)
{
  var newOpt = new Option(theText, theValue);
  var selLength = theSel.length;
  theSel.options[selLength] = newOpt;
}

function deleteOption(theSel, theIndex)
{
  var selLength = theSel.length;
  if(selLength>0)
  {
    theSel.options[theIndex] = null;
  }
}

function moveOptions(theSelFrom, theSelTo)
{

  var selLength = theSelFrom.length;
  var selectedText = new Array();
  var selectedValues = new Array();
  var selectedCount = 0;

  var i;

  // Find the selected Options in reverse order
  // and delete them from the 'from' Select.
  for(i=selLength-1; i>=0; i--)
  {
    if(theSelFrom.options[i].selected)
    {
      selectedText[selectedCount] = theSelFrom.options[i].text;
      selectedValues[selectedCount] = theSelFrom.options[i].value;
      deleteOption(theSelFrom, i);
      selectedCount++;
    }
  }

  // Add the selected text/values in reverse order.
  // This will add the Options to the 'to' Select
  // in the same order as they were in the 'from' Select.
  for(i=selectedCount-1; i>=0; i--)
  {
    addOption(theSelTo, selectedText[i], selectedValues[i]);
  }

  if(NS4) history.go(0);
}

function inSelect(theSel, theLabel, theValue)
{
    if(theSel.length > 0)
    {
        for(theIndex=0; theIndex<theSel.length; ++theIndex)
        {
            if(theSel.options[theIndex].text == theLabel)
            {
                return true;
            }
        }
    }
    else {return false;}
}

function addQuads(quadSel, ctySel)
{
    var selLen = quadSel.length;
    for (i=selLen; i>=0; --i) {
        quadSel.options[i] = null;
    }
    if(ctySel.options[ctySel.selectedIndex].value > 0) {
      //addOption(quadSel, "Any", 0);
      //quadSel.options[0].selected = true;
      for (i=0; i<ctySel.length; ++i) {
        if(ctySel.options[i].selected) {
          for (j=0; j<county_quad.length; ++j) {
            if((county_quad[j][0] == ctySel.options[i].value) && (!inSelect(quadSel,county_quad[j][1],county_quad[j][2]))) {
              addOption(quadSel, county_quad[j][1], county_quad[j][2]);
	        }
          }
        }
      }
	}
	else {
      for(i=0; i<quad.length; ++i) {
        addOption(quadSel, quad[i][1], quad[i][0]);
      }
    }
	
}


function addQuads2(quadSel, quadSelList, ctySel)
{
    var selLen = quadSel.length;
    for (i=selLen; i>=0; --i) {
        quadSel.options[i] = null;
    }
    if(ctySel.options[ctySel.selectedIndex].value > 0) {
      //addOption(quadSel, "Any", 0);
      //quadSel.options[0].selected = true;
      for (i=0; i<ctySel.length; ++i) {
        for (j=0; j<county_quad.length; ++j) {
            if((county_quad[j][0] == ctySel.options[i].value) && (!inSelect(quadSelList,county_quad[j][1],county_quad[j][2]))) {
                addOption(quadSel, county_quad[j][1], county_quad[j][2]);
	        }
          }
	   }
    } else {
      for(i=0; i<quad.length; ++i) {
        addOption(quadSel, quad[i][1], quad[i][2]);
      }
    }

}


function verifyDelete(){
    msg = "Are you sure you want to delete this mine?";
    return confirm(msg);
  }

function filterList(pattern, list){
  
  list.options.length = 0;
	j=0;
  for(i=0; i<listBackup.length; ++i) {
    if(listBackup[i].text.toLowerCase().indexOf(pattern.toLowerCase()) == 0) 
    {
      list.add(listBackup[i], i);
    }
  }
  if(list.length==0) {
    alert("No matches");
  }
}

function addToList(list1, list2)
{
	j = false;
	for(i = 0; i < list2.options.length;i++)
	{
		if(list2.options[i].text.toLowerCase() == list1.options[list1.selectedIndex].text.toLowerCase())
			j = true;
	}
   if(!j) addOption(list2, list1.options[list1.selectedIndex].text, list1.options[list1.selectedIndex].value);
}

function updateQuads(quadList, countyList)
{
	addQuads(quadList, countyList);
	sortSelect(quadList);
}
