var total_errors = 0;

function form(theForm){
	
	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	strEmail_1 = inqform.femail.value;

	if(inqform.fname.value == ''){
		var error_id = document.getElementById('name_err');
		error_id.style.visibility = 'visible';
		error_id.style.color = '#CD0202';
		total_errors++;
	}else{
		var error_id = document.getElementById('name_err');
		error_id.style.visibility = 'hidden';
	}
	
 	if ((strEmail_1.search(validRegExp) == -1) || (inqform.femail.value == '')){
		var error_id = document.getElementById('email_err');
		error_id.style.visibility = 'visible';
		error_id.style.color = '#CD0202';
		total_errors++;
	}else{
		var error_id = document.getElementById('email_err');
		error_id.style.visibility = 'hidden';
	}

	if(inqform.comments.value == ''){
		var error_id = document.getElementById('comments_err');
		error_id.style.visibility = 'visible';
		error_id.style.color = '#CD0202';
		total_errors++;
	}else{
		var error_id = document.getElementById('comments_err');
		error_id.style.visibility = 'hidden';
	}
		
	if(total_errors > 0){
		total_errors = 0;
		return false;
	}else{
		return true;
	}
}