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

var DoneImportAssistant = Class.create({
	initialize: function(accountType){
		this.accountType = accountType;
	},
	
	setup: function() {
		this.doneText = "";
		if("local" == this.accountType) {
			this.doneText = $L("Your data is being transferred to your Palm Profile. This may take up to an hour.");
		} else {
			this.acctType = "";
			if("gmail" == this.accountType) {
				this.acctType = $L("Google");
			} else if("eas" == this.accountType) {
				this.acctType = $L("Exchange");
			}
			this.doneText = $L("Your data is being transferred to your #{accountType} account. This may take up to an hour.").interpolate({
				accountType: this.acctType
			});	
		}
		this.controller.get('doneText').update(this.doneText);
		Mojo.listen(this.controller.get('doneButton'), Mojo.Event.tap, this.closeApp.bindAsEventListener(this));
	},
	
	closeApp: function() {
		this.controller.window.close();
	}
});	