function frm()
{
	return document.formRegistro;
}


function validar()
{	
	bError = false;
	with(frm())
	{
		if(!bError)
		{	
                     


			if(nombres.value == "" && !bError){
				alerta("Debe ingresar su nombre.");
				nombres.focus();
				bError = true;
			}

			
			if(apellido.value == "" && !bError){
				alerta("Debe ingresar su apellido.");
				apellido.focus();
				bError = true;
			}
			
			if(telefonoPrincipal.value == "" && !bError){
				alerta("Debe ingresar su teléfono.");
				telefonoPrincipal.focus();
				bError = true;
			}
			
			if(!bError)
			{
				if(email.value == ""){
					alerta("Debe ingresar su direccion de e-mail.");
					email.focus();
					bError = true;
				}else{
					if(!chekeoMail(email.value)){
						alerta("La dirección de e-mail no es válida.");
						email.focus();
						bError = true;
					}
				}
			}
			
			if(!bError)
			{
			if (!bError && clave.value =="")
				{
					alerta("Debe Ingresar su password.");
					clave.focus();
					bError = true;
				}else{
					if(claveConf.value ==""){
						alerta("Debe Ingresar la confirmación de su password.");
						claveConf.focus();
						bError = true;
					}else{
						if(claveConf.value != clave.value){
							alerta("El password no coincide con la confirmación.");
							clave.focus();
							bError = true;
						}
					}
				}
			}
            
            
			/*if(!bError)
			{
				if(profesional[0].checked == true){
					if(nick.value ==""){
						alerta("Debe Ingresar su nick profesional.");
						nick.focus();
						bError = true;
					}   
				}
			}*/
			
			
			
		}
	}

	return !bError;	
}
