
var albumHelper = {};

albumHelper.playAlbum = function() {
  var playlist = bookletController.buildPlaylist(appData.songs);
  playlist.play();
};

var homeController = new TKController({
  id: 'home',
  actions : [
    { selector: '.menu > .play', action: albumHelper.playAlbum }
  ],
  navigatesTo : [
    { selector: '.menu > .songs', controller: 'songs' },
    { selector: '.menu > .flipbook', controller: 'flipbook' }
  ],
  // make the PLAY button be default highlight
  highlightedElement : '.menu > .play'
});

/* ==================== Animation Management - DidAppear ==================== */

homeController.viewDidAppear = function(){	
	setTimeout(homeController.showTitle, 000);
}

homeController.showTitle = function(){
	var titleImage = document.getElementById('title');
	titleImage.style.opacity = 1;
}

/* ==================== Animation Management - WillDisappear ==================== */

homeController.viewWillDisappear = function () {
	setTimeout(homeController.hideTitle, 0);
}

homeController.hideTitle = function(){
	var titleImage = document.getElementById('title');
	titleImage.style.opacity = 0;
}