<!-- 2008/12/12 (C)Copyright OmniX Web Design(Matthew David Xerri) -->
<!-- Validates the user's input for the contactus form	. -->

// Email - Allows the chracters 0-9A-Za-z@-_.
function email(character) {
	character.value = character.value.replace(/[^0-9A-Za-z@_.-]/,"");
}

// Letter - Allows the characters A-Za-z
function letter(character) {
	character.value = character.value.replace(/[^A-Za-z ]/,"");
}

// Mixed - Allows the characters 0-9A-Za-z
function mixed(character) {
	character.value = character.value.replace(/[^0-9A-Za-z ]/,"");
}

// Number - Allows the characters 0-9
function number(character) {
	character.value = character.value.replace(/[^0-9 ]/,"");
}

function contactus_message() {
	// Restricts the amount of characters to be entered into 'text_message' (no more than 1000 characters or less)
	if(form_contactus.text_message.value.length >= 1000) {			
		alert("Your message exceeds 1000 characters, please resize your message.");
		return false;
	}

	// Checks that all text fields have been completed and do not contain the default values
	if(	form_contactus.text_name.value.length		== 0	||	form_contactus.text_number.value.length 	== 0 	||
		form_contactus.text_email.value.length 		== 0	||	form_contactus.text_service.value.length	== 0	||
		form_contactus.text_message.value.length 	== 0	||	form_contactus.text_key.value.length 		== 0	){
		alert("The form is incomplete, please complete the form before proceeding.");
		return false;
	} else {
		// Displays a confirm message and then yes(true) or no(false) is returned
		var confirm_contactus = confirm("Are you sure you want to send the form?");
		if(confirm_contactus) {
			return true;
		} else {
			return false;
		}
	}
}