DAWGS = new function DAWGSi() {

  var self = this;

  var current_image = 0;
  var images = [
    "/images/photos/tables.jpg",
    "/images/photos/wrigleyseat.jpg",
    "/images/photos/longshot.jpg",
    "/images/photos/wall.jpg",
    "/images/photos/outside.jpg",
    "/images/photos/bluejayseat.jpg",
    "/images/photos/nyerfries.jpg",
    "/images/photos/dodgertruck.jpg",
    "/images/photos/desserts.jpg",
    "/images/photos/pastrami.jpg",
    "/images/photos/redwall.jpg",
    "/images/photos/angelseat.jpg",
    "/images/photos/twinkiedog.jpg",
    "/images/photos/seating.jpg",
    "/images/photos/inthehaze.jpg",
    "/images/photos/bldg.jpg", 
    "/images/photos/twinkie.jpg",
    "/images/photos/yankeetable.jpg",   
    "/images/photos/backlogo.jpg",
    "/images/photos/bobbyd.jpg"
  ];

  this.init = function() {
    self.welcome();
    self.updateTwitter();
  };

  this.welcome = function() {
    $(".box").hide();
    $("#box_welcome").show();
  };

  this.photos = function() {
    $(".box").hide();
    $("#box_photos").show();
    $("#photo").attr("src", images[current_image]);
    $("#photo_prev").click(function() { DAWGS.photo_prev(); });
    $("#photo_next").click(function() { DAWGS.photo_next(); });
  };

  this.photo_next = function() {
    if (++current_image > images.length - 1) current_image = 0;
    $("#photo").attr("src", images[current_image]);
  };

  this.photo_prev = function() {
    if (--current_image < 0) current_image = images.length - 1;
    $("#photo").attr("src", images[current_image]);
  };

  this.menu = function() {
    $(".box").hide();
    $("#box_menu").show();
  };

  this.mapLoad = function() {
    var latlng = new google.maps.LatLng(34.1503507, -118.4451653);
    var myOptions = {
      zoom: 15,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.HYBRID
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    var marker = new google.maps.Marker({
      position: latlng, 
      map: map, 
      title: "The Infield Hotdogs"
    });   
  };

  this.updateTwitter = function() {
    getTwitters('tweets', { 
      id: 'theinfield', 
      count: 20, 
      enableLinks: true, 
      ignoreReplies: true, 
      clearContents: true,
      template: '"%text%" <a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a>'
});
  };

};

$(document).ready(function() {

  $("#menu_welcome").click(function() { DAWGS.welcome(); });
  $("#menu_photos").click(function() { DAWGS.photos(); });
  $("#menu_menu").click(function() { DAWGS.menu(); });

  DAWGS.init();
  DAWGS.mapLoad();

});