/* Validacion formulario de Consultas y Reclamos ubicado en /dgmn/formulario_consultas.php */

function ValidaReclamos(form)
{
	if (Empty(form.nombres.value))
	{
		alert('Ingrese su Nombre y apellidos.');
		form.nombres.focus();
		return false;
	}
			
		
		if (Empty(form.run.value))
	{
		alert('Ingrese su RUN.');
		form.run.focus();
		return false;
	}

	if (!isMail(form.email.value))
	{
		alert('E-mail no Válido.');
		form.email.focus();
		return false;
	}	

	if(form.area_interes.options[form.area_interes.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar el área de su interés');
		form.area_interes.focus();
		return false;
	}  

	if (Empty(form.consultas.value))
	{
		alert('Ingrese su Consulta o Reclamo.');
		form.consultas.focus();
		return false;
	}

	return;
}

/* Validacion formulario ubicado en /quimica/formulario_registro.php */

function ValidaFormularioRegistro(form)
{
	if (Empty(form.razon_social.value))
	{
		alert('Ingrese la razón social.');
		form.razon_social.focus();
		return false;
	}
	if (Empty(form.nombre_comercial.value))
	{
		alert('Ingrese el nombre comercial.');
		form.nombre_comercial.focus();
		return false;
	}
	if (Empty(form.rut.value))
	{
		alert('Ingrese RUT.');
		form.rut.focus();
		return false;
	}
	if (Empty(form.direccion.value))
	{
		alert('Ingrese Dirección.');
		form.direccion.focus();
		return false;
	}
	if (Empty(form.numero.value))
	{
		alert('Ingrese Numero de su direccion.');
		form.numero.focus();
		return false;
	}
	if(form.region.options[form.region.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.region.focus();
		return false;
	}
	if(form.provincia.options[form.provincia.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.provincia.focus();
		return false;
	}  
	if(form.comuna.options[form.comuna.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.comuna.focus();
		return false;
	}  
	if (Empty(form.direccion_plantas.value))
	{
		alert('Ingrese su direccion.');
		form.direccion_plantas.focus();
		return false;
	}
	if (Empty(form.numero_plantas.value))
	{
		alert('Ingrese el numero de su direccion.');
		form.numero_plantas.focus();
		return false;
	}
	if(form.region_plantas.options[form.region_plantas.selectedIndex].value == "VALUE")
		{	
			alert('Ingrese su Región.');
			form.region_plantas.focus();
			return false;
		}
	if(form.provincia_plantas.options[form.provincia_plantas.selectedIndex].value == "VALUE")
		{	
			alert('Ingrese su Provincia.');
			form.provincia_plantas.focus();
			return false;
		}
	if(form.comuna_plantas.options[form.comuna_plantas.selectedIndex].value == "VALUE")
		{	
			alert('Ingrese su Comuna.');
			form.comuna_plantas.focus();
			return false;
		}
	if (Empty(form.telefono_plantas.value))
	{
		alert('Ingrese un telefono.');
		form.telefono_plantas.focus();
		return false;
	}
	if (Empty(form.fax_plantas.value))
	{
		alert('Ingrese el fax.');
		form.fax_plantas.focus();
		return false;
	}
	if (!isMail(form.email.value))
	{
		alert('E-mail no Válido, ingreselo denuevo por favor.');
		form.email.focus();
		return false;
	}
	if (Empty(form.nombres_apellidos.value))
	{
		alert('Ingrese sus nombres y apellidos.');
		form.nombres_apellidos.focus();
		return false;
	}
	if (Empty(form.cargo.value))
	{
		alert('Ingrese su Cargo.');
		form.cargo.focus();
		return false;
	}
	if (Empty(form.run_rep_legal.value))
	{
		alert('Ingrese RUN.');
		form.run_rep_legal.focus();
		return false;
	}
	if (Empty(form.nombre_importador.value))
	{
		alert('Ingrese nombre del Importador.');
		form.nombre_importador.focus();
		return false;
	}

/* Valida anexo del formulario de registro */

	if (Empty(form.anexo_lista.value))
	{
		alert('Ingrese Lista.');
		form.anexo_lista.focus();
		return false;
	}
	if (Empty(form.anexo_nombre_comun.value))
	{
		alert('Ingrese Nombre Comun.');
		form.anexo_nombre_comun.focus();
		return false;
	}
	if (Empty(form.anexo_nomenclatura.value))
	{
		alert('Ingrese Nomenclatura.');
		form.anexo_nomenclatura.focus();
		return false;
	}
	if (Empty(form.anexo_registro_cas.value))
	{
		alert('Ingrese Nº Registro CAS.');
		form.anexo_registro_cas.focus();
		return false;
	}
	if (Empty(form.anexo_cantidad.value))
	{
		alert('Ingrese Cantidad.');
		form.anexo_cantidad.focus();
		return false;
	}

	if (Empty(form.anexo_direccion.value))
	{
		alert('Ingrese Direccion.');
		form.anexo_direccion.focus();
		return false;
		
	}
	if (Empty(form.anexo_numero.value))
	{
		alert('Ingrese el numero de su Direccion.');
		form.anexo_numero.focus();
		return false;
	}

if (Empty(form.anexo_coordenadas.value))
	{
		alert('Ingrese las coordenadas.');
		form.anexo_coordenadas.focus();
		return false;
	}
	if (Empty(form.anexo_fono1.value))
	{
		alert('Ingrese un teléfono.');
		form.anexo_fono1.focus();
		return false;
	}
	if (Empty(form.anexo_fax1.value))
	{
		alert('Ingrese un Fax.');
		form.anexo_fax1.focus();
		return false;
	}
	if (!isMail(form.anexo_email.value))
	{
		alert('E-mail no Válido, ingreselo denuevo por favor.');
		form.anexo_email.focus();
		return false;
	} 
	return;
}
/*------- Solicitud para Importar e Internar --------- */
function ValidaFormularioImportar(form)
{
	if (Empty(form.nombre_comun.value))
	{
		alert('Ingrese Nombre Comun.');
		form.nombre_comun.focus();
		return false;
	}
	if (Empty(form.nomenclatura_iupac.value))
	{
		alert('Ingrese la Nomenclaruta.');
		form.nomenclatura_iupac.focus();
		return false;
	}
	if (Empty(form.nro_registro_cas.value))
	{
		alert('Ingrese numero de registro.');
		form.nro_registro_cas.focus();
		return false;
	}
	if (Empty(form.cod_arancel.value))
	{
		alert('Ingrese codigo de arancel.');
		form.cod_arancel.focus();
		return false;
	}
	if (Empty(form.cantidad_peso.value))
	{
		alert('Ingrese Cantidad en peso');
		form.cantidad_peso.focus();
		return false;
	}
	if (Empty(form.concentracion.value))
	{
		alert('Ingrese porcentaje.');
		form.concentracion.focus();
		return false;
	}
	/*if (Empty(form.ciudad.value))
	{
		alert('Ingrese Ciudad.');
		form.ciudad.focus();
		return false;
	}*/
	if (Empty(form.fecha_importacion.value))
	{
		alert('Ingrese Fecha de importacion.');
		form.fecha_importacion.focus();
		return false;
		
	}
	/*if (Empty(form.medios_transporte.value))
	{
		alert('Seleccione el medio de transporte.');
		form.medios_transporte.focus();
		return false;
	}*/
	if (Empty(form.pais_origen_importacion.value))
	{
		alert('Ingrese el país de origen.');
		form.pais_origen_importacion.focus();
		return false;
	}
	if (Empty(form.pais_adquisicion_importacion.value))
	{
		alert('Ingrese el país de origen.');
		form.pais_adquisicion_importacion.focus();
		return false;
	}
	if (Empty(form.nombre_remitente_importacion.value))
	{
		alert('Ingrese nombre de remitente.');
		form.nombre_remitente_importacion.focus();
		return false;
	}
	if (Empty(form.direccion_importacion.value))
	{
		alert('Ingrese dirección.');
		form.direccion_importacion.focus();
		return false;
	}
	if (Empty(form.ciudad_importacion.value))
	{
		alert('Ingrese ciudad de importacion.');
		form.ciudad_importacion.focus();
		return false;
	}
	if (Empty(form.telefono_importacion.value))
	{
		alert('Ingrese telefono.');
		form.telefono_importacion.focus();
		return false;
	}
	if (Empty(form.fax_importacion.value))
	{
		alert('Ingrese fax.');
		form.fax_importacion.focus();
		return false;
	}
	if (!isMail(form.email_importacion.value))
	{
		alert('E-mail no Válido, ingreselo denuevo por favor.');
		form.email_importacion.focus();
		return false;
	}
	if (Empty(form.aduana_ingreso_importacion.value))
	{
		alert('Ingrese aduana de ingreso.');
		form.aduana_ingreso_importacion.focus();
		return false;
	}
	if (Empty(form.razon_social_importador.value))
	{
		alert('Ingrese razón social del importador.');
		form.razon_social_importador.focus();
		return false;
	}
	if (Empty(form.rut_importador.value))
	{
		alert('Ingrese RUT del importador.');
		form.rut_importador.focus();
		return false;
	}
	if(form.region_importador.options[form.region_importador.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.region_importador.focus();
		return false;
	}
	if(form.provincia_importador.options[form.provincia_importador.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.provincia_importador.focus();
		return false;
	}
	if(form.comuna_importador.options[form.comuna_importador.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.comuna_importador.focus();
		return false;
	}
	if (Empty(form.fax_importador.value))
	{
		alert('Ingrese Fax del importador.');
		form.fax_importador.focus();
		return false;
	}
	if (!isMail(form.email_importador.value))
	{
		alert('E-mail no Válido, ingreselo denuevo por favor.');
		form.email_importador.focus();
		return false;
	}	
	
	return;
}
/*------- Solicitud para Exportar y Expedir --------- */
function ValidaFormularioExportar(form)
{
	if (Empty(form.nombre_comun.value))
	{
		alert('Ingrese Nombre Comun.');
		form.nombre_comun.focus();
		return false;
	}
	if (Empty(form.nomenclatura.value))
	{
		alert('Ingrese la Nomenclaruta.');
		form.nomenclatura.focus();
		return false;
	}
	if (Empty(form.nro_cas.value))
	{
		alert('Ingrese numero de registro.');
		form.nro_cas.focus();
		return false;
	}
	if (Empty(form.cod_arancel_aduanero.value))
	{
		alert('Ingrese codigo de arancel.');
		form.cod_arancel_aduanero.focus();
		return false;
	}
	if (Empty(form.cantidad_peso.value))
	{
		alert('Ingrese Cantidad en peso');
		form.cantidad_peso.focus();
		return false;
	}
	if (Empty(form.concentracion.value))
	{
		alert('Ingrese porcentaje.');
		form.concentracion.focus();
		return false;
	}

	if (Empty(form.pais_destino.value))
	{
		alert('Ingrese Pais de destino.');
		form.pais_destino.focus();
		return false;
	}
	if (Empty(form.nombre_empresa.value))
	{
		alert('Ingrese Nombre de empresa.');
		form.nombre_empresa.focus();
		return false;
	}
	if (Empty(form.direccion_destinatario.value))
	{
		alert('Ingrese Dirección destinatario.');
		form.direccion_destinatario.focus();
		return false;
	}
	if (Empty(form.pais_destinatario.value))
	{
		alert('Ingrese Pais destinatario.');
		form.pais_destinatario.focus();
		return false;
	}
	if (Empty(form.ciudad_destinatario.value))
	{
		alert('Ingrese Ciudad destinatario.');
		form.ciudad_destinatario.focus();
		return false;
	}
	if (Empty(form.telefono_destinatario.value))
	{
		alert('Ingrese Teléfono destinatario.');
		form.telefono_destinatario.focus();
		return false;
	}
	if (Empty(form.fax_destinatario.value))
	{
		alert('Ingrese Fax destinatario.');
		form.fax_destinatario.focus();
		return false;
	}
	if (!isMail(form.email.value))
	{
		alert('Ingrese Email destinatario.');
		form.email.focus();
		return false;
	}
	if (Empty(form.aduana_salida.value))
	{
		alert('Ingrese Aduana de salida.');
		form.aduana_salida.focus();
		return false;
	}	
	if (Empty(form.razon_social.value))
	{
		alert('Ingrese Razón Social.');
		form.razon_social.focus();
		return false;
	}	
	if (Empty(form.rut_exportador.value))
	{
		alert('Ingrese RUT.');
		form.rut_exportador.focus();
		return false;
	}	
	if (Empty(form.telefono_exportador.value))
	{
		alert('Ingrese Teléfono.');
		form.telefono_exportador.focus();
		return false;
	}	
	if (Empty(form.nro_registro_an.value))
	{
		alert('Ingrese Numero de registro A.N.');
		form.nro_registro_an.focus();
		return false;
	}	
	if (Empty(form.direccion_exportador.value))
	{
		alert('Ingrese dirección.');
		form.direccion_exportador.focus();
		return false;
	}	
	if(form.region_exportador.options[form.region_exportador.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.region_exportador.focus();
		return false;
	}
	if(form.provincia_exportador.options[form.provincia_exportador.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.provincia_exportador.focus();
		return false;
	}
	
	if (Empty(form.comuna_exportador.value))
	{
		alert('Ingrese comuna.');
		form.comuna_exportador.focus();
		return false;
	}
	if (Empty(form.fax_exportador.value))
	{
		alert('Ingrese Fax.');
		form.fax_exportador.focus();
		return false;
	}
	if (!isMail(form.email_exportador.value))
	{
		alert('E-mail no Válido, ingreselo denuevo por favor.');
		form.email_exportador.focus();
		return false;
	}

	if (Empty(form.fecha_estimada.value))
	{
		alert('Ingrese la fecha estimada de exportación.');
		form.fecha_estimada.focus();
		return false;
	}
	
	return;
}
/*------- Certificado de Destino --------- */
function ValidaCertificadoDestino(form)
{
	if (Empty(form.nombres.value))
	{
		alert('Ingrese Nombres.');
		form.nombres.focus();
		return false;
	}
	if (Empty(form.apellidos.value))
	{
		alert('Ingrese sus Apellidos.');
		form.apellidos.focus();
		return false;
	}
	if (Empty(form.rut.value))
	{
		alert('Ingrese RUT.');
		form.rut.focus();
		return false;
	}
	if (Empty(form.representante_legal.value))
	{
		alert('Ingrese los datos requeridos.');
		form.representante_legal.focus();
		return false;
	}
	if (Empty(form.numero_registro.value))
	{
		alert('Ingrese el numero de autoridad nacional');
		form.numero_registro.focus();
		return false;
	}
	if (Empty(form.numero_importacion.value))
	{
		alert('Ingrese los datos requeridos.');
		form.numero_importacion.focus();
		return false;
	}
	if (Empty(form.fecha.value))
	{
		alert('Ingrese Fecha.');
		form.fecha.focus();
		return false;
	}
	if (Empty(form.nombre_comun.value))
	{
		alert('Ingrese Nombre Comun.');
		form.nombre_comun.focus();
		return false;
	}
	if (Empty(form.nombre_iupaq.value))
	{
		alert('Ingrese Nombre IUPAQ.');
		form.nombre_iupaq.focus();
		return false;
	}
	if (Empty(form.nro_cas.value))
	{
		alert('Ingrese Nº CAS.');
		form.nro_cas.focus();
		return false;
	}
	if (Empty(form.cantidad.value))
	{
		alert('Ingrese Cantidad.');
		form.cantidad.focus();
		return false;
	}
	/*if (Empty(form.unidades1.value))
	{
		alert('Ingrese Unidad.');
		form.unidades1.focus();
		return false;
	}*/
	if (Empty(form.cod_arancel.value))
	{
		alert('Ingrese Codigo Arancel.');
		form.cod_arancel.focus();
		return false;
	}
	/*if (Empty(form.destino.value))
	{
		alert('Ingrese Destino.');
		form.destino.focus();
		return false;
	}*/
	if(form.uso_propio.options[form.uso_propio.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.uso_propio.focus();
		return false;
	}
	if (Empty(form.cantidad_uso_propio.value))
	{
		alert('Ingrese Cantidad.');
		form.cantidad_uso_propio.focus();
		return false;
	}	
	/*if (Empty(form.unidades2.value))
	{
		alert('Ingrese Unidad.');
		form.unidades2.focus();
		return false;
	}*/	
	if(form.distribucion.options[form.distribucion.selectedIndex].value == "VALUE")
	{
		alert('Debe seleccionar una opción por favor.');
		form.distribucion.focus();
		return false;
	}
	if (Empty(form.cantidad_comercializacion_distribucion.value))
	{
		alert('Ingrese Cantidad.');
		form.cantidad_comercializacion_distribucion.focus();
		return false;
	}	
	/*if (Empty(form.unidades3.value))
	{
		alert('Ingrese Unidad.');
		form.unidades3.focus();
		return false;
	}*/
	
	return;
}