/////////////////////
//
// Order form functions for Fun Bus
//
// This file contains the objects and functions
// for the order.asp	file- mostly related to
// populating the Area and Town select boxes, and
// selecting the correct Fun Bus owner based on
// user choices.
//
/////////////////////////

//The current value of the area select box
var cur_area = 0;

//Array of emails of Fun Bus owners
//The array index corresponds to the owner #, which
//is the same number as the corresponding info page
//e.g. owners_2.asp is the owner whose email is contained
//in emails[2]
var emails = new Array;

emails[1] = "westmonmouthocean@funbuses.com";
emails[2] = "fitnessfun@funbuses.com";
emails[3] = "greatermiddlesex@funbuses.com";
emails[4] = "Union@funbuses.com";
emails[5] = "hudson@funbuses.com";
emails[6] = "bergen@funbuses.com";
emails[7] = "queens@funbuses.com";
emails[8] = "funbus@funbuses.com";
emails[9] = "somersethunterdon@funbuses.com";
emails[10] = "hudson@funbuses.com";
emails[11] = "fitnessonwheels@funbuses.com";
emails[12] = "eastmonmouth@funbuses.com";
emails[13] = "southmetrodenver@funbuses.com";
emails[14] = "nbrowardfl@funbuses.com";
emails[15] = "fun4kidz@funbuses.com";
emails[16] = "southcharlotte@funbuses.com";
emails[17] = "littleonesfitness@funbuses.com";
emails[18] = "fitkidz@funbuses.com";
emails[19] = "fit4fun@funbuses.com";
emails[20] = "morris-union@funbuses.com";
emails[21] = "oceancounty@funbuses.com";
emails[22] = "LoudounVA@funbuses.com";
emails[23] = "fitness4kids@funbuses.com";
emails[24] = "westmorris-sussex@funbuses.com";
emails[25] = "8667funbus@funbuses.com";
emails[26] = "kidsfitness@funbuses.com";
emails[27] = "Kidzfitness@funbuses.com";
emails[28] = 
emails[29] = "collincounty@funbuses.com";
emails[30] = "ga.funbus@funbuses.com";
emails[31] = "Kidzfitness@funbuses.com";
emails[32] = "kidsplay@funbuses.com";
emails[33] = "kidsplay@funbuses.com";
emails[34] = "GloucesterNJ@funbuses.com";
emails[35] = "HappyKids@funbuses.com";
emails[36] = "palmettofitkids@funbuses.com";
emails[37] = "HanoverVA@funbuses.com";
emails[38] = "Fairfax1@funbuses.com";
emails[39] = "lowerbucks@funbuses.com";

emails[88] = "efisher@funbuses.com";
emails[99] = "funbus@funbuses.com";



///////////
//
// Function called when the user changes the selected Area
// This function will repopulate the Closest Town list, if
// the selected area is changed.
//
///////////

function changeArea() {
	//If the area didn't change, don't do anything.
	if (document.frmMain.area_id.value == cur_area) {
		return;
	} else {
	//Otherwise set the current area to the new value of the list box
		cur_area = document.frmMain.area_id.value;
	}
	
	//Get the options collection for the Towns list
	towns_list = document.frmMain.town_id.options;
	
	//Repopulate the Towns list based on the selected Area
	//This involves first purging the existing list, which
	//must be done backwards since the length of the list
	//automatically shortens as you remove elements from the end...
	if (document.frmMain.area_id.value == 'new_jersey') {
		
		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}
		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Aberdeen","18");
		towns_list[x++] = new Option("Alexandria Township","9");
		towns_list[x++] = new Option("Allamuchy","32");
		towns_list[x++] = new Option("Allendale","6");
		towns_list[x++] = new Option("Allens Mills","32");
		towns_list[x++] = new Option("Allenhurst","12");
		towns_list[x++] = new Option("Allentown","1");
		towns_list[x++] = new Option("Alpha","32");
		towns_list[x++] = new Option("Alphano","32");
		towns_list[x++] = new Option("Anderson","32");
		towns_list[x++] = new Option("Andover","24");
		towns_list[x++] = new Option("Annandale","9");
		towns_list[x++] = new Option("Asbury","32");
		towns_list[x++] = new Option("Asbury Park","12");
		towns_list[x++] = new Option("Atlantic Highlands","12");
		towns_list[x++] = new Option("Augusta","24");
		towns_list[x++] = new Option("Avenel","3");
		towns_list[x++] = new Option("Avon by the Sea","12");
		towns_list[x++] = new Option("Barnegat","21");
		towns_list[x++] = new Option("Barnegat Light","21");
		towns_list[x++] = new Option("Barry Lakes","24");
		towns_list[x++] = new Option("Bayonne","10");
		towns_list[x++] = new Option("Bayville","21");
		towns_list[x++] = new Option("Basking Ridge","9");
		towns_list[x++] = new Option("Beach Haven","21");
		towns_list[x++] = new Option("Beachwood","21");
		towns_list[x++] = new Option("Beattystown","32");
		towns_list[x++] = new Option("Beaver Lake","24");
		towns_list[x++] = new Option("Beckett","34");
		towns_list[x++] = new Option("Bedminster","9");
		towns_list[x++] = new Option("Beemerville","24");
		towns_list[x++] = new Option("Belford","12");
		towns_list[x++] = new Option("Belle Mead","9");
		towns_list[x++] = new Option("Belleville","5");
		towns_list[x++] = new Option("Belmar","12");
		towns_list[x++] = new Option("Berkeley Heights","20");
		towns_list[x++] = new Option("Bernardsville","9");
		towns_list[x++] = new Option("Bethlehem","9");
		towns_list[x++] = new Option("Belvidere","32");
		towns_list[x++] = new Option("Blairstown","32");
		towns_list[x++] = new Option("Bloomfield","5");
		towns_list[x++] = new Option("Boonton","20");
		towns_list[x++] = new Option("Bound Brook","2");
		towns_list[x++] = new Option("Bradley Beach","12");
		towns_list[x++] = new Option("Brainards","32");
		towns_list[x++] = new Option("Branchburg","9");
		towns_list[x++] = new Option("Branchville","24");
		towns_list[x++] = new Option("Brass Castle","32");
		towns_list[x++] = new Option("Brick","21");
		towns_list[x++] = new Option("Bridgeport","34");
		towns_list[x++] = new Option("Bridgeville","32");
		towns_list[x++] = new Option("Bridgewater","9");
		towns_list[x++] = new Option("Brielle","12");
		towns_list[x++] = new Option("Broadway","32");
		towns_list[x++] = new Option("Brownings","32");
		towns_list[x++] = new Option("Budd Lake","24");
		towns_list[x++] = new Option("Butler","20");
		towns_list[x++] = new Option("Butler Park","32");
		towns_list[x++] = new Option("Buttzville","32");
		towns_list[x++] = new Option("Caldwell","5");
		towns_list[x++] = new Option("Califon","9");
		towns_list[x++] = new Option("Calno","32");
		towns_list[x++] = new Option("Carpentersville","32");
		towns_list[x++] = new Option("Carteret","3");
		towns_list[x++] = new Option("Cedar Grove","5");
		towns_list[x++] = new Option("Cedar Knolls","20");
		towns_list[x++] = new Option("Changewater","32");
		towns_list[x++] = new Option("Chatham","20");
		towns_list[x++] = new Option("Chester","24");
		towns_list[x++] = new Option("Clark","4");
		towns_list[x++] = new Option("Clarksboro","34");
		towns_list[x++] = new Option("Clarkesburg","1");
		towns_list[x++] = new Option("Clayton","34");
		towns_list[x++] = new Option("Cliffwood","18");
		towns_list[x++] = new Option("Cliffwood Lake","24");
		towns_list[x++] = new Option("Clinton","9");
		towns_list[x++] = new Option("Colesville","24");
		towns_list[x++] = new Option("Collinsville","20");
		towns_list[x++] = new Option("Colonia","3");
		towns_list[x++] = new Option("Colts Neck","12");
		towns_list[x++] = new Option("Columbia","32");
		towns_list[x++] = new Option("Convent Station","20");
		towns_list[x++] = new Option("Coopersville","32");
		towns_list[x++] = new Option("Cornish","32");
		towns_list[x++] = new Option("Cranbury","18");
		towns_list[x++] = new Option("Cranford","4");
		towns_list[x++] = new Option("Cream Ridge","1");
		towns_list[x++] = new Option("Dayton","18");
		towns_list[x++] = new Option("Deal","12");
		towns_list[x++] = new Option("Delaware","9");
		towns_list[x++] = new Option("Denville","20");
		towns_list[x++] = new Option("Deptford","34");
		towns_list[x++] = new Option("Dover","20");
		towns_list[x++] = new Option("Dunellen","2");
		towns_list[x++] = new Option("Dunnfield","32");
		towns_list[x++] = new Option("East Amwell","9");
		towns_list[x++] = new Option("East Brunswick","3");
		towns_list[x++] = new Option("East Hanover","20");
		towns_list[x++] = new Option("East Windsor","1");
		towns_list[x++] = new Option("Eatontown","12");
		towns_list[x++] = new Option("Ebenezer","32");
		towns_list[x++] = new Option("Edison","3");
		towns_list[x++] = new Option("Elizabeth","4");
		towns_list[x++] = new Option("Elmwood Park","6");
		towns_list[x++] = new Option("Englishtown","1");
		towns_list[x++] = new Option("Essex Falls","5");
		towns_list[x++] = new Option("Ewan","34");
		towns_list[x++] = new Option("Fanwood","4");
		towns_list[x++] = new Option("Far Hills","9");
		towns_list[x++] = new Option("Fairfield","5");
		towns_list[x++] = new Option("Fair Haven","12");
		towns_list[x++] = new Option("Fairlawn","6");
		towns_list[x++] = new Option("Farmingdale","1");
		towns_list[x++] = new Option("Febletown","32");
		towns_list[x++] = new Option("Finesville","32");
		towns_list[x++] = new Option("Flagtown","9");
		towns_list[x++] = new Option("Flanders","24");
		towns_list[x++] = new Option("Flemington","9");
		towns_list[x++] = new Option("Florham Park","20");
		towns_list[x++] = new Option("Fords","3");
		towns_list[x++] = new Option("Forked River","21");
		towns_list[x++] = new Option("Fort Monmouth","12");
		towns_list[x++] = new Option("Foul Rift","32");
		towns_list[x++] = new Option("Franklin","24");
		towns_list[x++] = new Option("Franklin Grove","32");
		towns_list[x++] = new Option("Franklin Lakes","6");
		towns_list[x++] = new Option("Franklin Park","2");
		towns_list[x++] = new Option("Franklin Township","9");
		towns_list[x++] = new Option("Franklinville","34");
		towns_list[x++] = new Option("Fredon","24");
		towns_list[x++] = new Option("Fredon Township","24");
		towns_list[x++] = new Option("Freehold","1");
		towns_list[x++] = new Option("Frenchtown","9");
		towns_list[x++] = new Option("Garwood","4");
		towns_list[x++] = new Option("Gerard","24");
		towns_list[x++] = new Option("Gibbstown","34");
		towns_list[x++] = new Option("Gillette","20");
		towns_list[x++] = new Option("Gladstone","9");
		towns_list[x++] = new Option("Glassboro","34");
		towns_list[x++] = new Option("Glasser","24");
		towns_list[x++] = new Option("Glen Gardner","9");
		towns_list[x++] = new Option("Glen Ridge","5");
		towns_list[x++] = new Option("Glen Rock","6");
		towns_list[x++] = new Option("Glenwood","24");
		towns_list[x++] = new Option("Great Meadows","32");
		towns_list[x++] = new Option("Green Brook","2");
		towns_list[x++] = new Option("Greendell","24");
		towns_list[x++] = new Option("Green Village","20");
		towns_list[x++] = new Option("Grenloch","34");
		towns_list[x++] = new Option("Greystone Park","20");
		towns_list[x++] = new Option("Guttenberg","10");
		towns_list[x++] = new Option("Hackettstown","32");
		towns_list[x++] = new Option("Hainesburg","32");
		towns_list[x++] = new Option("Hamburg","24");
		towns_list[x++] = new Option("Hampton","9");
		towns_list[x++] = new Option("Hanover","20");
		towns_list[x++] = new Option("Harding","20");
		towns_list[x++] = new Option("Hardwick","32");
		towns_list[x++] = new Option("Hardwick Center","32");
		towns_list[x++] = new Option("Harmony","32");
		towns_list[x++] = new Option("Harrison","10");
		towns_list[x++] = new Option("Harrisonville","34");
		towns_list[x++] = new Option("Hazen","32");
		towns_list[x++] = new Option("Helmetta","3");
		towns_list[x++] = new Option("Hemlock Glen","32");
		towns_list[x++] = new Option("High Bridge","9");
		towns_list[x++] = new Option("Highland Park","2");
		towns_list[x++] = new Option("Highlands","12");
		towns_list[x++] = new Option("Highland Lakes","24");
		towns_list[x++] = new Option("High Point","24");
		towns_list[x++] = new Option("High Point Park","24");
		towns_list[x++] = new Option("Hightstown","18");
		towns_list[x++] = new Option("Hillside","4");
		towns_list[x++] = new Option("Hillsborough","9");
		towns_list[x++] = new Option("Hoboken","10");
		towns_list[x++] = new Option("Ho Ho Kus","6");
		towns_list[x++] = new Option("Holland","9");
		towns_list[x++] = new Option("Holmdel","12");
		towns_list[x++] = new Option("Hopatcong","24");
		towns_list[x++] = new Option("Hope","32");
		towns_list[x++] = new Option("Howell","1");
		towns_list[x++] = new Option("Hutchinson","32");
		towns_list[x++] = new Option("Imlaystown","1");
		towns_list[x++] = new Option("Iselin","3");
		towns_list[x++] = new Option("Island Heights","21");
		towns_list[x++] = new Option("Jackson","1");
		towns_list[x++] = new Option("Jacksonburg","32");
		towns_list[x++] = new Option("Jamesburg","18");
		towns_list[x++] = new Option("Jersey City","10");
		towns_list[x++] = new Option("Johnsonburg","32");
		towns_list[x++] = new Option("Kalarama","32");
		towns_list[x++] = new Option("Karrsville","32");
		towns_list[x++] = new Option("Kearny","10");
		towns_list[x++] = new Option("Keansburg","18");
		towns_list[x++] = new Option("Keasbey","3");
		towns_list[x++] = new Option("Kendall Park","18");
		towns_list[x++] = new Option("Kenilworth","4");
		towns_list[x++] = new Option("Kennedy Mills","32");
		towns_list[x++] = new Option("Kennedys","32");
		towns_list[x++] = new Option("Kenvil","24");
		towns_list[x++] = new Option("Keyport","18");
		towns_list[x++] = new Option("Kingwood","9");
		towns_list[x++] = new Option("Kinnelon","20");
		towns_list[x++] = new Option("Knowlton","32");
		towns_list[x++] = new Option("Lafayette","24");
		towns_list[x++] = new Option("Lakehurst","21");
		towns_list[x++] = new Option("Lake Hiawatha","20");
		towns_list[x++] = new Option("Lake Hopatcong","24");
		towns_list[x++] = new Option("Lake Parsippany","20");
		towns_list[x++] = new Option("Lake Stockholm","24");
		towns_list[x++] = new Option("Lake Tamarack","24");
		towns_list[x++] = new Option("Lake Telemark","20");
		towns_list[x++] = new Option("Lakewood","21");
		towns_list[x++] = new Option("Lambertville","9");
		towns_list[x++] = new Option("Landing","24");
		towns_list[x++] = new Option("Lanoka Harbor","21");
		towns_list[x++] = new Option("Laurence Harbor","18");
		towns_list[x++] = new Option("Lavallette","21");
		towns_list[x++] = new Option("Layton","24");
		towns_list[x++] = new Option("Lebanon","9");
		towns_list[x++] = new Option("Ledgewood","24");
		towns_list[x++] = new Option("Leonardo","12");
		towns_list[x++] = new Option("Lincoln Park","20");
		towns_list[x++] = new Option("Lincroft","12");
		towns_list[x++] = new Option("Linden","4");
		towns_list[x++] = new Option("Little Egg Harbor","21");
		towns_list[x++] = new Option("Little Silver","12");
		towns_list[x++] = new Option("Livingston","5");
		towns_list[x++] = new Option("Logan Township","34");
		towns_list[x++] = new Option("Lommasons Glen","32");
		towns_list[x++] = new Option("Long Branch","12");
		towns_list[x++] = new Option("Long Bridge","32");
		towns_list[x++] = new Option("Long Hill","20");
		towns_list[x++] = new Option("Long Valley","24");
		towns_list[x++] = new Option("Lower Harmony","32");
		towns_list[x++] = new Option("Lows Hollow","32");
		towns_list[x++] = new Option("Lyons/Liverty Corner","9");
		towns_list[x++] = new Option("Madison","20");
		towns_list[x++] = new Option("Mahwah","6");
		towns_list[x++] = new Option("Malaga","34");
		towns_list[x++] = new Option("Manahawkin","21");
		towns_list[x++] = new Option("Manalapan","1");
		towns_list[x++] = new Option("Manasquan","12");
		towns_list[x++] = new Option("Manchester","21");
		towns_list[x++] = new Option("Mantoloking","21");
		towns_list[x++] = new Option("Mantua","34");
		towns_list[x++] = new Option("Manunka Chunk","32");
		towns_list[x++] = new Option("Manville","2");
		towns_list[x++] = new Option("Maplewood","5");
		towns_list[x++] = new Option("Marble Hill ","32");
		towns_list[x++] = new Option("Marksboro","32");
		towns_list[x++] = new Option("Marlboro","18");
		towns_list[x++] = new Option("Martinsville","9");
		towns_list[x++] = new Option("Matawan","18");
		towns_list[x++] = new Option("Mayetta","21");
		towns_list[x++] = new Option("Maywood","6");
		towns_list[x++] = new Option("McAfee","24");
		towns_list[x++] = new Option("Mendham","24");
		towns_list[x++] = new Option("Metuchen","3");
		towns_list[x++] = new Option("Meyersville","20");
		towns_list[x++] = new Option("Mickleton","34");
		towns_list[x++] = new Option("Middlesex","2");
		towns_list[x++] = new Option("Middletown","12");
		towns_list[x++] = new Option("Middleville","24");
		towns_list[x++] = new Option("Midland Park","6");
		towns_list[x++] = new Option("Milford","9");
		towns_list[x++] = new Option("Millbrook","32");
		towns_list[x++] = new Option("Millburn","5");
		towns_list[x++] = new Option("Millington","20");
		towns_list[x++] = new Option("Millstone","1");
		towns_list[x++] = new Option("Milltown","3");
		towns_list[x++] = new Option("Mine Hill","24");
		towns_list[x++] = new Option("Monmouth Beach","12");
		towns_list[x++] = new Option("Monmouth Junction","18");
		towns_list[x++] = new Option("Monroe","18");
		towns_list[x++] = new Option("Monroeville","34");
		towns_list[x++] = new Option("Montague","24");
		towns_list[x++] = new Option("Montana","32");
		towns_list[x++] = new Option("Montclair","5");
		towns_list[x++] = new Option("Montville","20");
		towns_list[x++] = new Option("Morganville","18");
		towns_list[x++] = new Option("Morris","20");
		towns_list[x++] = new Option("Morris Plains","20");
		towns_list[x++] = new Option("Morristown","20");
		towns_list[x++] = new Option("Mount Arlington","24");
		towns_list[x++] = new Option("Mount Bethel","32");
		towns_list[x++] = new Option("Mount Freedom","20");
		towns_list[x++] = new Option("Mount Hermon","32");
		towns_list[x++] = new Option("Mount Pleasant","32");
		towns_list[x++] = new Option("Mount Royal","34");
		towns_list[x++] = new Option("Mount Vernon","32");
		towns_list[x++] = new Option("Mountain Lakes","20");
		towns_list[x++] = new Option("Mountainside","20");
		towns_list[x++] = new Option("Mullica Hill","34");
		towns_list[x++] = new Option("National Park","34");
		towns_list[x++] = new Option("Navesink","12");
		towns_list[x++] = new Option("Neptune","12");
		towns_list[x++] = new Option("Neshanic Station","9");
		towns_list[x++] = new Option("Netcong","24");
		towns_list[x++] = new Option("New Brunswick","2");
		towns_list[x++] = new Option("New Egypt","21");
		towns_list[x++] = new Option("Newfield","34");
		towns_list[x++] = new Option("New Providence","20");
		towns_list[x++] = new Option("New Vernon","20");
		towns_list[x++] = new Option("New Village","32");
		towns_list[x++] = new Option("Newton","24");
		towns_list[x++] = new Option("North Bergen","10");
		towns_list[x++] = new Option("North Branch","9");
		towns_list[x++] = new Option("North Brunswick","3");
		towns_list[x++] = new Option("North Caldwell","5");
		towns_list[x++] = new Option("North Plainfield","2");
		towns_list[x++] = new Option("Nutley","5");
		towns_list[x++] = new Option("Oakhurst","12");	
		towns_list[x++] = new Option("Oakland","6");
		towns_list[x++] = new Option("Ocean Grove","12");
		towns_list[x++] = new Option("Oceanport","12");
		towns_list[x++] = new Option("Ogdensburg","24");
		towns_list[x++] = new Option("Old Bridge","18");
		towns_list[x++] = new Option("Oxford","32");
		towns_list[x++] = new Option("Paramus","6");
		towns_list[x++] = new Option("Parlin","3");
		towns_list[x++] = new Option("Parsippany","20");
		towns_list[x++] = new Option("Parsipanny-Troy Hills","20");
		towns_list[x++] = new Option("Paulina","32");
		towns_list[x++] = new Option("Paulsboro","34");
		towns_list[x++] = new Option("Peapack/Gladstone","9");
		towns_list[x++] = new Option("Pequannock","20");
		towns_list[x++] = new Option("Pequest","32");
		towns_list[x++] = new Option("Perrineville","1");
		towns_list[x++] = new Option("Perth Amboy","3");
		towns_list[x++] = new Option("Petersburg","32");
		towns_list[x++] = new Option("Phillipsburg","32");
		towns_list[x++] = new Option("Picatinny Arsenal","24");
		towns_list[x++] = new Option("Pine Beach","21");
		towns_list[x++] = new Option("Pinebrook","20");
		towns_list[x++] = new Option("Pitman","34");
		towns_list[x++] = new Option("Pittstown","9");
		towns_list[x++] = new Option("Piscataway","2");
		towns_list[x++] = new Option("Plainfield","2");
		towns_list[x++] = new Option("Plainsboro","18");
		towns_list[x++] = new Option("Pleasant Valley","32");
		towns_list[x++] = new Option("Point Pleasant","21");
		towns_list[x++] = new Option("Polkville","32");
		towns_list[x++] = new Option("Pompton Plains","20");
		towns_list[x++] = new Option("Port Colden","32");
		towns_list[x++] = new Option("Port Monmouth","12");
		towns_list[x++] = new Option("Port Murray","32");
		towns_list[x++] = new Option("Port Reading","3");
		towns_list[x++] = new Option("Port Warren","32");
		towns_list[x++] = new Option("Princeton","1");
		towns_list[x++] = new Option("Princeton Junction","1");
		towns_list[x++] = new Option("Rahway","4");
		towns_list[x++] = new Option("Ramsey","6");
		towns_list[x++] = new Option("Ramseysburg","32");
		towns_list[x++] = new Option("Randolph","20");
		towns_list[x++] = new Option("Raritan","9");
		towns_list[x++] = new Option("Red Bank","12");
		towns_list[x++] = new Option("Richwood","34");
		towns_list[x++] = new Option("Ridgewood","6");
		towns_list[x++] = new Option("Riegelsville","32");
		towns_list[x++] = new Option("Ringoes","9");
		towns_list[x++] = new Option("Riverdale","20");
		towns_list[x++] = new Option("Rochelle Park","6");
		towns_list[x++] = new Option("Rockaway","20");
		towns_list[x++] = new Option("Rocky Hill","9");
		towns_list[x++] = new Option("Rockport","32");
		towns_list[x++] = new Option("Roosevelt","1");
		towns_list[x++] = new Option("Roseland","5");
		towns_list[x++] = new Option("Roselle","4");
		towns_list[x++] = new Option("Roselle Park","4");
		towns_list[x++] = new Option("Rosemont","9");
		towns_list[x++] = new Option("Roxburg","32");
		towns_list[x++] = new Option("Rumson","12");
		towns_list[x++] = new Option("Sarepta","32");
		towns_list[x++] = new Option("Saxton Falls","32");
		towns_list[x++] = new Option("Sayreville","3");
		towns_list[x++] = new Option("Scotch Plains","4");
		towns_list[x++] = new Option("Sea Girt","12");
		towns_list[x++] = new Option("Seaside Heights","21");
		towns_list[x++] = new Option("Seaside Park","21");
		towns_list[x++] = new Option("Secaucus","10");
		towns_list[x++] = new Option("Sewaren","3");
		towns_list[x++] = new Option("Sewell","34");
		towns_list[x++] = new Option("Shiloh","32");
		towns_list[x++] = new Option("Short Hills","5");
		towns_list[x++] = new Option("Shrewsbury","12");
		towns_list[x++] = new Option("Silver Lake","24");
		towns_list[x++] = new Option("Skillman","9");
		towns_list[x++] = new Option("Somerset","2");
		towns_list[x++] = new Option("Somerville","9");
		towns_list[x++] = new Option("South Amboy","3");
		towns_list[x++] = new Option("South Bound Brook","2");
		towns_list[x++] = new Option("South Harrison Township","34");
		towns_list[x++] = new Option("South Orange","5");
		towns_list[x++] = new Option("South Plainfield","3");
		towns_list[x++] = new Option("South River","3");
		towns_list[x++] = new Option("Southtown","32");
		towns_list[x++] = new Option("Sparta","24");
		towns_list[x++] = new Option("Spotswood","3");
		towns_list[x++] = new Option("Springfield","20");
		towns_list[x++] = new Option("Spring Lake/Heights","12");
		towns_list[x++] = new Option("Springtown","32");
		towns_list[x++] = new Option("Spring Valley","32");
		towns_list[x++] = new Option("Stanhope","24");
		towns_list[x++] = new Option("Stewartsville","32");
		towns_list[x++] = new Option("Still Vallry","32");
		towns_list[x++] = new Option("Stillwater","24");
		towns_list[x++] = new Option("Stirling","20");
		towns_list[x++] = new Option("Stockholm","24");
		towns_list[x++] = new Option("Stockton","9");
		towns_list[x++] = new Option("Succasunna","24");
		towns_list[x++] = new Option("Summerfield","32");
		towns_list[x++] = new Option("Summit","20");
		towns_list[x++] = new Option("Sussex","24");
		towns_list[x++] = new Option("Sussex County","24");
		towns_list[x++] = new Option("Swartswood","24");
		towns_list[x++] = new Option("Swayzes Mills","32");
		towns_list[x++] = new Option("Swedesboro","34");
		towns_list[x++] = new Option("Tewksbury","9");
		towns_list[x++] = new Option("Thorofare","34");
		towns_list[x++] = new Option("Three Bridges","9");
		towns_list[x++] = new Option("Tinton Falls","12");
		towns_list[x++] = new Option("Tranquility","24");
		towns_list[x++] = new Option("Toms River","21");
		towns_list[x++] = new Option("Towaco","20");
		towns_list[x++] = new Option("Townsbury","32");
		towns_list[x++] = new Option("Tuckerton","21");
		towns_list[x++] = new Option("Turnersville","34");
		towns_list[x++] = new Option("Union","4");
		towns_list[x++] = new Option("Union City","10");
		towns_list[x++] = new Option("Union Hill","20");
		towns_list[x++] = new Option("Uniontown","32");
		towns_list[x++] = new Option("Union Township","9");
		towns_list[x++] = new Option("Vail","32");
		towns_list[x++] = new Option("Vaux Hall","4");
		towns_list[x++] = new Option("Vernon","24");
		towns_list[x++] = new Option("Verona","5");
		towns_list[x++] = new Option("Victory Gardens","20");
		towns_list[x++] = new Option("Vienna","32");
		towns_list[x++] = new Option("Villa Madonna","32");
		towns_list[x++] = new Option("Waldwick","6");
		towns_list[x++] = new Option("Wall","12");
		towns_list[x++] = new Option("Wallkill Lake","24");
		towns_list[x++] = new Option("Wallpack Center","24");
		towns_list[x++] = new Option("Walnut Valley","32");
		towns_list[x++] = new Option("Wantage","24");
		towns_list[x++] = new Option("Wantage Township","24");
		towns_list[x++] = new Option("Waretown","21");
		towns_list[x++] = new Option("Warren","2");
		towns_list[x++] = new Option("Warren Glen","32");
		towns_list[x++] = new Option("Warrington","32");
		towns_list[x++] = new Option("Washington","32");
		towns_list[x++] = new Option("Washington Township","34");
		towns_list[x++] = new Option("Watchung","2");
		towns_list[x++] = new Option("Weehawken","10");
		towns_list[x++] = new Option("Weirtown","32");
		towns_list[x++] = new Option("Wenonah","34");
		towns_list[x++] = new Option("West Amwell","9");
		towns_list[x++] = new Option("West Caldwell","5");
		towns_list[x++] = new Option("West Creek","21");
		towns_list[x++] = new Option("West Deptford","34");
		towns_list[x++] = new Option("West Long Branch","12");
		towns_list[x++] = new Option("West Morris County","24");
		towns_list[x++] = new Option("West Orange","5");
		towns_list[x++] = new Option("Westfield","4");
		towns_list[x++] = new Option("Westville","34");
		towns_list[x++] = new Option("West Windsor","1");
		towns_list[x++] = new Option("West New York","10");
		towns_list[x++] = new Option("Wharton","20");
		towns_list[x++] = new Option("Whippany","20");
		towns_list[x++] = new Option("Whitehouse Station","9");
		towns_list[x++] = new Option("White Meadow Lake","20");
		towns_list[x++] = new Option("Whiting","21");
		towns_list[x++] = new Option("Wickatunk","1");
		towns_list[x++] = new Option("Williamstown","34");
		towns_list[x++] = new Option("Willow Grove","32");
		towns_list[x++] = new Option("Windsors","1");
		towns_list[x++] = new Option("Winfield Park","4");
		towns_list[x++] = new Option("Woodbridge","3");
		towns_list[x++] = new Option("Woodbury","34");
		towns_list[x++] = new Option("Woodbury Heights","34");
		towns_list[x++] = new Option("Woolwich","34");
		towns_list[x++] = new Option("Wyckoff","6");
		towns_list[x++] = new Option("Zarephath","2");
		}
	
	
	
	else 	if (document.frmMain.area_id.value == 'new_york') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Nassau County ","8");
      		towns_list[x++] = new Option("Suffolk County ","8");
		towns_list[x++] = new Option("Rockland ","25");
		towns_list[x++] = new Option("Westchester ","25");
		towns_list[x++] = new Option("Queens ","7");
	}
	
	else 	if (document.frmMain.area_id.value == 'pennsylvania') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Allen Township ","33");
		towns_list[x++] = new Option("Bangor ","33");
      		towns_list[x++] = new Option("Bath ","33");
      		towns_list[x++] = new Option("Bensalem Township ","39");
		towns_list[x++] = new Option("Bethlehem Township ","33");
		towns_list[x++] = new Option("Bristol Township ","39");
		towns_list[x++] = new Option("Buckingham Township ","39");
		towns_list[x++] = new Option("Bushkill Township ","33");
		towns_list[x++] = new Option("Chapman ","33");
		towns_list[x++] = new Option("East Allen Township ","33");
		towns_list[x++] = new Option("East Bangor ","33");
		towns_list[x++] = new Option("Easton ","33");
		towns_list[x++] = new Option("Falls Township ","39");
		towns_list[x++] = new Option("Forks Township ","33");
		towns_list[x++] = new Option("Freemansburg ","33");
		towns_list[x++] = new Option("Glendon ","33");
		towns_list[x++] = new Option("Hanover Township ","33");
		towns_list[x++] = new Option("Hellerton ","33");
		towns_list[x++] = new Option("Hulmeville Boro ","39");
		towns_list[x++] = new Option("Ivyland Boro ","39");
		towns_list[x++] = new Option("Langhorne Boro ","39");
		towns_list[x++] = new Option("Langhorne Manor Boro ","39");
		towns_list[x++] = new Option("Lehigh Township ","33");
		towns_list[x++] = new Option("Lower Makefield Township ","39");
		towns_list[x++] = new Option("Lower Mount Bethel Township ","33");
		towns_list[x++] = new Option("Lower Nazareth Township ","33");
		towns_list[x++] = new Option("Lower Saucon ","33");
		towns_list[x++] = new Option("Lower Southampton Township ","39");
		towns_list[x++] = new Option("Middletown Township ","39");
		towns_list[x++] = new Option("Moore Township ","33");
		towns_list[x++] = new Option("Morrisville Boro ","39");
		towns_list[x++] = new Option("Nazareth ","33");
		towns_list[x++] = new Option("New Hope Boro ","39");
		towns_list[x++] = new Option("Newtown Boro ","39");
		towns_list[x++] = new Option("Newtown Township ","39");
		towns_list[x++] = new Option("North Catasauqua ","33");
		towns_list[x++] = new Option("Northampton ","33");
		towns_list[x++] = new Option("Northampton Township ","39");
		towns_list[x++] = new Option("Palmer Township ","33");
		towns_list[x++] = new Option("Pen Argyl ","33");
		towns_list[x++] = new Option("Penndel Township ","39");
		towns_list[x++] = new Option("Plainfield Township ","33");
		towns_list[x++] = new Option("Portland ","33");
		towns_list[x++] = new Option("Roseto ","33");
		towns_list[x++] = new Option("Solebury Township ","39");
		towns_list[x++] = new Option("Stockerton ","33");
		towns_list[x++] = new Option("Tatamy ","33");
		towns_list[x++] = new Option("Upper Makefield Township ","39");
		towns_list[x++] = new Option("Upper Mount Bethel Township ","33");
		towns_list[x++] = new Option("Upper Nazareth Township ","33");
		towns_list[x++] = new Option("Upper Southampton Township ","39");
		towns_list[x++] = new Option("Walnutport ","33");
		towns_list[x++] = new Option("Warnimster Township ","39");
		towns_list[x++] = new Option("Warwick Township ","39");
		towns_list[x++] = new Option("West Easton ","33");
		towns_list[x++] = new Option("Williams Township ","33");
		towns_list[x++] = new Option("Wilson ","33");
		towns_list[x++] = new Option("Wind Gap ","33");
		towns_list[x++] = new Option("Wrightstown Township ","39");
		towns_list[x++] = new Option("Yardley Boro ","39");


		
	}
	else 	if (document.frmMain.area_id.value == 'georgia') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "30");
		towns_list[x++] = new Option("Cherokee County ","30");
		towns_list[x++] = new Option("East Cobb ","30");
		towns_list[x++] = new Option("Forsyth County ","30");
		towns_list[x++] = new Option("North Dekalb ","30");
		towns_list[x++] = new Option("North Fulton ","30");
		towns_list[x++] = new Option("West Gwinnett ","30");
	}		

	
	else 	if (document.frmMain.area_id.value == 'illinois') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Dupage County ","11");
      		towns_list[x++] = new Option("Will County ","11");
		towns_list[x++] = new Option("Kendall County ","11");
		towns_list[x++] = new Option("Kane County ","11");
		towns_list[x++] = new Option("Aurora","11");
		towns_list[x++] = new Option("Batavia","11");
		towns_list[x++] = new Option("Bolingbrook","11");
		towns_list[x++] = new Option("Burr Ridge","11");
		towns_list[x++] = new Option("Darien","11");
		towns_list[x++] = new Option("Downers Grove","11");
		towns_list[x++] = new Option("Dupage","11");
		towns_list[x++] = new Option("Geneva","11");
		towns_list[x++] = new Option("Glen Ellen","11");
		towns_list[x++] = new Option("Hinsdale","11");
		towns_list[x++] = new Option("Kendall","11");
		towns_list[x++] = new Option("Lemont","11");
		towns_list[x++] = new Option("Lisle","11");
		towns_list[x++] = new Option("Lombard","11");
		towns_list[x++] = new Option("Naperville","11");
		towns_list[x++] = new Option("Oak Brook","11");
		towns_list[x++] = new Option("Oswego","11");
		towns_list[x++] = new Option("Plainfield","11");
		towns_list[x++] = new Option("Romeoville","11");
		towns_list[x++] = new Option("Warrenville","11");
		towns_list[x++] = new Option("Westmont","11");
		towns_list[x++] = new Option("Wheaton","11");
		towns_list[x++] = new Option("Willowbrook","11");
		towns_list[x++] = new Option("Winfield","11");
		towns_list[x++] = new Option("Woodridge","11");
		towns_list[x++] = new Option("Yorkville","11");
		}
		else 	if (document.frmMain.area_id.value == 'colorado') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Aurora","23");
		towns_list[x++] = new Option("Castle Rock","23");
		towns_list[x++] = new Option("Centennial ","13");
		towns_list[x++] = new Option("Centennial 80015-80016","23");
      		towns_list[x++] = new Option("Cherry Hills ","13");
		towns_list[x++] = new Option("Denver","23");
		towns_list[x++] = new Option("Elizabeth","23");
		towns_list[x++] = new Option("Englewood ","13");
		towns_list[x++] = new Option("Franktown","23");
		towns_list[x++] = new Option("Greenwood Village ","13")
		towns_list[x++] = new Option("Highlands Ranch","13");
		towns_list[x++] = new Option("Ken Caryl ","13");
		towns_list[x++] = new Option("Littleton ","13");
		towns_list[x++] = new Option("Lone Tree ","13");
		towns_list[x++] = new Option("Parker 80134 ","13");
		towns_list[x++] = new Option("Parker 80138","23");
		towns_list[x++] = new Option("Roxborough","13");
		}
	else 	if (document.frmMain.area_id.value == 'florida') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Airport Area ","31");				
		towns_list[x++] = new Option("Altamonte Springs ","27");
		towns_list[x++] = new Option("Apopka ","31");
		towns_list[x++] = new Option("Avalon Park ","15");
		towns_list[x++] = new Option("Baldwin Park ","19");
		towns_list[x++] = new Option("Belle Isle ","15");
		towns_list[x++] = new Option("Boca Raton","35");
		towns_list[x++] = new Option("Boynton Beach","35");
		towns_list[x++] = new Option("Casselberry ","27");
		towns_list[x++] = new Option("Central/South Orlando ","31");
		towns_list[x++] = new Option("Coconut Creek ","14");
		towns_list[x++] = new Option("College Park ","31");
		towns_list[x++] = new Option("Colonialtown ","31");
		towns_list[x++] = new Option("Conway ","31");
		towns_list[x++] = new Option("Coral Springs ","14");
		towns_list[x++] = new Option("Country Walk ","19");
		towns_list[x++] = new Option("Curry Ford Area ","31");
		towns_list[x++] = new Option("Cutler Bay ","19");
		towns_list[x++] = new Option("Davie ","14");
		towns_list[x++] = new Option("Deerfield Beach ","14");
		towns_list[x++] = new Option("Delray Beach","35");
		towns_list[x++] = new Option("East Orlando ","15");
		towns_list[x++] = new Option("Fort Lauderdale ","14");
		towns_list[x++] = new Option("Fort Pierce ","17");
		towns_list[x++] = new Option("Geneva ","27");
		towns_list[x++] = new Option("Goldenrod ","27");
		towns_list[x++] = new Option("Gulf Stream","35");
		towns_list[x++] = new Option("Highland Beach","35");
		towns_list[x++] = new Option("Hobe Sound ","17");
		towns_list[x++] = new Option("Indiantown ","17");
		towns_list[x++] = new Option("Jensen Beach ","17");
		towns_list[x++] = new Option("Kendall ","19");
		towns_list[x++] = new Option("Kendall Lakes ","19");
		towns_list[x++] = new Option("Lake Mary ","27");
		towns_list[x++] = new Option("Lake Monroe ","27");
		towns_list[x++] = new Option("Lake Nona ","15");
		towns_list[x++] = new Option("Lake Underhill ","15");
		towns_list[x++] = new Option("Lee Vista ","15");
		towns_list[x++] = new Option("Lighthouse Point","35");
		towns_list[x++] = new Option("Maitland ","31");
		towns_list[x++] = new Option("Margate ","14");
		towns_list[x++] = new Option("Mid Florida ","27");
		towns_list[x++] = new Option("Mt. Dora ","31");
		towns_list[x++] = new Option("Northern Broward County ","14");
		towns_list[x++] = new Option("Ocean Ridge","35");
		towns_list[x++] = new Option("Orlando ","15");
		towns_list[x++] = new Option("Oviedo ","27");
		towns_list[x++] = new Option("Palm City ","17");
		towns_list[x++] = new Option("Palmetto Bay ","19");
		towns_list[x++] = new Option("Parkland ","14");
		towns_list[x++] = new Option("Pine Castle ","15");
		towns_list[x++] = new Option("Pinecrest ","19");
		towns_list[x++] = new Option("Plantation ","14");
		towns_list[x++] = new Option("Pompano Beach ","14");
		towns_list[x++] = new Option("Pompano Beach (33064) ","35");
		towns_list[x++] = new Option("Port Saint Lucie ","17");
		towns_list[x++] = new Option("Port Salerno ","17");
		towns_list[x++] = new Option("Richmond Heights ","19");
		towns_list[x++] = new Option("Rosemont ","31");
		towns_list[x++] = new Option("Sanford ","27");
		towns_list[x++] = new Option("Stuart ","17");
		towns_list[x++] = new Option("Sunrise ","14");
		towns_list[x++] = new Option("Sunset ","19");
		towns_list[x++] = new Option("Tamarac ","14");
		towns_list[x++] = new Option("The Crossing ","19");
		towns_list[x++] = new Option("The Hammocks ","19");
		towns_list[x++] = new Option("Three Lakes ","19");
		towns_list[x++] = new Option("UCF Area ","15");
		towns_list[x++] = new Option("Union Park ","15");
		towns_list[x++] = new Option("Waterford Lakes ","15");
		towns_list[x++] = new Option("West Kendall ","19");
		towns_list[x++] = new Option("West Perrine ","19");
		towns_list[x++] = new Option("Weston ","14");
		towns_list[x++] = new Option("Winter Park ","31");
		towns_list[x++] = new Option("Winter Springs ","27");
		towns_list[x++] = new Option("Zellwood ","31");			
		}
	else 	if (document.frmMain.area_id.value == 'north_carolina') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Charlotte ","16");				
		towns_list[x++] = new Option("Indian Trail ","16");
		towns_list[x++] = new Option("Marshville ","16");
		towns_list[x++] = new Option("Matthews ","16");
		towns_list[x++] = new Option("Monroe ","16");
		towns_list[x++] = new Option("Pineville ","16");
		towns_list[x++] = new Option("Waxhaw ","16");
		towns_list[x++] = new Option("Wingate ","16");
		}
	else 	if (document.frmMain.area_id.value == 'south_carolina') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Kershaw County","36");
		towns_list[x++] = new Option("Lexington County","36");
		towns_list[x++] = new Option("Richland County ","36");
		
		}
	else 	if (document.frmMain.area_id.value == 'texas') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Collin County, TX","29");				
		towns_list[x++] = new Option("any town","88");				
		
		
		}
	
	else 	if (document.frmMain.area_id.value == 'virginia') {

		for (x = towns_list.length; x >=0; x--) {
			towns_list[x] = null;
		}

		x = 0;
		towns_list[x++] = new Option("-------please select------","empty");
		towns_list[x++] = new Option("TOWN NOT LISTED", "99");
		towns_list[x++] = new Option("Aldie ","22");				
		towns_list[x++] = new Option("Arcola ","22");
		towns_list[x++] = new Option("Ashburn ","22");
		towns_list[x++] = new Option("Ashland ","37");
		towns_list[x++] = new Option("Burke ","38");
		towns_list[x++] = new Option("Centreville ","38");
		towns_list[x++] = new Option("Chantilly ","38");
		towns_list[x++] = new Option("Chesterfield County ","26");
		towns_list[x++] = new Option("Clifton ","38");
		towns_list[x++] = new Option("Colonial Heights ","26");
		towns_list[x++] = new Option("Dulles ","22");
		towns_list[x++] = new Option("Fairfax ","38");
		towns_list[x++] = new Option("Fairfax Station ","38");
		towns_list[x++] = new Option("Falls Church ","38");
		towns_list[x++] = new Option("Glen Allen ","37");
		towns_list[x++] = new Option("Hamilton ","22");
		towns_list[x++] = new Option("Henrico ","37");
		towns_list[x++] = new Option("Hopewell ","26");
		towns_list[x++] = new Option("Leesburg ","22");
		towns_list[x++] = new Option("Lovettsville ","22");
		towns_list[x++] = new Option("Mechanicsville ","37");
		towns_list[x++] = new Option("Middleburg ","22");
		towns_list[x++] = new Option("Paeonian Springs ","22");
		towns_list[x++] = new Option("Petersburg ","26");
		towns_list[x++] = new Option("Philomont ","22");
		towns_list[x++] = new Option("Prince George ","26");
		towns_list[x++] = new Option("Purcellville ","22");
		towns_list[x++] = new Option("Round Hill ","22");
		towns_list[x++] = new Option("Short Pump ","37");
		towns_list[x++] = new Option("Sterling ","22");
		towns_list[x++] = new Option("Vienna ","38");
		towns_list[x++] = new Option("Waterford ","22");
		}

	else	
	//Set the selection to the first element of the list...	
	document.frmMain.town_id.selectedIndex = 0;
}

///////////////
//
// Validate the form fields before submitting
//
//////////////

function valFields() {
	
	if (document.frmMain.area_id.value == 'empty' || document.frmMain.town_id.value == 'empty') {
		alert ("Please select your area and closest town from the lists provided.");
		return;
	}
	
	if (document.frmMain.name.value == '') {
		alert ("Please enter your name.");
		return;
	}
	
	if (document.frmMain.phone.value == '') {
		alert ("Please enter your phone number.");
		return;
	}
	
	if (document.frmMain.address.value == '') {
		alert ("Please enter the street address of your event.");
		return;
	}
	
	if (document.frmMain.citystate.value == '') {
		alert ("Please enter the city and state of your event.");
		return;
	
	}

	if (document.frmMain.zipcode.value == '') {
		alert ("Please enter the zip code of your event.");
		return;
	
	}

	if (document.frmMain.date.value == '') {
		alert ("Please enter the date of your event.");
		return;
	}
	
	if (document.frmMain.num_children.value == '') {
		alert ("Please enter the approximate number of children that will attend your event.");
		return;
	}
	
	if (document.frmMain.age_range.value == '') {
		alert ("Please enter the age range of the children that will attend your event.");
		return;
	}
	
	//Validate the email entered, if any
	var str = document.frmMain.email.value; // email string
  	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
  	if (str && !(!reg1.test(str) && reg2.test(str))) { // if syntax is valid
     alert ("Please enter a valid email address (or leave it blank)");
     return;
	}
	
	//The owner_email value can now be set to the email of the closest owner,
	//and that email will be used to send out the contact form.
	document.frmMain.recipient.value = emails[document.frmMain.town_id.value];
	
	document.frmMain.submit();
}
	
//////////////
//
// Go to the details page for the owner servicing
// the selected town
//
////////////////
function goToDetails() {
	if (document.frmMain.town_id.value == "99") {
		alert ("Since none of the listed towns are close to you, we can't tell which of our owners can best serve your needs.  Please continue to fill out this information form, and we'll have someone get back to you about your party ASAP!");
		return;
	}
	if (document.frmMain.town_id.value && document.frmMain.town_id.value!="empty") {
		url="owners_"+document.frmMain.town_id.value+".html";
		window.location = url;
	} else {
		alert ("Please select an area and a town from the list.");
		return;
	}
}
	
	
		
	
