function resetStateText(theForm) { theForm.state.value = ''; if (theForm.zone_id.options.length > 0) { theForm.state.value = '-- Select Above --'; } } function resetZoneSelected(theForm) { theForm.zone_id.selectedIndex = '0'; if (theForm.zone_id.options.length > 0) { theForm.state.value = '-- Select Above --'; } } function update_zone(theForm) { var NumState = theForm.zone_id.options.length; while(NumState > 0) { NumState--; theForm.zone_id.options[NumState] = null; } var SelectedCountry = ""; SelectedCountry = theForm.country.options[theForm.country.selectedIndex].value; if (SelectedCountry == "38") { theForm.zone_id.options[0] = new Option("Please Select", ""); theForm.zone_id.options[1] = new Option("Alberta", "66"); theForm.zone_id.options[2] = new Option("British Columbia", "67"); theForm.zone_id.options[3] = new Option("Manitoba", "68"); theForm.zone_id.options[4] = new Option("New Brunswick", "70"); theForm.zone_id.options[5] = new Option("Newfoundland", "69"); theForm.zone_id.options[6] = new Option("Northwest Territories", "72"); theForm.zone_id.options[7] = new Option("Nova Scotia", "71"); theForm.zone_id.options[8] = new Option("Nunavut", "73"); theForm.zone_id.options[9] = new Option("Ontario", "74"); theForm.zone_id.options[10] = new Option("Prince Edward Island", "75"); theForm.zone_id.options[11] = new Option("Quebec", "76"); theForm.zone_id.options[12] = new Option("Saskatchewan", "77"); theForm.zone_id.options[13] = new Option("Yukon Territory", "78"); } else if (SelectedCountry == "223") { theForm.zone_id.options[0] = new Option("Please Select", ""); theForm.zone_id.options[1] = new Option("Alabama", "1"); theForm.zone_id.options[2] = new Option("Alaska", "2"); theForm.zone_id.options[3] = new Option("Arizona", "4"); theForm.zone_id.options[4] = new Option("Arkansas", "5"); theForm.zone_id.options[5] = new Option("California", "12"); theForm.zone_id.options[6] = new Option("Colorado", "13"); theForm.zone_id.options[7] = new Option("Connecticut", "14"); theForm.zone_id.options[8] = new Option("Delaware", "15"); theForm.zone_id.options[9] = new Option("Florida", "18"); theForm.zone_id.options[10] = new Option("Georgia", "19"); theForm.zone_id.options[11] = new Option("Guam", "20"); theForm.zone_id.options[12] = new Option("Hawaii", "21"); theForm.zone_id.options[13] = new Option("Idaho", "22"); theForm.zone_id.options[14] = new Option("Illinois", "23"); theForm.zone_id.options[15] = new Option("Indiana", "24"); theForm.zone_id.options[16] = new Option("Iowa", "25"); theForm.zone_id.options[17] = new Option("Kansas", "26"); theForm.zone_id.options[18] = new Option("Kentucky", "27"); theForm.zone_id.options[19] = new Option("Louisiana", "28"); theForm.zone_id.options[20] = new Option("Maine", "29"); theForm.zone_id.options[21] = new Option("Marina Islands", "30"); theForm.zone_id.options[22] = new Option("Maryland", "31"); theForm.zone_id.options[23] = new Option("Massachusetts", "32"); theForm.zone_id.options[24] = new Option("Michigan", "33"); theForm.zone_id.options[25] = new Option("Minnesota", "34"); theForm.zone_id.options[26] = new Option("Mississippi", "35"); theForm.zone_id.options[27] = new Option("Missouri", "36"); theForm.zone_id.options[28] = new Option("Montana", "37"); theForm.zone_id.options[29] = new Option("Nebraska", "38"); theForm.zone_id.options[30] = new Option("Nevada", "39"); theForm.zone_id.options[31] = new Option("New Hampshire", "40"); theForm.zone_id.options[32] = new Option("New Jersey", "41"); theForm.zone_id.options[33] = new Option("New Mexico", "42"); theForm.zone_id.options[34] = new Option("New York", "43"); theForm.zone_id.options[35] = new Option("North Carolina", "44"); theForm.zone_id.options[36] = new Option("North Dakota", "45"); theForm.zone_id.options[37] = new Option("Ohio", "47"); theForm.zone_id.options[38] = new Option("Oklahoma", "48"); theForm.zone_id.options[39] = new Option("Oregon", "49"); theForm.zone_id.options[40] = new Option("Pennsylvania", "51"); theForm.zone_id.options[41] = new Option("Puerto Rico", "52"); theForm.zone_id.options[42] = new Option("Rhode Island", "53"); theForm.zone_id.options[43] = new Option("South Carolina", "54"); theForm.zone_id.options[44] = new Option("South Dakota", "55"); theForm.zone_id.options[45] = new Option("Tenessee", "56"); theForm.zone_id.options[46] = new Option("Texas", "57"); theForm.zone_id.options[47] = new Option("Utah", "58"); theForm.zone_id.options[48] = new Option("Vermont", "59"); theForm.zone_id.options[49] = new Option("Virgin Islands", "60"); theForm.zone_id.options[50] = new Option("Virginia", "61"); theForm.zone_id.options[51] = new Option("Washington", "62"); theForm.zone_id.options[52] = new Option("Washington DC", "79"); theForm.zone_id.options[53] = new Option("West Virginia", "63"); theForm.zone_id.options[54] = new Option("Wisconsin", "64"); theForm.zone_id.options[55] = new Option("Wyoming", "65"); } resetStateText(theForm); } function checkRegisterForm(theForm) { var error = 0; var error_message = "Errors have occured during the process of your form!\nPlease make the following corrections:\n\n"; var first_name = theForm.firstname.value; var last_name = theForm.lastname.value; var email_address = theForm.email_address.value; var street_address = theForm.street_address.value; var password = theForm.password.value; var confirmation = theForm.confirmation.value; var postcode = theForm.postcode.value; var city = theForm.city.value; if (first_name == "" || first_name.length < 3) { error_message = error_message + "* The 'First Name' entry must have atleast 3 characters.\n"; error = 1; } if (last_name == "" || last_name.length < 3) { error_message = error_message + "* The 'Last Name' entry must have atleast 3 characters.\n"; error = 1; } if (email_address == "" || email_address.length < 6) { error_message = error_message + "* The 'E-Mail Address' entry must have at least 6 characters.\n"; error = 1; } if (street_address == "" || street_address.length < 0) { error_message = error_message + "* The 'Street Address' entry must have at least 0 characters.\n"; error = 1; } if ((password != confirmation) || (password == "" || password.length < 5)) { error_message = error_message + "* The 'Password' and 'Confirmation' entries must match and have atleast 5 characters.\n"; error = 1; } if (postcode == "" || postcode.length < 6) { error_message = error_message + "* The 'Postal \/ Zip Code' entry must have at least 6 characters.\n"; error = 1; } if (city == "" || city.length < 4) { error_message = error_message + "* The 'City' entry must have atleast 4 characters.\n"; error = 1; } if (error == 1) { alert(error_message); return false; } else { return true; } }