// Forma avaluoHConstruccion1.jsp


//Función que valida la forma de HCnstruccion página 1
function guardarHConstruccion1() {
/****************************************
*			1. ANTECEDENTES				*
*****************************************/
//Contralor
	if (document.frmHConstruccion1.registroSHF.value=="") {
		alert("La Clave y Registro SHF no puede ser nulo.");
		document.frmHConstruccion1.registroSHF.focus();
		return false;
	}
	if (document.frmHConstruccion1.contralorProfesion.value=="")	{
		alert("La Profesión del Contralor no puede ser nulo.");
		document.frmHConstruccion1.contralorProfesion.focus();
		return false;
	}
	if (document.frmHConstruccion1.contralorCedulaProf.value=="")	{
		alert("La Cédula Profesional del Contralor no puede ser nulo.");
		document.frmHConstruccion1.contralorCedulaProf.focus();
		return false;
	}
	if (document.frmHConstruccion1.contralorPostgrado.value=="")	{
		alert("El Postgrado del Contralor no puede ser nulo.");
		document.frmHConstruccion1.contralorPostgrado.focus();
		return false;
	}
	if (document.frmHConstruccion1.contralorAutorizaSHF.value=="")	{
		alert("La Autorización SHF no puede ser nula.");
		document.frmHConstruccion1.contralorAutorizaSHF.focus();
		return false;
	}
/*	if (document.frmHConstruccion1.contralorRegFiscal.value=="")	{
		alert("El Registro Fiscal del Contralor no puede ser nulo.");
		document.frmHConstruccion1.contralorRegFiscal.focus();
		return false;
	}
*/
//Valuador
	if (document.frmHConstruccion1.valuadorProfesion.value=="")	{
		alert("La Profesión del Valuador no puede ser nulo.");
		document.frmHConstruccion1.valuadorProfesion.focus();
		return false;
	}
	if (document.frmHConstruccion1.valuadorPostgrado.value=="")	{
		alert("El Postgrado del Valuador no puede ser nulo.");
		document.frmHConstruccion1.valuadorPostgrado.focus();
		return false;
	}
//Solicitante
//	if (document.frmHConstruccion1.solicitanteDomicilio.value=="")	{
//		alert("El Domicilio del Solicitante no puede ser nulo.");
//		document.frmHConstruccion1.solicitanteDomicilio.focus();
//		return false;
//	}
	if (document.frmHConstruccion1.solicitanteCalle.value=="")	{
		alert("La Calle del Solicitante no puede ser nulo.");
		document.frmHConstruccion1.solicitanteCalle.focus();
		return false;
	}
	if (document.frmHConstruccion1.solicitanteCodigoPostal.value=="")	{
		alert("El Código Postal del Solicitante no puede ser nulo.");
		document.frmHConstruccion1.solicitanteCodigoPostal.focus();
		return false;
	}
//
/*	if (document.frmHConstruccion1.entidadOtorgaCredito.value=="")	{
		alert("La Entidad que Otorga el Crédito no puede ser nulo.");
		//document.frmHConstruccion1.entidadOtorgaCredito.focus();
		return false;
	}*/
	if (document.frmHConstruccion1.constructor.value=="")	{
		alert("El Constructor no puede ser nulo.");
		document.frmHConstruccion1.constructor.focus();
		return false;
	}
/************************************************************
*			2. INFORMACIÓN GENERAL DEL INMUEBLE				*
*************************************************************/
//Ubicación del inmueble
	if (document.frmHConstruccion1.tipoInmueble.value=="")	{
		alert("El Tipo de Inmueble no puede ser nulo.");
		document.frmHConstruccion1.tipoInmueble.focus();
		return false;
	}
  var valor =	document.frmHConstruccion1.fechaAvaluo.value;
  if ((valor=="")||(valor.length<10)||(!isDate(valor)))
    {
      alert("La Fecha de Avalúo no es válida.");
      document.frmHConstruccion1.fechaAvaluo.focus();
      return false;
    }
	if (document.frmHConstruccion1.inmuebleCalle.value=="")	{
		alert("La Calle del Inmueble no puede ser nula.");
		document.frmHConstruccion1.inmuebleCalle.focus();
		return false;
	}
	/*if (document.frmHConstruccion1.inmuebleNombreConjunto.value=="")	{
		alert("El Nombre del Conjunto no puede ser nulo.");
		document.frmHConstruccion1.inmuebleNombreConjunto.focus();
		return false;
	}*/
	if (document.frmHConstruccion1.inmuebleCodigoPostal.value=="")	{
		alert("El Código Postal del Inmueble no puede ser nulo.");
		document.frmHConstruccion1.inmuebleCodigoPostal.focus();
		return false;
	}
	if (document.frmHConstruccion1.regimenPropiedad.value=="")	{
		alert("El Régimen de Propiedad no puede ser nulo.");
		document.frmHConstruccion1.regimenPropiedad.focus();
		return false;
	}

	if (document.frmHConstruccion1.cuentaPredial.value=="") {
		alert("El Número de Cuenta de Predial no pude ser nulo.");
		document.frmHConstruccion1.cuentaPredial.focus();
		return false;
	}

	if (document.frmHConstruccion1.cuentaPredial.length > 20) {
		alert("El Número de Cuenta de Predial no puede tener una longitud mayor que 20.");
		document.frmHConstruccion1.cuentaPredial.focus();
		return false;
	}
	if (document.frmHConstruccion1.cuentaAgua.value=="") {
		alert("El Número de Cuenta de Agua no pude ser nulo.");
		document.frmHConstruccion1.cuentaAgua.focus();
		return false;
	}

	if (document.frmHConstruccion1.cuentaAgua.length > 20) {
		alert("El Número de Cuenta de Agua no puede tener una longitud mayor que 20.");
		document.frmHConstruccion1.cuentaAgua.focus();
		return false;
	}

/************************************
*			4. ENTORNO				*
*************************************/	
	if (document.frmHConstruccion1.construccionPredominante.value=="") {
		alert("La Construcción Predominante no pude ser nulo.");
		document.frmHConstruccion1.construccionPredominante.focus();
		return false;
	}
	if (document.frmHConstruccion1.indiceSaturacion.value=="") {
		alert("El Índice de Saturación no pude ser nulo.");
		document.frmHConstruccion1.indiceSaturacion.focus();
		return false;
	}
	if (document.frmHConstruccion1.viasAcceso.value=="") {
		alert("Las Vías de Acceso no pude ser nulo.");
		document.frmHConstruccion1.viasAcceso.focus();
		return false;
	}

	var ancho = document.frmHConstruccion1.vialidadAncho.value;
	if (ancho == "") {
		alert("El Ancho de la Vialidad no pude ser nulo.");
		document.frmHConstruccion1.vialidadAncho.focus();
		return false;
	}
	if (isNan(ancho)) {
		alert("El Ancho de la Vialidad debe ser un valor numérico.");
		document.frmHConstruccion1.vialidadAncho.focus();
		return false;
	}
	var infPorc = document.frmHConstruccion1.infraestructuraPorcenaje.value;
	if (infPorc == "") {
		alert("El Porcentaje de la Infraestructura no pude ser nulo.");
		document.frmHConstruccion1.infraestructuraPorcenaje.focus();
		return false;
	}
	if (isNan(infPorc)) {
		alert("El Porcentaje de la Infraestructuradebe ser un valor numérico.");
		document.frmHConstruccion1.infraestructuraPorcenaje.focus();
		return false;
	}

	var transProx = document.frmHConstruccion1.transporteProximidad.value;
	if (isNan(transProx) || transProx.length <= 0) {
		alert("La Proximidad de Transporte no es válida.");
		document.frmHConstruccion1.transporteProximidad.focus();
		return false;
	}
	var iglesiaProx = document.frmHConstruccion1.iglesiaProximidad.value;
	if (isNan(iglesiaProx) || iglesiaProx.length <= 0) {
		alert("La Proximidad de una Iglesia no es válida.");
		document.frmHConstruccion1.iglesiaProximidad.focus();
		return false;
	}
	var escuelaProx = document.frmHConstruccion1.escuelaProximidad.value;
	if (isNan(escuelaProx) || escuelaProx.length <= 0) {
		alert("La Proximidad de una Escuela no es válida.");
		document.frmHConstruccion1.escuelaProximidad.focus();
		return false;
	}
	var mercadoProx = document.frmHConstruccion1.mercadoProximidad.value;
	if (isNan(mercadoProx) || mercadoProx.length <= 0) {
		alert("La Proximidad de un Mercado no es válida.");
		document.frmHConstruccion1.mercadoProximidad.focus();
		return false;
	}
	var hospitalProx = document.frmHConstruccion1.hospitalProximidad.value;
	if (isNan(hospitalProx) || hospitalProx.length <= 0) {
		alert("La Proximidad de un Hospital no es válida.");
		document.frmHConstruccion1.hospitalProximidad.focus();
		return false;
	}
	var plazaProx = document.frmHConstruccion1.plazaPublicaProximidad.value;
	if (isNan(plazaProx) || plazaProx.length <= 0) {
		alert("La Proximidad de una Plaza Publica no es válida.");
		document.frmHConstruccion1.plazaPublicaProximidad.focus();
		return false;
	}
	var bancoProx = document.frmHConstruccion1.bancoProximidad.value;
	if (isNan(bancoProx) || bancoProx.length <= 0) {
		alert("La Proximidad de un Banco no es válida.");
		document.frmHConstruccion1.bancoProximidad.focus();
		return false;
	}
	var parqueProx = document.frmHConstruccion1.parqueProximidad.value;
	if (isNan(parqueProx) || parqueProx.length <= 0) {
		alert("La Proximidad de un Parque no es válida.");
		document.frmHConstruccion1.parqueProximidad.focus();
		return false;
	}
	var ETranspProx = document.frmHConstruccion1.est_transporteProximidad.value;
	if (isNan(ETranspProx) || ETranspProx.length <= 0) {
		alert("La Proximidad de una Estación de Transporte no es válida.");
		document.frmHConstruccion1.est_transporteProximidad.focus();
		return false;
	}
	return true;
 } 


 // Forma avaluoHConstruccion2.jsp

//II. CARACTER&Iacute;STICAS PARTICULARES

//Función que valida la forma de HCnstruccion página 1
function guardarHConstruccion2() {
/****************************************
*			1. TERRENO				*
*****************************************/
//Contralor
	if (document.frmHConstruccion2.topografia.value=="") {
		alert("La Topografía no puede ser nulo.");
		document.frmHConstruccion2.topografia.focus();
		return false;
	}
	if (document.frmHConstruccion2.panoramicas.value=="") {
		alert("La Características Panorámicas no pueden ser nulo.");
		document.frmHConstruccion2.panoramicas.focus();
		return false;
	}
	if (document.frmHConstruccion2.usosuelo.value=="") {
		alert("El Uso de Suelo no puede ser nulo.");
		document.frmHConstruccion2.usosuelo.focus();
		return false;
	}
	if (document.frmHConstruccion2.coeficienteUtilizacion.value=="") {
		alert("El Coeficiente de Utilización no puede ser nulo.");
		document.frmHConstruccion2.coeficienteUtilizacion.focus();
		return false;
	}
/*	if (document.frmHConstruccion2.densidadhabitacional.value=="") {
		alert("La Densidad Habitacional no puede ser nulo.");
		document.frmHConstruccion2.densidadhabitacional.focus();
		return false;
	}
*/
	if (document.frmHConstruccion2.medidaycolindancia.value=="") {
		alert("Las Colindancias no puede ser nulo.");
		document.frmHConstruccion2.medidaycolindancia.focus();
		return false;
	}
	if (document.frmHConstruccion2.usoactual.value=="") {
		alert("El Uso Actual no puede ser nulo.");
		document.frmHConstruccion2.usoactual.focus();
		return false;
	}
	if (document.frmHConstruccion2.calidadProyecto.value=="") {
		alert("La Calidad del Proyecto no puede ser nulo.");
		document.frmHConstruccion2.calidadProyecto.focus();
		return false;
	}
	if (document.frmHConstruccion2.claseInmueble.value=="") {
		alert("La Clase del Inmueble no puede ser nulo.");
		document.frmHConstruccion2.claseInmueble.focus();
		return false;
	}
	if (document.frmHConstruccion2.contruccionApreciado.value=="") {
		alert("El Tipo de Construcción no puede ser nulo.");
		document.frmHConstruccion2.contruccionApreciado.focus();
		return false;
	}
	if (document.frmHConstruccion2.edoConservacion.value=="") {
		alert("El Estado de Conservcación no puede ser nulo.");
		document.frmHConstruccion2.edoConservacion.focus();
		return false;
	}
	if (document.frmHConstruccion2.edadAprox.value=="") {
		alert("La Edad Aproximada no puede ser nulo.");
		document.frmHConstruccion2.edadAprox.focus();
		return false;
	}
	if (document.frmHConstruccion2.vidaUtil.value=="") {
		alert("La Vida Útil no puede ser nulo.");
		document.frmHConstruccion2.vidaUtil.focus();
		return false;
	}
	if (document.frmHConstruccion2.numeroNiveles.value=="") {
		alert("El Número de Niveles no puede ser nulo.");
		document.frmHConstruccion2.numeroNiveles.focus();
		return false;
	}
	if (document.frmHConstruccion2.gradoTerminacion.value=="") {
		alert("El Grado de Terminación no puede ser nulo.");
		document.frmHConstruccion2.gradoTerminacion.focus();
		return false;
	}

	
	return true;
} 
