function LimItensVeiculos(objCtrItensVeiculos) {

	this.setId("CtrItensVeiculos");
	this.setIdFormulario("formItensVeiculos");
	this.setLargura(450);
	this.setAltura(250);	
	this.setTitulo("Itens de Manuten&ccedil;&atilde;o");
	
	this.setHtml("departamento/veiculos/cad_itensVeiculos.html");
	this.setIdFoco("idCampoDescricao");
	
	this.setControlador(objCtrItensVeiculos);
	
	//***************
		
	// EVENTOS
	this.pesquisaItensVeiculos = function() {
		this.getControlador().pesquisaItensVeiculos();
	}
	
	this.botaoNovo = function() {
		this.limparMensagem();
		this.limpaHtml();	
	}
	
	this.buscaRapidaTipoItem = function(campoAtual, proximoCampo) {
		this.getControlador().buscaRapidaTipoItem(campoAtual, proximoCampo);
	}
	
	this.buscaTipoItem = function(codigo) {
		this.limparStyle();
		
		if (codigo > 0) {
			this.getControlador().buscaTipoItem(codigo);
		} else {
			this.setCampoCodigoTipoItem("");
			this.setCampoTipoItem("");
		}
	}
	
	this.pesquisaTipoItem = function() {
		this.getControlador().pesquisaTipoItem();
	}
	
	this.eventoBotaoSalvar = function() {
		var codigo = this.getCampoCodigoItemVeiculo();
		
		if (this.verificaCamposObrigatorios()) {
			if (codigo > 0){
				this.getControlador().altera(codigo);
			} else {
				this.getControlador().salvaItemVeiculo();
			}
		}
	}
	
	// METODOS
	this.limpaHtml = function() {
		$(this.getIdFormulario()).reset();
	} 
	
	
	
	
	// GETS E SETS
	this.getCampoCodigoItemVeiculo = function() {
		return $(this.getIdFormulario()).idCampoCodigoItemVeiculo.value;
	}
	
	this.setCampoCodigoItemVeiculo = function(valor) {
		$(this.getIdFormulario()).idCampoCodigoItemVeiculo.value = valor;
	}

	this.getRadioSituacao = function() {
		return ($(this.getIdFormulario()).ativoRadio[0].checked == true) ? true : false;
	}
	
	this.setRadioSituacao = function(valor) {
		if (valor == true) {
			$(this.getIdFormulario()).ativoRadio[0].checked = true;
		} else {
			$(this.getIdFormulario()).ativoRadio[1].checked = true;
		}
	}

	this.getCampoDescricao = function() {
		return $(this.getIdFormulario()).idCampoDescricao.value;
	}
	
	this.setCampoDescricao = function(valor) {
		$(this.getIdFormulario()).idCampoDescricao.value = valor;
	}

	this.getCampoCodigoTipoItem = function() {
		return $(this.getIdFormulario()).idCampoCodigoTipoItem.value;
	}
	
	this.setCampoCodigoTipoItem = function(valor) {
		$(this.getIdFormulario()).idCampoCodigoTipoItem.value = valor;
	}

	this.getCampoTipoItem = function() {
		return $(this.getIdFormulario()).idCampoTipoItem.value;
	}
	
	this.setCampoTipoItem = function(valor) {
		$(this.getIdFormulario()).idCampoTipoItem.value = valor;
	}
	
	this.posCarregamento = function() {
		this.colocaFoco();
		this.getControlador().inicializa();
	}
}
LimItensVeiculos.prototype = new Limite;