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

var ResetemailAssistant = Class.create({
	initialize: function(){
		$('next').observe(Mojo.Event.tap,this.enterPassword.bindAsEventListener(this));
		FirstUseUtil.addDashboardSmall($('target'));
	},
	
	setup: function() {	
		
		var data = {
			email: Account.email
		};
		var message = $L("We sent an email to #{email}. If you don't receive the email shortly, check your junk mail folder.").interpolate(data);
		$('resetEmailInfo').innerHTML="<p>"+$L(message)+"</p>";
		$('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) {
		
	},
	
	activate: function() {
		
	},
	
	enterPassword: function() {
		Account.questionId = "-1";
		if(Account.isInvalidToken == true) {
			Mojo.Controller.stageController.pushScene('invalid-token');
			return;
		}
		Mojo.Controller.stageController.pushScene('login');
	}
	
});	
