/* Copyright 2009 Palm, Inc.  All rights reserved. */

// Enable the AutoBinder to run automatically for each new scene.
Foundations.Mojo.Scenes.AutoBinder.autoRun();

var AppAssistant = Class.create
({
	initialize: function(appController)
	{
		this.data = { model: new NotesModel() };
	},

    handleLaunch: function(params)
    {
		var name = 'notes';
		var stageController = this.controller.getStageController(name);
		if (stageController) 
		{
			this.launch(false, stageController);
		}
		else
		{
			Mojo.Controller.appController.createStageWithCallback(
			{
				lightweight: true,
				name: name
			}, this.launch.bind(this, true));
		}
    },

	launch: function(created, stageController)
	{
		if (!created) 
		{
			stageController.activate();
		}
		else 
		{
			stageController.pushScene('grid', this.data);
		}
	}
});

function StageAssistant()
{
}
