function goToURL() { //v3.0
	  var i, args=goToURL.arguments; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	}

function validaCorreo(valor) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
    return (true)
  } else {
    return (false);
  }
}

function validarFrm() {  
	if(!document.frm['nombre'].value) 
	{ 
		document.frm['nombre'].focus(); 
		alert('El campo "nombre" es obligatorio.'); 
	}
	
	else if(document.frm['nombre'].value=='Su Nombre') 
	{ 
		document.frm['nombre'].focus(); 
		document.frm['nombre'].select(); 
		alert('Debe indicar su nombre'); 
	}
	
	else if(!document.frm['email'].value) 
	{ 
		document.frm['email'].focus(); 
		alert('El campo "email" es obligatorio.'); 
	}
	
	else if ((document.frm['email'].value > '') && (!validaCorreo(document.frm['email'].value)))
	{
		alert("Debe introducir un correo electrónico correcto.");
		document.frm['email'].focus();
		document.frm['email'].select();
	} 
	
	else if(!document.frm['consulta'].value) 
	{ 
		document.frm['consulta'].focus(); 
		alert('El campo "consulta" es obligatorio.'); 
	}  
	
	else if (document.frm['chkAcepto'].checked == false)
	{
		alert("Debe aceptar el aviso legal.");
		document.frm['chkAcepto'].focus();
	}
	
	else 
	{
	document.frm.submit(); 
	alert ("Su mensaje se ha enviado");
	goToURL('parent','contacto.php?enviar=enviar');
	
	}  
return false;  
}  

