// Form validation
		
function checkFields() {

	missinginfo = "";

	if (document.contactForm.name.value == "Name*" && document.contactForm.name.value != "") {
	missinginfo += "\n     -  name";
	}
	
	if (document.contactForm.email.value == "Email*" && document.contactForm.email != "") {
	missinginfo += "\n     -  email address";
	}		
	
	if (document.contactForm.telephone.value == "Contact Number*" && document.contactForm.telephone.value != "") {
	missinginfo += "\n     -  contact number";
	}
					
	if (missinginfo != "") {
	missinginfo ="_____________________________\n" +
	"You failed to correctly fill in your:\n" +
	missinginfo + "\n_____________________________" +
	"\nPlease re-enter and submit again!";
					
	alert(missinginfo);
				
return false;
}
else document.contactForm.submit() ;;
}




function getsupport ( selectedtype )
{
  document.contactForm.supporttype.value = selectedtype ;
  checkFields() ;
}






function checkFieldsEmail() {
				
	missinginfo = "";
					
	if (document.contactEmail.email.value == "Email Address") {
	  missinginfo += "\n     -  email";
	}	else if ( test( document.contactEmail.email.value ) == false ) {
	  missinginfo += "\n     -  a valid email";
	}
					
	if (missinginfo != "") {
	missinginfo ="_____________________________\n" +
	
	"You failed to correctly fill in your:\n" +
	
	missinginfo + "\n_____________________________" +
	
	"\nPlease re-enter and submit again!";
					
	alert(missinginfo);
				
return false;
}
else document.contactEmail.submit();
}

// tests if an email address is valid
function test(src) {
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
     return regex.test(src);
  }

				


function getsupport2 ( selectedtype2 )
{
  document.contactEmail.supporttype2.value = selectedtype2 ;
  checkFieldsEmail() ;
}
