/**
 * JavaScript上で使用するメッセージを管理する。
 * @author nanashima
 * @version $Revision: 1.8 $
 */

var message = new Object();

// メッセージ定義
// 必須チェックのエラーメッセージ
message['errors.required']       = 'Please enter your {0}.\n';
// 最小バイト数チェックのエラーメッセージ
message['errors.minlength']      = '{0} must contain at least {1} letters.\n';
// 最大バイト数チェックのエラーメッセージ
message['errors.maxlength']      = '{0} can only contain up to {1} letters.\n';
// 文字種：半角数字チェックのエラーメッセージ
message['errors.integer']        = '{0} must be numbers only.\n';
// 形式チェックのエラーメッセージ
message['errors.invalid']        = 'Please enter {0} in the correct format.\n';
// クレジットカード番号チェックのエラーメッセージ
message['errors.creditno']       = 'The card number you entered does not seem to be correct.\nThe card number must be a 16 digit number.\nIf your card number is less than 16 digits, please add 0s at the beginning.\n'
// クレジットカード利用額が1ヶ月の制限を越えた場合のエラーメッセージ
message['errors.creditexceeded'] = 'Only up to 100,000 yen worth of coins can be purchased in a month with a credit card.\n(Please use another payment method)\n';
// クレジットカードの有効期限が切れている場合のエラーメッセージ
message['errors.creditexpire']   = 'The information provided is incorrect.\n(Please check the expiry date on the credit card.)\n';
// 処理中のエラーメッセージ
message['errors.exec']           = 'Processing...\n';
// メールアドレスの中に@が存在しないエラーメッセージ
message['errors.mailaddr']       = 'Please enter a valid email address.\n';
// メールアドレスが携帯アドレスのエラーメッセージ
message['errors.keitai']         = 'A cellular phone email address cannot be used.\n';
// 購入確認のメッセージ
message['info.buyconfirm']       = 'Are you sure you would like to purchase G-Coins?\n';
// 禁止文字
message['errors.badlanguage']    = 'The use of that word is forbidden.\n';
// 最小以上最大以下チェックのエラーメッセージ(ログイン時)
message['errors.min.to.maxlength'] = 'Your {0} must be \"alphanumeric\" and be within {1} and {2} letters.';
// 入力情報不一致のエラーメッセージ
message['errors.notmatch']       = '{0} does not match. Please check the information you entered.\n';

// 異なる{0}が、{1}フィールドに入力されました。
message['errors.notsame']        = 'A different {0} has been entered in the {1} field.';
// パスワードには、3種類の異なる文字を組み合わせてください。
message['errors.notdifferent']       = "Your password is not secure. \nPlease use at least one letter, one number, and one symbol.";
// パスワードの変更が完了しました。
message['errors.changed']       = "Your password has been changed.";
// 新しいパスワードには、古いパスワードと同じものは使えません。違うパスワードを入力して下さい。
message['errors.notreuse']       = "You can't reuse the same password. Please enter a different password.";
// Exampleと同じパスワードは使用できません。
message['errors.example']       = "The example password cannot be used.";
// あなたのアカウントはロックされているため、ログインできません。メールを確認して下さい。
message['errors.locked']       = "You can't log in because your account is locked. Please check email.";
// ニックネームと異なるユーザIDを入力して下さい。
message['errors.same.nickname']       = "Please enter a User ID that is different from your Nickname.";

// ログイン画面画像認証エラー
message['errors.invalid.verified'] = "Image not verified. Please try again.";

// 日記用エラーメッセージ
message['diary.delete']				= 'Are you sure you would like to delete this entry?';
message['diarycomment.delete']		= 'Are you sure you would like to delete this comment?';
message['newcommentcheck.nocontent']= 'You did not fill in the required fields.';
message['length.toolong']			= 'Please enter no longer {1} characters.';
message['diary.blackedfriend']		= "You are on this user's black list and cannot leave a comment on the user's diary.";

// パンヤＩ／Ｆメッセージ
message['pangya.error.system']	= 'The server is currently very busy. Please try again later.\nIf you still have problems accessing, please contact the TinierMe Support Team.';
message['pangya.error.login']	= 'Please log into TinierMe.';
message['pangya.error.entry']	= 'Please make an entry to Pangya.';

// エンジェルラブオンラインＩ／Ｆメッセージ
message['angel.error.system']	= 'The server is currently very busy. Please try again later.\nIf you still have problems accessing, please contact the TinierMe Support Team.';
message['angel.error.login']	= 'Please log into TinierMe.';
message['angel.error.entry']	= 'Please make an entry to Angel Love Online.';

// シークレットオンラインＩ／Ｆメッセージ
message['secret.error.system']	= 'The server is currently very busy. Please try again later.\nIf you still have problems accessing, please contact the TinierMe Support Team.';
message['secret.error.login']	= 'Please log into TinierMe.';
message['secret.error.entry']	= 'Please make an entry to Secret Online.';

// 鬼魂Ｉ／Ｆメッセージ
message['onidama.error.system']	= 'The server is currently very busy. Please try again later.\nIf you still have problems accessing, please contact the TinierMe Support Team.';
message['onidama.error.login']	= 'Please log into TinierMe.';
message['onidama.error.entry']	= 'Please make an entry to Onidama.';

// ラテールＩ／Ｆメッセージ
message['latale.error.system']	= 'The server is currently very busy. Please try again later.\nIf you still have problems accessing, please contact the TinierMe Support Team.';
message['latale.error.login']	= 'Please log into TinierMe.';
message['latale.error.entry']	= 'Please make an entry to Latale.';

// GetAmped2 I/Fメッセージ
message['ga2.error.entry']	= 'Please make an entry to Get Amped II.';

// CosmicBreak I/Fメッセージ
message['cb.error.entry']	= 'Please make an entry to Cosmic Break.';

// カオティックブレイン I/Fメッセージ
message['halka.error.entry']	= 'Please make an entry to Chaotic Brain.';

// 汎用I/Fメッセージ
message['content.error.system']	= 'The server is currently very busy. Please try again later.\nIf you still have problems accessing, please contact the TinierMe Support Team.';
message['content.error.login']	= 'Please log into TinierMe.';

/**
 * メッセージを取得する
 * @param messageId メッセージID
 * @param argArray 引数の配列
 * @param return メッセージ（未定義のIDの場合は空文字を返却）
 */
function getMessage(messageId, argArray) {
    var result = "";

    // メッセージの取得
    if (message[messageId] != undefined) {
        result = message[messageId];
    }

    // アンカーの置換処理
    if (result != null && argArray != null) {
        for (i = 0; i < argArray.length; i++) {
            var anchor = "{" + i + "}";
            result = result.replace(anchor, argArray[i]);
        }
    }

    return result;
}
