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

var PasswordchangedAssistant = Class.create({
    initialize: function(params){
    	this.accountId = params.accountId;
		this.accountName = params.accountDisplayName;
		this.iconClass = params.iconClass;
		this.login = params.login;
    },
    setup: function(){
        var renderedInfo = Mojo.View.render({
            object: this,
            template: 'passwordchanged/password-info'
        })
        // Insert the HTML into the DOM, replacing the existing content.
        this.controller.get('message_info').update(renderedInfo);
        this.controller.listen("message_info", Mojo.Event.tap, this.launchPasswordEditor.bind(this));
    },
	
	launchPasswordEditor:function(){
		this.controller.serviceRequest("palm://com.palm.applicationManager", {
			method:"open",
			parameters:{
				id:"com.palm.app.contacts",
				params:{
					launchType:"editPassword",
					accountId:this.accountId,
					iconClass:this.iconClass,
					login:this.login
				}
			}
		})
	}


})
