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

var IMName = Class.create({
    initialize: function(imStr){
        if (imStr) {
            this.value = imStr;
        }
    },
    isImAddress: true,
    getHashKey: function(){
        return IMName.getHashKey(this);
    }
});

IMName.getHashKey = function(imName){
    var imStr = imName.serviceName + imName.value.strip().toLowerCase();
    return imStr;
};

IMName.NO_PRESENCE = 6;
IMName.PENDING = 5;
IMName.OFFLINE = 4;
IMName.BUSY = 2;
IMName.IDLE = 2;
IMName.STEPPED_OUT = 2;
IMName.BE_RIGHT_BACK = 2;
IMName.NOT_AT_MY_DESK = 2;
IMName.ON_THE_PHONE = 2;
IMName.FREE_FOR_CHAT = 0;
IMName.OUT_TO_LUNCH = 2;
IMName.MOBILE = 1;
IMName.ONLINE = 0;

IMName.popupLabels = [{
    value: 'aol',
    label: $L('AIM'),
    command: 'aol'
}, {
    value: 'yahoo',
    label: $L('Yahoo!'),
    command: 'yahoo'
}, {
    value: 'gmail',
    label: $L('Google'),
    command: 'gmail'
}, {
    value: 'msn',
    label: $L('MSN'),
    command: 'msn'
}, {
    value: 'jabber',
    label: $L('Jabber'),
    command: 'jabber'
}, {
    value: 'icq',
    label: $L('ICQ'),
    command: 'icq'
}, {
    value: 'irc',
    label: $L('IRC'),
    command: 'irc'
}, {
    value: 'qq',
    label: $L('QQ'),
    command: 'qq'
}, {
    value: 'yjp',
    label: $L('Y! Japan'),
    command: 'yjp'
}, {
    value: 'lcs',
    label: $L('LCS'),
    command: 'lcs'
}, {
    value: 'skype',
    label: $L('Skype'),
    command: 'skype'
}];

IMName.labels = {
    'aol': 'AIM',
    'yahoo': 'Yahoo!',
    'gmail': 'Google',
    'msn': 'MSN',
    'jabber': 'Jabber',
    'icq': 'ICQ',
    'irc': 'IRC',
    'qq': 'QQ',
    'skype': 'Skype',
    'yjp': 'Y! Japan',
    'lcs': 'LCS',
    'noDomain': 'IM'
};
