function updateStatus(user_id, page_name) {
    jQuery.get(
        '/session/getList',
        {user_id: user_id,
         friends: updateStatus.ids.join(','),
         page_name: page_name},
        function(data) {
            var result = eval('(' + data + ')');
            if (!result.users) {
                return;
            }
            jQuery.each(
                result.users,
                function(user_id, user) {
                    var shouldChange = false;
                    var newInnerHtml = '';

                    if (user.live == '1') {
                        shouldChange = true;
                        newInnerHtml = '<img src="/images/ja/status/live.gif" alt="ライブ中" width="42" height="11" />';
                    }

                    if (user.chatroom == '1') {
                        shouldChange = true;
                        newInnerHtml += '<img src="/images/ja/status/chatroom.gif" alt="チャット中" width="42" height="11" />';
                    }

                    if (!shouldChange && user.online == '1') {
                        shouldChange = true;
                        newInnerHtml = '<img src="/images/ja/status/online.gif" alt="オンライン" width="42" height="11" />';
                    }

                    if (shouldChange) {
                        jQuery('.' + 'status_' + user_id).html(newInnerHtml);
                    }
                });
        });
}
updateStatus.ids = [];

function registerMyId(userId, userName) {
    updateStatus.ids.push(userId);
}
