// JavaScript Document

<!-- Begin
function taLimit() {
	var taObj=event.srcElement;
	if (taObj.value.length==taObj.maxLength*1) return false;
}
 
function taCount(visCnt) { 
	var taObj=event.srcElement;
	if (taObj.value.length>taObj.maxLength*1) taObj.value=taObj.value.substring(0,taObj.maxLength*1);
	if (visCnt) visCnt.innerText=taObj.maxLength-taObj.value.length;
}
// End -->

function submitCheck() {
if(document.contactus.Name.value=="") {
		alert("You must supply your Name to submit your Inquiry.");
		document.contactus.Name.focus();
		document.contactus.Name.select();
		return false;}

	var test = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' "
		
		// All characters must be digits
		// Check each character in Name to see that it is a digit
		
			for (var index = 0; index < 36; index ++)
			
			{
				if
			(test.indexOf(document.contactus.Name.value.charAt(index))
			< 0) {
					alert("You must supply a valid Name to submit your Inquiry.")
					document.contactus.Name.focus();
					document.contactus.Name.select();
					return false;}  // Something other than a digit found
				 }

if((document.contactus.contactnumber.value.length < 8) || (document.contactus.contactnumber.value.length > 10)) { 
	  		alert("You must supply a valid Phone Number to submit your Inquiry.");
			document.contactus.contactnumber.focus();
			document.contactus.contactnumber.select();
			return false;}		//Incorrect length
		
		var test = "0123456789"
		
		// All characters must be digits
		// Check each character in contact number to see that it is a digit
		
			for (var index = 0; index < 11; index ++)
			
			{
				if
			(test.indexOf(document.contactus.contactnumber.value.charAt(index))
			< 0) {
					alert("The Phone Number must be numeric to submit your Inquiry.")
					document.contactus.contactnumber.focus();
					document.contactus.contactnumber.select();
					return false;}    // Something other than a digit found
					}

if(document.contactus.EmailAddress.value=="") {
alert("You must supply an Email Address to submit your Inquiry."); 
                document.contactus.EmailAddress.focus();
                document.contactus.EmailAddress.select();
                return false;}

if(document.contactus.EmailAddress.value.length > 0) {
var j = new RegExp(); 
        j.compile("@"); 
        if (!j.test(contactus["EmailAddress"].value)) { 
                alert("You must supply a valid Email Address to submit your Inquiry."); 
                document.contactus.EmailAddress.focus();
                document.contactus.EmailAddress.select();
                return false;}
	} 
	
if (document.contactus.StreetAddress.value=="") {
		alert("You must supply your Address to submit your Inquiry.");
		document.contactus.StreetAddress.focus();
		document.contactus.StreetAddress.select();
		return false;}

if (document.contactus.City.value=="") {
		alert("You must supply your City to submit your Inquiry.");
		document.contactus.City.focus();
		document.contactus.City.select();
		return false;}

	var test = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' "
		
		// All characters must be digits
		// Check each character in Name to see that it is a digit
		
			for (var index = 0; index < 25; index ++)
			
			{
				if
			(test.indexOf(document.contactus.City.value.charAt(index))
			< 0) {
					alert("You must supply a valid City to submit your Inquiry.")
					document.contactus.City.focus();
					document.contactus.City.select();
					return false;
					}   // Something other than a digit found
				 }
if(document.contactus.PostCode.value.length ==4) {
	  	len = 4
		}
		else {
			alert("Postcode must be four digits in length to submit your Inquiry.");
			document.contactus.PostCode.focus();
			document.contactus.PostCode.select();
			return false;}		//Incorrect length
		
		var test = "0123456789"
		
		// All characters must be digits
		// Check each character in PCode to see that it is a digit
		
			for (var index = 0; index < 4; index ++)
			

			{
				if
			(test.indexOf(document.contactus.PostCode.value.charAt(index))
			< 0) {
					alert("Postcode must be numeric to submit your Inquiry.")
					document.contactus.PostCode.focus();
					document.contactus.PostCode.select();
					return false;}
					// Something other than a digit found
				 }
}