Function formulario_onsubmit()
	Dim Bandera, Bandera2, Bandera3, validacion_emailde, validacion_emailpara, clave, clave_conf
	validacion_emailde = 0
	validacion_emailpara = 0	
	Bandera = True
	Bandera2 = True
	Bandera3 = True
	clave=""
	clave_conf=""
	
	for each control in document.formulario
'		if left(control.name,3) = "nn_" and (control.type = "text" or control.type = "password" or control.type = "file") then
		if left(control.name,3) = "nn_" then
			if control.value = "" then
				control.style.backgroundColor="#FFFFCC"
				Bandera = False
			else
				control.style.backgroundColor="#FFFFFF"
			end if
		end if
	next

	for each control in document.formulario
		if left(control.name,8) = "nn_email" then
			arrayemail=split(control.value,";")
			for I = 0 to ubound(arrayemail)
				validacion_email = ValidarEMAIL(arrayemail(I))
				If validacion_email = 0 or validacion_email = 1 then
					control.style.backgroundColor="#FFFFCC"
					Bandera2 = False
				else
					control.style.backgroundColor="#FFFFFF"
				End if
			next
		end if
		if left(control.name,8) = "nn_clave" or left(control.name,5) = "clave" then
			clave = trim(control.value)
		end if
		if left(control.name,13) = "nn_conf_clave" or left(control.name,10) = "conf_clave" then
			clave_conf = trim(control.value)
		end if	
	next
		
	if clave <> clave_conf then
		Bandera3 = False
	else
		if clave <> "" and len(clave) < 4 then
			Bandera3 = False
		end if
	end if		

		
	If Bandera = True then
			If Bandera2 = True then	
					If Bandera3 = True then	
						formulario_onsubmit = True
					else
						MsgBox "Por favor verifique que coincidan la clave y su confirmación,"&chr(13)&"recuerde el tamaño mínimo.", 64, "Mensaje"	
						formulario_onsubmit = False
					end if
			else
				MsgBox "Por favor verifique las direcciones de correo coloreadas.", 64, "Mensaje"	
				formulario_onsubmit = False
			end if		
	else
		MsgBox "Por favor ingrese valores en los campos coloreados.", 64, "Mensaje"
		formulario_onsubmit = False
	End if 
End Function
