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

var ContactPointLabels = {
    0: $L("Home"),
    1: $L("Work"),
    2: $L("Other")
};

var ContactPointPopupLabels = [{
    value: 0,
    label: $L("Home"),
    command: 0
}, {
    value: 1,
    label: $L("Work"),
    command: 1
}, {
    value: 2,
    label: $L("Other"),
    command: 2
}];

/* serviceName: maps to syncSource values we're using in edit view
 * max field values: max of < 0 indicates infinite max
 * labels: empty labels indicate no labels should be used for the field */
var EditRules = [{
    serviceName: 'LOCAL Palm Profile',
    maxPhoneNumbers: -1,
    maxEmail: -1,
    maxAddresses: -1,
    maxIMs: -1,
    maxUrls: -1,
    
    phoneLabels: PhoneNumber.labels,
    phonePopupLabels: PhoneNumber.popupLabels,
    addressLabels: ContactPointLabels,
    addressPopupLabels: ContactPointPopupLabels,
    emailLabels: ContactPointLabels,
    emailPopupLabels: ContactPointPopupLabels,
    messagingPopupLabels: IMName.popupLabels,
    imLabels: {
        'aol': 'AIM',
        'yahoo': 'Yahoo!',
        'gmail': 'Google',
        'msn': 'MSN',
        'jabber': 'Jabber',
        'icq': 'ICQ',
        'irc': 'IRC',
        'qq': 'QQ',
        'yjp': 'Y! Japan',
        'lcs': 'LCS',
        'skype': 'Skype'
    },
    urlLabels: {}
}, {
    serviceName: 'SIM simphonebook',
    maxPhoneNumbers: 1,
    maxEmail: 0,
    maxAddresses: 0,
    maxUrls: 0,
    maxIMs: 0,
    moreDetails: false
}, {
    serviceName: 'EAS eas',
    maxPhoneNumbers: 4,
    maxEmail: 3,
    maxAddresses: 3,
    maxIMs: 1,
    maxUrls: 1,
    
    phoneLabels: PhoneNumber.labels,
    addressLabels: ContactPointLabels,
    emailLabels: ContactPointLabels,
    imLabels: {},
    urlLabels: {}
}, {
    serviceName: 'GOOGLE gmail',
    maxPhoneNumbers: -1,
    maxEmail: -1,
    maxAddresses: -1,
    maxIMs: -1,
    maxUrls: -1,
    
    phoneLabels: PhoneNumber.labels,
    addressLabels: ContactPointLabels,
    /*
     * For some reason emailLabels for GMAIL used to be
     *     emailLabels: { 0: 'Home',
     1: 'Work',
     3: 'Other' },
     instead of having 2:"Other"
     If there was a reason for that we can put it back.
     */
    emailLabels: ContactPointLabels,
    imLabels: {
        'aol': 'AIM',
        'yahoo': 'Yahoo',
        'gmail': 'Google Talk',
        'msn': 'MSN',
        'jabber': 'Jabber',
        'icq': 'ICQ',
        'irc': 'IRC',
        'qq': 'QQ',
        'yjp': 'Y! Japan',
        'lcs': 'LCS',
        'skype': 'Skype'
    },
    urlLabels: {}
}, {
    serviceName: 'IM',
    maxPhoneNumbers: -1,
    maxEmail: -1,
    maxAddresses: -1,
    maxIMs: -1,
    maxUrls: -1,
    
    phoneLabels: PhoneNumber.labels,
    addressLabels: ContactPointLabels,
    /*
     * For some reason emailLabels for GMAIL used to be
     *     emailLabels: { 0: 'Home',
     1: 'Work',
     3: 'Other' },
     instead of having 2:"Other"
     If there was a reason for that we can put it back.
     */
    emailLabels: ContactPointLabels,
    imLabels: {
        'aol': 'AIM',
        'yahoo': 'Yahoo',
        'gmail': 'Google Talk',
        'msn': 'MSN',
        'jabber': 'Jabber',
        'icq': 'ICQ',
        'irc': 'IRC',
        'qq': 'QQ',
        'yjp': 'Y! Japan',
        'lcs': 'LCS',
        'skype': 'Skype'
    },
    urlLabels: {}
}];

EditRules.staticPhoneLabels = PhoneNumber.labels;
