/*******************************************************************************
 formValidator.js v1.0 - Validacion simple para formularios.
 Copyright (C) 2011, PixelWarrior [division437(at)gmail.com].

 @licstart
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License (GNU GPL) as
 published by the Free Software Foundation, either version 3 of the
 License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 General Public License for more details: <http://www.gnu.org/licenses/>.
 @licend
*******************************************************************************/

function validateContacto() {

if (document.getElementById('nombre').value == "") {
	alert ("Por favor, escribe tu nombre completo.");
	document.getElementById('nombre').focus();
	return false;
	}
	
else if (document.getElementById('nombre').value.indexOf (' ') == -1){
	alert ("Por favor, escribe tu nombre CON APELLIDOS.");
	document.getElementById('nombre').focus();
	return false;
	}

else if (document.getElementById('email').value == ""){
	alert ("Por favor, escribe tu dirección de correo.");
	document.getElementById('email').focus();
	return false;
	}

else if (document.getElementById('email').value.indexOf ('@') == -1){
	alert ("Por favor, escribe una dirección de correo válida.");
	document.getElementById('email').focus();
	return false;
	}

else if (document.getElementById('email').value.indexOf ('.') == -1){
	alert ("Por favor, escribe una dirección de correo válida.");
	document.getElementById('email').focus();
	return false;
	}
	
	return true;
}

