/*
 * Application Router
 *
 */

Fullers.Routers.App = Backbone.Router.extend({

  //These are the default routes/urls for this application

  routes: { 
    "" : "index",
    "/index" : "index",
    "/map" : "map",
    "/single/:id": "map_detail",
    "/maplist": "map_list",
    "/postcode/:query" : "postcode_search",
    "/detail/:id" : "detail",
    "/attractions" : "attractions",
    "/pubs" : "pubs",
    "/directions/:dest" : "directions",
  },

  index: function() {
    new Fullers.Views.Index();
  },

  map: function(){
	  new Fullers.Views.Map();
  },

  map_list: function(){
    new Fullers.Views.MapList();
  },

  map_detail: function(id){ //I am a bit rushed. This is stupid logic duplication
    new Fullers.Views.Single(id);  
  },

  directions: function(dest){
    new Fullers.Views.Directions(dest);
  },

  postcode_search: function(query){
    new Fullers.Views.Map(query);
  },

  detail: function(id){ 
    //Accepts an ID which comes from the URL i.e /detail/32
    new Fullers.Views.Detail(id);
  },

  pubs: function(){
    new Fullers.Views.Pubs; 
  },

  attractions: function(){
    new Fullers.Views.Attractions;  
  }

});
