function validateForm(operacion) {	
	
	var oper = operacion;
	
	var counter=0;	
	var expName = /^[a-zA-Z]{3}/;
	var expApe = /^[a-zA-Z]{2,}|^[A-Z][a-z]/;
	var expMail = /^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	var expPhone = /^[0-9-]{7,15}$/;
	
	if (oper == 'contacto')
	{		
		var name = $('#nombre').val();		
		var ape = $('#apellido').val();
		var mail = $('#e-mail').val();		
		var phone = $('#telefono').val();		
		var subject = $('#asunto').val();
		var message = $('#mensaje').val();		
		
		if ( (name.length < 3) || (!expName.test(name)) ) {			
			document.getElementById("nombre").value = "*";
			$('#nombre').focus();
			counter++;
		}		
		
		/*if ( (ape == "") || (!expApe.test(ape)) ) {			
			$('#apellido').html("apellido inv&aacute;lido");
			$('#apellido').focus();
			counter++;
		}*/		
		
		if( (mail == "") || (!expMail.test(mail)) ) {
			document.getElementById("e-mail").value = "*";
			$('#e-mail').focus();
			counter++;
		}		
		
		/*if( (phone == "") || (!expPhone.test(phone)) ) {
			$('#telefono').html("tel&eacute;fono inv&aacute;lido");
			$('#telefono').focus();
			counter++;
		}*/		
		
		if ( message.length < 3 ) {
			$('#mensaje').html("*");			
			$('#mensaje').focus();
			counter++;	
		}		
			
		if ( counter==0 ) {
			$('#output').html("");	
			$('#output').html("Enviando mensaje...");		
			return true;			
		} else {		
			$('#output').html("");	
			$('#output').html("El mensaje no ha sido enviado. Por favor, verifique sus datos.");						
			return false;
		}
	}
	
	if (oper == 'newsletter')
	{			
		var name_news = $('#nombre_news').val();
		var mail_news = $('#e-mail_news').val();
		
		if ( (name_news.length < 3) || (!expName.test(name_news)) || (name_news == "nombre") ) {			
			document.getElementById("nombre_news").value = "*";
			$('#nombre_news').focus();
			counter++;
		}
		if( (mail_news == "") || (!expMail.test(mail_news)) || (name_news == "e-mail_news") ) {
			document.getElementById("e-mail_news").value = "*";
			$('#e-mail_news').focus();
			counter++;
		}
		if ( counter==0 ) {
			$('#output_news').html("");	
			$('#output_news').html("Enviando datos...");		
			return true;			
		} else {		
			$('#output_news').html("");	
			$('#output_news').html("Verifique sus datos.");						
			return false;
		}
	}	
}
