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

function AppAssistant(appController) {
  this.appController = appController;
}

AppAssistant.prototype.handleLaunch = function(params){
   
   var datetimeStageController = Mojo.Controller.getAppController().getStageController('dateandtimestage');
	if (datetimeStageController) {
		if (datetimeStageController.topScene() && datetimeStageController.topScene().sceneName == "dateandtimeconfig")
			datetimeStageController.delegateToSceneAssistant('showDateTimePicker',params.launchType);
		else
			datetimeStageController.window.focus(); 
	} else {
		var f = function(stageController) {
			stageController.pushScene('dateandtimeconfig', params);
		}
		Mojo.Controller.getAppController().createStageWithCallback({name: 'dateandtimestage'}, f);		
	}
}


