//Edit the counter/limiter value as your wish
		
		var count = 0;//counter variable
		
		function counter(num)
		{
			var mooText = document.getElementById("message").value;
			var mooCount = mooText.length;
			
			count = mooCount;	
		}
		
		
		function limiter(event)
		{   
		    
		   counter(1); //call counter function and then increment by 1
			
         
			document.getElementById("count").value = count;// this provides a count for the box next to the submit button
			
			
		
			
			if(count > 500) // 500 is the number of characters allowed
			{
			  var temp = document.getElementById("message").value; //this grabs the value of the text area saves it to a variable temp

			  var temp_replace = temp.substr(0,500,""); //use substr to replace the extra text with blanks

			  document.getElementById("message").value = temp_replace; //now replace the content of the textfield the temp-replace

			}
		}
		
		// If the length of the element's string is 0 then display helper message
		function notEmpty(elem, helperMsg)
		{
			if(elem.value.length == 0)
			{
			alert(helperMsg);
			elem.focus(); // set the focus to this input
			return false;
			}
			return true;
		}
		
		// If the element's string matches the regular expression it is all numbers
		function isNumeric(elem, helperMsg)
		{
			var numericExpression = /^[0-9]+$/;
			if(elem.value.match(numericExpression))
			{
				return true;
			}
			else
			{
				alert(helperMsg);
				elem.focus();
				return false;
			}
		}
		
		// If the element's string matches the regular expression it is all letters
		function isAlphabet(elem, helperMsg)
		{
			var alphaExp = /^[a-zA-Z]+$/;
			if(elem.value.match(alphaExp))
			{
				return true;
			}
			else
			{
			alert(helperMsg);
			elem.focus();
			return false;
			}
		}
		
		// If the element's string matches the regular expression it is numbers and letters
		function isAlphanumeric(elem, helperMsg)
		{
			var alphaExp = /^[0-9a-zA-Z]+$/;
			if(elem.value.match(alphaExp))
			{
				return true;
			}
			else
			{
				alert(helperMsg);
				elem.focus();
				return false;
			}
		}
		
		function lengthRestriction(elem, min, max)
		{
			var uInput = elem.value;
			if(uInput.length >= min && uInput.length <= max)
			{
				return true;
			}
			else
			{
				alert("Please enter between " +min+ " and " +max+ " characters");
				elem.focus();
				return false;
			}
		}
		
		function madeSelection(elem, helperMsg)
		{
			if(elem.value == "Please Choose")
			{
				alert(helperMsg);
				elem.focus();
				return false;
			}
			else
			{
				return true;
			}
		}
		
		function emailValidator(elem, helperMsg)
		{
			var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
			if(elem.value.match(emailExp))
			{
				return true;
			}
			else
			{
				alert(helperMsg);
				elem.focus();
				return false;
			}
		}
		
		function formValidator(){
		// Make quick references to our fields
		var firstname = document.getElementById('firstname');
		var surname = document.getElementById('surname');
		var email = document.getElementById('email');
		var message = document.getElementById('message');
	
		// Check each input in the order that it appears in the form!
		if(isAlphabet(firstname, "First name section: - Please enter only letters for your name"))
		{
			if(isAlphabet(surname, "Surname section: - Please enter only letters"))
			{
				if(emailValidator(email, "Email section: - Please enter a valid email address"))
				{
					if(notEmpty(message,"Message section: - Please enter letters and numbers only"))
					{
						return true;
					}
				}
			}
		}
		return false;
		}
//-->

