var  requestAnBrochureValidator = function(){
	
	var regularExpression = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	
	var validateForm = function(){
		
		var isValid = true;
		
		var nameField = document.getElementById('name');
		var nameError = document.getElementById('nameError')
		if(nameField.value == '')		 
		{
			nameError.style.display = 'inline';
			nameField.className = 'text error';
			isValid = false;
		}
		else{
			nameError.style.display = 'none';
			nameField.className = 'text';
		}
		
		var emailField = document.getElementById('email'); 
		var emailError = document.getElementById('emailError');
		if( !regularExpression.test(emailField.value) )
		{
            emailError.style.display = 'inline';
            emailField.className = 'text error';
			isValid = false;
		}
		else{
			emailError.style.display = 'none';
            emailField.className = 'text';
		}
		
		return isValid;
	}
	
	return {
		init: function(config){		
		},
		
		isValidForm: function(){
			return validateForm();
		}
	}
}
();
