/**
 * ProfilePage
 * @author Jae Cho
 * Subclass of Page for the ProfilePage
 */
function ProfilePage()
{
    this._profile = null;

    this.getProfile = function() {
        return this._profile;
    };

    this.setProfile = function(profile)
    {
        this._profile = profile;

        for (var i in this.modules){
            var module = this.modules[i];

            if (this._profile && module.setUserId) {
                module.setUserId(this._profile.userId);
            }
        }
    };

    this.getUserId = function() {
        return this._profile.userId;
    };

    this.getProfilePath = function()
    {
        var pathname = document.location.pathname;
        var index = pathname.lastIndexOf('/');
        var profilePath = "";
        if (index > 0) profilePath = pathname.substring(index + 1, pathname.length);
        return profilePath;
    };
}

ProfilePage.prototype = new Page();
