function VeiculosModel() {
    "use strict";
    var mSelf = this;

    mSelf.Lista = ko.observableArray([]);
    mSelf.Todos = ko.observableArray([]);
    mSelf.Selected = ko.observable(null);

    mSelf.Show = ko.observable(true);

    mSelf.Visible = ko.observable(false);

    mSelf.ListaVisivel = ko.observable(false);

    mSelf.AddVisivel = ko.observable(false);
    mSelf.EditarVisivel = ko.observable(false);

    mSelf.mostrar = function () {
        mSelf.Visible(true);
        mSelf.ListaVisivel(true);
        mSelf.AddVisivel(false);
        mSelf.EditarVisivel(false);
    };

    mSelf.esconder = function () {
        mSelf.Visible(false);
        mSelf.ListaVisivel(false);
        mSelf.AddVisivel(false);
        mSelf.EditarVisivel(false);
    };

    mSelf.toggleAdicionar = function () {
        var aux = mSelf.AddVisivel();
        mSelf.ListaVisivel(aux);
        mSelf.AddVisivel(!aux);
        ajusteTamanhos();
    };

    mSelf.Add = ko.computed(function () {
        return mSelf.AddVisivel() && !mSelf.ListaVisivel();
    }, mSelf);

    mSelf.Edit = ko.computed(function () {
        return mSelf.Visible() && mSelf.EditarVisivel();
    }, mSelf);

    mSelf.mostrarEditar = function () {
        var aux = mSelf.EditarVisivel();
        mSelf.ListaVisivel(aux);
        mSelf.EditarVisivel(!aux);
        ajusteTamanhos();
    };

    mSelf.remover = function (terminal) {
        mSelf.Lista.remove(terminal);
        terminal.setMap(null);
        mSelf.exibirMapa();
    };

}