var app = app || {};
app.SearchView = Backbone.View.extend({
    tagName: "tr",
    className: "search",

    events: {
        "tap": "navigateTo"
    },

    navigateTo: function () {
        if (this.model.get("searchType") == 0) {
            window.location.href = "/team-detail.html?teamId=" + this.model.get("id");
        }else if (this.model.get("searchType") == 2) {
            window.location.href = "/standings.html?leagueId=" + this.model.get("id") + "&groupId=" + this.model.get("groupId");
        }
    },
    
    render: function () {
        var template = Handlebars.templates.search;
        this.$el.html(template(this.model.toJSON()));
        return this;
    }
});