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

var RegisteredemailAssistant = Class.create({
	initialize: function(){
		$('getEmail').observe(Mojo.Event.tap, this.getEmail.bindAsEventListener(this));
		$('login').observe(Mojo.Event.tap, this.login.bindAsEventListener(this));
		FirstUseUtil.addDashboardSmall($('target'));
		saveCurrentState("registeredemail");
	},
	
	setup: function(){
		$('target').addEventListener(Mojo.Event.tap, FirstUseUtil.tapHandler.bindAsEventListener(this));
		// Listen to ## key presses
		this.controller.listen(this.controller.sceneElement, Mojo.Event.keydown, FirstUseUtil.handleKeyPressEvent.bind(this));
	},
	
	handleCommand: function(event) {
		if (event.type == Mojo.Event.back) {
			event.preventDefault();
			event.stopPropagation();
			Mojo.Controller.stageController.pushScene('email');
		}	
	},
	
	getEmail: function(event){
		Mojo.Controller.stageController.pushScene('email');
	},
	
	login: function(event){
		Mojo.Controller.stageController.pushScene('login');
	}
		
}); 



