 var nav4 = window.Event ? true : false;
 
 function acceptNum(evt){ 
  // NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57 
  var key = nav4 ? evt.which : evt.keyCode; 
  return (key <= 13 || (key >= 48 && key <= 57));
 }
 
//funcion que determina si el email es correcto
function isValidEmail(address) {
	if (address != '' && address.search) {
      if (address.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) return true;
      else return false;
	}
   else return true;
}

function isValidEmailStrict(address) {
	if (isValidEmail(address) == false) return false;
	var domain = address.substring(address.indexOf('@') + 1);
	if (domain.indexOf('.') == -1) return false;
	if (domain.indexOf('.') == 0 || domain.indexOf('.') == domain.length - 1) return false;
	return true;
}

//funcion que determina si el valor es numerico
function isNumeric(string, ignoreWhiteSpace) {
	if (string.search) {
		if ((ignoreWhiteSpace && string.search(/[^\d\s]/) != -1) || (!ignoreWhiteSpace && string.search(/\D/) != -1)) return false;
	}
	return true;
}

//funcion que checkea el formulario
function checkForm() {
		msj = '';
  	mailOK  = isValidEmailStrict(document.getElementById('email').value);
  	

    if(document.getElementById('nombre').value == '') msj+="· Nombre\n";
    if(document.getElementById('email').value == '' || mailOK == 0 ) msj+="· E-Mail\n";
    if(document.getElementById('telefono').value == '') msj+="· Teléfono\n";
    if(document.getElementById('consulta').value == '') msj+="· Consulta\n";
    

    if (msj != '') {
     msj2 = 'Alguno de los siguientes campos está vacío o es incorrecto:\n\n'+msj;
     alert(msj2);
     return;
    }
    else{
    	document.formCont.submit();
    }
	}
