// JavaScript Document
function validar(theForm){
	if (!IsInteger(theForm.tiempo_contratacion.value)){
		alert("Seleccione el tiempo de contratación.");
		theForm.tiempo_contratacion.focus();
		return (false);
	}
	
	if (theForm.tiempo_contratacion.value == ""){
		alert("Seleccione el tiempo de contratación.");
		theForm.tiempo_contratacion.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.plataforma1.value) || theForm.plataforma1.value > 20){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.plataforma1.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.plataforma2.value) || theForm.plataforma2.value > 6){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.plataforma2.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.plataforma3.value) || theForm.plataforma3.value > 16){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.plataforma3.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.plataforma4.value) || theForm.plataforma4.value > 31){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.plataforma4.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.plataforma5.value) || theForm.plataforma5.value > 4){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.plataforma5.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.plataforma6.value) || theForm.plataforma6.value > 6){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.plataforma6.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.plataforma7.value) || theForm.plataforma7.value > 9){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.plataforma7.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.plataforma8.value)){
		alert("El ancho del muro seleccionado no es válido.");
		theForm.plataforma8.focus();
		return (false);
	}
	
	if (theForm.plataforma8.value != "" && theForm.plataforma8.value < 6){
		alert("El ancho del muro seleccionado debe ser mayor a 6 metros.");
		theForm.plataforma8.focus();
		return (false);
	}
	
	if (theForm.plataforma8.value > 250){
		alert("El ancho del muro seleccionado debe ser menor a 250 metros.");
		theForm.plataforma8.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.boleteria1.value) || theForm.boleteria1.value > 38){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.boleteria1.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.boleteria2.value) || theForm.boleteria2.value > 8){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.boleteria2.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.boleteria3.value) || theForm.boleteria3.value > 2){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.boleteria3.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.boleteria4.value) || theForm.boleteria4.value > 2){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.boleteria4.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.boleteria5.value) || theForm.boleteria5.value > 4){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.boleteria5.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.boleteria6.value) || theForm.boleteria6.value > 4){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.boleteria6.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.boleteria7.value) || theForm.boleteria7.value > 3){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.boleteria7.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.patio1.value) || theForm.patio1.value > 2){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.patio1.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.patio2.value) || theForm.patio2.value > 5){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.patio2.focus();
		return (false);
	}
	
	if (!IsInteger(theForm.patio3.value) || theForm.patio3.value > 5){
		alert("Las cantidad de unidades seleccionadas no es válida.");
		theForm.patio3.focus();
		return (false);
	}
	
	return (true);
}
