//
//  Service.m
//  Afficheur
//
//  Created by kichi on 08/09/02.
//  Copyright 2008 Katsuhiko Ichinose. All rights reserved.
//

#import "Service.h"
#import "HTTP.h"
#import "AfficheurController.h"
#import "AfficheurPreferences.h"
#import "AfficheurGrowl.h"
#import "AfficheurTimeline.h"
#import "NSStringOgreKit.h"
#import <OgreKit/OgreKit.h>
#import "ServiceXMPPClient.h"
#import "TinyURL.h"
#import "ServiceBitLyKey.h"


@implementation Service
#if defined(_D_E_B_U_G_)
APPKIT_EXTERN NSThread* TheMainThread;
#endif //defined(_D_E_B_U_G_)

NSString *IdZero = @"0";

NSString *KeyService = @"service";
NSString *KeyServiceIcon = @"service_icon";
NSString *KeyId = @"id";
NSString *KeyRId = @"rid";
NSString *KeyChannel = @"channel";
NSString *KeyUser = @"user";
NSString *KeyName = @"name";
NSString *KeyText = @"text";
NSString *KeyTextEx = @"text_ex";
NSString *KeyTextRaw = @"text_raw";
NSString *KeyComment = @"comment";
NSString *KeySource = @"source";
NSString *KeySourceIcon = @"source_icon";
NSString *KeySourceIconImage = @"source_icon_image";
NSString *KeyPhotoURL = @"photo_url";
NSString *KeyImageURL = @"image_url";
NSString *KeyImage = @"image";
NSString *KeyIcon = @"icon";
NSString *KeyIconImage = @"icon_image";
NSString *KeyTextDisplay = @"text_display";
NSString *KeyTextDisplaySelected = @"text_display_slected";
NSString *KeyTextNotify = @"text_notify";
NSString *KeyCreatedAt = @"created_at";
NSString *KeyUserProfile = @"user_profile";
NSString *KeyProfileImage = @"profile_image";
NSString *KeyNotifyTitle = @"notify_title";
NSString *KeyNotify = @"notify";
NSString *KeyDate = @"date";
NSString *KeyDateDisplay = @"date_display";
NSString *KeyDateDisplaySelected = @"date_display_selected";
NSString *KeyKind = @"kind";
NSString *KeyCategory = @"category";
NSString *KeyFirst = @"first";
NSString *KeyIndex = @"index";
NSString *KeyWidth = @"width";
NSString *KeyHeight = @"height";
NSString *KeyInReplyUser = @"in_reply_user";
NSString *KeyRetweetedBy = @"retweeted_by";
NSString *KeyRetweetedId = @"retweeted_id";
NSString *KeyFrom = @"from";
NSString *KeyKeyword = @"keyword";
NSString *KeyProtected = @"protected";
NSString *KeySort = @"sort";
NSString *KeyVerified = @"verified";
NSString *KeyFbName = @"fb_name";
NSString *KeyFbCaption = @"fb_caption";
NSString *KeyFbDescription = @"fb_description";
NSString *KeyFbLink = @"fb_link";

NSString *KindTimeline = @"timeline";
NSString *KindReply = @"reply";
NSString *KindDM = @"message";
NSString *KindChannel = @"channel";
NSString *KindError = @"error";

NSString *FromAPI = @"api";
NSString *FromXMPP = @"xmpp";

NSString *Twitter = @"Twitter";
NSString *Jaiku = @"Jaiku";
NSString *Tumblr = @"Tumblr";
//NSString *Nowa = @"Nowa";
NSString *Wassr = @"Wassr";
NSString *Identica = @"Identica";
//NSString *Jisko = @"Jisko";
//NSString *Chuitter = @"Chuitter";
NSString *FriendFeed = @"FriendFeed";
NSString *FaceBook = @"facebook";

NSString *ProfilePhoto = @"photo:";
NSString *ProfileIcon = @"icon:";
NSString *ProfileSource = @"source:";


static const id DoCoMo[] = {
(id)0xE63E, @"晴れ",
(id)0xE63F, @"曇り",
(id)0xE640, @"雨",
(id)0xE641, @"雪",
(id)0xE642, @"雷",
(id)0xE643, @"台風",
(id)0xE644, @"霧",
(id)0xE645, @"小雨",
(id)0xE646, @"牡羊座",
(id)0xE647, @"牡牛座",
(id)0xE648, @"双子座",
(id)0xE649, @"蟹座",
(id)0xE64A, @"獅子座",
(id)0xE64B, @"乙女座",
(id)0xE64C, @"天秤座",
(id)0xE64D, @"蠍座",
(id)0xE64E, @"射手座",
(id)0xE64F, @"山羊座",
(id)0xE650, @"水瓶座",
(id)0xE651, @"魚座",
(id)0xE652, @"スポーツ",
(id)0xE653, @"野球",
(id)0xE654, @"ゴルフ",
(id)0xE655, @"テニス",
(id)0xE656, @"サッカー",
(id)0xE657, @"スキー",
(id)0xE658, @"バスケットボール",
(id)0xE659, @"モータースポーツ",
(id)0xE65A, @"ポケットベル",
(id)0xE65B, @"電車",
(id)0xE65C, @"地下鉄",
(id)0xE65D, @"新幹線",
(id)0xE65E, @"車（セダン）",
(id)0xE65F, @"車（ＲＶ）",
(id)0xE660, @"バス",
(id)0xE661, @"船",
(id)0xE662, @"飛行機",
(id)0xE663, @"家",
(id)0xE664, @"ビル",
(id)0xE665, @"郵便局",
(id)0xE666, @"病院",
(id)0xE667, @"銀行",
(id)0xE668, @"ＡＴＭ",
(id)0xE669, @"ホテル",
(id)0xE66A, @"コンビニ",
(id)0xE66B, @"ガソリンスタンド",
(id)0xE66C, @"駐車場",
(id)0xE66D, @"信号",
(id)0xE66E, @"トイレ",
(id)0xE66F, @"レストラン",
(id)0xE670, @"喫茶店",
(id)0xE671, @"バー",
(id)0xE672, @"ビール",
(id)0xE673, @"ファーストフード",
(id)0xE674, @"ブティック",
(id)0xE675, @"美容院",
(id)0xE676, @"カラオケ",
(id)0xE677, @"映画（Ａ）",
(id)0xE678, @"右斜め上",
(id)0xE679, @"遊園地",
(id)0xE67A, @"音楽",
(id)0xE67B, @"アート",
(id)0xE67C, @"演劇",
(id)0xE67D, @"イベント",
(id)0xE67E, @"チケット",
(id)0xE67F, @"喫煙",
(id)0xE680, @"禁煙",
(id)0xE681, @"カメラ",
(id)0xE682, @"カバン",
(id)0xE683, @"本",
(id)0xE684, @"リボン",
(id)0xE685, @"プレゼント",
(id)0xE686, @"バースデー",
(id)0xE687, @"電話",
(id)0xE688, @"携帯電話",
(id)0xE689, @"メモ",
(id)0xE68A, @"ＴＶ",
(id)0xE68B, @"ゲーム",
(id)0xE68C, @"ＣＤ",
(id)0xE68D, @"ハート",
(id)0xE68E, @"スペード",
(id)0xE68F, @"ダイヤ",
(id)0xE690, @"クラブ",
(id)0xE691, @"目",
(id)0xE692, @"耳",
(id)0xE693, @"手（グー）",
(id)0xE694, @"手（チョキ）",
(id)0xE695, @"手（パー）",
(id)0xE696, @"右斜め下",
(id)0xE697, @"左斜め上",
(id)0xE698, @"足",
(id)0xE699, @"くつ",
(id)0xE69A, @"眼鏡",
(id)0xE69B, @"車椅子",
(id)0xE69C, @"新月",
(id)0xE69D, @"やや欠け月",
(id)0xE69E, @"半月",
(id)0xE69F, @"三日月",
(id)0xE6A0, @"満月",
(id)0xE6A1, @"犬",
(id)0xE6A2, @"猫",
(id)0xE6A3, @"リゾート",
(id)0xE6A4, @"クリスマス",
(id)0xE6A5, @"左斜め下",
(id)0xE6A6, @"ぴ",
(id)0xE6A7, @"あ",
(id)0xE6A8, @"チケット（チケ白抜）",
(id)0xE6A9, @"チケット（チケ）",
(id)0xE6AA, @"先に電話",
(id)0xE6AB, @"Ｐコード",
(id)0xE6AC, @"カチンコ",
(id)0xE6AD, @"ふくろ",
(id)0xE6AE, @"ペン",
(id)0xE6AF, @"映画（Ｂ）",
(id)0xE6B0, @"ぴ（白抜き）",
(id)0xE6B1, @"人影",
(id)0xE6B2, @"イス",
(id)0xE6B3, @"夜",
(id)0xE6B4, @"ぴ（枠付きＡ）",//@"ぴ(枠付きＡ)",
(id)0xE6B5, @"ぴ（枠付きＢ）",//@"ぴ(枠付きＢ)",
(id)0xE6B6, @"Ｃ！",
(id)0xE6B7, @"soon",
(id)0xE6B8, @"on",
(id)0xE6B9, @"end",
(id)0xE6BA, @"時計",
(id)0xE6BB, @"Ｆ",
(id)0xE6BC, @"Ｄ",
(id)0xE6BD, @"Ｓ",
(id)0xE6BE, @"Ｃ",
(id)0xE6BF, @"Ｒ",
(id)0xE6C0, @"四角（Ａ）",
(id)0xE6C1, @"四角（Ｂ）",
(id)0xE6C2, @"逆三角",
(id)0xE6C3, @"柵４",
(id)0xE6C4, @"柵３",
(id)0xE6C5, @"柵２",
(id)0xE6C6, @"柵１",
(id)0xE6C7, @"Ｉ",
(id)0xE6C8, @"Ｍ",
(id)0xE6C9, @"Ｅ",
(id)0xE6CA, @"ＶＥ",
(id)0xE6CB, @"ボール",
(id)0xE6CC, @"きんし（だめ）",
(id)0xE6CD, @"終わり",
(id)0xE6CE, @"phoneto",
(id)0xE6CF, @"mailto",
(id)0xE6D0, @"faxto",
(id)0xE6D1, @"iモード",
(id)0xE6D2, @"iモード（枠付き）",
(id)0xE6D3, @"メール",
(id)0xE6D4, @"ドコモ提供",
(id)0xE6D5, @"ドコモポイント",
(id)0xE6D6, @"有料",
(id)0xE6D7, @"無料",
(id)0xE6D8, @"ID",
(id)0xE6D9, @"パスワード",
(id)0xE6DA, @"次項有",
(id)0xE6DB, @"クリア",
(id)0xE6DC, @"サーチ（調べる）",
(id)0xE6DD, @"ＮＥＷ",
(id)0xE6DE, @"位置情報",
(id)0xE6DF, @"フリーダイヤル",
(id)0xE6E0, @"シャープダイヤル",
(id)0xE6E1, @"モバＱ",
(id)0xE6E2, @"1",
(id)0xE6E3, @"2",
(id)0xE6E4, @"3",
(id)0xE6E5, @"4",
(id)0xE6E6, @"5",
(id)0xE6E7, @"6",
(id)0xE6E8, @"7",
(id)0xE6E9, @"8",
(id)0xE6EA, @"9",
(id)0xE6EB, @"0",
(id)0xE6EC, @"黒ハート",
(id)0xE6ED, @"揺れるハート",
(id)0xE6EE, @"失恋",
(id)0xE6EF, @"ハートたち（複数ハート）",
(id)0xE6F0, @"わーい（嬉しい顔）",
(id)0xE6F1, @"ちっ（怒った顔）",
(id)0xE6F2, @"がく〜（落胆した顔）",	//@"がく～（落胆した顔）",
(id)0xE6F3, @"もうやだ～（悲しい顔）",
(id)0xE6F4, @"ふらふら",
(id)0xE6F5, @"グッド（上向き矢印）",
(id)0xE6F6, @"るんるん",
(id)0xE6F7, @"いい気分（温泉）",
(id)0xE6F8, @"かわいい",
(id)0xE6F9, @"キスマーク",
(id)0xE6FA, @"ぴかぴか（新しい）",
(id)0xE6FB, @"ひらめき",
(id)0xE6FC, @"むかっ（怒り）",
(id)0xE6FD, @"パンチ",
(id)0xE6FE, @"爆弾",
(id)0xE6FF, @"ムード",
(id)0xE700, @"バッド（下向き矢印）",
(id)0xE701, @"眠い(睡眠)",
(id)0xE702, @"exclamation",
(id)0xE703, @"exclamation&question",
(id)0xE704, @"exclamation×2",
(id)0xE705, @"どんっ（衝撃）",
(id)0xE706, @"あせあせ（飛び散る汗）",
(id)0xE707, @"たらーっ（汗）",
(id)0xE708, @"ダッシュ（走り出すさま）",
(id)0xE709, @"ー（長音記号１）",
(id)0xE70A, @"ー（長音記号２）",
(id)0xE70B, @"決定",
(id)0xE70C, @"iアプリ",
(id)0xE70D, @"iアプリ（枠付き）",
(id)0xE70E, @"Tシャツ（ボーダー）",
(id)0xE70F, @"がま口財布",
(id)0xE710, @"化粧",
(id)0xE711, @"ジーンズ",
(id)0xE712, @"スノボ",
(id)0xE713, @"チャペル",
(id)0xE714, @"ドア",
(id)0xE715, @"ドル袋",
(id)0xE716, @"パソコン",
(id)0xE717, @"ラブレター",
(id)0xE718, @"レンチ",
(id)0xE719, @"鉛筆",
(id)0xE71A, @"王冠",
(id)0xE71B, @"指輪",
(id)0xE71C, @"砂時計",
(id)0xE71D, @"自転車",
(id)0xE71E, @"湯のみ",
(id)0xE71F, @"腕時計",
(id)0xE720, @"考えてる顔",
(id)0xE721, @"ほっとした顔",
(id)0xE722, @"冷や汗",
(id)0xE723, @"冷や汗2",
(id)0xE724, @"ぷっくっくな顔",
(id)0xE725, @"ボケーっとした顔",
(id)0xE726, @"目がハート",
(id)0xE727, @"指でOK",
(id)0xE728, @"あっかんべー",
(id)0xE729, @"ウィンク",
(id)0xE72A, @"うれしい顔",
(id)0xE72B, @"がまん顔",
(id)0xE72C, @"猫2",
(id)0xE72D, @"泣き顔",
(id)0xE72E, @"涙",
(id)0xE72F, @"NG",
(id)0xE730, @"クリップ",
(id)0xE731, @"コピーライト",
(id)0xE732, @"トレードマーク",
(id)0xE733, @"走る人",
(id)0xE734, @"マル秘",
(id)0xE735, @"リサイクル",
(id)0xE736, @"レジスタードトレードマーク",
(id)0xE737, @"危険・警告",
(id)0xE738, @"禁止",
(id)0xE739, @"空室・空席・空車",
(id)0xE73A, @"合格マーク",
(id)0xE73B, @"満室・満席・満車",
(id)0xE73C, @"矢印左右",
(id)0xE73D, @"矢印上下",
(id)0xE73E, @"学校",
(id)0xE73F, @"波",
(id)0xE740, @"富士山",
(id)0xE741, @"クローバー",
(id)0xE742, @"さくらんぼ",
(id)0xE743, @"チューリップ",
(id)0xE744, @"バナナ",
(id)0xE745, @"りんご",
(id)0xE746, @"芽",
(id)0xE747, @"もみじ",
(id)0xE748, @"桜",
(id)0xE749, @"おにぎり",
(id)0xE74A, @"ショートケーキ",
(id)0xE74B, @"とっくり（おちょこ付き）",
(id)0xE74C, @"どんぶり",
(id)0xE74D, @"パン",
(id)0xE74E, @"かたつむり",
(id)0xE74F, @"ひよこ",
(id)0xE750, @"ペンギン",
(id)0xE751, @"魚",
(id)0xE752, @"うまい！",
(id)0xE753, @"ウッシッシ",
(id)0xE754, @"ウマ",
(id)0xE755, @"ブタ",
(id)0xE756, @"ワイングラス",
(id)0xE757, @"げっそり",
nil
};

static const id EZweb[] = {
(id)0xEF59, @"！",
(id)0xEF5A, @"！",
(id)0xEF5B, @"？",
(id)0xF048, @"？",
(id)0xF049, @"左向き三角１",
(id)0xF04A, @"右向き三角１",
(id)0xF04B, @"左向き三角２",
(id)0xF04C, @"右向き三角２",
(id)0xF04D, @"小四角１",
(id)0xF04E, @"小四角２",
(id)0xF04F, @"インフォメーションシンボル",
(id)0xEF9A, @"ワイングラス",
(id)0xEFEA, @"スピーカ",
(id)0xF096, @"ドル",
(id)0xEF5E, @"三日月",
(id)0xEF5F, @"いなずま",
(id)0xF050, @"中四角１",
(id)0xF051, @"中四角２",
(id)0xF052, @"小菱形１",
(id)0xF053, @"小菱形２",
(id)0xF054, @"大四角１",
(id)0xF055, @"大四角２",
(id)0xF056, @"小丸１",
(id)0xF057, @"小丸２",
(id)0xF097, @"腕時計",
(id)0xF058, @"プラス",
(id)0xF059, @"マイナス",
(id)0xF05A, @"星１",
(id)0xF05B, @"上矢印１",
(id)0xF05C, @"下矢印１",
(id)0xF05D, @"丸に斜め線",
(id)0xF05E, @"下三角１",
(id)0xF05F, @"上三角１",
(id)0xF060, @"下三角２",
(id)0xF061, @"上三角２",
(id)0xF062, @"大菱形１",
(id)0xF063, @"大菱形２",
(id)0xF064, @"特大四角１",
(id)0xF065, @"特大四角２",
(id)0xF066, @"大丸１",
(id)0xF067, @"大丸２",
(id)0xF068, @"上矢印２",
(id)0xF069, @"下矢印２",
(id)0xEF60, @"太陽",
(id)0xEF93, @"野球ボール",
(id)0xF0B1, @"時計",
(id)0xEF61, @"満月（顔付き）",//@"満月(顔付き)",
(id)0xEFEB, @"ベル",
(id)0xF07C, @"プッシュピン（画鋲）",//@"プッシュピン(画鋲)",
(id)0xEFD3, @"小顔",
(id)0xF0B2, @"ハート",
(id)0xEF9B, @"マティーニ（カクテルグラス）",//@"マティーニ(カクテルグラス)",
(id)0xEFEC, @"四つ葉",
(id)0xF06A, @"トレードマーク（TM）",//@"トレードマーク(TM)",
(id)0xF06B, @"かける",
(id)0xF07D, @"文書１",
(id)0xF098, @"砂時計１",
(id)0xEF54, @"砂時計２",
(id)0xF07E, @"フロッピーディスク",
(id)0xEF62, @"雪の結晶",
(id)0xF06C, @"バツ１",
(id)0xF06D, @"バツ２",
(id)0xF06E, @"右矢印１",
(id)0xF06F, @"左矢印１",
(id)0xEF9C, @"マグカップ",
(id)0xF070, @"割る",
(id)0xF080, @"カレンダー",
(id)0xEFD4, @"スマイルフェイス",
(id)0xEF63, @"星２",
(id)0xF071, @"右矢印２",
(id)0xF072, @"左矢印２",
(id)0xEFED, @"ジュエリー",
(id)0xF073, @"チェックマーク１",
(id)0xEFB8, @"犬（プードル）",//@"犬(プードル)",
(id)0xEF40, @"流れ星",
(id)0xEF44, @"スパーク",
(id)0xEF4E, @"電球",
(id)0xEFB9, @"鳥",
(id)0xF0AC, @"フォルダ１（閉）",//@"フォルダ１(閉)",
(id)0xEFD5, @"顔１",
(id)0xF074, @"コピーライトマーク",
(id)0xF075, @"レジスタードマーク",
(id)0xEF74, @"ブリーフケース（ハンドバッグ）",//@"ブリーフケース(ハンドバッグ)",
(id)0xF0AD, @"フォルダ２（開）",//@"フォルダ２(開)",
(id)0xF0B3, @"電話１（プッシュホン）",//@"電話１(プッシュホン)",
(id)0xEFD6, @"吹き出しコメント",
(id)0xF099, @"クレジットカード",
(id)0xF076, @"上三角３",
(id)0xF077, @"下三角３",
(id)0xF090, @"ＵＳＡ",
(id)0xEF75, @"ノート３",
(id)0xF081, @"クリップボード",
(id)0xF0B4, @"カップ",
(id)0xEFEE, @"カメラ",
(id)0xEF64, @"雨",
(id)0xEF94, @"フットボール",
(id)0xF082, @"本１",
(id)0xEF5C, @"立ち入り禁止",
(id)0xEF42, @"信号",
(id)0xF083, @"本２",
(id)0xF084, @"本３",
(id)0xF085, @"本４",
(id)0xF086, @"文書２",
(id)0xEFEF, @"はさみ",
(id)0xF087, @"ひめくりカレンダー",
(id)0xEF76, @"チケット・キップ",
(id)0xEF65, @"くもり",
(id)0xEFFA, @"封筒",
(id)0xF09A, @"小切手（CHECK）",//@"小切手(CHECK)",
(id)0xEFF0, @"ビデオカメラ",
(id)0xF09B, @"ハンディカム",
(id)0xEF84, @"家",
(id)0xEFBD, @"花",
(id)0xF09C, @"ナイフ",
(id)0xF09D, @"ビデオテープ",
(id)0xEFD7, @"めがね",
(id)0xF078, @"回り矢印１",
(id)0xF079, @"回り矢印２",
(id)0xEFF1, @"むしめがね",
(id)0xEFF2, @"鍵",
(id)0xF088, @"ノート１",
(id)0xEF77, @"ノート２",
(id)0xF09E, @"ボルト＆ナット",
(id)0xEFF3, @"くつ",
(id)0xEF8A, @"車",
(id)0xF09F, @"フロッピー２",
(id)0xF091, @"チャート（棒グラフ）",//@"チャート(棒グラフ)",
(id)0xF092, @"グラフ１（折れ線グラフ）",//@"グラフ１(折れ線グラフ)",
(id)0xEFF4, @"メールボックス",
(id)0xF0A0, @"懐中電灯",
(id)0xF089, @"Roldex",
(id)0xF07A, @"チェックマーク２",
(id)0xEFA7, @"はっぱ",
(id)0xEFBA, @"猟犬",
(id)0xF0A1, @"電池",
(id)0xF07B, @"スクロール",
(id)0xF08A, @"がびょう",
(id)0xEFF5, @"錠前",
(id)0xF0A2, @"ドル札",
(id)0xEFD8, @"指差し確認左",
(id)0xEFD9, @"指差し確認右",
(id)0xF08B, @"台帳",
(id)0xEF78, @"クリップ",
(id)0xEFA8, @"プレゼント",
(id)0xEFF6, @"名札",
(id)0xEF85, @"ゴハン１",
(id)0xF08C, @"複数本",
(id)0xEF8B, @"トラック",
(id)0xEF79, @"エンピツ",
(id)0xF0A3, @"ロゴ（PDC社）",//@"ロゴ(PDC社)",
(id)0xF0AE, @"封筒２",
(id)0xF0A4, @"レンチ",
(id)0xF0AF, @"送信ＢＯＸ",
(id)0xF0B0, @"受信ＢＯＸ",
(id)0xEFF7, @"電話２",
(id)0xEF86, @"工場・建物",
(id)0xF08D, @"定規１",
(id)0xEF7A, @"定規２",
(id)0xF093, @"グラフ２",
(id)0xEF9D, @"食事２",
(id)0xF0A5, @"電話３",
(id)0xF0A6, @"コンセント",
(id)0xEFDA, @"家族",
(id)0xF0A7, @"リンク",
(id)0xEFF8, @"パッケージ",
(id)0xEFF9, @"ＦＡＸ",
(id)0xEF66, @"ときどき曇り",
(id)0xEF8C, @"飛行機",
(id)0xEF8D, @"ボート（船）",//@"ボート(船)",
(id)0xEFA1, @"サイコロ",
(id)0xF0A8, @"新聞",
(id)0xEF8E, @"電車",
(id)0xF0A9, @"全部ブランク",
(id)0xF0AA, @"半分ブランク",
(id)0xF0AB, @"4分の1ブランク",
(id)0xEF55, @"喫煙",
(id)0xEF56, @"禁煙",
(id)0xEF57, @"車椅子",
(id)0xEF58, @"若葉マーク",
(id)0xEFFB, @"四角数字１",
(id)0xEFFC, @"四角数字２",
(id)0xF040, @"四角数字３",
(id)0xF041, @"四角数字４",
(id)0xF042, @"四角数字５",
(id)0xF043, @"四角数字６",
(id)0xF044, @"四角数字７",
(id)0xF045, @"四角数字８",
(id)0xF046, @"四角数字９",
(id)0xF047, @"四角数字10",
(id)0xEF41, @"台風",
(id)0xEF5D, @"ゆきだるま",
(id)0xEF67, @"星座（おひつじ座）",//@"星座(おひつじ座)",
(id)0xEF68, @"星座（おうし座）",//@"星座(おうし座)",
(id)0xEF69, @"星座（双子座）",//@"星座(双子座)",
(id)0xEF6A, @"星座（かに座）",//@"星座(かに座)",
(id)0xEF6B, @"星座（かに座）",//@"星座(かに座)",
(id)0xEF6C, @"星座（おとめ座）",//@"星座(おとめ座)",
(id)0xEF6D, @"星座（天秤座）",//@"星座(天秤座)",
(id)0xEF6E, @"星座（さそり座）",//@"星座(さそり座)",
(id)0xEF6F, @"星座（いて座）",//@"星座(いて座)",
(id)0xEF70, @"星座（やぎ座）",//@"星座(やぎ座)",
(id)0xEF71, @"星座（水瓶座）",//@"星座(水瓶座)",
(id)0xEF72, @"星座（うお座）",//@"星座(うお座)",
(id)0xEF73, @"星座（へびつかい座）",//@"星座(へびつかい座)",
(id)0xEF7B, @"ＡＴＭ",
(id)0xEF7C, @"24HOURS（コンビニ）",//@"24HOURS(コンビニ)",
(id)0xEF7D, @"トイレ",
(id)0xEF7E, @"パーキング",
(id)0xEF80, @"バス停",
(id)0xEF81, @"アンテナ（位置情報マーク）",//@"アンテナ(位置情報マーク)",
(id)0xEF82, @"港（いかりマーク）",//@"港(いかりマーク)",
(id)0xEF83, @"銀行",
(id)0xF08E, @"ガススタンド",
(id)0xF08F, @"地図",
(id)0xEF87, @"自転車",
(id)0xEF88, @"バス",
(id)0xEF89, @"新幹線",
(id)0xEF43, @"マラソン",
(id)0xEF8F, @"サッカー",
(id)0xEF90, @"テニス",
(id)0xEF91, @"スノーボード",
(id)0xEF92, @"チェッカーフラグ（モータースポーツ）",//@"チェッカーフラグ(モータースポーツ)",
(id)0xEF45, @"遊園地",
(id)0xEF95, @"温泉",
(id)0xEF96, @"居酒屋（赤ちょうちん）",//@"居酒屋(赤ちょうちん)",
(id)0xEF97, @"映画（かちんこ）",//@"映画(かちんこ)",
(id)0xEF98, @"夜の橋",
(id)0xEF99, @"東京タワー",
(id)0xEF46, @"スロット（７７７）",//@"スロット(７７７)",
(id)0xEF47, @"くす玉（アタリのくす玉）",//@"くす玉(アタリのくす玉)",
(id)0xEF9E, @"当選弓矢",
(id)0xEF9F, @"ゲームのコントローラ",
(id)0xEFA0, @"賞金",
(id)0xEFA2, @"クリスマスツリー",
(id)0xEFA3, @"花見（さくら）",//@"花見(さくら)",
(id)0xEFA4, @"お化け",
(id)0xEFA5, @"旗（祝日・日の丸）",//@"旗(祝日・日の丸)",
(id)0xEFA6, @"スイカ",
(id)0xEFA9, @"ケーキ",
(id)0xEFAA, @"フライパン（目玉焼き）",//@"フライパン(目玉焼き)",
(id)0xEFAB, @"さくらんぼ",
(id)0xEFAC, @"ふぐ",
(id)0xEFAD, @"イチゴ",
(id)0xEFAE, @"おにぎり",
(id)0xEFAF, @"ハンバーガー（ファーストフード）",//@"ハンバーガー(ファーストフード)",
(id)0xEF48, @"くじら",
(id)0xEFB0, @"うさぎ",
(id)0xEFB1, @"うま",
(id)0xEFB2, @"さる",
(id)0xEFB3, @"かえる",
(id)0xEFB4, @"猫",
(id)0xEFB5, @"ペンギン",
(id)0xEFB6, @"あり",
(id)0xEFB7, @"ぶた",
(id)0xEFBB, @"やしのき",
(id)0xEFBC, @"ひまわり",
(id)0xEF49, @"顔１（うれしいカオ）",//@"顔１(うれしいカオ)",
(id)0xEF4A, @"顔２（おこったカオ）",//@"顔２(おこったカオ)",
(id)0xEF4B, @"顔３（かなしいカオ）",//@"顔３(かなしいカオ)",
(id)0xEF4C, @"顔４（つかれたカオ）",//@"顔４(つかれたカオ)",
(id)0xEF4D, @"眠い（ＺＺＺ…）",	//@"眠い(ＺＺＺ…)",
(id)0xEFBE, @"怒り（ムカッ）",//@"怒り(ムカッ)",
(id)0xEFBF, @"雫（涙・汗）",//@"雫(涙・汗)",
(id)0xEFC0, @"からかう（あっかんべえ）",//@"からかう(あっかんべえ)",
(id)0xEF4F, @"ハート２（われている）",//@"ハート２(われている)",
(id)0xEF50, @"ハート３（大きい＆小さい）",//@"ハート３(大きい＆小さい)",
(id)0xEF51, @"スパーク２（キラリマーク）",//@"スパーク２(キラリマーク)",
(id)0xEF52, @"爆弾",
(id)0xEF53, @"炎",
(id)0xEFC1, @"捜索（SOS）",//@"捜索(SOS)",
(id)0xEFC2, @"力こぶ",
(id)0xEFC3, @"ハート５（矢がささっている）",//@"ハート５(矢がささっている)",
(id)0xEFC4, @"キスマーク",
(id)0xEFC5, @"宇宙人",
(id)0xEFC6, @"なると",
(id)0xEFC7, @"足跡（犬）",//@"足跡(犬)",
(id)0xEFC8, @"悪魔",
(id)0xEFC9, @"花丸",
(id)0xEFCA, @"丸秘",
(id)0xEFCB, @"100点満点",
(id)0xEFCC, @"パンチ",
(id)0xEFCD, @"ダッシュ",
(id)0xEFCE, @"ウンチマーク",
(id)0xEFCF, @"人差し指サイン",
(id)0xEFD0, @"マル得",
(id)0xEFD1, @"どくろ",
(id)0xEFD2, @"おやゆびサイン",
(id)0xEFDB, @"テレビ",
(id)0xEFDC, @"マイク",
(id)0xEFDD, @"財布",
(id)0xEFDE, @"メロディ",
(id)0xEFDF, @"ギター（エレキ）",//@"ギター(エレキ)",
(id)0xEFE0, @"バイオリン（クラシック）",//@"バイオリン(クラシック)",
(id)0xEFE1, @"ヘッドフォン",
(id)0xEFE2, @"口紅",
(id)0xEFE3, @"アクション（ピストル）",//@"アクション(ピストル)",
(id)0xEFE4, @"エステ",
(id)0xF094, @"EZマーク",
(id)0xF095, @"無料（FREE）",//@"無料(FREE)",
(id)0xEFE5, @"CD/DVD",
(id)0xEFE6, @"婦人服",
(id)0xEFE7, @"UFO",
(id)0xEFE8, @"更新（UP!）",//@"更新(UP!)",
(id)0xEFE9, @"注射器（血）",//@"注射器(血)",
(id)0xF0B5, @"霧",
(id)0xF0B6, @"ゴルフ",
(id)0xF0B7, @"バスケットボール",
(id)0xF0B8, @"ポケットベル",
(id)0xF0B9, @"アート",
(id)0xF0BA, @"演劇",
(id)0xF0BB, @"イベント",
(id)0xF0BC, @"リボン",
(id)0xF0BD, @"バースデー",
(id)0xF0BE, @"スペード",
(id)0xF0BF, @"ダイヤ",
(id)0xF0C0, @"クラブ",
(id)0xF0C1, @"目",
(id)0xF0C2, @"耳",
(id)0xF0C3, @"手（チョキ）",//@"手(チョキ)",
(id)0xF0C4, @"手（パー）",//@"手(パー)",
(id)0xF0C5, @"新月",
(id)0xF0C6, @"やや欠け月",
(id)0xF0C7, @"半月",
(id)0xF0C8, @"クリア",
(id)0xF0C9, @"四角数字０",
(id)0xF0CA, @"決定",
(id)0xF0CB, @"ふらふら",
(id)0xF0CC, @"かわいい",
(id)0xF0CD, @"どんっ（衝撃）",//@"どんっ(衝撃)",
(id)0xF0CE, @"あせあせ（飛び散る汗）",//@"あせあせ(飛び散る汗)",
(id)0xF0CF, @"イージープラス",
(id)0xF0D0, @"地球",
(id)0xF0D1, @"ラーメン",
(id)0xF0E5, @"NEW",
(id)0xF0E6, @"紳士服",
(id)0xF0E7, @"紳士靴",
(id)0xF0E8, @"パソコン",
(id)0xF0E9, @"ラジオ",
(id)0xF0EA, @"バラ",
(id)0xF0EB, @"チャペル",
(id)0xF0EC, @"地下鉄",
(id)0xF0ED, @"富士山",
(id)0xF0EE, @"八分音符",
(id)0xF0EF, @"天使",
(id)0xF0F0, @"トラ",
(id)0xF0F1, @"くま",
(id)0xF0F2, @"ねずみ",
(id)0xF0F3, @"ウィンク",
(id)0xF0F4, @"目がハート",
(id)0xF0F5, @"ショッキング",
(id)0xF0F6, @"困り",
(id)0xF0F7, @"たこ",
(id)0xF0F8, @"ロケット",
(id)0xF0F9, @"王冠",
(id)0xF0FA, @"チュー",
(id)0xF0FB, @"ハンマー",
(id)0xF0FC, @"打ち上げ花火",
(id)0xEC40, @"枯れ葉",
(id)0xEC41, @"仕事かばん",
(id)0xEC42, @"噴水",
(id)0xEC43, @"キャンプ",
(id)0xEC44, @"麻雀",
(id)0xEC45, @"VS（バーサス）",//@"VS(バーサス)",
(id)0xEC46, @"トロフィー",
(id)0xEC47, @"カメ",
(id)0xEC48, @"スペイン国旗",
(id)0xEC49, @"ﾛｼｱ国旗",
(id)0xEC4A, @"工事中",
(id)0xEC4B, @"風呂",
(id)0xEC4C, @"祝日マーク",
(id)0xEC4D, @"夕方街並み",
(id)0xEC4E, @"卵割り",
(id)0xEC4F, @"株価",
(id)0xEC50, @"ポリス",
(id)0xEC51, @"郵便局",
(id)0xEC52, @"病院",
(id)0xEC53, @"学校",
(id)0xEC54, @"ホテル",
(id)0xEC55, @"船",
(id)0xEC56, @"18禁",
(id)0xEC57, @"圏内",
(id)0xEC58, @"COOL!",
(id)0xEC59, @"割ﾏｰｸ",
(id)0xEC5A, @"ザ・マーク",
(id)0xEC5B, @"IDマーク",
(id)0xEC5C, @"満マーク",
(id)0xEC5D, @"空マーク",
(id)0xEC5E, @"指定マーク",
(id)0xEC5F, @"営業中マーク",
(id)0xEC60, @"上指差し",
(id)0xEC61, @"下指差し",
(id)0xEC62, @"占い",
(id)0xEC63, @"マナーモード",
(id)0xEC64, @"電源OFF",
(id)0xEC65, @"メモする",
(id)0xEC66, @"ネクタイ",
(id)0xEC67, @"ハイビスカス",
(id)0xEC68, @"花束",
(id)0xEC69, @"サボテン",
(id)0xEC6A, @"お銚子＆杯",
(id)0xEC6B, @"乾杯",
(id)0xEC6C, @"祝マーク",
(id)0xEC6D, @"風邪薬",
(id)0xEC6E, @"風船",
(id)0xEC6F, @"クラッカー",
(id)0xEC70, @"eznavigation",
(id)0xEC71, @"帽子",
(id)0xEC72, @"ロングブーツ",
(id)0xEC73, @"ネイル",
(id)0xEC74, @"美容院",
(id)0xEC75, @"床屋",
(id)0xEC76, @"着物",
(id)0xEC77, @"ビキニ",
(id)0xEC78, @"ハート（トランプ）",
(id)0xEC79, @"光るハート",
(id)0xEC7A, @"青ハート",
(id)0xEC7B, @"緑ハート",
(id)0xEC7C, @"黄ハート",
(id)0xEC7D, @"紫ハート",
(id)0xEC7E, @"きらきら",
(id)0xEC80, @"スキー",
(id)0xEC81, @"○",
(id)0xEC82, @"日本茶",
(id)0xEC83, @"食パン",
(id)0xEC84, @"ソフトクリーム",
(id)0xEC85, @"ポテト",
(id)0xEC86, @"だんご",
(id)0xEC87, @"おせんべい",
(id)0xEC88, @"ごはん",
(id)0xEC89, @"スパゲッティ",
(id)0xEC8A, @"カレー",
(id)0xEC8B, @"おでん",
(id)0xEC8C, @"寿司",
(id)0xEC8D, @"りんご",
(id)0xEC8E, @"みかん",
(id)0xEC8F, @"トマト",
(id)0xEC90, @"なす",
(id)0xEC91, @"弁当",
(id)0xEC92, @"鍋",
(id)0xEC93, @"ふっ",
(id)0xEC94, @"しょんぼり",
(id)0xEC95, @"勝ち誇り",
(id)0xEC96, @"失敗",
(id)0xEC97, @"わからん",
(id)0xEC98, @"眠い",
(id)0xEC99, @"てれてれ",
(id)0xEC9A, @"青ざめ",
(id)0xEC9B, @"風邪ひき",
(id)0xEC9C, @"熱",
(id)0xEC9D, @"横目",
(id)0xEC9E, @"びっくり",
(id)0xEC9F, @"あせり",
(id)0xECA0, @"楽譜",
(id)0xECA1, @"にこにこ",
(id)0xECA2, @"チュー２",
(id)0xECA3, @"チュッ",
(id)0xECA4, @"鼻",
(id)0xECA5, @"口",
(id)0xECA6, @"ゴメン／お願い",
(id)0xECA7, @"拍手",
(id)0xECA8, @"ＯＫ！",//@"OK!",
(id)0xECA9, @"ブーイング",
(id)0xECAA, @"バイバイ",
(id)0xECAB, @"ＮＧ",//@"NG",
(id)0xECAC, @"ＯＫ！２",//@"ＯＫ！2",
(id)0xECAD, @"平謝り",
(id)0xECAE, @"カップル",
(id)0xECAF, @"バニー",
(id)0xECB0, @"トランペット",
(id)0xECB1, @"ビリヤード",
(id)0xECB2, @"水泳",
(id)0xECB3, @"消防車",
(id)0xECB4, @"救急車",
(id)0xECB5, @"パトカー",
(id)0xECB6, @"ジェットコースター",
(id)0xECB7, @"門松",
(id)0xECB8, @"雛祭り",
(id)0xECB9, @"卒業式",
(id)0xECBA, @"入学式",
(id)0xECBB, @"こいのぼり",
(id)0xECBC, @"傘",
(id)0xECBD, @"花嫁",
(id)0xECBE, @"かき氷",
(id)0xECBF, @"線香花火",
(id)0xECC0, @"巻き貝",
(id)0xECC1, @"風鈴",
(id)0xECC2, @"ハロウィン",
(id)0xECC3, @"お月見",
(id)0xECC4, @"サンタ",	//@"サンタクロース",
(id)0xECC5, @"夜/流れ星",
(id)0xECC6, @"虹",
(id)0xECC7, @"ホテル2",
(id)0xECC8, @"日の出",
(id)0xECC9, @"シルクハット",
(id)0xECCA, @"デパート",
(id)0xECCB, @"城（日本）",
(id)0xECCC, @"城（ヨーロッパ）",
(id)0xECCD, @"工場2",
(id)0xECCE, @"フランス国旗",
(id)0xF0D2, @"Openwave",
(id)0xF0D3, @"ロック確認",
(id)0xF0D4, @"大文字",
(id)0xF0D5, @"小文字",
(id)0xF0D6, @"数字",
(id)0xF0D7, @"記号",
(id)0xF0D8, @"アクセプト",
(id)0xF0D9, @"チェックボックス",
(id)0xF0DA, @"エディット",
(id)0xF0DB, @"ラジオボタン",
(id)0xF0DC, @"見る",
(id)0xF0DD, @"戻る",
(id)0xF0DE, @"お気に入り",
(id)0xF0DF, @"終了",
(id)0xF0E0, @"ホーム",
(id)0xF0E1, @"受信箱１",
(id)0xF0E2, @"マーク",
(id)0xF0E3, @"個人",
(id)0xF0E4, @"再読み込み",
(id)0xECCF, @"ドイツ国旗",
(id)0xECD0, @"イタリア国旗",
(id)0xECD1, @"イギリス国旗",
(id)0xECD2, @"中国国旗",
(id)0xECD3, @"韓国国旗",
(id)0xECD4, @"白人",
(id)0xECD5, @"中国人",
(id)0xECD6, @"インド人",
(id)0xECD7, @"おじいさん",
(id)0xECD8, @"おばあさん",
(id)0xECD9, @"赤ちゃん",
(id)0xECDA, @"工事現場の人",
(id)0xECDB, @"お姫様",
(id)0xECDC, @"イルカ",
(id)0xECDD, @"ダンス",
(id)0xECDE, @"熱帯魚",
(id)0xECDF, @"げじげじ",
(id)0xECE0, @"象",
(id)0xECE1, @"コアラ",
(id)0xECE2, @"ホルスタイン",
(id)0xECE3, @"ヘビ",
(id)0xECE4, @"鶏",
(id)0xECE5, @"うりぼう",
(id)0xECE6, @"ふたこぶらくだ",
(id)0xECE7, @"Ａ型",
(id)0xECE8, @"Ｂ型",
(id)0xECE9, @"Ｏ型",
(id)0xECEA, @"ＡＢ型",
(id)0xECEB, @"足跡",
(id)0xECEC, @"スニーカー",
(id)0xECED, @"旗",
(id)0xECEE, @"上向きカーブ矢印",
(id)0xECEF, @"下向きカーブ矢印",
(id)0xECF0, @"「！？」",
(id)0xECF1, @"「！！」",
(id)0xECF2, @"くるり",
(id)0xECF3, @"メロン",
(id)0xECF4, @"パイナップル",
(id)0xECF5, @"ぶどう",
(id)0xECF6, @"バナナ",
(id)0xECF7, @"とうもろこし",
(id)0xECF8, @"きのこ",
(id)0xECF9, @"栗",
(id)0xECFA, @"桃",
(id)0xECFB, @"やきいも",
(id)0xECFC, @"ピザ",
(id)0xED40, @"ターキー",
(id)0xED41, @"七夕笹飾り",
(id)0xED42, @"トロピカルドリンク",
(id)0xED43, @"辰",
(id)0xED44, @"ピアノ",
(id)0xED45, @"サーフィン",
(id)0xED46, @"釣り",
(id)0xED47, @"ボーリング",
(id)0xED48, @"なまはげ",
(id)0xED49, @"天狗",
(id)0xED4A, @"パンダ",
(id)0xED4B, @"あかんべー",
(id)0xED4C, @"ぶたの鼻",
(id)0xED4D, @"花",
(id)0xED4E, @"アイスクリーム",
(id)0xED4F, @"ドーナッツ",
(id)0xED50, @"クッキー",
(id)0xED51, @"チョコ",
(id)0xED52, @"キャンディ（つつみ）",
(id)0xED53, @"キャンディ（ぺろぺろ）",
(id)0xED54, @"見ざる",
(id)0xED55, @"言わざる",
(id)0xED56, @"聞かざる",
(id)0xED57, @"火山",
(id)0xED58, @"リボンがけのハート",
(id)0xED59, @"英語「ABC」",
(id)0xED5A, @"プリン",
(id)0xED5B, @"ミツバチ",
(id)0xED5C, @"テントウムシ",
(id)0xED5D, @"蜂蜜ポット",
(id)0xED5E, @"青りんご",
(id)0xED5F, @"羽のはえたお札",
(id)0xED60, @"目がまわる時の記号",
(id)0xED61, @"ぷー（かわいく怒）",//@"ぷー(かわいく怒)",
(id)0xED62, @"ぶー（かわいく怒）（ネコ）",
(id)0xED63, @"天の川",
(id)0xED64, @"チュー（ネコ）",
(id)0xED65, @"にこ（ネコ）",//@"にこ(ネコ)",
(id)0xED66, @"メールする",
(id)0xED67, @"泣き笑い（ネコ）",
(id)0xED68, @"泣き笑い",
(id)0xED69, @"目がハート（ネコ）",
(id)0xED6A, @"ほえー（ネコ）",
(id)0xED6B, @"ほえー",
(id)0xED6C, @"涙ぽろり（ネコ）",
(id)0xED6D, @"涙ぽろり",
(id)0xED6E, @"きりり（ネコ）",
(id)0xED6F, @"ドレス",
(id)0xED70, @"モヤイ象",
(id)0xED71, @"駅",
(id)0xED72, @"花札",
(id)0xED73, @"ジョーカー",
(id)0xED74, @"エビフライ",
(id)0xED75, @"eメールアイコン",
(id)0xED76, @"歩く人",
(id)0xED77, @"パトカーのランプ",
(id)0xED78, @"ezmovie",
(id)0xED79, @"ドキドキしているハート",
(id)0xED7A, @"正面向きのひよこ",
(id)0xED7B, @"ジーンズ",
(id)0xED7C, @"ハートつきメール",
(id)0xED7D, @"循環矢印",
(id)0xED7E, @"左右両方向矢印",
(id)0xED80, @"上下両方向矢印",
(id)0xED81, @"荒波",
(id)0xED82, @"双葉",
(id)0xED83, @"かたつむり",
(id)0xED84, @"うっしっし（ネコ）",
(id)0xED85, @"うっしっし",
(id)0xED86, @"Cメールアイコン",
(id)0xED87, @"ハーブ",
(id)0xED88, @"グー",
(id)0xED89, @"＃",
(id)0xED8A, @"キャラクター（挙手）",
(id)0xED8B, @"キャラクター（万歳）",
(id)0xED8C, @"キャラクター（しょんぼり）",
(id)0xED8D, @"キャラクター（かわいく怒る）",
(id)0xED8E, @"EZアプリ（Java）",
(id)0xED8F, @"EZアプリ（BREW）",
(id)0xED90, @"EZ着うた",
(id)0xED91, @"EZナビMS",
(id)0xED92, @"WIN",
(id)0xED93, @"プレミアム",
nil
};

static const id SoftBank[] = {
(id)0xE001, @"男の子",
(id)0xE002, @"女の子",
(id)0xE003, @"美容",
(id)0xE004, @"お父さん",
(id)0xE005, @"お母さん",
(id)0xE006, @"洋服",
(id)0xE007, @"ブーツ",
(id)0xE008, @"カメラ",
(id)0xE009, @"電話",
(id)0xE00A, @"携帯電話",
(id)0xE00B, @"FAX",
(id)0xE00C, @"パソコン",
(id)0xE00D, @"パンチ!",
(id)0xE00E, @"GOOD!",
(id)0xE00F, @"No.1!",
(id)0xE010, @"グー",
(id)0xE011, @"チョキ",
(id)0xE012, @"パー",
(id)0xE013, @"スキー",
(id)0xE014, @"ゴルフ",
(id)0xE015, @"テニス",
(id)0xE016, @"野球",
(id)0xE017, @"サーフィン",
(id)0xE018, @"サッカー",
(id)0xE019, @"魚",
(id)0xE01A, @"うま",
(id)0xE01B, @"車",
(id)0xE01C, @"ヨット",
(id)0xE01D, @"飛行機",
(id)0xE01E, @"電車",
(id)0xE01F, @"新幹線",
(id)0xE020, @"ハテナ",
(id)0xE021, @"ビックリ",
(id)0xE022, @"ハートマーク",
(id)0xE023, @"ハートブレイク",
(id)0xE024, @"1時",
(id)0xE025, @"2時",
(id)0xE026, @"時計",
(id)0xE027, @"4時",
(id)0xE028, @"5時",
(id)0xE029, @"6時",
(id)0xE02A, @"7時",
(id)0xE02B, @"8時",
(id)0xE02C, @"9時",
(id)0xE02D, @"10時",
(id)0xE02E, @"11時",
(id)0xE02F, @"12時",
(id)0xE030, @"お花見",
(id)0xE031, @"エンブレム",
(id)0xE032, @"バラ",
(id)0xE033, @"クリスマス",
(id)0xE034, @"指輪",
(id)0xE035, @"宝石",
(id)0xE036, @"家",
(id)0xE037, @"教会",
(id)0xE038, @"ビル",
(id)0xE039, @"駅",
(id)0xE03A, @"ガソリンスタンド",
(id)0xE03B, @"山",
(id)0xE03C, @"マイク",
(id)0xE03D, @"映画",
(id)0xE03E, @"音楽",
(id)0xE03F, @"カギ",
(id)0xE040, @"サックス",
(id)0xE041, @"ギター",
(id)0xE042, @"トランペット",
(id)0xE043, @"レストラン",
(id)0xE044, @"カクテル",
(id)0xE045, @"コーヒー",
(id)0xE046, @"ケーキ",
(id)0xE047, @"ビール",
(id)0xE048, @"雪",
(id)0xE049, @"曇り",
(id)0xE04A, @"晴れ（昼）",//@"晴れ(昼)",
(id)0xE04B, @"雨",
(id)0xE04C, @"晴れ（夜）",//@"晴れ(夜)",
(id)0xE04D, @"朝",
(id)0xE04E, @"天使",
(id)0xE04F, @"ねこ",
(id)0xE050, @"とら",
(id)0xE051, @"くま",
(id)0xE052, @"いぬ",
(id)0xE053, @"ねずみ",
(id)0xE054, @"クジラ",
(id)0xE055, @"ペンギン",
(id)0xE056, @"楽",
(id)0xE057, @"喜",
(id)0xE058, @"哀",
(id)0xE059, @"怒",
(id)0xE05A, @"ウンチ",
(id)0xE101, @"メール受信",
(id)0xE102, @"メール送信",
(id)0xE103, @"メール宛先",
(id)0xE104, @"電話連絡先",
(id)0xE105, @"アカンベー",
(id)0xE106, @"ラブラブ",
(id)0xE107, @"ガビーン",
(id)0xE108, @"タラー",
(id)0xE109, @"さる",
(id)0xE10A, @"タコ",
(id)0xE10B, @"ぶた",
(id)0xE10C, @"宇宙人",
(id)0xE10D, @"ロケット",
(id)0xE10E, @"王冠",
(id)0xE10F, @"電球",
(id)0xE110, @"よつば",
(id)0xE111, @"キス",
(id)0xE112, @"バースデー",
(id)0xE113, @"ピストル",
(id)0xE114, @"虫眼鏡",
(id)0xE115, @"陸上",
(id)0xE116, @"オークション",
(id)0xE117, @"花火",
(id)0xE118, @"もみじ",
(id)0xE119, @"落ち葉",
(id)0xE11A, @"悪魔",
(id)0xE11B, @"おばけ",
(id)0xE11C, @"ドクロ",
(id)0xE11D, @"ファイヤー",
(id)0xE11E, @"かばん",
(id)0xE11F, @"座席",
(id)0xE120, @"ハンバーガー",
(id)0xE121, @"公園",
(id)0xE122, @"キャンプ場",
(id)0xE123, @"温泉",
(id)0xE124, @"遊園地",
(id)0xE125, @"チケット",
(id)0xE126, @"CD",
(id)0xE127, @"DVD",
(id)0xE128, @"ラジオ",
(id)0xE129, @"ビデオ",
(id)0xE12A, @"テレビ",
(id)0xE12B, @"ゲーム",
(id)0xE12C, @"歌い出し",
(id)0xE12D, @"マージャン",
(id)0xE12E, @"対決",
(id)0xE12F, @"賞金",
(id)0xE130, @"当たり",
(id)0xE131, @"トロフィー",
(id)0xE132, @"ゴール",
(id)0xE133, @"スロット",
(id)0xE134, @"競馬",
(id)0xE135, @"競艇",
(id)0xE136, @"競輪",
(id)0xE137, @"工事中",
(id)0xE138, @"男性",
(id)0xE139, @"女性",
(id)0xE13A, @"乳幼児",
(id)0xE13B, @"注射器",
(id)0xE13C, @"睡眠",
(id)0xE13D, @"雷",
(id)0xE13E, @"ハイヒール",
(id)0xE13F, @"入浴",
(id)0xE140, @"トイレ",
(id)0xE141, @"音声",
(id)0xE142, @"お知らせ",
(id)0xE143, @"祝日",
(id)0xE144, @"ロックON",
(id)0xE145, @"ロックOFF",
(id)0xE146, @"街",
(id)0xE147, @"料理",
(id)0xE148, @"本",
(id)0xE149, @"為替相場",
(id)0xE14A, @"株価",
(id)0xE14B, @"ニュース",
(id)0xE14C, @"元気",
(id)0xE14D, @"銀行",
(id)0xE14E, @"信号",
(id)0xE14F, @"駐車場",
(id)0xE150, @"バス停",
(id)0xE151, @"公衆トイレ",
(id)0xE152, @"交番",
(id)0xE153, @"郵便局",
(id)0xE154, @"ATM",
(id)0xE155, @"病院",
(id)0xE156, @"コンビニ",
(id)0xE157, @"学校",
(id)0xE158, @"ホテル",
(id)0xE159, @"バス",
(id)0xE15A, @"タクシー",
(id)0xE201, @"徒歩",
(id)0xE202, @"船",
(id)0xE203, @"目的地",
(id)0xE204, @"飾罫1",
(id)0xE205, @"飾罫2",
(id)0xE206, @"飾罫3",
(id)0xE207, @"18禁",
(id)0xE208, @"禁煙",
(id)0xE209, @"初心者",
(id)0xE20A, @"バリアフリー",
(id)0xE20B, @"アンテナマーク",
(id)0xE20C, @"ハート",
(id)0xE20D, @"ダイヤ",
(id)0xE20E, @"スペード",
(id)0xE20F, @"クラブ",
(id)0xE210, @"シャープダイヤル",
(id)0xE211, @"フリーダイヤル",
(id)0xE212, @"新着",
(id)0xE213, @"更新",
(id)0xE214, @"おすすめ",
(id)0xE215, @"有料",
(id)0xE216, @"無料",
(id)0xE217, @"月額",
(id)0xE218, @"申し込み",
(id)0xE219, @"見出しボタン1",
(id)0xE21A, @"見出しボタン2",
(id)0xE21B, @"見出しボタン3",
(id)0xE21C, @"1ボタン",
(id)0xE21D, @"2ボタン",
(id)0xE21E, @"3ボタン",
(id)0xE21F, @"4ボタン",
(id)0xE220, @"5ボタン",
(id)0xE221, @"6ボタン",
(id)0xE222, @"7ボタン",
(id)0xE223, @"8ボタン",
(id)0xE224, @"9ボタン",
(id)0xE225, @"0ボタン",
(id)0xE226, @"お得",
(id)0xE227, @"割引",
(id)0xE228, @"サービス料",
(id)0xE229, @"ID",
(id)0xE22A, @"満席",
(id)0xE22B, @"空席",
(id)0xE22C, @"指定席",
(id)0xE22D, @"営業時間",
(id)0xE22E, @"上へ",
(id)0xE22F, @"下へ",
(id)0xE230, @"左へ",
(id)0xE231, @"右へ",
(id)0xE232, @"上",
(id)0xE233, @"下",
(id)0xE234, @"右",
(id)0xE235, @"左",
(id)0xE236, @"右上",
(id)0xE237, @"左上",
(id)0xE238, @"右下",
(id)0xE239, @"左下",
(id)0xE23A, @"次へ",
(id)0xE23B, @"前へ",
(id)0xE23C, @"早送り",
(id)0xE23D, @"巻戻し",
(id)0xE23E, @"星座",
(id)0xE23F, @"おひつじ座",
(id)0xE240, @"おうし座",
(id)0xE241, @"ふたご座",
(id)0xE242, @"かに座",
(id)0xE243, @"しし座",
(id)0xE244, @"おとめ座",
(id)0xE245, @"てんびん座",
(id)0xE246, @"さそり座",
(id)0xE247, @"いて座",
(id)0xE248, @"やぎ座",
(id)0xE249, @"みずがめ座",
(id)0xE24A, @"うお座",
(id)0xE24B, @"へびつかい座",
(id)0xE24C, @"TOPページ",
(id)0xE24D, @"OKボタン",
(id)0xE24E, @"著作権",
(id)0xE24F, @"登録商標",
(id)0xE250, @"マナーモード",
(id)0xE251, @"電源切",
(id)0xE252, @"ご注意",
(id)0xE253, @"ご案内",
(id)0xE254, @"J-PHONEショップ",
(id)0xE255, @"Sky",
(id)0xE256, @"Sky",
(id)0xE257, @"Sky",
(id)0xE258, @"J-PHONE1",
(id)0xE259, @"J-PHONE2",
(id)0xE25A, @"J-PHONE3",
(id)0xE301, @"メモ",
(id)0xE302, @"ネクタイ",
(id)0xE303, @"ハイビスカス",
(id)0xE304, @"チューリップ",
(id)0xE305, @"ひまわり",
(id)0xE306, @"花束",
(id)0xE307, @"やしの木",
(id)0xE308, @"サボテン",
(id)0xE309, @"トイレ",
(id)0xE30A, @"ヘッドホン",
(id)0xE30B, @"晩酌",
(id)0xE30C, @"乾杯",
(id)0xE30D, @"祝",
(id)0xE30E, @"喫煙",
(id)0xE30F, @"カプセル薬",
(id)0xE310, @"風船",
(id)0xE311, @"爆弾",
(id)0xE312, @"クラッカー",
(id)0xE313, @"ハサミ",
(id)0xE314, @"リボン",
(id)0xE315, @"マル秘",
(id)0xE316, @"MD",
(id)0xE317, @"メガホン",
(id)0xE318, @"帽子",
(id)0xE319, @"可愛いワンピース",
(id)0xE31A, @"ミュール",
(id)0xE31B, @"ロングブーツ",
(id)0xE31C, @"口紅",
(id)0xE31D, @"マニキュア",
(id)0xE31E, @"エステ",
(id)0xE31F, @"美容院",
(id)0xE320, @"理容院",
(id)0xE321, @"着物",
(id)0xE322, @"ビキニ",
(id)0xE323, @"ブランドバッグ",
(id)0xE324, @"カチンコ",
(id)0xE325, @"すず",
(id)0xE326, @"踊る音符",
(id)0xE327, @"ぴかぴかハート",
(id)0xE328, @"ドキドキハート",
(id)0xE329, @"ハートを射とめて",
(id)0xE32A, @"ハート:青",
(id)0xE32B, @"ハート:緑",
(id)0xE32C, @"ハート:黄",
(id)0xE32D, @"ハート:紫",
(id)0xE32E, @"NEW",
(id)0xE32F, @"☆",
(id)0xE330, @"ダッシュ",
(id)0xE331, @"飛び散る汗",
(id)0xE332, @"○",
(id)0xE333, @"×",
(id)0xE334, @"怒り",
(id)0xE335, @"☆（点滅）",//@"☆(点滅)",
(id)0xE336, @"動く”?”",
(id)0xE337, @"動く”!”",
(id)0xE338, @"お茶",
(id)0xE339, @"パン",
(id)0xE33A, @"ソフトクリーム",
(id)0xE33B, @"フライドポテト",
(id)0xE33C, @"串団子",
(id)0xE33D, @"せんべい",
(id)0xE33E, @"ご飯",
(id)0xE33F, @"スパゲッティ",
(id)0xE340, @"ラーメン",
(id)0xE341, @"カレーライス",
(id)0xE342, @"おにぎり",
(id)0xE343, @"おでん",
(id)0xE344, @"寿司",
(id)0xE345, @"りんご",
(id)0xE346, @"みかん",
(id)0xE347, @"いちご",
(id)0xE348, @"すいか",
(id)0xE349, @"トマト",
(id)0xE34A, @"なす",
(id)0xE34B, @"バースデーケーキ",
(id)0xE34C, @"駅弁",
(id)0xE34D, @"ナベ",
(id)0xE401, @"アセリ",
(id)0xE402, @"ほくそえんでいる",
(id)0xE403, @"ひたすらごめんなさい",
(id)0xE404, @"エッヘン",
(id)0xE405, @"ウィンク",
(id)0xE406, @"わさびがきいた",
(id)0xE407, @"目がぐるぐる",
(id)0xE408, @"鼻ちょうちん",
(id)0xE409, @"あっかんべー",
(id)0xE40A, @"酔っぱらい",
(id)0xE40B, @"ゲロゲロ",
(id)0xE40C, @"マスクをつけた顔",
(id)0xE40D, @"顔が赤くなる",
(id)0xE40E, @"しらけ顔",
(id)0xE40F, @"冷や汗",
(id)0xE410, @"びっくり",
(id)0xE411, @"泣き",
(id)0xE412, @"泣いたり笑ったり",
(id)0xE413, @"可愛く泣いてる人",
(id)0xE414, @"にこにこ",
(id)0xE415, @"あははと笑う",
(id)0xE416, @"めちゃめちゃ怒っている",
(id)0xE417, @"KISS:動く口",
(id)0xE418, @"投げKISS",
(id)0xE419, @"目",
(id)0xE41A, @"鼻",
(id)0xE41B, @"耳",
(id)0xE41C, @"口",
(id)0xE41D, @"ごめんなさい",
(id)0xE41E, @"バイバイ",
(id)0xE41F, @"拍手",
(id)0xE420, @"OK",
(id)0xE421, @"Booing",
(id)0xE422, @"おっは〜",
(id)0xE423, @"×",
(id)0xE424, @"○",
(id)0xE425, @"手をつないでいる",
(id)0xE426, @"土下座",
(id)0xE427, @"バンザイ",
(id)0xE428, @"人と人が歩いている",
(id)0xE429, @"ラインダンス",
(id)0xE42A, @"バスケットボール",
(id)0xE42B, @"フットボール",
(id)0xE42C, @"ビリヤード",
(id)0xE42D, @"水泳",
(id)0xE42E, @"RV",
(id)0xE42F, @"トラック",
(id)0xE430, @"消防車",
(id)0xE431, @"救急車",
(id)0xE432, @"パトカー",
(id)0xE433, @"ジェットコースター",
(id)0xE434, @"地下鉄",
(id)0xE435, @"新幹線（700系）",//@"新幹線(700系)",
(id)0xE436, @"門松",
(id)0xE437, @"チョコ",
(id)0xE438, @"お雛様",
(id)0xE439, @"卒業式",
(id)0xE43A, @"ランドセル",
(id)0xE43B, @"鯉のぼり",
(id)0xE43C, @"とじかさ",
(id)0xE43D, @"結婚式",
(id)0xE43E, @"波がザーン",
(id)0xE43F, @"かき氷",
(id)0xE440, @"線香花火",
(id)0xE441, @"貝",
(id)0xE442, @"風鈴",
(id)0xE443, @"台風",
(id)0xE444, @"稲穂",
(id)0xE445, @"ハロウィン",
(id)0xE446, @"お月見",
(id)0xE447, @"風がビュー",
(id)0xE448, @"サンタクロース",
(id)0xE449, @"朝日",
(id)0xE44A, @"夕日",
(id)0xE44B, @"流れ星",
(id)0xE44C, @"虹",
(id)0xE501, @"ラブホテル",
(id)0xE502, @"アート",
(id)0xE503, @"演劇",
(id)0xE504, @"デパート",
(id)0xE505, @"お城（和）",//@"お城(和)",
(id)0xE506, @"お城（洋）",//@"お城(洋)",
(id)0xE507, @"映画館",
(id)0xE508, @"工場",
(id)0xE509, @"東京タワー",
(id)0xE50A, @"1090",
(id)0xE50B, @"日本",
(id)0xE50C, @"アメリカ",
(id)0xE50D, @"フランス",
(id)0xE50E, @"ドイツ",
(id)0xE50F, @"イタリア",
(id)0xE510, @"イギリス",
(id)0xE511, @"スペイン",
(id)0xE512, @"ロシア",
(id)0xE513, @"中国",
(id)0xE514, @"韓国",
(id)0xE515, @"白人",
(id)0xE516, @"中国人",
(id)0xE517, @"インド人",
(id)0xE518, @"おじいちゃん",
(id)0xE519, @"おばあちゃん",
(id)0xE51A, @"あかちゃん",
(id)0xE51B, @"安全第一",
(id)0xE51C, @"お姫さま",
(id)0xE51D, @"自由の女神",
(id)0xE51E, @"衛兵",
(id)0xE51F, @"フラメンコ",
(id)0xE520, @"イルカ",
(id)0xE521, @"とり",
(id)0xE522, @"熱帯魚",
(id)0xE523, @"ひよこ",
(id)0xE524, @"ハムスター",
(id)0xE525, @"けむし",
(id)0xE526, @"ぞう",
(id)0xE527, @"こあら",
(id)0xE528, @"チンパンジー",
(id)0xE529, @"ひつじ",
(id)0xE52A, @"おおかみ",
(id)0xE52B, @"うし",
(id)0xE52C, @"うさぎ",
(id)0xE52D, @"へび",
(id)0xE52E, @"にわとり",
(id)0xE52F, @"いのしし",
(id)0xE530, @"らくだ",
(id)0xE531, @"かえる",
(id)0xE532, @"A型",
(id)0xE533, @"B型",
(id)0xE534, @"AB型",
(id)0xE535, @"O型",
(id)0xE536, @"足あと",
(id)0xE537, @"TM",
(id)0xE538, @"JSKY1",
(id)0xE539, @"JSKY2",
(id)0xE53A, @"vodafoneロゴ1",
(id)0xE53B, @"vodafoneロゴ2",
(id)0xE53C, @"vodafone1",
(id)0xE53D, @"vodafone2",
(id)0xE53E, @"vodafone3",
nil
};

#if 0
static const id EZwebNowa[] = {
(id)0xE5CD, @"EC40",
(id)0xE5CE, @"EC41",
(id)0xE5CF, @"EC42",
(id)0xE5D0, @"EC43",
(id)0xE5D1, @"EC44",
(id)0xE5D2, @"EC45",
(id)0xE5D3, @"EC46",
(id)0xE5D4, @"EC47",
(id)0xE5D5, @"EC48",
(id)0xE5D6, @"EC49",
(id)0xE5D7, @"EC4A",
(id)0xE5D8, @"EC4B",
(id)0xE5D9, @"EC4C",
(id)0xE5DA, @"EC4D",
(id)0xE5DB, @"EC4E",
(id)0xE5DC, @"EC4F",
(id)0xE5DD, @"EC50",
(id)0xE5DE, @"EC51",
(id)0xE5DF, @"EC52",
(id)0xEA80, @"EC53",
(id)0xEA81, @"EC54",
(id)0xEA82, @"EC55",
(id)0xEA83, @"EC56",
(id)0xEA84, @"EC57",
(id)0xEA85, @"EC58",
(id)0xEA86, @"EC59",
(id)0xEA87, @"EC5A",
(id)0xEA88, @"EC5B",
(id)0xEA89, @"EC5C",
(id)0xEA8A, @"EC5D",
(id)0xEA8B, @"EC5E",
(id)0xEA8C, @"EC5F",
(id)0xEA8D, @"EC60",
(id)0xEA8E, @"EC61",
(id)0xEA8F, @"EC62",
(id)0xEA90, @"EC63",
(id)0xEA91, @"EC64",
(id)0xEA92, @"EC65",
(id)0xEA93, @"EC66",
(id)0xEA94, @"EC67",
(id)0xEA95, @"EC68",
(id)0xEA96, @"EC69",
(id)0xEA97, @"EC6A",
(id)0xEA98, @"EC6B",
(id)0xEA99, @"EC6C",
(id)0xEA9A, @"EC6D",
(id)0xEA9B, @"EC6E",
(id)0xEA9C, @"EC6F",
(id)0xEA9D, @"EC70",
(id)0xEA9E, @"EC71",
(id)0xEA9F, @"EC72",
(id)0xEAA0, @"EC73",
(id)0xEAA1, @"EC74",
(id)0xEAA2, @"EC75",
(id)0xEAA3, @"EC76",
(id)0xEAA4, @"EC77",
(id)0xEAA5, @"EC78",
(id)0xEAA6, @"EC79",
(id)0xEAA7, @"EC7A",
(id)0xEAA8, @"EC7B",
(id)0xEAA9, @"EC7C",
(id)0xEAAA, @"EC7D",
(id)0xEAAB, @"EC7E",
(id)0xEAAC, @"EC80",
(id)0xEAAD, @"EC81",
(id)0xEAAE, @"EC82",
(id)0xEAAF, @"EC83",
(id)0xEAB0, @"EC84",
(id)0xEAB1, @"EC85",
(id)0xEAB2, @"EC86",
(id)0xEAB3, @"EC87",
(id)0xEAB4, @"EC88",
(id)0xEAB5, @"EC89",
(id)0xEAB6, @"EC8A",
(id)0xEAB7, @"EC8B",
(id)0xEAB8, @"EC8C",
(id)0xEAB9, @"EC8D",
(id)0xEABA, @"EC8E",
(id)0xEABB, @"EC8F",
(id)0xEABC, @"EC90",
(id)0xEABD, @"EC91",
(id)0xEABE, @"EC92",
(id)0xEABF, @"EC93",
(id)0xEAC0, @"EC94",
(id)0xEAC1, @"EC95",
(id)0xEAC2, @"EC96",
(id)0xEAC3, @"EC97",
(id)0xEAC4, @"EC98",
(id)0xEAC5, @"EC99",
(id)0xEAC6, @"EC9A",
(id)0xEAC7, @"EC9B",
(id)0xEAC8, @"EC9C",
(id)0xEAC9, @"EC9D",
(id)0xEACA, @"EC9E",
(id)0xEACB, @"EC9F",
(id)0xEACC, @"ECA0",
(id)0xEACD, @"ECA1",
(id)0xEACE, @"ECA2",
(id)0xEACF, @"ECA3",
(id)0xEAD0, @"ECA4",
(id)0xEAD1, @"ECA5",
(id)0xEAD2, @"ECA6",
(id)0xEAD3, @"ECA7",
(id)0xEAD4, @"ECA8",
(id)0xEAD5, @"ECA9",
(id)0xEAD6, @"ECAA",
(id)0xEAD7, @"ECAB",
(id)0xEAD8, @"ECAC",
(id)0xEAD9, @"ECAD",
(id)0xEADA, @"ECAE",
(id)0xEADB, @"ECAF",
(id)0xEADC, @"ECB0",
(id)0xEADD, @"ECB1",
(id)0xEADE, @"ECB2",
(id)0xEADF, @"ECB3",
(id)0xEAE0, @"ECB4",
(id)0xEAE1, @"ECB5",
(id)0xEAE2, @"ECB6",
(id)0xEAE3, @"ECB7",
(id)0xEAE4, @"ECB8",
(id)0xEAE5, @"ECB9",
(id)0xEAE6, @"ECBA",
(id)0xEAE7, @"ECBB",
(id)0xEAE8, @"ECBC",
(id)0xEAE9, @"ECBD",
(id)0xEAEA, @"ECBE",
(id)0xEAEB, @"ECBF",
(id)0xEAEC, @"ECC0",
(id)0xEAED, @"ECC1",
(id)0xEAEE, @"ECC2",
(id)0xEAEF, @"ECC3",
(id)0xEAF0, @"ECC4",
(id)0xEAF1, @"ECC5",
(id)0xEAF2, @"ECC6",
(id)0xEAF3, @"ECC7",
(id)0xEAF4, @"ECC8",
(id)0xEAF5, @"ECC9",
(id)0xEAF6, @"ECCA",
(id)0xEAF7, @"ECCB",
(id)0xEAF8, @"ECCC",
(id)0xEAF9, @"ECCD",
(id)0xEAFA, @"ECCE",
(id)0xEB0E, @"ECCF",
(id)0xEB0F, @"ECD0",
(id)0xEB10, @"ECD1",
(id)0xEB11, @"ECD2",
(id)0xEB12, @"ECD3",
(id)0xEB13, @"ECD4",
(id)0xEB14, @"ECD5",
(id)0xEB15, @"ECD6",
(id)0xEB16, @"ECD7",
(id)0xEB17, @"ECD8",
(id)0xEB18, @"ECD9",
(id)0xEB19, @"ECDA",
(id)0xEB1A, @"ECDB",
(id)0xEB1B, @"ECDC",
(id)0xEB1C, @"ECDD",
(id)0xEB1D, @"ECDE",
(id)0xEB1F, @"ECDF",
(id)0xEB1F, @"ECE0",
(id)0xEB20, @"ECE1",
(id)0xEB21, @"ECE2",
(id)0xEB22, @"ECE3",
(id)0xEB23, @"ECE4",
(id)0xEB24, @"ECE5",
(id)0xEB25, @"ECE6",
(id)0xEB26, @"ECE7",
(id)0xEB27, @"ECE8",
(id)0xEB28, @"ECE9",
(id)0xEB29, @"ECEA",
(id)0xEB2A, @"ECEB",
(id)0xEB2B, @"ECEC",
(id)0xEB2C, @"ECED",
(id)0xEB2D, @"ECEE",
(id)0xE82E, @"ECEF",
(id)0xE82F, @"ECF0",
(id)0xEB30, @"ECF1",
(id)0xEB31, @"ECF2",
(id)0xEB32, @"ECF3",
(id)0xEB33, @"ECF4",
(id)0xEB34, @"ECF5",
(id)0xEB35, @"ECF6",
(id)0xEB36, @"ECF7",
(id)0xEB37, @"ECF8",
(id)0xEB38, @"ECF9",
(id)0xEB39, @"ECFA",
(id)0xEB3A, @"ECFB",
(id)0xEB3B, @"ECFC",
(id)0xEB3C, @"ED40",
(id)0xEB3D, @"ED41",
(id)0xEB3E, @"ED42",
(id)0xEB3F, @"ED43",
(id)0xEB40, @"ED44",
(id)0xEB41, @"ED45",
(id)0xEB42, @"ED46",
(id)0xEB43, @"ED47",
(id)0xEB44, @"ED48",
(id)0xEB45, @"ED49",
(id)0xEB46, @"ED4A",
(id)0xEB47, @"ED4B",
(id)0xEB48, @"ED4C",
(id)0xEB49, @"ED4D",
(id)0xEB4A, @"ED4E",
(id)0xEB4B, @"ED4F",
(id)0xEB4C, @"ED50",
(id)0xEB4D, @"ED51",
(id)0xEB4E, @"ED52",
(id)0xEB4F, @"ED53",
(id)0xEB50, @"ED54",
(id)0xEB51, @"ED55",
(id)0xEB52, @"ED56",
(id)0xEB53, @"ED57",
(id)0xEB54, @"ED58",
(id)0xEB55, @"ED59",
(id)0xEB56, @"ED5A",
(id)0xEB57, @"ED5B",
(id)0xEB58, @"ED5C",
(id)0xEB59, @"ED5D",
(id)0xEB5A, @"ED5E",
(id)0xEB5B, @"ED5F",
(id)0xEB5C, @"ED60",
(id)0xEB5D, @"ED61",
(id)0xEB5E, @"ED62",
(id)0xEB5F, @"ED63",
(id)0xEB60, @"ED64",
(id)0xEB61, @"ED65",
(id)0xEB62, @"ED66",
(id)0xEB63, @"ED67",
(id)0xEB64, @"ED68",
(id)0xEB65, @"ED69",
(id)0xEB66, @"ED6A",
(id)0xEB67, @"ED6B",
(id)0xEB68, @"ED6C",
(id)0xEB69, @"ED6D",
(id)0xEB6A, @"ED6E",
(id)0xEB6B, @"ED6F",
(id)0xEB6C, @"ED70",
(id)0xEB6D, @"ED71",
(id)0xEB6E, @"ED72",
(id)0xEB6F, @"ED73",
(id)0xEB70, @"ED74",
(id)0xEB71, @"ED75",
(id)0xEB72, @"ED76",
(id)0xEB73, @"ED77",
(id)0xEB74, @"ED78",
(id)0xEB75, @"ED79",
(id)0xEB76, @"ED7A",
(id)0xEB77, @"ED7B",
(id)0xEB78, @"ED7C",
(id)0xEB79, @"ED7D",
(id)0xEB7A, @"ED7E",
(id)0xEB7B, @"ED80",
(id)0xEB7C, @"ED81",
(id)0xEB7D, @"ED82",
(id)0xEB7E, @"ED83",
(id)0xEB7F, @"ED84",
(id)0xEB80, @"ED85",
(id)0xEB81, @"ED86",
(id)0xEB82, @"ED87",
(id)0xEB83, @"ED88",
(id)0xEB84, @"ED89",
(id)0xEB85, @"ED8A",
(id)0xEB86, @"ED8B",
(id)0xEB87, @"ED8C",
(id)0xEB88, @"ED8D",
(id)0xEB89, @"ED8E",
(id)0xEB8A, @"ED8F",
(id)0xEB8B, @"ED90",
(id)0xEB8C, @"ED91",
(id)0xEB8D, @"ED92",
(id)0xEB8E, @"ED93",
(id)0xE468, @"EF40",
(id)0xE469, @"EF41",
(id)0xE46A, @"EF42",
(id)0xE46B, @"EF43",
(id)0xE46C, @"EF44",
(id)0xE46D, @"EF45",
(id)0xE46E, @"EF46",
(id)0xE46F, @"EF47",
(id)0xE470, @"EF48",
(id)0xE471, @"EF49",
(id)0xE472, @"EF4A",
(id)0xE473, @"EF4B",
(id)0xE474, @"EF4C",
(id)0xE475, @"EF4D",
(id)0xE476, @"EF4E",
(id)0xE477, @"EF4F",
(id)0xE478, @"EF50",
(id)0xE479, @"EF51",
(id)0xE47A, @"EF52",
(id)0xE47B, @"EF53",
(id)0xE47C, @"EF54",
(id)0xE47D, @"EF55",
(id)0xE47E, @"EF56",
(id)0xE47F, @"EF57",
(id)0xE480, @"EF58",
(id)0xE481, @"EF59",
(id)0xE482, @"EF5A",
(id)0xE483, @"EF5B",
(id)0xE484, @"EF5C",
(id)0xE485, @"EF5D",
(id)0xE486, @"EF5E",
(id)0xE487, @"EF5F",
(id)0xE488, @"EF60",
(id)0xE489, @"EF61",
(id)0xE48A, @"EF62",
(id)0xE48B, @"EF63",
(id)0xE48C, @"EF64",
(id)0xE48D, @"EF65",
(id)0xE48E, @"EF66",
(id)0xE48F, @"EF67",
(id)0xE490, @"EF68",
(id)0xE491, @"EF69",
(id)0xE492, @"EF6A",
(id)0xE493, @"EF6B",
(id)0xE494, @"EF6C",
(id)0xE495, @"EF6D",
(id)0xE496, @"EF6E",
(id)0xE497, @"EF6F",
(id)0xE498, @"EF70",
(id)0xE499, @"EF71",
(id)0xE49A, @"EF72",
(id)0xE49B, @"EF73",
(id)0xE49C, @"EF74",
(id)0xE49D, @"EF75",
(id)0xE49E, @"EF76",
(id)0xE49F, @"EF77",
(id)0xE4A0, @"EF78",
(id)0xE4A1, @"EF79",
(id)0xE4A2, @"EF7A",
(id)0xE4A3, @"EF7B",
(id)0xE4A4, @"EF7C",
(id)0xE4A5, @"EF7D",
(id)0xE4A6, @"EF7E",
(id)0xE4A7, @"EF80",
(id)0xE4A8, @"EF81",
(id)0xE4A9, @"EF82",
(id)0xE4AA, @"EF83",
(id)0xE4AB, @"EF84",
(id)0xE4AC, @"EF85",
(id)0xE4AD, @"EF86",
(id)0xE4AE, @"EF87",
(id)0xE4AF, @"EF88",
(id)0xE4B0, @"EF89",
(id)0xE4B1, @"EF8A",
(id)0xE4B2, @"EF8B",
(id)0xE4B3, @"EF8C",
(id)0xE4B4, @"EF8D",
(id)0xE4B5, @"EF8E",
(id)0xE4B6, @"EF8F",
(id)0xE4B7, @"EF90",
(id)0xE4B8, @"EF91",
(id)0xE4B9, @"EF92",
(id)0xE4BA, @"EF93",
(id)0xE4BB, @"EF94",
(id)0xE4BC, @"EF95",
(id)0xE4BD, @"EF96",
(id)0xE4BE, @"EF97",
(id)0xE4BF, @"EF98",
(id)0xE4C0, @"EF99",
(id)0xE4C1, @"EF9A",
(id)0xE4C2, @"EF9B",
(id)0xE4C3, @"EF9C",
(id)0xE4C4, @"EF9D",
(id)0xE4C5, @"EF9E",
(id)0xE4C6, @"EF9F",
(id)0xE4C7, @"EFA0",
(id)0xE4C8, @"EFA1",
(id)0xE4C9, @"EFA2",
(id)0xE4CA, @"EFA3",
(id)0xE4CB, @"EFA4",
(id)0xE4CC, @"EFA5",
(id)0xE4CD, @"EFA6",
(id)0xE4CE, @"EFA7",
(id)0xE4CF, @"EFA8",
(id)0xE4D0, @"EFA9",
(id)0xE4D1, @"EFAA",
(id)0xE4D2, @"EFAB",
(id)0xE4D3, @"EFAC",
(id)0xE4D4, @"EFAD",
(id)0xE4D5, @"EFAE",
(id)0xE4D6, @"EFAF",
(id)0xE4D7, @"EFB0",
(id)0xE4D8, @"EFB1",
(id)0xE4D9, @"EFB2",
(id)0xE4DA, @"EFB3",
(id)0xE4DB, @"EFB4",
(id)0xE4DC, @"EFB5",
(id)0xE4DD, @"EFB6",
(id)0xE4DE, @"EFB7",
(id)0xE4DF, @"EFB8",
(id)0xE4E0, @"EFB9",
(id)0xE4E1, @"EFBA",
(id)0xE4E2, @"EFBB",
(id)0xE4E3, @"EFBC",
(id)0xE4EA, @"EFBD",
(id)0xE4E5, @"EFBE",
(id)0xE4E6, @"EFBF",
(id)0xE4E7, @"EFC0",
(id)0xE4E8, @"EFC1",
(id)0xE4E9, @"EFC2",
(id)0xE4EA, @"EFC3",
(id)0xE4EB, @"EFC4",
(id)0xE4EC, @"EFC5",
(id)0xE4ED, @"EFC6",
(id)0xE4EE, @"EFC7",
(id)0xE4EF, @"EFC8",
(id)0xE4F0, @"EFC9",
(id)0xE4F1, @"EFCA",
(id)0xE4F2, @"EFCB",
(id)0xE4F3, @"EFCC",
(id)0xE4F4, @"EFCD",
(id)0xE4F5, @"EFCE",
(id)0xE4F6, @"EFCF",
(id)0xE4F7, @"EFD0",
(id)0xE4F8, @"EFD1",
(id)0xE4F9, @"EFD2",
(id)0xE4FA, @"EFD3",
(id)0xE4FB, @"EFD4",
(id)0xE4FC, @"EFD5",
(id)0xE4FD, @"EFD6",
(id)0xE4FE, @"EFD7",
(id)0xE4FF, @"EFD8",
(id)0xE500, @"EFD9",
(id)0xE501, @"EFDA",
(id)0xE502, @"EFDB",
(id)0xE503, @"EFDC",
(id)0xE504, @"EFDD",
(id)0xE505, @"EFDE",
(id)0xE506, @"EFDF",
(id)0xE507, @"EFE0",
(id)0xE508, @"EFE1",
(id)0xE509, @"EFE2",
(id)0xE50A, @"EFE3",
(id)0xE50B, @"EFE4",
(id)0xE50C, @"EFE5",
(id)0xE50D, @"EFE6",
(id)0xE50E, @"EFE7",
(id)0xE50F, @"EFE8",
(id)0xE510, @"EFE9",
(id)0xE511, @"EFEA",
(id)0xE512, @"EFEB",
(id)0xE513, @"EFEC",
(id)0xE514, @"EFED",
(id)0xE515, @"EFEE",
(id)0xE516, @"EFEF",
(id)0xE517, @"EFF0",
(id)0xE518, @"EFF1",
(id)0xE519, @"EFF2",
(id)0xE51A, @"EFF3",
(id)0xE51B, @"EFF4",
(id)0xE51C, @"EFF5",
(id)0xE51D, @"EFF6",
(id)0xE51E, @"EFF7",
(id)0xE51F, @"EFF8",
(id)0xE520, @"EFF9",
(id)0xE521, @"EFFA",
(id)0xE522, @"EFFB",
(id)0xE523, @"EFFC",
(id)0xE524, @"F040",
(id)0xE525, @"F041",
(id)0xE526, @"F042",
(id)0xE527, @"F043",
(id)0xE528, @"F044",
(id)0xE529, @"F045",
(id)0xE52A, @"F046",
(id)0xE52B, @"F047",
(id)0xE52C, @"F048",
(id)0xE52D, @"F049",
(id)0xE52E, @"F04A",
(id)0xE52F, @"F04B",
(id)0xE530, @"F04C",
(id)0xE531, @"F04D",
(id)0xE532, @"F04E",
(id)0xE533, @"F04F",
(id)0xE534, @"F050",
(id)0xE535, @"F051",
(id)0xE536, @"F052",
(id)0xE537, @"F053",
(id)0xE538, @"F054",
(id)0xE539, @"F055",
(id)0xE53A, @"F056",
(id)0xE53B, @"F057",
(id)0xE53C, @"F058",
(id)0xE53D, @"F059",
(id)0xE53E, @"F05A",
(id)0xE53F, @"F05B",
(id)0xE540, @"F05C",
(id)0xE541, @"F05D",
(id)0xE542, @"F05E",
(id)0xE543, @"F05F",
(id)0xE544, @"F060",
(id)0xE545, @"F061",
(id)0xE546, @"F062",
(id)0xE547, @"F063",
(id)0xE548, @"F064",
(id)0xE549, @"F065",
(id)0xE54A, @"F066",
(id)0xE54B, @"F067",
(id)0xE54C, @"F068",
(id)0xE54D, @"F069",
(id)0xE54E, @"F06A",
(id)0xE54F, @"F06B",
(id)0xE550, @"F06C",
(id)0xE551, @"F06D",
(id)0xE552, @"F06E",
(id)0xE553, @"F06F",
(id)0xE554, @"F070",
(id)0xE555, @"F071",
(id)0xE556, @"F072",
(id)0xE557, @"F073",
(id)0xE558, @"F074",
(id)0xE559, @"F075",
(id)0xE55A, @"F076",
(id)0xE55B, @"F077",
(id)0xE55C, @"F078",
(id)0xE55D, @"F079",
(id)0xE55E, @"F07A",
(id)0xE55F, @"F07B",
(id)0xE560, @"F07C",
(id)0xE561, @"F07D",
(id)0xE562, @"F07E",
(id)0xE563, @"F080",
(id)0xE564, @"F081",
(id)0xE565, @"F082",
(id)0xE566, @"F083",
(id)0xE567, @"F084",
(id)0xE568, @"F085",
(id)0xE569, @"F086",
(id)0xE56A, @"F087",
(id)0xE56B, @"F088",
(id)0xE56C, @"F089",
(id)0xE56D, @"F08A",
(id)0xE56E, @"F08B",
(id)0xE56F, @"F08C",
(id)0xE570, @"F08D",
(id)0xE571, @"F08E",
(id)0xE572, @"F08F",
(id)0xE573, @"F090",
(id)0xE574, @"F091",
(id)0xE575, @"F092",
(id)0xE576, @"F093",
(id)0xE577, @"F094",
(id)0xE578, @"F095",
(id)0xE579, @"F096",
(id)0xE57A, @"F097",
(id)0xE57B, @"F098",
(id)0xE57C, @"F099",
(id)0xE57D, @"F09A",
(id)0xE57E, @"F09B",
(id)0xE57F, @"F09C",
(id)0xE580, @"F09D",
(id)0xE581, @"F09E",
(id)0xE582, @"F09F",
(id)0xE583, @"F0A0",
(id)0xE584, @"F0A1",
(id)0xE585, @"F0A2",
(id)0xE586, @"F0A3",
(id)0xE587, @"F0A4",
(id)0xE588, @"F0A5",
(id)0xE589, @"F0A6",
(id)0xE58A, @"F0A7",
(id)0xE58B, @"F0A8",
(id)0xE58C, @"F0A9",
(id)0xE58D, @"F0AA",
(id)0xE58E, @"F0AB",
(id)0xE58F, @"F0AC",
(id)0xE590, @"F0AD",
(id)0xE591, @"F0AE",
(id)0xE592, @"F0AF",
(id)0xE593, @"F0B0",
(id)0xE594, @"F0B1",
(id)0xE595, @"F0B2",
(id)0xE596, @"F0B3",
(id)0xE597, @"F0B4",
(id)0xE598, @"F0B5",
(id)0xE599, @"F0B6",
(id)0xE59A, @"F0B7",
(id)0xE59B, @"F0B8",
(id)0xE59C, @"F0B9",
(id)0xE59D, @"F0BA",
(id)0xE59E, @"F0BB",
(id)0xE59F, @"F0BC",
(id)0xE5A0, @"F0BD",
(id)0xE5A1, @"F0BE",
(id)0xE5A2, @"F0BF",
(id)0xE5A3, @"F0C0",
(id)0xE5A4, @"F0C1",
(id)0xE5A5, @"F0C2",
(id)0xE5A6, @"F0C3",
(id)0xE5A7, @"F0C4",
(id)0xE5A8, @"F0C5",
(id)0xE5A9, @"F0C6",
(id)0xE5AA, @"F0C7",
(id)0xE5AB, @"F0C8",
(id)0xE5AC, @"F0C9",
(id)0xE5AD, @"F0CA",
(id)0xE5AE, @"F0CB",
(id)0xE5AF, @"F0CC",
(id)0xE5B0, @"F0CD",
(id)0xE5B1, @"F0CE",
(id)0xE5B2, @"F0CF",
(id)0xE5B3, @"F0D0",
(id)0xE5B4, @"F0D1",
(id)0xEAFB, @"F0D2",
(id)0xEAFC, @"F0D3",
(id)0xEAFD, @"F0D4",
(id)0xEAFE, @"F0D5",
(id)0xEAFF, @"F0D6",
(id)0xEB00, @"F0D7",
(id)0xEB01, @"F0D8",
(id)0xEB02, @"F0D9",
(id)0xEB03, @"F0DA",
(id)0xEB04, @"F0DB",
(id)0xEB05, @"F0DC",
(id)0xEB06, @"F0DD",
(id)0xEB07, @"F0DE",
(id)0xEB08, @"F0DF",
(id)0xEB09, @"F0E0",
(id)0xEB0A, @"F0E1",
(id)0xEB0B, @"F0E2",
(id)0xEB0C, @"F0E3",
(id)0xEB0D, @"F0E4",
(id)0xE5B5, @"F0E5",
(id)0xE5B6, @"F0E6",
(id)0xE5B7, @"F0E7",
(id)0xE5B8, @"F0E8",
(id)0xE5B9, @"F0E9",
(id)0xE5BA, @"F0EA",
(id)0xE5BB, @"F0EB",
(id)0xE5BC, @"F0EC",
(id)0xE5BD, @"F0ED",
(id)0xE5BE, @"F0EE",
(id)0xE5BF, @"F0EF",
(id)0xE5C0, @"F0F0",
(id)0xE5C1, @"F0F1",
(id)0xE5C2, @"F0F2",
(id)0xE5C3, @"F0F3",
(id)0xE5C4, @"F0F4",
(id)0xE5C5, @"F0F5",
(id)0xE5C6, @"F0F6",
(id)0xE5C7, @"F0F7",
(id)0xE5C8, @"F0F8",
(id)0xE5C9, @"F0F9",
(id)0xE5CA, @"F0FA",
(id)0xE5CB, @"F0FB",
(id)0xE5CC, @"F0FC",
nil
};
#endif

static const id JaikuIcon[] = {
@"web-hand", @"344",
@"web-hanger", @"345",
@"web-hearingprotector", @"346",
@"web-love", @"347",
@"web-eat", @"341",
@"web-gameboy", @"342",
@"web-grenade", @"343",
@"web-balloons", @"348",
@"web-clock", @"349",
@"web-wheelchair", @"379",
@"web-train", @"378",
@"web-straitjacket", @"371",
@"web-storm", @"370",
@"web-luggage", @"373",
@"web-metro", @"372",
@"web-taxi", @"375",
@"web-sun", @"374",
@"web-toaster", @"377",
@"web-technics", @"376",
@"web-coffee", @"319",
@"web-grumpy", @"318",
@"web-cigarettes", @"313",
@"web-videotape", @"312",
@"web-bra", @"311",
@"web-bomb", @"310",
@"web-bus", @"317",
@"web-airplain", @"316",
@"web-champaign", @"315",
@"web-vinyl", @"314",
@"web-happy", @"393",
@"web-home", @"392",
@"web-lifejacket", @"391",
@"web-picnic", @"390",
@"web-search", @"397",
@"web-shop", @"396",
@"web-theatre", @"395",
@"web-toiletpaper", @"394",
@"web-hurry", @"399",
@"web-cloudy", @"398",
@"web-spraycan", @"368",
@"web-sticks", @"369",
@"web-soda", @"366",
@"web-song", @"367",
@"web-snorkeling", @"364",
@"web-snowflake", @"365",
@"web-sk8", @"362",
@"web-sleep", @"363",
@"web-salt", @"360",
@"web-scull", @"361",
@"web-uzi", @"308",
@"web-scoop", @"309",
@"web-car", @"301",
@"web-alarmclock", @"302",
@"web-loudspeaker", @"303",
@"web-tram", @"304",
@"web-casette", @"305",
@"web-underware", @"306",
@"web-rollerblade", @"307",
@"web-zippo", @"380",
@"web-icecream", @"381",
@"web-movie", @"382",
@"web-makeup", @"383",
@"web-bandaid", @"384",
@"web-wine", @"385",
@"web-clean", @"386",
@"web-blading", @"387",
@"web-bike", @"388",
@"web-pils", @"389",
@"web-football", @"339",
@"web-exclamationmark", @"338",
@"web-playshirt", @"335",
@"web-popcorn", @"334",
@"web-event", @"337",
@"web-disc", @"336",
@"web-game", @"331",
@"web-videocamera", @"330",
@"web-driller", @"333",
@"web-cone", @"332",
@"web-baby-boy", @"402",
@"web-morning", @"400",
@"web-beer", @"322",
@"web-binoculars", @"323",
@"web-camera", @"320",
@"web-basketball", @"321",
@"web-wallclock", @"326",
@"web-trashcan", @"327",
@"web-boiler", @"324",
@"web-walk", @"325",
@"web-tv", @"328",
@"web-computing", @"329",
@"web-question", @"357",
@"web-notes", @"356",
@"web-middlefinger", @"355",
@"web-book", @"354",
@"web-microwave", @"353",
@"web-megaphone", @"352",
@"web-barrier", @"350",
@"web-shuttlecock", @"359",
@"web-rollator", @"358",
nil
};

static const id JaikuToolTip[] = {
@"hand", @"344",
@"hanger", @"345",
@"ear muffs", @"346",
@"love", @"347",
@"fork", @"341",
@"gameboy", @"342",
@"grenade", @"343",
@"balloons", @"348",
@"clock", @"349",
@"wheelchair", @"379",
@"train", @"378",
@"straitjacket", @"371",
@"storm", @"370",
@"luggage", @"373",
@"metro", @"372",
@"taxi", @"375",
@"sun", @"374",
@"toaster", @"377",
@"technics", @"376",
@"coffee", @"319",
@"grumpy", @"318",
@"cigarettes", @"313",
@"videotape", @"312",
@"bra", @"311",
@"bomb", @"310",
@"bus", @"317",
@"airport", @"316",
@"champaign", @"315",
@"vinyl", @"314",
@"happy", @"393",
@"home", @"392",
@"lifejacket", @"391",
@"picnic", @"390",
@"search", @"397",
@"shop", @"396",
@"theatre", @"395",
@"toiletpaper", @"394",
@"Hurry", @"399",
@"cloudy", @"398",
@"spray", @"368",
@"sticks", @"369",
@"soda", @"366",
@"song", @"367",
@"snorkeling", @"364",
@"snowflake", @"365",
@"sk8", @"362",
@"leep", @"363",
@"salt", @"360",
@"scull", @"361",
@"uzi", @"308",
@"scoop", @"309",
@"car", @"301",
@"alarm clock", @"302",
@"loudspeaker", @"303",
@"tram", @"304",
@"casette", @"305",
@"underwear", @"306",
@"rollerblade", @"307",
@"zippo", @"380",
@"ice cream", @"381",
@"movie", @"382",
@"makeup", @"383",
@"bandaid", @"384",
@"wine", @"385",
@"clean", @"386",
@"blading", @"387",
@"bike", @"388",
@"pils", @"389",
@"football", @"339",
@"exclamationmark", @"338",
@"play", @"335",
@"popcorn", @"334",
@"event", @"337",
@"disc", @"336",
@"game", @"331",
@"videocamera", @"330",
@"driller", @"333",
@"cone", @"332",
@"Itsaboy", @"402",
@"Morning", @"400",
@"beer", @"322",
@"binoculars", @"323",
@"camera", @"320",
@"basketball", @"321",
@"wallclock", @"326",
@"trashcan", @"327",
@"boiler", @"324",
@"walk", @"325",
@"tv", @"328",
@"computer", @"329",
@"question", @"357",
@"notes", @"356",
@"middle finger", @"355",
@"book", @"354",
@"microwave", @"353",
@"megaphone", @"352",
@"barrier", @"350",
@"shuttlecock", @"359",
@"rollator", @"358",
nil
};

+ (NSImage *)resizeImage:(NSImage *)image
				withSize:(NSSize)size
{
	NSImage *cellImage = [[[NSImage alloc] initWithSize:size] autorelease];
	NSSize imageSize = [image size];
	@synchronized([NSApplication sharedApplication])
	{
		[cellImage lockFocus];
		[[NSGraphicsContext currentContext] setShouldAntialias:YES];
		[image drawInRect:NSMakeRect(0, 0, size.width, size.height)
				 fromRect:NSMakeRect(0, 0, imageSize.width, imageSize.height)
				operation:NSCompositeCopy
				 fraction:1.0];
		[cellImage unlockFocus];
	}
	return cellImage;
}

- (void)getMainThread:(id)object
{
	_mainThread = [NSThread currentThread];
}

- (NSDictionary *)makeDictionary:(id *)table
{
	NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
	while (*table)
	{
		int code = (int)*table++;
		id value = *table++;
		[dic setValue:value forKey:[NSString stringWithFormat:@"%04X", code]];
	}
	return [[NSDictionary alloc] initWithDictionary:dic];
}

- (NSDictionary *)makeDictionaryJaiku:(id *)table
{
	NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
	while (*table)
	{
		id value = *table++;
		id key = *table++;
		[dic setValue:value forKey:key];
	}
	return [[NSDictionary alloc] initWithDictionary:dic];
}

- (id)init
{
	self = [super init];
	if (self)
	{
		_changeHeight = NO;
		_image = [[NSMutableDictionary alloc] init];
		_DoCoMo = [self makeDictionary:(id *)DoCoMo];
		_EZweb = [self makeDictionary:(id *)EZweb];
		_SoftBank = [self makeDictionary:(id *)SoftBank];
//		_EZwebNowa = [self makeDictionsry:(id *)EZwebNowa];
		_JaikuIcon = [self makeDictionaryJaiku:(id *)JaikuIcon];
		_JaikuToolTip = [self makeDictionaryJaiku:(id *)JaikuToolTip];
		_controller = nil;
		_service = nil;
		_icon = nil;
		_xmppCount = 0;
		//_lockXMPP = [[NSLock alloc] init];
		//_lockedXMPP = NO;
		//_queueXMPP = [[NSMutableArray alloc] init];
		_delayedReply = [[NSMutableDictionary alloc] init];
		_unescaping = [[NSDictionary alloc] initWithObjectsAndKeys:
					   @"\"", @"quot",		//quotation mark = APL quote"
					   @"&", @"amp",		//ampersand"
					   @"<", @"lt",			//less-than sign"
					   @">", @"gt",			//greater-than sign"
					   @" ", @"nbsp",		//no-break space = non-breaking space"
					   @"¡", @"iexcl",		//inverted exclamation mark"
					   @"¢", @"cent",		//cent sign"
					   @"£", @"pound",		//pound sign"
					   @"¤", @"curren",		//currency sign"
					   @"¥", @"yen",		//yen sign = yuan sign"
					   @"¦", @"brvbar",		//broken bar = broken vertical bar"
					   @"§", @"sect",		//section sign"
					   @"¨", @"uml",		//diaeresis = spacing diaeresis"
					   @"©", @"copy",		//copyright sign"
					   @"ª", @"ordf",		//feminine ordinal indicator"
					   @"«", @"laquo",		//left-pointing double angle quotation mark = left pointing guillemet"
					   @"¬", @"not",		//not sign"
					   @"­ ", @"shy",		//soft hyphen = discretionary hyphen"
					   @"®", @"reg",		//registered sign = registered trade mark sign"
					   @"¯", @"macr",		//macron = spacing macron = overline = APL overbar"
					   @"°", @"deg",		//degree sign"
					   @"±", @"plusmn",		//plus-minus sign = plus-or-minus sign"
					   @"²", @"sup2",		//superscript two = superscript digit two = squared"
					   @"³", @"sup3",		//superscript three = superscript digit three = cubed"
					   @"´", @"acute",		//acute accent = spacing acute"
					   @"µ", @"micro",		//micro sign"
					   @"¶", @"para",		//pilcrow sign = paragraph sign"
					   @"·", @"middot",		//middle dot = Georgian comma = Greek middle dot"
					   @"¸", @"cedil",		//cedilla = spacing cedilla"
					   @"¹", @"sup1",		//superscript one = superscript digit one"
					   @"º", @"ordm",		//masculine ordinal indicator"
					   @"»", @"raquo",		//right-pointing double angle quotation mark = right pointing guillemet"
					   @"¼", @"frac14",		//vulgar fraction one quarter = fraction one quarter"
					   @"½", @"frac12",		//vulgar fraction one half = fraction one half"
					   @"¾", @"frac34",		//vulgar fraction three quarters = fraction three quarters"
					   @"¿", @"iquest",		//inverted question mark = turned question mark"
					   @"À", @"Agrave",		//latin capital letter A with grave = latin capital letter A grave"
					   @"Á", @"Aacute",		//latin capital letter A with acute"
					   @"Â", @"Acirc",		//latin capital letter A with circumflex"
					   @"Ã", @"Atilde",		//latin capital letter A with tilde"
					   @"Ä", @"Auml",		//latin capital letter A with diaeresis"
					   @"Å", @"Aring",		//latin capital letter A with ring above = latin capital letter A ring"
					   @"Æ", @"AElig",		//latin capital letter AE = latin capital ligature AE"
					   @"Ç", @"Ccedil",		//latin capital letter C with cedilla"
					   @"È", @"Egrave",		//latin capital letter E with grave"
					   @"É", @"Eacute",		//latin capital letter E with acute"
					   @"Ê", @"Ecirc",		//latin capital letter E with circumflex"
					   @"Ë", @"Euml",		//latin capital letter E with diaeresis"
					   @"Ì", @"Igrave",		//latin capital letter I with grave"
					   @"Í", @"Iacute",		//latin capital letter I with acute"
					   @"Î", @"Icirc",		//latin capital letter I with circumflex"
					   @"Ï", @"Iuml",		//latin capital letter I with diaeresis"
					   @"Ð", @"ETH",		//latin capital letter ETH"
					   @"Ñ", @"Ntilde",		//latin capital letter N with tilde"
					   @"Ò", @"Ograve",		//latin capital letter O with grave"
					   @"Ó", @"Oacute",		//latin capital letter O with acute"
					   @"Ô", @"Ocirc",		//latin capital letter O with circumflex"
					   @"Õ", @"Otilde",		//latin capital letter O with tilde"
					   @"Ö", @"Ouml",		//latin capital letter O with diaeresis"
					   @"×", @"times",		//multiplication sign"
					   @"Ø", @"Oslash",		//latin capital letter O with stroke = latin capital letter O slash"
					   @"Ù", @"Ugrave",		//latin capital letter U with grave"
					   @"Ú", @"Uacute",		//latin capital letter U with acute"
					   @"Û", @"Ucirc",		//latin capital letter U with circumflex"
					   @"Ü", @"Uuml",		//latin capital letter U with diaeresis"
					   @"Ý", @"Yacute",		//latin capital letter Y with acute"
					   @"Þ", @"THORN",		//latin capital letter THORN"
					   @"ß", @"szlig",		//latin small letter sharp s = ess-zed"
					   @"à", @"agrave",		//latin small letter a with grave = latin small letter a grave"
					   @"á", @"aacute",		//latin small letter a with acute"
					   @"â", @"acirc",		//latin small letter a with circumflex"
					   @"ã", @"atilde",		//latin small letter a with tilde"
					   @"ä", @"auml",		//latin small letter a with diaeresis"
					   @"å", @"aring",		//latin small letter a with ring above = latin small letter a ring"
					   @"æ", @"aelig",		//latin small letter ae = latin small ligature ae"
					   @"ç", @"ccedil",		//latin small letter c with cedilla"
					   @"è", @"egrave",		//latin small letter e with grave"
					   @"é", @"eacute",		//latin small letter e with acute"
					   @"ê", @"ecirc",		//latin small letter e with circumflex"
					   @"ë", @"euml",		//latin small letter e with diaeresis"
					   @"ì", @"igrave",		//latin small letter i with grave"
					   @"í", @"iacute",		//latin small letter i with acute"
					   @"î", @"icirc",		//latin small letter i with circumflex"
					   @"ï", @"iuml",		//latin small letter i with diaeresis"
					   @"ð", @"eth",		//latin small letter eth"
					   @"ñ", @"ntilde",		//latin small letter n with tilde"
					   @"ò", @"ograve",		//latin small letter o with grave"
					   @"ó", @"oacute",		//latin small letter o with acute"
					   @"ô", @"ocirc",		//latin small letter o with circumflex"
					   @"õ", @"otilde",		//latin small letter o with tilde"
					   @"ö", @"ouml",		//latin small letter o with diaeresis"
					   @"÷", @"divide",		//division sign"
					   @"ø", @"oslash",		//latin small letter o with stroke, = latin small letter o slash"
					   @"ù", @"ugrave",		//latin small letter u with grave"
					   @"ú", @"uacute",		//latin small letter u with acute"
					   @"û", @"ucirc",		//latin small letter u with circumflex"
					   @"ü", @"uuml",		//latin small letter u with diaeresis"
					   @"ý", @"yacute",		//latin small letter y with acute"
					   @"þ", @"thorn",		//latin small letter thorn"
					   @"ÿ", @"yuml",		//latin small letter y with diaeresis"
					   @"Œ", @"OElig",		//latin capital ligature OE"
					   @"œ", @"oelig",		//latin small ligature oe"
					   @"Š", @"Scaron",		//latin capital letter S with caron"
					   @"š", @"scaron",		//latin small letter s with caron"
					   @"Ÿ", @"Yuml",		//llatin capital letter Y with diaeresis"
					   @"ˆ", @"circ",		//modifier letter circumflex accent"
					   @"˜", @"tilde",		//small tilde"
					   @"ƒ", @"fnof",		//latin small f with hook = function = florin, U+0192 ISOtech"
					   @"Α", @"Alpha",		//greek capital letter alpha"
					   @"Β", @"Beta",		//greek capital letter beta"
					   @"Γ", @"Gamma",		//greek capital letter gamma"
					   @"Δ", @"Delta",		//greek capital letter Delta"
					   @"Ε", @"Epsilon",	//greek capital letter epsilon"
					   @"Ζ", @"Zeta",		//greek capital letter zeta"
					   @"Η", @"Eta",		//greek capital letter eta"
					   @"Θ", @"Theta",		//greek capital letter theta"
					   @"Ι", @"Iota",		//greek capital letter iota"
					   @"Κ", @"Kappa",		//greek capital letter kappa"
					   @"Λ", @"Lambda",		//greek capital letter lambda"
					   @"Μ", @"Mu",			//greek capital letter mu"
					   @"Ν", @"Nu",			//greek capital letter nu"
					   @"Ξ", @"Xi",			//greek capital letter xi"
					   @"Ο", @"Omicron",	//greek capital letter omicron"
					   @"Π", @"Pi",			//greek capital letter pi"
					   @"Ρ", @"Rho",		//greek capital letter rho"
					   @"Σ", @"Sigma",		//greek capital letter sigma"
					   @"Τ", @"Tau",		//greek capital letter kappa"
					   @"Υ", @"Upsilon",	//greek capital letter upsilon"
					   @"Φ", @"Phi",		//greek capital letter phi"
					   @"Χ", @"Chi",		//greek capital letter chi"
					   @"Ψ", @"Psi",		//greek capital letter psi"
					   @"Ω", @"Omega",		//greek capital letter omega"
					   @"α", @"alpha",		//greek small letter alpha"
					   @"β", @"beta",		//greek small letter beta"
					   @"γ", @"gamma",		//greek small letter gamma"
					   @"δ", @"delta",		//greek small letter Delta"
					   @"ε", @"epsilon",	//greek small letter epsilon"
					   @"ζ", @"zeta",		//greek small letter zeta"
					   @"η", @"eta",		//greek small letter eta"
					   @"θ", @"theta",		//greek small letter theta"
					   @"ι", @"iota",		//greek small letter iota"
					   @"κ", @"kappa",		//greek small letter kappa"
					   @"λ", @"lambda",		//greek small letter lambda"
					   @"μ", @"mu",			//greek small letter mu"
					   @"ν", @"nu",			//greek small letter nu"
					   @"ξ", @"xi",			//greek small letter xi"
					   @"ο", @"omicron",	//greek small letter omicron"
					   @"π", @"pi",			//greek small letter pi"
					   @"ρ", @"rho",		//greek small letter rho"
					   @"ς", @"sigmaf",		//greek small letter final sigma"
					   @"σ", @"sigma",		//greek small letter sigma"
					   @"τ", @"tau",		//greek small letter kappa"
					   @"υ", @"upsilon",	//greek small letter upsilon"
					   @"φ", @"phi",		//greek small letter phi"
					   @"χ", @"chi",		//greek small letter chi"
					   @"ψ", @"psi",		//greek small letter psi"
					   @"ω", @"omega",		//greek small letter omega"
					   @"ϑ", @"thetasym",	//greek small letter theta symbol"
					   @"ϒ", @"upsih",		//greek upsilon with hook symbol"
					   @"ϖ", @"piv",		//greek pi symbol"
					   @" ", @"ensp",		//en space"
					   @" ", @"emsp",		//em space"
					   @" ", @"thinsp",		//thin space"
					   @"‌", @"zwnj",		//zero width non-joiner"
					   @"‍", @"zwj",		//zero width joiner"
					   @"‎", @"lrm",		//left-to-right mark"
					   @"‏", @"rlm",		//right-to-left mark"
					   @"–", @"ndash",		//en dash"
					   @"—", @"mdash",		//em dash"
					   @"‘", @"lsquo",		//left single quotation mark"
					   @"’", @"rsquo",		//right single quotation mark"
					   @"‚", @"sbquo",		//single low-9 quotation mark"
					   @"“", @"ldquo",		//left double quotation mark"
					   @"”", @"rdquo",		//right double quotation mark"
					   @"„", @"bdquo",		//double low-9 quotation mark"
					   @"†", @"dagger",		//dagger"
					   @"‡", @"Dagger",		//double dagger"
					   @"•", @"bull",		//bullet = black small circle"
					   @"…", @"hellip",		//horizontal ellipsis = three dot leader"
					   @"‰", @"permil",		//per mille sign"
					   @"′", @"prime",		//prime = minutes = feet"
					   @"″", @"Prime",		//double prime = seconds = inches"
					   @"‹", @"lsaquo",		//single left-pointing angle quotation mark"
					   @"›", @"rsaquo",		//single right-pointing angle quotation mark"
					   @"‾", @"oline",		//overline = spacing overscore"
					   @"⁄", @"frasl",		//fraction slash"
					   @"€", @"euro",		//euro sign"
					   @"ℑ", @"image",		//blackletter capital I = imaginary part"
					   @"℘", @"ewierp",		//script capital P = power set = Weierstrass p"
					   @"ℜ", @"real",		//blackletter capital R = real part symbol"
					   @"™", @"trade",		//trade mark sign"
					   @"ℵ", @"alefsym",	//alef symbol = first transfinite cardinal"
					   @"←", @"larr",		//leftwards arrow"
					   @"↑", @"uarr",		//uowards arrow"
					   @"→", @"rarr",		//rightwards arrow"
					   @"↓", @"darr",		//downwards arrow"
					   @"↔", @"harr",		//left right arrow"
					   @"↵", @"crarr",		//downwards arrow with corner leftwards = carriage return"
					   @"⇐", @"lArr",		//leftwards double arrow"
					   @"⇑", @"uArr",		//upwards double arrow"
					   @"⇒", @"rArr",		//rightwards double arrow"
					   @"⇓", @"dArr",		//downwards double arrow"
					   @"⇔", @"hArr",		//left right double arrow"
					   @"∀", @"forall",		//for all"
					   @"∂", @"part",		//partial differential"
					   @"∃", @"exist",		//there exists"
					   @"∅", @"empty",		//empty set = null set = diameter"
					   @"∇", @"nabla",		//nabla = backward difference"
					   @"∈", @"isin",		//element of"
					   @"∉", @"notin",		//not an element of"
					   @"∋", @"ni",			//contains as member"
					   @"∏", @"prod",		//n-ary product = product sign"
					   @"∑", @"sum",		//n-ary sumation"
					   @"−", @"minus",		//minus sign"
					   @"∗", @"lowast",		//asterisk operator"
					   @"√", @"radic",		//square root = radical sign"
					   @"∝", @"prop",		//proportional to"
					   @"∞", @"infin",		//infinity"
					   @"∠", @"ang",		//angle"
					   @"∧", @"and",		//logical and = wedge"
					   @"∨", @"or",			//logical or = vee"
					   @"∩", @"cap",		//intersection = cap"
					   @"∪", @"cup",		//union = cup"
					   @"∫", @"int",		//integral"
					   @"∴", @"there4",		//therefore"
					   @"∼", @"sim",		//tilde operator = varies with = similar to"
					   @"≅", @"cong",		//approximately equal to"
					   @"≈", @"asymp",		//almost equal to = asymptotic to"
					   @"≠", @"ne",			//not equal to"
					   @"≡", @"equiv",		//identical to"
					   @"≤", @"le",			//less-than or equal to"
					   @"≥", @"ge",			//greater-than or equal to"
					   @"⊂", @"sub",		//subset of"
					   @"⊃", @"sup",		//superset of"
					   @"⊄", @"nsub",		//not a subset of"
					   @"⊆", @"sube",		//subset of or equal to"
					   @"⊇", @"supe",		//superset of or equal to"
					   @"⊕", @"oplus",		//circled plus = direct sum"
					   @"⊗", @"otimes",		//circled times = vector product"
					   @"⊥", @"perp",		//up tack = orthogonal to = perpendicular"
					   @"⋅", @"sdot",		//dot operator"
					   @"⌈", @"lceil",		//left ceiling = apl upstile"
					   @"⌉", @"rceil",		//right ceiling"
					   @"⌊", @"lfloor",		//left floor = apl downstile"
					   @"⌋", @"rfloor",		//right floor"
					   @"〈", @"lang",		//left-pointing angle bracket = bra"
					   @"〉", @"rang",		//right-pointing angle bracket = ket"
					   @"◊", @"loz",		//lozenge"
					   @"♠", @"spades",		//black spade suit"
					   @"♣", @"clubs",		//black club suit = shamrock"
					   @"♥", @"hearts",		//black heart suit = valentine"
					   @"♦", @"diams",		//black diamond suit"
					   nil];
		[self performSelectorOnMainThread:@selector(getMainThread:)
							   withObject:nil
							waitUntilDone:YES];
	}
	return self;
}

- (void)dealloc
{
	[_image release];
	[_DoCoMo release];
	[_EZweb release];
	[_SoftBank release];
	[_JaikuIcon release];
	[_JaikuToolTip release];
	if (_icon)
	{
		[_icon release];
	}
	[_delayedReply release];
	[_unescaping release];
	[super dealloc];
}

- (NSImage *)makeIcon:(NSString *)name
{
	NSImage *icon = [[NSImage alloc] initWithSize:NSMakeSize(16, 16+13)];
#if defined(_D_E_B_U_G_)
	if ([[NSThread currentThread] isEqual:TheMainThread])
	{
		LOG(@"[%@ setImage] MAIN THREAD !!!", [self className]);
	}
#endif //defined(_D_E_B_U_G_)
	@synchronized([NSApplication sharedApplication])
	{
		[icon lockFocus];
		[[NSGraphicsContext currentContext] setShouldAntialias:YES];
		[[NSImage imageNamed:name] compositeToPoint:NSMakePoint(0, 0) operation:NSCompositeSourceOver];
		[icon unlockFocus];
	}
	return icon;
}

- (id)init:(NSString *)service
WithController:(AfficheurController *)controller
preferences:(AfficheurPreferences *)preferences;
{
	self = [self init];
	if (self)
	{
		_controller = controller;
		_preferences = preferences;
		_service = service;
		if ([service isEqualToString:Twitter])
		{
			_icon = [self makeIcon:@"icon-twitter"];
			_title = @"Twitter";
			_errorIcon = LogoTwitter;
		}
		else if ([service isEqualToString:Jaiku])
		{
			_icon = [self makeIcon:@"icon-jaiku"];
			_title = @"Jaiku";
			_errorIcon = LogoJaiku;
		}
		else if ([service isEqualToString:Tumblr])
		{
			_icon = [self makeIcon:@"icon-tumblr"];
			_title = @"Tumblr";
			_errorIcon = LogoTumblr;
		}
//		else if ([service isEqualToString:Nowa])
//		{
//			_icon = [self makeIcon:@"icon-nowa"];
//			_title = @"nowa";
//			_errorIcon = LogoNowa;
//		}
		else if ([service isEqualToString:Wassr])
		{
			_icon = [self makeIcon:@"icon-wassr"];
			_title = @"Wassr";
			_errorIcon = LogoWassr;
		}
		else if ([service isEqualToString:Identica])
		{
			_icon = [self makeIcon:@"icon-identica"];
			_title = @"identi.ca";
			_errorIcon = LogoIdentica;
		}
//		else if ([service isEqualToString:Jisko])
//		{
//			_icon = [self makeIcon:@"icon-jisko"];
//			_title = @"Jisko";
//			_errorIcon = LogoJisko;
//		}
//		else if ([service isEqualToString:Chuitter])
//		{
//			_icon = [self makeIcon:@"icon-chuitter"];
//			_title = @"chuitter";
//			_errorIcon = LogoChuitter;
//		}
		else if ([service isEqualToString:FriendFeed])
		{
			_icon = [self makeIcon:@"icon-friendfeed"];
			_title = @"FriendFeed";
			_errorIcon = LogoFriendFeed;
		}
		else if ([service isEqualToString:FaceBook])
		{
			_icon = [self makeIcon:@"icon-facebook"];
			_title = @"facebook";
			_errorIcon = LogoFaceBook;
		}
	}
	return self;
}

- (NSString *)service
{
	return _service;
}

- (NSString *)toolTipDoCoMo:(unichar)unicode
{
	NSString *tooltip = [_DoCoMo valueForKey:[NSString stringWithFormat:@"%04X", unicode]];
	if (tooltip)
	{
		return tooltip;
	}
	return nil;
}

- (NSString *)toolTipEZweb:(unichar)unicode
{
	NSString *tooltip = [_EZweb valueForKey:[NSString stringWithFormat:@"%04X", unicode]];
	if (tooltip)
	{
		return tooltip;
	}
	return nil;
}

- (NSString *)toolTipSoftBank:(unichar)unicode
{
	NSString *tooltip = [_SoftBank valueForKey:[NSString stringWithFormat:@"%04X", unicode]];
	if (tooltip)
	{
		return tooltip;
	}
	return nil;
}

- (NSString *)toolTipJaiku:(int)iconCode
{
	return [_JaikuToolTip valueForKey:[[NSNumber numberWithInt:iconCode] stringValue]];
}

- (NSString *)imageNameJaiku:(int)iconCode
{
	return [_JaikuIcon valueForKey:[[NSNumber numberWithInt:iconCode] stringValue]];
}

- (void)saveState:(BOOL)state
	   andEnabled:(BOOL)enabled
{
	_state = state;
	_enable = enabled;
}

- (BOOL)status
{
	return _state;
}

- (BOOL)enable
{
	return _enable;
}

- (BOOL)changeHeight
{
	return _changeHeight;
}

- (NSString *)determineResponse:(NSString *)response
				   withFunction:(NSString *)function
{
	NSString* description = [NSString stringWithFormat:@"%@ was successful.", function];
	if (response)
	{
		description = [NSString stringWithFormat:@"%@", response];
	}
	return description;
}

- (NSString *)determineNotify:(NSString *)response
{
	NSString* notify = GrowlAfficheurSuccessNotify;
	if (response)
	{
		notify = GrowlAfficheurFailureNotify;
	}
	return notify;
}

- (BOOL)determineSuccess:(NSString *)response
{
	BOOL success = YES;
	if (response && ![response isKindOfClass:[NSNull class]])
	{
		success = NO;
	}
	return success;
}

- (void)determinePost:(NSString *)response
			withTitle:(NSString *)title
			 function:(NSString *)function
{
	if (![response isKindOfClass:[NSNull class]])
	{
		[_controller notifyWithTitle:title
						 description:[self determineResponse:response withFunction:function]
					notificationName:[self determineNotify:response]
							iconData:nil
						clickContext:nil];
	}
	if ([self determineSuccess:response])
	{
		[_controller postOK];
	}
	else
	{
		[_controller postNG];
	}
}

- (void)determinePost:(NSString *)response
{
	[self determinePost:response withTitle:_title function:@"Post"];
}

- (BOOL)isReply:(NSDictionary *)object
{
	return NO;
}

- (BOOL)isChannel:(NSDictionary *)object
{
	return NO;
}

- (NSString *)convertText:(NSString *)text
{
	if (text)
	{
		NSString *string = [text replaceWithExpression:@"\\r"
											   replace:@""];
		string = [string replaceWithExpression:@"\\\\u([0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z])"
									   replace:@"&#x\\1;"];
		LOG(@"[%@ convertText]\n%@", [self className], string);
		return (NSString*)CFXMLCreateStringByUnescapingEntities(kCFAllocatorDefault,
																(CFStringRef)string,
																(CFDictionaryRef)_unescaping);
	}
	return @"";
}

- (NSDictionary *)fetch:(NSString *)item_id
			withService:(NSString *)service
{
	return [_controller fetchTimeline:item_id withService:service];
}

- (NSDictionary *)fetchALL:(NSString *)item_id
			   withService:(NSString *)service
{
	return [_controller fetchTimelineALL:item_id withService:service];
}

- (NSDictionary *)begins:(NSString *)item_id
			 withService:(NSString *)service
					user:(NSString *)user
{
	return [_controller beginsTimeline:item_id withService:service user:user];
}

- (int)hasKeyword:(NSString *)text
{
	//LOG(@"[%@(%@) hasKeyword]", [self className], _service);
	@try
	{
#if 0
		NSArray *ignoreKeywords = [_preferences ignoreKeywords];
		if (text && ignoreKeywords)
		{
			NSEnumerator *enumerator = [ignoreKeywords objectEnumerator];
			id obj;
			while ((obj = [enumerator nextObject]))
			{
				NSString *keyword = [obj valueForKey:@"keyword"];
				if (keyword)
				{
					if ([text lengthOfRegularExpression:[keyword regularizeString]
											withOptions:OgreIgnoreCaseOption | OgreMultilineOption] > 0)
					{
						return NO;
					}
				}
			}
		}
#endif
		NSArray *keywords = [_preferences keywords];
		if (text && keywords)
		{
			NSEnumerator *enumerator = [keywords objectEnumerator];
			id keyword;
			while ((keyword = [enumerator nextObject]))
			{
				if ([[keyword valueForKey:@"enable"] intValue])
				{
					int all = [[keyword valueForKey:@"rule"] intValue];
					int has = 0;
					NSArray *rules = [keyword valueForKey:@"rule.array"];
					NSEnumerator *enumRules = [rules objectEnumerator];
					id rule;
					while ((rule = [enumRules nextObject]))
					{
						NSString *word = [rule valueForKey:@"keyword"];
						if (word)
						{
							NSString *format = @"%@";
							BOOL not = NO;
							switch ([[rule valueForKey:@"rule"] intValue])
							{
								case 0://contains
									format = @"%@";
									break;
								case 1://not contains
									format = @"%@";
									not = YES;
									break;
								case 2://begins
									format = @"^%@";
									break;
								case 3://ends
									format = @"%@$";
									break;
								case 4://equal
									format = @"^%@$";
									break;
							}
							NSString *reg = [NSString stringWithFormat:format, [word regularizeString]];
							if ([text lengthOfRegularExpression:reg
													withOptions:OgreIgnoreCaseOption | OgreMultilineOption] > 0)
							{
								if(!not)
								{
									has++;
								}
							}
							else
							{
								if(not)
								{
									has++;
								}
							}
						}
					}
					if ((!all && (has > 0)) ||
						(all && (has >= [rules count])))
					{
						LOG(@"[%@(%@) hasKeyword]\n%d\n%@\n%@", [self className], _service, has, text, keyword);
						int result = 0;
						if ([[keyword valueForKey:@"no_growl"] intValue])
						{
							result |= 1;
						}
						if ([[keyword valueForKey:@"no_timeline"] intValue])
						{
							result |= 2;
						}
						return result;
					}
				}
			}
		}
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) hasKeyword] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
	return -1;
}

- (int)hasKeywords:(NSArray *)texts
{
	@try
	{
		NSEnumerator *enumerator = [texts objectEnumerator];
		id text;
		while ((text = [enumerator nextObject]))
		{
			int result = [self hasKeyword:text];
			if (result != -1)
			{
				return result;
			}
		}
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) hasKeywords] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
	return -1;
}

- (unichar)unicharFromHexString:(NSString *)str
{
	unichar v = 0;
	int l = [str length];
	int i;
	for(i = 0; i < l; i++)
	{
		if (i != 0)
		{
			v <<= 4;
		}
		unichar c = [str characterAtIndex:i];
		if (c <= '9')
		{
			v += (c - '0');
		}
		else if (c <= 'F')
		{
			v += (c - 'A' + 0x0a);
		}
		else
		{
			v += (c - 'a' + 0x0a);
		}
	}
	return v;
}

- (NSString *)stringFromHexString:(NSString *)str
{
	unichar v = [self unicharFromHexString:str];
	//LOG(@"[%@(%@) stringFromHexString] %@", [self className], _service, str);
	//LOG(@"[%@(%@) stringFromHexString] %X", [self className], _service, v);
	return [NSString stringWithCharacters:&v length:1];
}

- (NSString*)emojiStringFromEmoji:(OGRegularExpressionMatch*)aMatch
					  contextInfo:(id)contextInfo
{
	//LOG(@"[%@(%@) emojiStringFromEmoji]\n%@", [self className], _service, [aMatch matchedString]);
	NSString *code = [[aMatch matchedString] replaceWithExpression:@"\\{emoji\\:(.*?)\\}"
																replace:@"\\1"];
//	if ([contextInfo boolValue])
//	{
//		id isNowa = [_EZwebNowa valueForKey:[NSString stringWithFormat:@"%04X",
//											 [self unicharFromHexString:code]]];
//		if (isNowa)
//		{
//			code = [NSString stringWithFormat:@"%04X", [isNowa intValue]];
//		}
//	}
	NSString *hex = [self stringFromHexString:code];
	//LOG(@"[%@(%@) emojiStringFromEmoji]\ncode = %@", [self className], _service, code);
	//LOG(@"[%@(%@) emojiStringFromEmoji]\nhex = %@", [self className], _service, hex);
	return hex;
}

- (NSString *)stringFromEmoji:(NSString *)str
					 flagNowa:(BOOL)nowa
{
	//LOG(@"[%@(%@) stringFromEmoji]\n%@", [self className], _service, str);
	@synchronized([NSApplication sharedApplication])
	{
		@try
		{
			OGRegularExpression *regex = [OGRegularExpression
										  regularExpressionWithString:@"\\{emoji\\:.*?\\}"
										  options:OgreMultilineOption];
			str = [regex replaceAllMatchesInString:str
										  delegate:self
								   replaceSelector:@selector(emojiStringFromEmoji:contextInfo:)
									   contextInfo:[NSNumber numberWithBool:nowa]];
		}
		@catch (NSException *exception)
		{
			EXPLOG(@"[%@(%@) stringFromEmoji] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
		}
	}
	//LOG(@"[%@(%@) stringFromEmoji]\n%@", [self className], _service, str);
#if 0
	if (nowa)
	{
		//LOG(@"[%@(%@) stringFromEmoji]\nstr = %@", [self className], _service, str);
		NSMutableString *mstr = [[[NSMutableString alloc] init] autorelease];
		int len = [str length];
		unichar *buf = malloc(len * sizeof(unichar));
		if (buf)
		{
			@try
			{
				[str getCharacters:buf];
				unichar *end = buf + len;
				unichar *top = buf;
				unichar *p = buf;
				while (p < end)
				{
					if (((*p >= 0xe001) && (*p <= 0xf0ff)))
					{
						if ((p - top) > 0)
						{
							[mstr appendString:
							 [NSString stringWithCharacters:top length:p - top]];
						}
						unichar unicode = *p;
						[mstr appendFormat:@"{emoji:%04X}", unicode];
						p++;
						top = p;
					}
					p++;
				}
				if (top < end)
				{
					[mstr appendString:
					 [NSString stringWithCharacters:top length:p - top]];
				}
			}
			@catch (NSException *exception)
			{
				EXPLOG(@"[%@(%@) stringFromEmoji] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
			}
			@finally
			{
				free(buf);
			}
		}
		//LOG(@"[%@(%@) stringFromEmoji]\nmstr = %@", [self className], _service, mstr);
		str = [NSString stringWithString:mstr];
	}
#endif
	//LOG(@"[%@(%@) stringFromEmoji] %@", [self className], _service, str);
	return str;
}

- (NSString *)stringFromEmoji:(NSString *)str
{
	return [self stringFromEmoji:str flagNowa:NO];
}

//- (NSString *)stringFromEmojiNowa:(NSString *)str
//{
//	return [self stringFromEmoji:str flagNowa:YES];
//}

- (NSImage *)imageWithUnichar:(unichar)unicode
{
	//LOG(@"[%@(%@) imageWithUnichar] %X", [self className], _service, unicode);
	return [NSImage imageNamed:[NSString stringWithFormat:@"emoji%04X", unicode]];
}

- (NSTextAttachment *)emoji:(unichar)unicode
				   withSize:(float)size
{
	NSTextAttachment *emoji = nil;
	NSString *key = [[NSNumber numberWithInt:unicode] stringValue];
	NSImage *image = [_image valueForKey:key];
	if (!image)
	{
		image = [self imageWithUnichar:unicode];
		//LOG(@"[%@(%@) emoji]\nimage: %@", [self className], _service, image);
		if (image)
		{
			[_image setValue:image forKey:key];
		}
	}
	if (image)
	{
		emoji = [[[NSTextAttachment alloc] init] autorelease];
		NSImage *cellImage = [[[NSImage alloc] initWithSize:NSMakeSize(size, size)] autorelease];
		NSSize cellSize = [cellImage size];
		NSSize imageSize = [image size];
#if defined(_D_E_B_U_G_)
		if ([[NSThread currentThread] isEqual:TheMainThread])
		{
			LOG(@"[%@ setImage] MAIN THREAD !!!", [self className]);
		}
#endif //defined(_D_E_B_U_G_)
		@synchronized([NSApplication sharedApplication])
		{
			[cellImage lockFocus];
			[[NSGraphicsContext currentContext] setShouldAntialias:YES];
			[image drawInRect:NSMakeRect(0, 0, cellSize.width, cellSize.height)
					 fromRect:NSMakeRect(0, 0, imageSize.width, imageSize.height)
					operation:NSCompositeCopy
					 fraction:1.0];
			[cellImage unlockFocus];
		}
		NSTextAttachmentCell *cell = [[[NSTextAttachmentCell alloc] initImageCell:cellImage] autorelease];
		[emoji setAttachmentCell:cell];
	}
	return emoji;
}

- (NSAttributedString *)attributedString:(NSString *)text
								withAttr:(NSDictionary *)attr
{
	NSMutableAttributedString *txtA = nil;
	NSMutableDictionary *link = nil;
	if ([text lengthOfRegularExpression:@"(^.*)<a href\\=\"(.*?)\".*>(.*)</a>.*$"
							withOptions:OgreMultilineOption])
	{
		NSString *from = [text replaceWithExpression:@"(^.*)<a href\\=\"(.*?)\".*>(.*)</a>.*$"
											 replace:@"\\1"
											 options:OgreMultilineOption];
		NSString *url = [text replaceWithExpression:@"(^.*)<a href\\=\"(.*?)\".*>(.*)</a>.*$"
											replace:@"\\2"
											options:OgreMultilineOption];
		NSString *txt = [text replaceWithExpression:@"(^.*)<a href\\=\"(.*?)\".*>(.*)</a>.*$"
											replace:@"\\3"
											options:OgreMultilineOption];
		//LOG(@"[%@(%@) attributedString]\n'%@'\n'%@'\n'%@'", [self className], _service, from, url, txt);
		if (attr)
		{
			txtA = [[[NSMutableAttributedString alloc] initWithString:from
														   attributes:attr] autorelease];
			link = [NSMutableDictionary dictionaryWithDictionary:attr];
		}
		else
		{
			txtA = [[[NSMutableAttributedString alloc] initWithString:from] autorelease];
			link = [NSMutableDictionary dictionary];
		}
		[link setValue:url
				forKey:NSLinkAttributeName];
		if (![[attr valueForKey:NSForegroundColorAttributeName] isEqualTo:[NSColor selectedTextColor]])
		{
			[link setValue:[NSColor colorWithCalibratedRed:0.0 green:0.0 blue:0.3984375 alpha:1]
					forKey:NSForegroundColorAttributeName];
		}
		[link setValue:[[NSFontManager sharedFontManager]
						convertWeight:YES
						ofFont:[attr valueForKey:NSFontAttributeName]]
				forKey:NSFontAttributeName];
		[txtA appendAttributedString:[[[NSAttributedString alloc]
									   initWithString:txt
									   attributes:link] autorelease]];
		//LOG(@"[%@(%@) attributedString]\n%@", [self className], _service, txtA);
	}
	else if (attr)
	{
		txtA = [[[NSMutableAttributedString alloc] init] autorelease];
		NSString *txt = [NSString stringWithString:text];
#if 0
		while ([txt lengthOfRegularExpression:[AfficheurController stringRegularExpressionURL] withOptions:OgreMultilineOption])
		{
			NSString *e = [NSString stringWithFormat:@"^(.*?)(%@)(.*)$", [AfficheurController stringRegularExpressionURL]];
			NSString *t = [txt replaceWithExpression:e
											 replace:@"\\1"
											 options:OgreMultilineOption];
			NSString *u = [txt replaceWithExpression:e
											 replace:@"\\2"
											 options:OgreMultilineOption];
			txt = [txt replaceWithExpression:e
									 replace:@"\\5"
									 options:OgreMultilineOption];
			LOG2(@"[%@(%@) attributedString] t\n%@", [self className], _service, t);
			LOG2(@"[%@(%@) attributedString] u\n%@", [self className], _service, u);
			LOG2(@"[%@(%@) attributedString] txt\n%@", [self className], _service, txt);
			[txtA appendAttributedString:[[[NSAttributedString alloc]
										   initWithString:t
										   attributes:attr] autorelease]];
			link = [NSMutableDictionary dictionaryWithDictionary:attr];
			[link setValue:u
					forKey:NSLinkAttributeName];
			[link setValue:[NSCursor pointingHandCursor]
					forKey:NSCursorAttributeName];
			if (![[attr valueForKey:NSForegroundColorAttributeName] isEqualTo:[NSColor selectedTextColor]])
			{
				[link setValue:[NSColor colorWithCalibratedRed:0.0 green:0.0 blue:0.3984375 alpha:1]
						forKey:NSForegroundColorAttributeName];
			}
			[txtA appendAttributedString:[[[NSAttributedString alloc]
										   initWithString:u
										   attributes:link] autorelease]];
		}
#endif
		if ([txt length] > 0)
		{
			[txtA appendAttributedString:[[[NSAttributedString alloc]
										   initWithString:txt
										   attributes:attr] autorelease]];
		}
	}
	else
	{
		txtA = [[[NSMutableAttributedString alloc] initWithString:text] autorelease];
	}
	return txtA;
}

- (NSAttributedString *)attributedString:(id)text
								withSize:(float)size
								baseLine:(float)baseLine
									attr:(NSDictionary *)attr
{
	if (!attr)
	{
		attr = [NSDictionary dictionaryWithObjectsAndKeys:
				[NSFont fontWithName:@"Lucida Grande" size:11], NSFontAttributeName,
				nil];
	}
	NSMutableAttributedString *txtA = [[[NSMutableAttributedString alloc] init] autorelease];
	[txtA beginEditing];
	if ([text isKindOfClass:[NSImage class]])
	{
		LOG(@"[%@(%@) attributedString] NSImage", [self className], _service);
		@try
		{
			//LOG(@"[%@(%@) attributedString] photo\n%@", [self className], _service, text);
			[txtA appendAttributedString:[[[NSAttributedString alloc]
										   initWithString:@"\n"
										   attributes:attr] autorelease]];
			NSImage *image = text;
			NSSize size = [image size];
			float widthOfTimeline = [_controller withOfTimeline] - 0;
			float width = size.width;
			float height = size.height;
			float mag = 1.0;
			//LOG2(@"[%@(%@) attributedString] %f, %f", [self className], _service, width, height);
			if (size.width > widthOfTimeline)
			{
				//LOG2(@"[%@(%@) attributedString] size.width > width", [self className], _service);
				width = widthOfTimeline;
				mag = width / size.width;
				height = size.height * mag;
			}
			if ((size.height > size.width) && (size.height > widthOfTimeline))
			{
				//LOG2(@"[%@(%@) attributedString] size.height > width", [self className], _service);
				height = widthOfTimeline;
				mag = height / size.height;
				width = size.width * mag;
			}
			//LOG2(@"[%@(%@) attributedString] %f, %f / %f", [self className], _service, width, height, mag);
			NSImage *photo = [[[NSImage alloc] initWithSize:NSMakeSize(width + 0, height + 6)]
							  autorelease];
			if (photo)
			{
#if defined(_D_E_B_U_G_)
				if ([[NSThread currentThread] isEqual:TheMainThread])
				{
					LOG(@"[%@ setImage] MAIN THREAD !!!", [self className]);
				}
#endif //defined(_D_E_B_U_G_)
				@synchronized([NSApplication sharedApplication])
				{
					[photo lockFocus];
					[[NSGraphicsContext currentContext] setShouldAntialias:YES];
					[image drawInRect:NSMakeRect(0, 3, width, height)
							 fromRect:NSMakeRect(0, 0, size.width, size.height)
							operation:NSCompositeSourceOver
							 fraction:1.0];
					[photo unlockFocus];
				}
				image = photo;
				//LOG(@"[%@(%@) attributedString] image\n%@", [self className], _service, image);
				NSTextAttachment *att = [[[NSTextAttachment alloc] init] autorelease];
				NSTextAttachmentCell *cell = [[[NSTextAttachmentCell alloc] initImageCell:image] autorelease];
				[att setAttachmentCell:cell];
				id str = [NSMutableAttributedString attributedStringWithAttachment:att];
				[str addAttributes:attr
							 range:NSMakeRange(0, [str length])];
				[txtA appendAttributedString:str];
				//LOG(@"[%@(%@) attributedString] photo\n%f\n%@", [self className], _service, widthOfTimeline, txtA);
			}
		}
		@catch (NSException *exception)
		{
			EXPLOG(@"[%@(%@) attributedString] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
		}
		LOG(@"[%@(%@) attributedString] NSImage done", [self className], _service);
	}
	else if ([text isKindOfClass:[NSString class]])
	{
		int len = [text length];
		unichar *buf = malloc(len * sizeof(unichar));
		if (buf)
		{
			@try
			{
				[text getCharacters:buf];
				unichar *end = buf + len;
				unichar *top = buf;
				unichar *p = buf;
				while (p < end)
				{
					if (((*p >= 0xe001) && (*p <= 0xf0ff)))
					{
						if ((p - top) > 0)
						{
							[txtA appendAttributedString:
							 [self attributedString:[NSString stringWithCharacters:top
																			length:p - top]
										   withAttr:attr]];
						}
						NSTextAttachment *emoji = [self emoji:*p withSize:size];
						if (emoji)
						{
							//LOG(@"[%@(%@) attributedString]\nemoji: %@", [self className], _service, emoji);
							id str = [NSMutableAttributedString attributedStringWithAttachment:emoji];
							NSMutableDictionary *attach = [NSMutableDictionary
														   dictionaryWithDictionary:attr];
							[attach setValue:[NSNumber numberWithFloat:baseLine]
									  forKey:NSBaselineOffsetAttributeName];
							[str addAttributes:attach
										 range:NSMakeRange(0, [str length])];
							[txtA appendAttributedString:str];
						}
						else if (attr)
						{
							[txtA appendAttributedString:
							 [[[NSAttributedString alloc] initWithString:
							   [NSString stringWithCharacters:p length:1] attributes:attr] autorelease]];
						}
						else
						{
							[txtA appendAttributedString:
							 [[[NSAttributedString alloc] initWithString:
							   [NSString stringWithCharacters:p length:1]] autorelease]];
						}
						top = p + 1;
					}
					p++;
				}
				if (top < end)
				{
					[txtA appendAttributedString:
					 [self attributedString:[NSString stringWithCharacters:top
																	length:end - top]
								   withAttr:attr]];
				}
			}
			@catch (NSException *exception)
			{
				EXPLOG(@"[%@(%@) attributedString] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
			}
			@finally
			{
				free(buf);
			}
		}
		else
		{
			[txtA appendAttributedString:[[[NSAttributedString alloc] initWithString:text attributes:attr] autorelease]];
		}
	}
	[txtA endEditing];
	//LOG(@"[%@(%@) attributedString]\n%@", [self className], _service, txtA);
	return txtA;
}

- (NSAttributedString *)replyAttributedString:(NSString *)text
{
	NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys:
						  [NSFont controlContentFontOfSize:
						   [NSFont smallSystemFontSize] - 2], NSFontAttributeName,
						  nil];
	//LOG(@"[%@(%@) replyAttributedString]\n%@", [self className], _service, attr);
	return [self attributedString:text
						 withSize:9
						 baseLine:-1
							 attr:attr];
}

- (void)registComplete:(NSString *)text
		  flagIdentica:(BOOL)flagIdentica
{
	//LOG(@"[%@(%@) registComplete]\n'%@'", [self className], _service, text);
	@try
	{
		NSMutableArray *regist = [NSMutableArray array];
		if (flagIdentica)
		{
			@synchronized([NSApplication sharedApplication])
			{
				OGRegularExpression *regex = [OGRegularExpression
											  regularExpressionWithString:@"\\![a-zA-Z][\\!-~]+"
											  options:OgreMultilineOption];
				// マッチ結果の列挙子の生成
				NSEnumerator *enumerator = [regex matchEnumeratorInString:text];
				if (enumerator)
				{
					OGRegularExpressionMatch *match;	// マッチ結果
					while ((match = [enumerator nextObject]) != nil) {	// 順番にマッチ結果を得る
						//LOG(@"[%@(%@) registComplete]\n%@", [self className], _service, [match matchedString]);
						[regist addObject:[match matchedString]];
					}
				}
			}
		}
		@synchronized([NSApplication sharedApplication])
		{
			OGRegularExpression *regex = [OGRegularExpression
										  regularExpressionWithString:@"\\#[a-zA-Z][\\!-~]+"
										  options:OgreMultilineOption];
			// マッチ結果の列挙子の生成
			NSEnumerator *enumerator = [regex matchEnumeratorInString:text];
			if (enumerator)
			{
				OGRegularExpressionMatch *match;	// マッチ結果
				while ((match = [enumerator nextObject]) != nil) {	// 順番にマッチ結果を得る
					//LOG(@"[%@(%@) registComplete]\n%@", [self className], _service, [match matchedString]);
					[regist addObject:[match matchedString]];
				}
			}
		}
		BOOL add = NO;
		NSEnumerator *enumerator = [regist objectEnumerator];
		id obj;
		while ((obj = [enumerator nextObject]))
		{
			if ([_preferences addComplete:obj])
			{
				LOG(@"[%@(%@) registComplete]\n%@", [self className], _service, obj);
				add = YES;
			}
		}
		if (add)
		{
			[_controller setComplete];
		}
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) registComplete] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
}

- (void)registComplete:(NSString *)text
{
	[self registComplete:text flagIdentica:NO];
}

- (void)registCompleteIdentica:(NSString *)text
{
	[self registComplete:text flagIdentica:YES];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				   created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
				 retweetedBy:(NSString *)retweetedBy
				 retweetedId:(NSString *)retweetedId
					 keyword:(int)keyword
					 protect:(BOOL)protect
					verified:(BOOL)verified
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	NSDictionary *item = nil;
	@try
	{
		if (!source || [source isKindOfClass:[NSNull class]])
		{
			source = @"";
		}
		if (!text || [text isKindOfClass:[NSNull class]])
		{
			text = @"";
		}
		text = [self convertText:text];
		if (!comment || [comment isKindOfClass:[NSNull class]])
		{
			comment = @"";
		}
		NSString *header = [NSString stringWithFormat:@"%@%@%@", 
							[self convertText:user],
							[self convertText:name],
							[self convertText:channel]];
		NSString *notifyTitle = [NSString stringWithFormat:@"%@", header];
		if ([item_id isEqualToString:IdZero])
		{
			notifyTitle = notify;
		}
		if (![header isEqualToString:@""])
		{
			header = [NSString stringWithFormat:@"%@\n", header];
		}
		NSString *txtN = @"";
		NSMutableAttributedString *txtD = [[[NSMutableAttributedString alloc] init] autorelease];
		NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
		[formatter setFormatterBehavior:NSDateFormatterBehavior10_4];
		NSLocale *locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease];
		[formatter setLocale:locale];
		[formatter setDateFormat:@"MM/dd\nHH:mm"];
		if (!rid)
		{
			rid = @"";
		}
		if (!inReplyUser)
		{
			inReplyUser = @"";
		}
		if (!user_profile)
		{
			user_profile = @"";
		}
		NSNumber *firstNum = [NSNumber numberWithBool:first];
		if (!retweetedBy || [retweetedBy isKindOfClass:[NSNull class]])
		{
			retweetedBy = @"";
		}
		if (!retweetedId || [retweetedId isKindOfClass:[NSNull class]])
		{
			retweetedId = @"";
		}
		item = [NSDictionary dictionaryWithObjectsAndKeys:
				_service, KeyService,
				_icon, KeyServiceIcon,
				item_id, KeyId,
				rid, KeyRId,
				channel, KeyChannel,
				user, KeyUser,
				name, KeyName,
				text, KeyText,
				text, KeyTextEx,
				text_raw, KeyTextRaw,
				comment, KeyComment,
				source, KeySource,
				txtD, KeyTextDisplay,
				txtN, KeyTextNotify,
				created_at, KeyCreatedAt,
				user_profile, KeyUserProfile,
				notifyTitle, KeyNotifyTitle,
				notify, KeyNotify,
				kind, KeyKind,
				category, KeyCategory,
				inReplyUser, KeyInReplyUser,
				retweetedBy , KeyRetweetedBy,
				retweetedId , KeyRetweetedId,
				[NSNumber numberWithInt:keyword], KeyKeyword,
				[NSNumber numberWithBool:protect], KeyProtected,
				[NSNumber numberWithBool:verified], KeyVerified,
				firstNum, KeyFirst,
				[formatter stringFromDate:created_at], KeyDate,
				[NSNumber numberWithInt:-1], KeyIndex,
				[NSNumber numberWithInt:-1], KeyWidth,
				[NSNumber numberWithInt:-1], KeyHeight,
				(xmpp ? FromXMPP : FromAPI), KeyFrom,
				[NSNumber numberWithInt:0], KeySort,
				nil];
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) createItem] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
	return item;
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
				 retweetedBy:(NSString *)retweetedBy
				 retweetedId:(NSString *)retweetedId
					 protect:(BOOL)protect
					verified:(BOOL)verified
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:retweetedBy
				retweetedId:retweetedId
					keyword:-1
					protect:protect
				   verified:NO
					  first:first
					   xmpp:xmpp];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
				 retweetedBy:(NSString *)retweetedBy
				 retweetedId:(NSString *)retweetedId
					 protect:(BOOL)protect
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:retweetedBy
				retweetedId:retweetedId
					protect:protect
				   verified:NO
					  first:first
					   xmpp:xmpp];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
				 retweetedBy:(NSString *)retweetedBy
				 retweetedId:(NSString *)retweetedId
					 keyword:(int)keyword
					 protect:(BOOL)protect
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:retweetedBy
				retweetedId:retweetedId
					keyword:keyword
					protect:protect
				   verified:NO
					  first:first
					   xmpp:xmpp];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					 protect:(BOOL)protect
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:nil
				retweetedId:nil
					protect:protect
					  first:first
					   xmpp:xmpp];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					 keyword:(int)keyword
					 protect:(BOOL)protect
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:nil
				retweetedId:nil
					keyword:keyword
					protect:protect
					  first:first
					   xmpp:xmpp];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					protect:NO
					  first:first
					   xmpp:xmpp];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					 protect:(BOOL)protect
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					protect:protect
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					text_raw:(NSString *)text_raw
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					 keyword:(int)keyword
					 protect:(BOOL)protect
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text_raw
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					keyword:keyword
					protect:protect
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					 keyword:(int)keyword
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					keyword:keyword
					protect:NO
					  first:first
					   xmpp:xmpp];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					   first:(BOOL)first
						xmpp:(BOOL)xmpp
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					  first:first
					   xmpp:xmpp];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
				 retweetedBy:(NSString *)retweetedBy
				 retweetedId:(NSString *)retweetedId
					 keyword:(int)keyword
					 protect:(BOOL)protect
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:retweetedBy
				retweetedId:retweetedId
					keyword:keyword
					protect:protect
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
				 retweetedBy:(NSString *)retweetedBy
				 retweetedId:(NSString *)retweetedId
					 protect:(BOOL)protect
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:retweetedBy
				retweetedId:retweetedId
					protect:protect
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
				 retweetedBy:(NSString *)retweetedBy
				 retweetedId:(NSString *)retweetedId
					 keyword:(int)keyword
					 protect:(BOOL)protect
					verified:(BOOL)verified
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:retweetedBy
				retweetedId:retweetedId
					keyword:keyword
					protect:protect
				   verified:verified
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
				 retweetedBy:(NSString *)retweetedBy
				 retweetedId:(NSString *)retweetedId
					 protect:(BOOL)protect
					verified:(BOOL)verified
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
				retweetedBy:retweetedBy
				retweetedId:retweetedId
					protect:protect
				   verified:verified
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					 protect:(BOOL)protect
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
				   text_raw:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					protect:protect
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					 keyword:(int)keyword
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					keyword:keyword
					  first:first
					   xmpp:NO];
}

- (NSDictionary *)createItem:(NSString *)item_id
					withUser:(NSString *)user
						name:(NSString *)name
					 channel:(NSString *)channel
						 rid:(NSString *)rid
						text:(NSString *)text
					 comment:(NSString *)comment
					  source:(NSString *)source
				  created_at:(NSDate *)created_at
				user_profile:(NSString *)user_profile
					  notify:(NSString *)notify
						kind:(NSString *)kind
					category:(NSString *)category
				 inReplyUser:(NSString *)inReplyUser
					   first:(BOOL)first
{
	return [self createItem:item_id
				   withUser:user
					   name:name
					channel:channel
						rid:rid
					   text:text
					comment:comment
					 source:source
				 created_at:created_at
			   user_profile:user_profile
					 notify:notify
					   kind:kind
				   category:category
				inReplyUser:inReplyUser
					  first:first
					   xmpp:NO];
}


- (NSString *)stringTinyURL:(NSString *)url
{
	LOG(@"[%@(%@) stringTinyURL]\ntiny = %@", [self className], _service, url);
	@synchronized(self)
	{
		@try
		{
			if ([url lengthOfRegularExpression:@"http://j\\.mp/"] ||
				[url lengthOfRegularExpression:@"http://bit\\.ly/"])
			{
				if ([url lengthOfRegularExpression:@"http://j\\.mp/"])
				{
					url = [TinyURL expandJmp:url
								   withLogin:BITLY_LOGIN
									  apiKey:BITLY_KEY];
				}
				else
				{
					url = [TinyURL expandBitLy:url
									 withLogin:BITLY_LOGIN
										apiKey:BITLY_KEY];
				}
			}
			else
			{
				NSString *host = [url replaceWithExpression:@"(:?http|https)://(.*?)/.*$"
													replace:@"\\2"];
				NSMutableDictionary *header = [NSMutableDictionary dictionaryWithObjectsAndKeys:
											   host, @"Host",
											   nil];
				HTTP *api = [[[HTTP alloc] init] autorelease];
				[api setRedirect:NO];
				[api head:url header:header body:@""];
				NSString *location = [[api headers] valueForKey:@"Location"];
				LOG(@"[%@(%@) stringTinyURL]\n%@\n%@", [self className], _service, [HTTP urlEncode:location unescaped:@"" escaped:@""], [HTTP urlDencode:location]);
				if (location)
				{
					if ([location lengthOfRegularExpression:@"tinyurl\\.com"])
					{
						[api setRedirect:YES];
						id html = [api get:url header:header body:@""];
						if ([html isKindOfClass:[NSData class]])
						{
							html = [[[NSString alloc] initWithData:html
														  encoding:NSUTF8StringEncoding]
									autorelease];
							if ([HTTP isHTML:html])
							{
								if ([html lengthOfRegularExpression:@"<a .*? href=\".*?\">Proceed to this site.</a>"
														withOptions:OgreMultilineOption])
								{
									LOG(@"[%@(%@) stringTinyURL]\nProceed = %@",
										[self className], _service,
										[html replaceWithExpression:@"^.*(<a .*? href=\".*?\">Proceed to this site.</a>).*$"
															replace:@"\\1"
															options:OgreMultilineOption]);
									url = [html replaceWithExpression:@"^.*<a .*? href=\"(.*?)\">Proceed to this site.</a>.*$"
															  replace:@"\\1"
															  options:OgreMultilineOption];
									//LOG(@"[%@(%@) stringTinyURL]\nurl = %@", [self className], _service, url);
								}
							}
						}
					}
					else if ([location lengthOfRegularExpression:@"^(:?http|https)://"])
					{
						url = [NSString stringWithFormat:@"%@", location];
						//LOG(@"[%@(%@) stringTinyURL]\nurl = %@", [self className], _service, url);
					}
					else
					{
						NSString *site = [url replaceWithExpression:@"((:?http|https)://.*?)/.*$"
															replace:@"\\1"];
						url = [NSString stringWithFormat:@"%@%@", site, location];
					}
				}
			}
		}
		@catch (NSException *exception)
		{
			EXPLOG(@"[%@(%@) stringTinyURL] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
		}
	}
	url = [HTTP urlDencode:url];
	LOG(@"[%@(%@) stringTinyURL]\nurl = %@", [self className], _service, url);
	return url;
}

- (NSString*)extractShortenURL:(NSString*)match
{
	@try
	{
		if ([match lengthOfRegularExpression:
			 [NSString stringWithFormat:
			  @"(:?http|https)://%@/",
			  stringURLShorten]])
		{
			NSString *url = [_controller tinyURL:match];
			if (!url)
			{
				url = [self stringTinyURL:match];
				[_controller setTinyURL:match withURL:url];
			}
			return url;
		}
		else if ([match lengthOfRegularExpression:stringURLShorten])
		{
			LOG(@"[%@(%@) extractShortenURL]\n%@", [self className], _service, match);
			NSString *http_match = [NSString stringWithFormat:@"http://%@", match];
			NSString *url = [_controller tinyURL:http_match];
			if (!url)
			{
				url = [self stringTinyURL:http_match];
				[_controller setTinyURL:http_match withURL:url];
			}
			LOG(@"[%@(%@) extractShortenURL]\n%@", [self className], _service, url);
			return url;
		}
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) extractShortenURL] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
	return match;
}

- (NSString*)extractShortenURL:(OGRegularExpressionMatch*)aMatch
				   contextInfo:(id)contextInfo
{
	return [self extractShortenURL:[aMatch matchedString]];
}

- (NSString*)extractTinyURL:(OGRegularExpressionMatch*)aMatch
			   contextInfo:(id)contextInfo
{
	NSString *match = [aMatch matchedString];
	NSString *url = [self extractShortenURL:match];
	if (![url isEqualToString:match])
	{
		if ([url lengthOfRegularExpression:[AfficheurController stringRegularExpressionURL]] > 0)
		{
			match = url;
			url = [self extractShortenURL:match];
			if (![url isEqualToString:match])
			{
				match = [NSString stringWithFormat:@"%@ [%@ [%@]]", [aMatch matchedString], match, url];
			}
			else
			{
				match = [NSString stringWithFormat:@"%@ [%@]", [aMatch matchedString], match];
			}
		}
		else
		{
			match = [NSString stringWithFormat:@"%@ [%@]", match, url];
		}
	}
	return match;
}

- (NSString *)getHTML:(NSString *)url
	withHandleCookies:(BOOL)handleCookies
{
	id html = nil;
	@try
	{
		LOG(@"[%@(%@) getHTML]\n%@", [self className], _service, url);
		NSString *host = nil;
		HTTP *api = [[[HTTP alloc] init] autorelease];
		[api setTimeoutInterval:30];
		[api setShouldHandleCookies:handleCookies];
		BOOL redirect = YES;
		while (redirect)
		{
			host = [url replaceWithExpression:@"^.*?http://(.*?)/.*$"
									  replace:@"\\1"];
			[api setRedirect:NO];
			NSDictionary *head = [api head:url
									header:[NSDictionary dictionaryWithObjectsAndKeys:
											host, @"Host",
											nil]
									  body:@""];
			LOG(@"[%@(%@) getHTML] %d", [self className], _service, [api statusCode]);
			if ([head isKindOfClass:[NSDictionary class]] && [api statusCode] >= 300)
			{
				if ([api statusCode] >= 400)
				{
					redirect = NO;
				}
				else if ([head valueForKey:@"Location"])
				{
					LOG(@"[%@(%@) getHTML]\nLocation = %@", [self className], _service, [head valueForKey:@"Location"]);
					NSString *location = [head valueForKey:@"Location"];
					if ([location lengthOfRegularExpression:@"^http://"])
					{
						url = location;
					}
					else
					{
						url = [NSString stringWithFormat:@"%@%@",
							   [url replaceWithExpression:@"^(http://.*?)/.*$" replace:@"\\1"], location];
					}
				}
				else
				{
					redirect = NO;
				}
			}
			else
			{
				redirect = NO;
			}
		}
		if ([api statusCode] < 300)
		{
			[api setRedirect:YES];
			host = [url replaceWithExpression:@"^.*?http://(.*?)/.*$"
									  replace:@"\\1"];
			LOG(@"[%@(%@) getHTML]\nurl = %@\nhost = %@", [self className], _service, url, host);
			int retry = 3;
			while (retry--)
			{
				html = [api get:url
						 header:[NSDictionary dictionaryWithObjectsAndKeys:
								 host, @"Host",
								 nil]
						   body:@""];
				if ([html isKindOfClass:[NSData class]])
				{
					html = [[[NSString alloc] initWithData:html
												  encoding:NSASCIIStringEncoding] autorelease];//NSUTF8StringEncoding
					if ([html length] > 0)
					{
						break;
					}
					else
					{
						LOG(@"[%@(%@) getHTML] LEN=0\n%@", [self className], _service, url);
						html = nil;
					}

				}
				else
				{
					LOG(@"[%@(%@) getHTML] NO DATA\n%@", [self className], _service, html);
					html = nil;
					break;
				}
			}
			if (html)
			{
				if (html && ![HTTP isHTML:html])
				{
					LOG(@"[%@(%@) getHTML] NSString\n%@", [self className], _service, html);
					LOG(@"[%@(%@) getHTML] NO HTML\n%@", [self className], _service, html);
				}
				else
				{
					html = [NSString stringWithFormat:@"%@\n%@", url, html];
				}
			}
		}
		else
		{
			html = nil;
		}
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) getHTML] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
	LOG(@"[%@(%@) getHTML] done", [self className], _service);
	return html;
}

- (NSDictionary *)parsePhotoURL:(NSDictionary *)item
{
	@try
	{
		if (item)
		{
			LOG(@"[Service: %@(%@) parsePhotoURL]", [self className], _service);
			NSString *text = [item valueForKey:KeyText];
			if ([_preferences generalExtractTinyURL])
			{
				@synchronized([NSApplication sharedApplication])
				{
					@try
					{
						NSString *exp = [NSString stringWithFormat:@"%@", [AfficheurController stringRegularExpressionURL]];
						OGRegularExpression *regex = [OGRegularExpression
													  regularExpressionWithString:exp
													  options:OgreMultilineOption];
						text = [regex replaceAllMatchesInString:text
													   delegate:self
												replaceSelector:@selector(extractTinyURL:contextInfo:)
													contextInfo:nil];
						NSMutableDictionary *extract = [NSMutableDictionary dictionaryWithDictionary:item];
						[extract setValue:text forKey:KeyTextEx];
						item = [NSDictionary dictionaryWithDictionary:extract];
					}
					@catch (NSException *exception)
					{
						EXPLOG(@"[%@(%@) parsePhotoURL] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
					}
				}
			}
			NSString *photo_url = [item valueForKey:KeyTextEx];
			if (photo_url && ![photo_url isKindOfClass:[NSNull class]])
			{
				BOOL isURL = NO;
				NSString *trailer = stringRegularExpressionURLtrailer;
				NSString *expURL = [AfficheurController stringRegularExpressionURL];
				NSString *expFlickr = [NSString stringWithFormat:
									   @"^.*?(http://(:?www\\.flickr|flickr)\\.com/(:?photos|p)/[%@]+).*$",
									   trailer];
				LOG(@"[Service: %@(%@) parsePhotoURL] photo?\n%@", [self className], _service, photo_url);
				if ([photo_url lengthOfRegularExpression:@"http://.*?\\]http://"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] []http://\n%@", [self className], _service, photo_url);
				}
				if ([photo_url lengthOfRegularExpression:@"^.*?http://h4xr.org/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] h4xr?", [self className], _service);
					isURL = YES;
					photo_url = [photo_url replaceWithExpression:@"^.*?(http://h4xr.org/[0-9a-zA-Z]+).*$"
														 replace:@"\\1"
														 options:OgreMultilineOption];
				}
				else if ([photo_url lengthOfRegularExpression:@"http://movapic.com/pic/"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] movapic?", [self className], _service);
					isURL = YES;
					photo_url = [photo_url replaceWithExpression:@"^.*?http://movapic.com/pic/([0-9a-zA-Z]+).*$"
														 replace:@"http://image.movapic.com/pic/m_\\1.jpeg"
														 options:OgreMultilineOption];
				}
				else if ([photo_url lengthOfRegularExpression:@"http://f.hatena.ne.jp/.*?/."])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] hatena?", [self className], _service);
					isURL = YES;
					photo_url = [photo_url replaceWithExpression:@"^.*?http://f.hatena.ne.jp/(.)(.*?)/(........)([0-9a-zA-Z]+).*$"
														 replace:@"http://img.f.hatena.ne.jp/images/fotolife/\\1/\\1\\2/\\3/\\3\\4.jpg"
														 options:OgreMultilineOption];
				}
				else if ([photo_url lengthOfRegularExpression:expFlickr])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] flickr?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:expFlickr
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] flickr?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://(:?www\\.flickr|flickr).com/photos/.*?/(:?[0-9]+|[0-9]+/)$"])
					{
						NSString *path = [url replaceWithExpression:@"^.*?http://((:?www\\.flickr|flickr).com)/photos/.*?/([0-9]+).*$"
															replace:@"\\3"];
						LOG(@"[Service: %@(%@) parsePhotoURL] flickr??\n%@", [self className], _service, path);
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = [NSString stringWithFormat:
											 @"^.*<img src=\"(http://.*?\\.flickr\\.com/.*?/%@_.*?\\.jpg).*$", path];
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] flickr!\n%@", [self className], _service, photo_url);
							}
							exp = @"^.*class=\"photoImgDiv\".*?<img src=\"(.*?)\".*$";
							if (!isURL && [html lengthOfRegularExpression:exp
															  withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] flickr!\n%@", [self className], _service, photo_url);
							}
							exp = @"^.*<link rel=\"image_src\" href=\"(http://.*?\").*$";
							if (!isURL && [html lengthOfRegularExpression:exp
															  withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] flickr!\n%@", [self className], _service, photo_url);
							}
						}
					}
					else if ([url lengthOfRegularExpression:@"^http://(:?www\\.flickr|flickr).com/p/(:?[0-9a-zA-Z]+|[0-9a-zA-Z]+/)$"])
					{
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							NSString *path = [url replaceWithExpression:@"^.*?http://((:?www\\.flickr|flickr).com)/p/([0-9a-zA-Z]+).*$"
																 replace:@"\\3"
																 options:OgreMultilineOption];
							LOG(@"[Service: %@(%@) parsePhotoURL] flickr??\n%@", [self className], _service, path);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = [NSString stringWithFormat:
											 @"^.*<img src=\"(http://.*?\\.flickr\\.com/.*?/%@_.*?\\.jpg).*$", path];
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] flickr!\n%@", [self className], _service, photo_url);
							}
							exp = @"^.*class=\"photoImgDiv\".*?<img src=\"(.*?)\".*$";
							if (!isURL && [html lengthOfRegularExpression:exp
															  withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] flickr!\n%@", [self className], _service, photo_url);
							}
							exp = @"^.*<link rel=\"image_src\" href=\"(http://.*?\").*$";
							if (!isURL && [html lengthOfRegularExpression:exp
															  withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] flickr!\n%@", [self className], _service, photo_url);
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://twitpic\\.com/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] twitpic?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://twitpic\\.com/[0-9a-zA-Z]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					if ([url lengthOfRegularExpression:@"^http://twitpic\\.com/[0-9a-zA-Z]+$"])
					{
						NSString *path = [url replaceWithExpression:@"^.*?http://twitpic\\.com/([0-9a-zA-Z]+).*$"
															replace:@"\\1"];
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = [NSString stringWithFormat:
											 @"^.*? src=\"(/img/%@-.*?\\.jpg)\".*$", path];
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"http://twitpic.com\\1"
																options:OgreMultilineOption];
							}
							if (!isURL)
							{
								exp = [NSString stringWithFormat:
									   @"^.*?<a href=\"/%@/full\".*?<img id=\"photo-display\" class=\"photo-large\" src=\"(.*?)\".*$", path];
								if ([html lengthOfRegularExpression:exp
														withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
								}
							}
							if (!isURL)
							{
								exp = [NSString stringWithFormat:
									   @"^.*?<img class=\"photo\" id=\"photo-display\" src=\"(.*?)\".*$", path];
								if ([html lengthOfRegularExpression:exp
														withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
								}
							}
							if (!isURL)
							{
								exp = [NSString stringWithFormat:
									   @"^.*? src=\"(\\S+\\-full\\.jpg)\".*$", path];
								if ([html lengthOfRegularExpression:exp
														withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
								}
								if (!isURL)
								{
									exp = [NSString stringWithFormat:
										   @"^.*? src=\"(\\S+\\-full\\.png)\".*$", path];
									if ([html lengthOfRegularExpression:exp
															withOptions:OgreMultilineOption])
									{
										isURL = YES;
										photo_url = [html replaceWithExpression:exp
																		replace:@"\\1"
																		options:OgreMultilineOption];
									}
								}
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://twitxr\\.com/.*?/updates/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] twitxe?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://twitxr\\.com/.*?/updates/[0-9a-zA-Z]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					if ([url lengthOfRegularExpression:@"^http://twitxr\\.com/.*?/updates/[0-9a-zA-Z]+$"])
					{
						NSString *path = [url replaceWithExpression:@"^.*?http://twitxr\\.com/.*?/updates/([0-9a-zA-Z]+).*$"
															replace:@"\\1"];
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = [NSString stringWithFormat:
											 @"^.*? src=\"(/image/%@)\".*$", path];
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"http://twitxr.com\\1"
																options:OgreMultilineOption];
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"(:?Photo:|Photo: )http://bkite.com/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] bkite?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(:?Photo:|Photo: )(http://bkite.com/[0-9a-zA-Z]+).*$"
															 replace:@"\\2"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] bkite?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://bkite.com/[0-9a-zA-Z]+$"])
					{
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = @"^.*?<img alt=\"Photo-feed\" src=\"(\\S+/photo-feed.jpg)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
							}
							else
							{
								exp = @"^.*?<img alt=\".*?object\" src=\"(\\S+-object.png)\".*$";
								if ([html lengthOfRegularExpression:exp
														withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
								}
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://www\\.bcphotoshare\\.com/photos/[0-9]+/[0-9]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] bcphotoshare?", [self className], _service);
					isURL = YES;
					photo_url = [photo_url replaceWithExpression:@"^.*http://www\\.bcphotoshare\\.com/photos/[0-9]+/([0-9]+).*$"
													replace:@"http://images.bcphotoshare.com/storages/\\1/large.jpg"
													options:OgreMultilineOption];
				}
				else if ([photo_url lengthOfRegularExpression:@"http://bcphotoshare\\.com/photos/[0-9]+/[0-9]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] bcps?", [self className], _service);
					isURL = YES;
					photo_url = [photo_url replaceWithExpression:@"^.*http://bcphotoshare\\.com/photos/[0-9]+/([0-9]+).*$"
														 replace:@"http://images.bcphotoshare.com/storages/\\1/large.jpg"
														 options:OgreMultilineOption];
				}
				else if ([photo_url lengthOfRegularExpression:@"http://.*?yfrog\\.com/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] yfrog?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://.*?yfrog.com/[0-9a-zA-Z]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] yfrog?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://.*?yfrog.com/[0-9a-zA-Z]+$"])
					{
						LOG(@"[Service: %@(%@) parsePhotoURL] yfrog??\n%@", [self className], _service, url);
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							LOG(@"[Service: %@(%@) parsePhotoURL] yfrog???\n%@", [self className], _service, url);
							//LOG(@"[Service: %@(%@) parsePhotoURL] yfrog?\n%@", [self className], _service, html);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							LOG(@"[Service: %@(%@) parsePhotoURL] yfrog???\n%@", [self className], _service, html);
							NSString *exp = @"^.*?<link rel=\"image_src\" href=\"(.*?)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] yfrog!\n%@", [self className], _service, photo_url);
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://.*?yfrog\\.com/i/[0-9a-zA-Z]+\\.jpg/"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] yfrog?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://.*?frog\\.com/i/[0-9a-zA-Z]+\\.jpg/).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] yfrog?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://.*?frog\\.com/i/[0-9a-zA-Z]+\\.jpg/$"])
					{
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							//LOG(@"[Service: %@(%@) parsePhotoURL] yfrog?\n%@", [self className], _service, html);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = @"^.*?<link rel=\"image_src\" href=\"(.*?)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] yfrog!\n%@", [self className], _service, photo_url);
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://.*?yfrog\\.com/[0-9a-zA-Z]+\\.jpg"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] yfrog?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://.*?frog\\.com/[0-9a-zA-Z]+\\.jpg).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] yfrog?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://.*?frog\\.com/i/[0-9a-zA-Z]+\\.jpg$"])
					{
						isURL = YES;
						photo_url = url;
						LOG(@"[Service: %@(%@) parsePhotoURL] yfrog!\n%@", [self className], _service, photo_url);
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://1day1shot\\.jp/photos/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] 1day1shot?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://1day1shot\\.jp/photos/[0-9a-zA-Z]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] 1day1shot?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://1day1shot\\.jp/photos/[0-9a-zA-Z]+$"])
					{
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							LOG(@"[Service: %@(%@) parsePhotoURL] 1day1shot?\n%@", [self className], _service, html);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = @"^.* src=\"(/upimg/\\S+.*?_v.jpg)\" />.*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] 1day1shot?\n%@", [self className], _service, photo_url);
								photo_url = [NSString stringWithFormat:@"http://1day1shot.jp%@", photo_url];
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://tumblr\\.com/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] tumblr?", [self className], _service);
					if ([text lengthOfRegularExpression:@"(:?\\[Photo\\]|Photo\\: )" withOptions:OgreMultilineOption])
					{
						NSString *url = [photo_url replaceWithExpression:@"^.*?(http://tumblr\\.com/[0-9a-zA-Z]+).*$"
																 replace:@"\\1"
																 options:OgreMultilineOption];
						LOG(@"[Service: %@(%@) parsePhotoURL] tumblr?\n%@", [self className], _service, url);
						if ([url lengthOfRegularExpression:@"^http://tumblr\\.com/[0-9a-zA-Z]+$"])
						{
							NSString *html = [self getHTML:url withHandleCookies:NO];
							if (html)
							{
								html = [html replaceWithExpression:@"<!--.*?-->"
														   replace:@""
														   options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] tumblr?\n%@", [self className], _service, html);
								url = [html replaceWithExpression:@"^(.*?)\\n.*$"
														  replace:@"\\1"
														  options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] tumblr?\n%@", [self className], _service, url);
								NSString *exp = @"^.*<img src=\"\\S+/(tumblr_\\S+)o1.*?\".*$";
								if ([html lengthOfRegularExpression:exp
														withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
									url = [url replaceWithExpression:@"^(.*/)post(/[0-9]+).*$"
															 replace:@"\\1photo/1280\\2/1/"];
									photo_url = [NSString stringWithFormat:@"%@%@", url, photo_url];
									LOG(@"[Service: %@(%@) parsePhotoURL] tumblr!\n%@", [self className], _service, photo_url);
								}
								exp = @"^.* src=\"\\S+/(tumblr_\\S+)o1.*?\".*$";
								if (!isURL && [html lengthOfRegularExpression:exp
														withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
									url = [url replaceWithExpression:@"^(.*/)post(/[0-9]+).*$"
															 replace:@"\\1photo/1280\\2/1/"];
									photo_url = [NSString stringWithFormat:@"%@%@", url, photo_url];
									LOG(@"[Service: %@(%@) parsePhotoURL] tumblr!\n%@", [self className], _service, photo_url);
								}
								exp = @"^.*<img src=\"\\S+/(tumblr_\\S+)\".*$";
								if (!isURL && [html lengthOfRegularExpression:exp
														withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
									url = [url replaceWithExpression:@"^(.*/)post(/[0-9]+).*$"
															 replace:@"\\1photo/1280\\2/1/"];
									photo_url = [NSString stringWithFormat:@"%@%@", url, photo_url];
									LOG(@"[Service: %@(%@) parsePhotoURL] tumblr!\n%@", [self className], _service, photo_url);
								}
								exp = @"^.* src=\"\\S+/(tumblr_\\S+)\".*$";
								if (!isURL && [html lengthOfRegularExpression:exp
																  withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
									url = [url replaceWithExpression:@"^(.*/)post(/[0-9]+).*$"
															 replace:@"\\1photo/1280\\2/1/"];
									photo_url = [NSString stringWithFormat:@"%@%@", url, photo_url];
									LOG(@"[Service: %@(%@) parsePhotoURL] tumblr!\n%@", [self className], _service, photo_url);
								}
								exp = @"^.*<div class=\"photo\">(.*?)</div>.*$";
								if (!isURL && [html lengthOfRegularExpression:exp
																  withOptions:OgreMultilineOption])
								{
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
									exp = @"^.*<img src=\"(.*?)\".*$";
									if ([photo_url lengthOfRegularExpression:exp
																 withOptions:OgreMultilineOption])
									{
										isURL = YES;
										photo_url = [photo_url replaceWithExpression:exp
																			 replace:@"\\1"
																			 options:OgreMultilineOption];
										photo_url = [photo_url replaceWithExpression:@"^(.*//)[0-9]+\\.(media\\.tumblr\\.com/.*)$"
																			 replace:@"\\1\\2"
																			 options:OgreMultilineOption];
										LOG(@"[Service: %@(%@) parsePhotoURL] tumblr!\n%@", [self className], _service, photo_url);
									}
								}
								exp = @"^.*<img src=\"(\\S+tumblr\\.com/\\S+o1_\\S+)\".*$";
								if (!isURL && [html lengthOfRegularExpression:exp
																  withOptions:OgreMultilineOption])
								{
									isURL = YES;
									photo_url = [html replaceWithExpression:exp
																	replace:@"\\1"
																	options:OgreMultilineOption];
									LOG(@"[Service: %@(%@) parsePhotoURL] tumblr!\n%@", [self className], _service, photo_url);
								}
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://friendfeed-media\\.com/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] ff-media?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://friendfeed-media\\.com/[0-9a-zA-Z]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] friendfeed-media?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://friendfeed-media\\.com/[0-9a-zA-Z]+$"])
					{
						isURL = YES;
						photo_url = [NSString stringWithFormat:@"%@", url];
						LOG(@"[Service: %@(%@) parsePhotoURL] 1day1shot!\n%@", [self className], _service, photo_url);
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://pi\\.pe/[0-9a-zA-Z\\-]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] pi.pe?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://pi\\.pe/[0-9a-zA-Z\\-]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] pixelpipe?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://pi\\.pe/[0-9a-zA-Z\\-]+$"])
					{
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							LOG(@"[Service: %@(%@) parsePhotoURL] 1day1shot?\n%@", [self className], _service, html);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = @"^.* class='centered objectBox'><img src='(.*?)'.*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] 1day1shot?\n%@", [self className], _service, photo_url);
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://tweetphoto\\.com/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] TweetPhoto?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://tweetphoto\\.com/[0-9a-zA-Z]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] TweetPhoto?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://tweetphoto\\.com/[0-9a-zA-Z]+$"])
					{
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							LOG(@"[Service: %@(%@) parsePhotoURL] TweetPhoto?\n%@", [self className], _service, html);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = @"^.*<div id='photo'.*?<img src=\"(.*?)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] TweetPhoto?\n%@", [self className], _service, photo_url);
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://instagr\\.am/p/.*?/"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] Instagram?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://instagr\\.am/p/.*?/).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] Instagram?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://instagr\\.am/p/.*?/$"])
					{
						LOG(@"[Service: %@(%@) parsePhotoURL] Instagram?\n%@", [self className], _service, url);
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							LOG(@"[Service: %@(%@) parsePhotoURL] Instagram?\n%@", [self className], _service, [html className]);
							LOG(@"[Service: %@(%@) parsePhotoURL] Instagram?\n%@", [self className], _service, html);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = @"^.*<div id=\"photo\".*?<img src=\"(.*?)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] Instagram?\n%@", [self className], _service, photo_url);
							}
							exp = @"^.*<div id=\"photo-frame\".*?<img src=\"(.*?)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] Instagram?\n%@", [self className], _service, photo_url);
							}
							exp = @"^.*<img class=\"photo\" src=\"(.*?)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] Instagram?\n%@", [self className], _service, photo_url);
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://plixi\\.com/p/[0-9a-zA-Z]+"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] Plixi?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://plixi\\.com/p/[0-9a-zA-Z]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] Plixi?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://plixi\\.com/p/[0-9a-zA-Z]+$"])
					{
						LOG(@"[Service: %@(%@) parsePhotoURL] Plixi?\n%@", [self className], _service, url);
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							LOG(@"[Service: %@(%@) parsePhotoURL] Plixi?\n%@", [self className], _service, [html className]);
							LOG(@"[Service: %@(%@) parsePhotoURL] Plixi?\n%@", [self className], _service, html);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = @"^.*?title=\"View .*? next photo\".*?<img src=\"(.*?)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] Plixi?\n%@", [self className], _service, photo_url);
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:@"http://photozou\\.jp/photo/.*?/"])
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] photozou?", [self className], _service);
					NSString *url = [photo_url replaceWithExpression:@"^.*?(http://photozou\\.jp/photo/show/.*?/[0-9]+).*$"
															 replace:@"\\1"
															 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] photozou?\n%@", [self className], _service, url);
					if ([url lengthOfRegularExpression:@"^http://photozou\\.jp/photo/show/.*?/[0-9]+$"])
					{
						LOG(@"[Service: %@(%@) parsePhotoURL] photozou?\n%@", [self className], _service, url);
						NSString *html = [self getHTML:url withHandleCookies:NO];
						if (html)
						{
							LOG(@"[Service: %@(%@) parsePhotoURL] photozou?\n%@", [self className], _service, [html className]);
							LOG(@"[Service: %@(%@) parsePhotoURL] photozou?\n%@", [self className], _service, html);
							html = [html replaceWithExpression:@"<!--.*?-->"
													   replace:@""
													   options:OgreMultilineOption];
							NSString *exp = @"^.*<div id=\"indivi_media\".*?<img src=\"(.*?)\".*$";
							if ([html lengthOfRegularExpression:exp
													withOptions:OgreMultilineOption])
							{
								isURL = YES;
								photo_url = [html replaceWithExpression:exp
																replace:@"\\1"
																options:OgreMultilineOption];
								LOG(@"[Service: %@(%@) parsePhotoURL] photozou?\n%@", [self className], _service, photo_url);
							}
						}
					}
				}
				else if ([photo_url lengthOfRegularExpression:[NSString stringWithFormat:@"^.*?%@\\.(:?jpg|jpeg|png)", expURL]])
				{
					isURL = YES;
					photo_url = [photo_url replaceWithExpression:[NSString stringWithFormat:@"^.*?(%@\\.(:?jpg|jpeg|png)).*$", expURL]
														 replace:@"\\1"
														 options:OgreMultilineOption];
					LOG(@"[Service: %@(%@) parsePhotoURL] jpg\n%@", [self className], _service, photo_url);
				}
				if (isURL)
				{
					LOG(@"[Service: %@(%@) parsePhotoURL] photo\n%@", [self className], _service, photo_url);
					NSMutableDictionary *photo = [NSMutableDictionary dictionaryWithDictionary:item];
					photo_url = [NSString stringWithFormat:@"%@%@", ProfilePhoto, photo_url];
					[photo setValue:photo_url forKey:KeyImageURL];
				//	NSImage *image = [_controller profileImage:photo_url];
				//	if (image)
				//	{
				//		[photo setValue:image forKey:KeyImage];
				//	}
					item = [NSDictionary dictionaryWithDictionary:photo];
				}
			}
		}
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[Service: %@(%@) parsePhotoURL] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
	return item;
}

- (id)getWithAuth:(NSString *)url
{
	return nil;
}

- (void)lockService
{
	[_controller lockService];
}

- (void)unlockService
{
	[_controller unlockService];
}

- (BOOL)isDelayedReply:(NSString *)item_id
{
	BOOL result = NO;
	id delayed = nil;
	@synchronized(_delayedReply)
	{
		delayed = [_delayedReply valueForKey:item_id];
	}
	if (delayed)
	{
		result = YES;
	}
	return result;
}

- (void)setDelayedReply:(NSString *)item_id
{
	@synchronized(_delayedReply)
	{
		[_delayedReply setValue:@"" forKey:item_id];
	}
}

- (void)removeDelayedReply:(NSString *)item_id
{
	@synchronized(_delayedReply)
	{
		if ([_delayedReply valueForKey:item_id])
		{
			[_delayedReply removeObjectForKey:item_id];
		}
	}
}

- (BOOL)addTimeline:(NSDictionary *)item
		  withFirst:(BOOL)first
{
	BOOL notify = NO;
	@try
	{
		//LOG(@"[%@(%@) addTimeline]", [self className], _service);
		notify = [_controller addTimeline:item withService:self first:first];
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) addTimeline] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
	return notify;
}

- (void)finishAddTimeline:(NSArray *)objects
			   withNotify:(NSArray *)notify
{
	@try
	{
		//LOG(@"[%@(%@) addTimeline]", [self className], _service);
		[_controller finishAddTimeline:objects
							withNotify:notify
							   service:self];
		_changeHeight = NO;
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) finishAddTimeline] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
}

- (BOOL)deleteTimeline:(NSString *)item_id
		   withService:(NSString *)service
{
	BOOL result = NO;
	@try
	{
		LOG(@"[%@(%@) deleteTimeline]", [self className], _service);
		result = [_controller deleteTimeline:item_id withService:service];
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) deleteTimeline] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
	return result;
}

- (void)doOpenURL:(NSString *)url
{
	@try
	{
		url = [HTTP urlEncode:url unescaped:@"#%" escaped:nil];
		LOG(@"[%@(%@) doOpenURL]\n%@", [self className], _service, url);
		[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) doOpenURL] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
}

- (void)openURL:(NSString *)item_id
{
	LOG2(@"[%@(%@) openURL]", [self className], _service);
	@try
	{
		id item = [self fetchALL:item_id withService:_service];
		if (item)
		{
			NSMutableArray *URLs = [NSMutableArray array];
			@synchronized([NSApplication sharedApplication])
			{
				NSString *text = [item valueForKey:KeyTextEx];
				NSString *exp = [NSString stringWithFormat:@"%@", [AfficheurController stringRegularExpressionURL]];
				OGRegularExpression *regex = [OGRegularExpression
											  regularExpressionWithString:exp
											  options:OgreMultilineOption];
				// マッチ結果の列挙子の生成
				NSEnumerator *enumerator = [regex matchEnumeratorInString:text];
				OGRegularExpressionMatch *match;	// マッチ結果
				while ((match = [enumerator nextObject]) != nil) {	// 順番にマッチ結果を得る
					NSString *url = [match matchedString];
					if (![_controller tinyURL:url])
					{
						[URLs addObject:url];
					}
				}
			}
			NSEnumerator *enumerator = [URLs objectEnumerator];
			id obj;
			while ((obj = [enumerator nextObject]))
			{
				LOG2(@"[%@(%@) openURL]\n%@", [self className], _service, obj);
				[self doOpenURL:obj];
			}
		}
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) openURL] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
}

- (void)doReply:(NSString *)item_id
	   withText:(BOOL)withText
{
}

- (void)doReply:(NSString *)item_id
{
	[self doReply:item_id withText:YES];
}

- (void)doRetweetViaAPI:(NSString *)item_id
{
	//LOG2(@"[%@(%@) doRetweetViaAPI]\n%@", [self className], _service, item_id);
}

- (void)doDirectMessage:(NSString *)item_id
{
}

#if 0
- (void)performLockXMPP:(id)object
{
	@synchronized(_lockXMPP)
	{
		//LOG(@"[%@ lockXMPP]", [self className]);
		_lockedXMPP = YES;
		[_lockXMPP lock];
	}
}

- (void)lockXMPP
{
	//LOG(@"[%@ lockXMPP]", [self className]);
	if ([[NSThread currentThread] isEqual:_mainThread])
	{
		[self performLockXMPP:nil];
	}
	else
	{
		[self performSelectorOnMainThread:@selector(performLockXMPP:)
							   withObject:nil
							waitUntilDone:YES];
	}
}

- (void)performUnlockXMPP:(id)object
{
	@synchronized(_lockXMPP)
	{
		if (_lockedXMPP)
		{
			//LOG(@"[%@ unlockXMPP]", [self className]);
			_lockedXMPP = NO;
			[_lockXMPP unlock];
		}
	}
}

- (void)unlockXMPP
{
	//LOG(@"[%@ unlockXMPP]", [self className]);
	if ([[NSThread currentThread] isEqual:_mainThread])
	{
		[self performUnlockXMPP:nil];
	}
	else
	{
		[self performSelectorOnMainThread:@selector(performUnlockXMPP:)
							   withObject:nil
							waitUntilDone:YES];
	}
}
#endif

- (void)performReceiveMessage:(NSXMLElement *)message
{
}

- (void)serviceXMPP:(ServiceXMPPClient *)xc
  didReceiveMessage:(NSXMLElement *)message
{
	@try
	{
		//LOG(@"[%@(%@) serviceXMPP:didReceiveMessage]\n%@", [self className], _service, message);
		[self performReceiveMessage:message];
	}
	@catch (NSException *exception)
	{
		EXPLOG(@"[%@(%@) serviceXMPP:didReceiveMessage] EXCEPTION\n%@: %@", [self className], _service, [exception name], [exception reason]);
	}
}

@end
