        //______________________________
        //Function for checking number fields for empty and nonnumeric values.
        //______________________________
        function isNum(str)	{
	        for(i=0; i <str.length ; i++)	{
		   if(str.charAt(i) > "9")	{
			return false;
	           }
		if (str.charAt(i) < "0")	{
			return false;
	        }

        	}
		return true;
	}

	function validEmail(email) {
		var invalidChars =" /:,;";

		if (email.length == "") {
			alert("Your email address shouldn't be empty!");
			document.ContactUs.email.focus();
			return false;
		}
   
                for (i=0; i<invalidChars.length; i++) {
			badChar = invalidChars.charAt(i);
			if (email.indexOf(badChar,0) > -1) { 	//it searches invalidChars string
				alert("Your email contains invalid characters!");
				document.ContactUs.email.focus();
				return false;
			}
		}

		var atPos = email.indexOf("@",1);
		if (atPos == -1) {				 //it checks if email contains any @ character.
			alert("Your email address doesn't contain @ character!");
			document.ContactUs.email.focus();
			return false;
		}

		if (email.indexOf("@",atPos+1) > -1) {		//it checks if email contains more than one @ character, if there is gives an error message.
			alert("Your email contains more than one @ character!");
			document.ContactUs.email.focus();
			return false;
		}

		var periodPos = email.indexOf(".",atPos);
		if (periodPos == -1) {				//it checks that there is a period after the @ sign, if not gives an error message.
			alert("Your email doesn't contain dot character after the @ character!");
			document.ContactUs.email.focus();
			return false;
		}

		if (periodPos+3 > email.length) {		//it checks if is there at least two characters after the dot character.
			alert("Your email should contain at least two characters after the dot character.");
			document.ContactUs.email.focus();
			return false;
		}
		return true;
	}
	

        function checkForm1() {
	   	    
		var name = document.ContactUs.name.value;
		if(name <= 0)	{
			alert("Please enter your name");
			document.ContactUs.name.focus();
			return false;
		}


	//	var Lastname = document.ContactUs.lastname.value;
	//	if(Lastname.length <= 0)	{
	//		alert("Please enter your lastname");
	//		document.ContactUs.lastname.focus();
	//		return false;
	//	}
                               

//		var Street = document.ContactUs.street.value;
//	        if(Street.length <= 0)	{
//		        alert("Please enter your street address");
//			document.ContactUs.street.focus();
//			return false;
//		}

//		var Suburb = document.ContactUs.suburb.value;
//		if(Suburb.length <= 0)	{
//			alert("Please enter your suburb");
//	         	document.ContactUs.suburb.focus();
//			return false;
//		}	

//		var State = document.ContactUs.state.value;
//		if(State.length <= 0)	{
//			alert("Please enter a city");
//			document.ContactUs.state.focus();
//			return false;
//		}

//		var SelectInd = document.ContactUs.country.selectedIndex;
//		var SelCountry = document.ContactUs.country.options[SelectInd].text;
		//________________________________________________________________________________________________________________
		//If country is Australia, post code must be 4  digit numbers and not less not more, and a State must be selected.
        	//________________________________________________________________________________________________________________

//		var PostCode = document.ContactUs.postcode.value;
//		if(SelCountry == "Australia")	{
//			if(PostCode.length != 4)	{
//				alert("Postcode must be 4 digit numbers for Australia");
//				document.ContactUs.postcode.focus();
//				return false;
//			}
//			else {
//				if(isNum(PostCode) == false)  {
//					alert("Postcode is not valid for Australia");
//					document.ContactUs.postcode.focus();
//					return false;
//				}
//			}
//		}



 
 
		

		var telephone = document.ContactUs.telephone.value;
            if(telephone.length <= 0)	{
			alert("Please enter your phone number");
			document.ContactUs.telephone.focus();
			return false;
		}
		if(telephone.length <= 7)	{
			alert("Phone must be at least 8 digits");
			document.ContactUs.telephone.focus();
			return false;
		}
		else {
			if(isNum(telephone) == false)  {
				alert("Phone is not numeric");
				document.ContactUs.telephone.focus();
				return false;
			}
      		}




        
//              var Username = document.ContactUs.username.value;
//		if(Username.length <= 0)	{
//			alert("Please enter your username");
//			document.ContactUs.username.focus();
//			return false;
//		}

                                          
//		var Password1 = document.ContactUs.password1.value;
//		if(Password1.length <= 0)	{
//			alert("Please enter your password");
//			document.ContactUs.password1.focus();
//			return false;
//		}


//		var Password2 = document.ContactUs.password2.value;
//		if(Password2.length <= 0)	{
//			alert("Please confirm your password");
//			document.ContactUs.password2.focus();
//			return false;
//		}

//              if(Password1 == Password2)	{
//		}
//		else  {    
//		    alert("Your Password doesn't match");
//		    document.ContactUs.password2.focus();
//			return false;
//        }
         
//		var email = document.ContactUs.email.value;
//		if (validEmail(email) == false) {
//			return false;
//		}

    		return true;

	} 

         
	// End hiding script from old browsers -->
 