        //______________________________
        //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 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;
			}
      		}
 

    		return true;

	} 

         



        function checkForm6() {
	   	    
		var firstname = document.join.firstname.value;
		if(firstname <= 0)	{
			alert("Please enter your name");
			document.join.firstname.focus();
			return false;
		}
 
		var phone = document.join.phone.value;
		if(phone <= 0)	{
			alert("Please enter your phone");
			document.join.phone.focus();
			return false;
		}
		var email = document.join.email.value;
		if(email <= 0)	{
			alert("Please enter your email");
			document.join.email.focus();
			return false;
		}
    		return true;

	} 


	// End hiding script from old browsers -->
 
