		function isEmpty(strng) {
		var error = "";
  			if (strng.length == 0) {
     				error = "A required text area has not been filled in.\n"
  			}
		return error;	  
		}

		function checkPhone (strng) {
		var error = "";

		var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters
    		if (isNaN(parseInt(stripped))) {
       			error = "The phone number contains illegal characters.";
 			}
		return error;
		}

		function checkDropdown(choice) {
		var error = "";
    		if (choice == "") {
    			error = "Please select a country from the drop-down list.\n";
    			}    
		return error;
		}

		function checkform() {
			var why = "";
			var why2 = "";
			why += isEmpty(form1.FirstName.value);
			why += isEmpty(form1.Surname.value);
			why += isEmpty(form1.BusinessEmail.value);
			why += isEmpty(form1.JobTitle.value);
			why += isEmpty(form1.CompanyName.value);
			why += isEmpty(form1.FirstName.value);
			why += isEmpty(form1.Address1.value);
			why += isEmpty(form1.Town.value);
			why += isEmpty(form1.Postcode.value);
			why += isEmpty(form1.CountryCode.value);
			why += isEmpty(form1.AreaCode.value);
			why += isEmpty(form1.LocalNumber.value);
			if (why != "") {
				why = "A required text field is blank!\n";}			
			why2 += checkPhone(form1.CountryCode.value);
			why2 += checkPhone(form1.AreaCode.value);
			why2 += checkPhone(form1.LocalNumber.value);
			if (why2 != ""){
				why +="The phone number contains illegal characters!\n";}  
			why += checkDropdown(form1.country.value);

			if (why != "") {
				alert (why);
				return false;}
			else {
				form1.action = "mailto:ssutherland@merlin360.com?subject=Contact from the Merlin 360 Website"
				document.redirect = "index.html"
				return true;
			}
		}