OSDN Git Service

起動時のタブ復元で左端のスクロール位置がトップに戻る不具合の修正の反映
[gikonavigoeson/gikonavi.git] / Giko.pas
index ae91840..6c8155c 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -4,7 +4,7 @@ interface
 
 uses
        Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
-       OleCtrls,       ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils, Math,
+       OleCtrls,       ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils,
 {$IF Defined(DELPRO) }
        SHDocVw,
        MSHTML,
@@ -13,24 +13,25 @@ uses
        MSHTML_TLB,
 {$IFEND}
        IdHTTP, ActiveX, ActnList, ImgList,
-       ToolWin, Buttons, {Clipbrd,} {HTTPApp,} YofUtils, IdComponent,
-       ShellAPI,  UrlMon, Tabs, IdGlobal, StrUtils,
-       CommCtrl, IniFiles, Dialogs,
-       GikoSystem, GikoUtil, Setting, BoardGroup, ThreadControl, ItemDownload,
-       Editor, RoundData, RoundName, KeySetting, GikoPanel, Favorite, FavoriteAdd,
-       FavoriteArrange, AddressHistory, Preview, HTMLDocumentEvent, Kotehan,
-       HintWindow, GikoCoolBar, GikoListView, ToolBarSetting, ToolBarUtil,
-       IndividualAbon, Search, ExternalBoardManager, ExternalBoardPlugInMain,
-       StdActns, GikoXMLDoc, Variants, ExtActns,IdTCPConnection, IdBaseComponent,
-  IdTCPClient;
+       ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils,
+       CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload,
+       Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent,
+       {HintWindow,} GikoCoolBar, GikoListView, Search, ExternalBoardManager,
+       ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,
+       IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem,
+    ShellAPI,Preview, HistoryList, ResPopupBrowser;
 
+const
+       NGWORDNAME_PANEL = 3;
+       THREADSIZE_PANEL = 2;
+       
 type
-       TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite);
+
        TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
        TMinimizeType = (mtNone, mtMinimizing, mtMinimized);
        TResizeType = (rtNone, rtResizing);
 
-       TBrowserRecord = class;
+//     TBrowserRecord = class;
 
        TGikoForm = class(TForm)
                StatusBar: TStatusBar;
@@ -50,44 +51,16 @@ type
                MessageListView: TListView;
                MessageSplitter: TSplitter;
                Panel3: TPanel;
-               SpeedButton1: TSpeedButton;
+    CabinetCloseSpeedButton: TSpeedButton;
                ToolBar1: TToolBar;
                CabinetSelectToolButton: TToolButton;
                HistoryToolBar: TToolBar;
-               ToolButton15: TToolButton;
-               ToolButton18: TToolButton;
+    HistoryShowToolButton: TToolButton;
+    HistoryAllClearToolButton: TToolButton;
                ItemIcon16: TImageList;
                ItemIcon32: TImageList;
                HotToobarImageList: TImageList;
-               ToobarImageList: TImageList;
                ItemImageList: TImageList;
-               ActionList: TActionList;
-               LogDeleteAction: TAction;
-               KidokuAction: TAction;
-               StdToolBarVisibleAction: TAction;
-               SearchAction: TAction;
-               GikoNaviWebPageAction: TAction;
-               AboutAction: TAction;
-               ExitAction: TAction;
-               MsgBarVisibleAction: TAction;
-               StatusBarVisibleAction: TAction;
-               LargeIconAction: TAction;
-               SmallIconAction: TAction;
-               ListIconAction: TAction;
-               DetailIconAction: TAction;
-               CabinetBBSAction: TAction;
-               CabinetHistoryAction: TAction;
-               CabinetVisibleAction: TAction;
-               MidokuAction: TAction;
-               AllSelectAction: TAction;
-               UpFolderAction: TAction;
-               ListNumberVisibleAction: TAction;
-               AllItemAction: TAction;
-               LogItemAction: TAction;
-               NewItemAction: TAction;
-               SelectItemAction: TAction;
-               ShowThreadAction: TAction;
-               StopAction: TAction;
                MainMenu: TMainMenu;
                FileMenu: TMenuItem;
                DeleteMenu: TMenuItem;
@@ -117,20 +90,16 @@ type
                G1: TMenuItem;
                N1: TMenuItem;
                AboutMenu: TMenuItem;
-               IconStyle: TAction;
                BrowserPopupMenu: TPopupMenu;
                ShowThreadMenu: TMenuItem;
                ShowBoardMenu: TMenuItem;
-               ShowBoardAction: TAction;
                ListIconPopupMenu: TPopupMenu;
                LargeIconPMenu: TMenuItem;
                SmallIconPMenu: TMenuItem;
                ListPMenu: TMenuItem;
                DetailPMenu: TMenuItem;
-               CabinetCloseAction: TAction;
                ClosePopupMenu: TPopupMenu;
                CloseMenu: TMenuItem;
-               OptionAction: TAction;
                U1: TMenuItem;
                N3: TMenuItem;
                B1: TMenuItem;
@@ -140,7 +109,6 @@ type
                L1: TMenuItem;
                N5: TMenuItem;
                S2: TMenuItem;
-               RoundAction: TAction;
                ListPopupMenu: TPopupMenu;
                ListRoundPMenu: TMenuItem;
                ListReservPMenu: TMenuItem;
@@ -162,19 +130,9 @@ type
                T1: TMenuItem;
                B2: TMenuItem;
                N8: TMenuItem;
-               URLCopyAction: TAction;
                URLC1: TMenuItem;
                N9: TMenuItem;
                N10: TMenuItem;
-               MsgBarCloseAction: TAction;
-               ScrollTopAction: TAction;
-               ScrollLastAction: TAction;
-               ScrollNewAction: TAction;
-               ScrollKokoAction: TAction;
-               EditorAction: TAction;
-               IEAction: TAction;
-               ItemReloadAction: TAction;
-               BrowserMaxAction: TAction;
                G2: TMenuItem;
                N11: TMenuItem;
                T3: TMenuItem;
@@ -186,22 +144,13 @@ type
                R1: TMenuItem;
                A2: TMenuItem;
                N15: TMenuItem;
-               SelectListReloadAction: TAction;
-               SelectThreadReloadAction: TAction;
                KokoPopupMenu: TPopupMenu;
                KokomadePMenu: TMenuItem;
                AllPMenu: TMenuItem;
                MenuItem1: TMenuItem;
                MenuItem2: TMenuItem;
-               BrowserTabCloseAction: TAction;
                BrowserTabPopupMenu: TPopupMenu;
                Close1: TMenuItem;
-               KokomadeAction: TAction;
-               ZenbuAction: TAction;
-               KokoResAction: TAction;
-               SelectItemURLCopyAction: TAction;
-               SelectReservAction: TAction;
-               NotSelectTabCloseAction: TAction;
                A3: TMenuItem;
                N16: TMenuItem;
                A4: TMenuItem;
@@ -210,11 +159,6 @@ type
                TreeSelectBoardPupupMenu: TMenuItem;
                TPMSep01: TMenuItem;
                TreeSelectURLPupupMenu: TMenuItem;
-               TreeSelectBoradReload: TAction;
-               TreeSelectThreadReload: TAction;
-               TreeSelectURLCopy: TAction;
-               ListToolBarVisibleAction: TAction;
-               BrowserToolBarVisibleAction: TAction;
                T2: TMenuItem;
                L3: TMenuItem;
                B3: TMenuItem;
@@ -223,16 +167,10 @@ type
                H2: TMenuItem;
                ItemReservPMenu: TMenuItem;
                RoundNamePopupMenu: TPopupMenu;
-               SelectNewRoundName: TAction;
-               SelectDeleteRound: TAction;
-               NewBoardAction: TAction;
                N7: TMenuItem;
                B4: TMenuItem;
-               LoginAction: TAction;
                L4: TMenuItem;
-               KeySettingAction: TAction;
                K2: TMenuItem;
-               AllTabCloseAction: TAction;
                A5: TMenuItem;
                A6: TMenuItem;
                C1: TMenuItem;
@@ -242,10 +180,7 @@ type
                D2: TMenuItem;
                MessageImageList: TImageList;
                ProgressBar: TProgressBar;
-               ArrangeAction: TAction;
                URL1: TMenuItem;
-               NameURLCopyAction: TAction;
-               SelectItemNameURLCopyAction: TAction;
                NameUrlCopyPMenu: TMenuItem;
                URLC2: TMenuItem;
                URLN1: TMenuItem;
@@ -255,31 +190,12 @@ type
                N23: TMenuItem;
                ListCoolBar: TGikoCoolBar;
                ListToolBar: TToolBar;
-               ViewNoButton: TToolButton;
-               IconToolButton: TToolButton;
-               UpFolderButton: TToolButton;
-               Sepa01ToolButton: TToolButton;
-               AllItemToolButton: TToolButton;
-               LogItemToolButton: TToolButton;
-               NewItemToolButton: TToolButton;
-               ListDownloadToolButton: TToolButton;
-               ListThreadDownloadToolButton: TToolButton;
-               ToolButton2: TToolButton;
-               ToolButton1: TToolButton;
                BrowserCoolBar: TGikoCoolBar;
                BrowserToolBar: TToolBar;
-               BrowserSizeButton: TToolButton;
                ToolButton3: TToolButton;
-               TopButton: TToolButton;
-               LastBotton: TToolButton;
-               NewButton: TToolButton;
-               KokoButton: TToolButton;
                ToolButton9: TToolButton;
-               EditorButton: TToolButton;
                ToolButton11: TToolButton;
-               IEButton: TToolButton;
                ToolButton5: TToolButton;
-               ItemReloadButton: TToolButton;
                ListNameToolBar: TToolBar;
                ListNameLabel: TLabel;
                FolderImage: TImage;
@@ -288,53 +204,34 @@ type
                BrowserBoardNameLabel: TLabel;
                ItemImage: TImage;
                BrowserNameLabel: TLabel;
-               ActiveLogDeleteAction: TAction;
                D3: TMenuItem;
                N25: TMenuItem;
                N26: TMenuItem;
-               ListNameBarVisibleAction: TAction;
                D4: TMenuItem;
-               BrowserNameBarVisibleAction: TAction;
                S3: TMenuItem;
                R2: TMenuItem;
-               TreeSelectNameURLCopy: TAction;
                TreeSelectNameURLPupupMenu: TMenuItem;
                N27: TMenuItem;
                H3: TMenuItem;
-               PaneInitAction: TAction;
                I1: TMenuItem;
                BrowserTabToolBar: TToolBar;
                BrowserTab: TTabControl;
-               ToolButton7: TToolButton;
-               BrowserMinAction: TAction;
                About1: TMenuItem;
                N28: TMenuItem;
-               SelectTextClearAction: TAction;
-               MailTextClearAction: TAction;
-               NameTextClearAction: TAction;
                S4: TMenuItem;
                N29: TMenuItem;
                N30: TMenuItem;
-               LeftmostTabSelectAction: TAction;
-               LeftTabSelectAction: TAction;
-               RightTabSelectAction: TAction;
-               RightmostTabSelectAction: TAction;
                N31: TMenuItem;
                L5: TMenuItem;
                L6: TMenuItem;
                A7: TMenuItem;
                R3: TMenuItem;
                FavoriteMenu: TMenuItem;
-               FavoriteAddAction: TAction;
                N32: TMenuItem;
                BoardFavoriteAddMenu: TMenuItem;
-               BoardFavoriteAddAction: TAction;
-               ThreadFavoriteAddAction: TAction;
                ThreadFavoriteAddMenu: TMenuItem;
-               TreeSelectFavoriteAddAction: TAction;
                N33: TMenuItem;
                TreeSelectFavoriteAddPupupMenu: TMenuItem;
-               FavoriteArrangeAction: TAction;
                FavoriteTreeView: TTreeView;
                StateIconImageList: TImageList;
                TopPanel: TPanel;
@@ -345,78 +242,49 @@ type
                MainCoolBar: TGikoCoolBar;
                MenuToolBar: TToolBar;
                StdToolBar: TToolBar;
-               RoundToolButton: TToolButton;
-               ToolButton6: TToolButton;
-               ToolButton4: TToolButton;
-               ToolButton13: TToolButton;
-               AbortToolButton: TToolButton;
-               LoginToolButton: TToolButton;
                AddressToolBar: TToolBar;
                AddressComboBox: TComboBox;
                MoveToToolButton: TToolButton;
-               MoveToAction: TAction;
                AddressImageList: TImageList;
-               AddressBarVisibleAction: TAction;
                AddressToolBarMenu: TMenuItem;
                T4: TMenuItem;
-               BrowserTabVisibleAction: TAction;
                Show1: TMenuItem;
                N34: TMenuItem;
-               BrowserTabTopAction: TAction;
-               BrowserTabBottomAction: TAction;
                T5: TMenuItem;
                B5: TMenuItem;
                N35: TMenuItem;
-               BrowserTabTabStyleAction: TAction;
-               BrowserTabButtonStyleAction: TAction;
-               BrowserTabFlatStyleAction: TAction;
                A8: TMenuItem;
                U2: TMenuItem;
                F1: TMenuItem;
                PreviewTimer: TTimer;
-               MonazillaWebPageAction: TAction;
                MonazillaWebPageAction1: TMenuItem;
-               GikoHelpAction: TAction;
                N36: TMenuItem;
                H4: TMenuItem;
-               KotehanAction: TAction;
                K3: TMenuItem;
-               LinkBarVisibleAction: TAction;
                L7: TMenuItem;
                N37: TMenuItem;
                A9: TMenuItem;
                ChevronPopupMenu: TPopupMenu;
-               BBS2chWebPageAction: TAction;
                N2N1: TMenuItem;
                N38: TMenuItem;
-               GikoFolderOpenAction: TAction;
                F2: TMenuItem;
                LinkToolBar: TToolBar;
                a10: TMenuItem;
-               ToolButton8: TToolButton;
-               ToolButton10: TToolButton;
-               ThreadEditorAction: TAction;
                N39: TMenuItem;
                T6: TMenuItem;
                N40: TMenuItem;
                LinkBarPopupMenu: TPopupMenu;
-               ToolBarSettingAction: TAction;
                T7: TMenuItem;
-               ToolButton12: TToolButton;
-               ToolButton14: TToolButton;
                ThreadPopupMenu: TPopupMenu;
                MenuItem4: TMenuItem;
                MenuItem5: TMenuItem;
                MenuItem6: TMenuItem;
                T8: TMenuItem;
-               NameCopyAction: TAction;
-               BoardIEAction: TAction;
                URLN3: TMenuItem;
-               SelectItemNameCopyAction: TAction;
                SelectItemNameCopyAction1: TMenuItem;
                B6: TMenuItem;
                T9: TMenuItem;
-               C2: TMenuItem;
+    NameCopyPMenu: TMenuItem;
                SelectComboBox: TComboBox;
                MainCoolBarPopupMenu: TPopupMenu;
                StdToolBarVisiblePMenu: TMenuItem;
@@ -442,50 +310,33 @@ type
                F4: TMenuItem;
                N48: TMenuItem;
                T14: TMenuItem;
-               SelectItemToolButton: TToolButton;
-               SelectResToolButton: TToolButton;
-               SelectResAction: TAction;
                ToolButton16: TToolButton;
-               AllResAction: TAction;
                N50: TMenuItem;
                A11: TMenuItem;
                S5: TMenuItem;
                Reload: TMenuItem;
                GoBack: TMenuItem;
                GoFoward: TMenuItem;
-    EditNGAction: TAction;
-               ReloadAction: TAction;
-               GoFowardAction: TAction;
-               GoBackAction: TAction;
-               SelectComboBoxSplitter: TImage;
                IndividualAbon1: TMenuItem;
                N41: TMenuItem;
                IndividualAbon2: TMenuItem;
-               N42: TMenuItem;
-               CancellIndividualAbon: TAction;
+    AntiIndivAbonMenuItem: TMenuItem;
                AntiIndividualAbon: TMenuItem;
                N49: TMenuItem;
                N51: TMenuItem;
                N52: TMenuItem;
-               N53: TMenuItem;
                SearchBoardName: TMenuItem;
     TreeSelectLogDeleteSeparator: TMenuItem;
-               TreeSelectSearchBoardName: TAction;
-               CabinetFavoriteAction: TAction;
                N54: TMenuItem;
                A13: TMenuItem;
                FavoriteTreePopupMenu: TPopupMenu;
-               FavoriteTreeViewRenameAction: TAction;
                FavoriteTreeRenamePopupMenu: TMenuItem;
-               FavoriteTreeViewNewFolderAction: TAction;
                FavoriteTreeNewFolderPopupMenu: TMenuItem;
                N56: TMenuItem;
-               FavoriteTreeViewDeleteAction: TAction;
                FavoriteTreeDeletePopupMenu: TMenuItem;
                FavoriteToolBar: TToolBar;
-               ToolButton17: TToolButton;
-               ToolButton19: TToolButton;
-               FavoriteTreeViewBrowseFolderAction: TAction;
+    FavoriteAddToolButton: TToolButton;
+    FavoriteArrangeToolButton: TToolButton;
                FavoriteTreeBrowseFolderPopupMenu: TMenuItem;
                N57: TMenuItem;
                FavoriteTreeReloadPopupMenu: TMenuItem;
@@ -495,102 +346,81 @@ type
                FavoriteTreeLogDeletePopupMenu: TMenuItem;
                N59: TMenuItem;
                FavoriteTreeNameURLCopyPopupMenu: TMenuItem;
-               FavoriteTreeViewReloadAction: TAction;
-               FavoriteTreeViewURLCopyAction: TAction;
-               FavoriteTreeViewNameCopyAction: TAction;
-               FavoriteTreeViewNameURLCopyAction: TAction;
-               FavoriteTreeViewLogDeleteAction: TAction;
-    ResRangeAction: TAction;
                ToolButton20: TToolButton;
-    ResRangeButton: TToolButton;
                N60: TMenuItem;
                ExportFavoriteFileAction1: TMenuItem;
-               ExportFavoriteFile: TFileSaveAs;
-               ToolButton21: TToolButton;
-               CabinetBBSToolButton: TToolButton;
-               ToolButton23: TToolButton;
-               ToolButton24: TToolButton;
                N6: TMenuItem;
                N17: TMenuItem;
-               FavoriteTreeViewBrowseBoardAction: TAction;
-               FavoriteTreeViewBrowseThreadAction: TAction;
-               UpBoardAction: TAction;
     N18: TMenuItem;
     N20: TMenuItem;
-    N24: TMenuItem;
+       N24: TMenuItem;
     N62: TMenuItem;
-    N61: TMenuItem;
-    N63: TMenuItem;
-    KoreCopy: TAction;
+       N61: TMenuItem;
+       N63: TMenuItem;
     N64: TMenuItem;
     dummy1: TMenuItem;
-    TreeSelectLogDeletePopupMenu: TMenuItem;
-    N65: TMenuItem;
+       TreeSelectLogDeletePopupMenu: TMenuItem;
+       N65: TMenuItem;
     BBSSelectPopupMenu: TPopupMenu;
                PlugInMenu: TMenuItem;
-       TmpToolBar: TToolBar;
-    TreeSelectNameCopy: TAction;
-    TreeSelectNamePupupMenu: TMenuItem;
+       TreeSelectNamePupupMenu: TMenuItem;
     BrowserPanel: TPanel;
-    SetFocusForBrowserAction: TAction;
-    SetFocusForThreadListAction: TAction;
-    SetFocusForCabinetAction: TAction;
-    FileRun1: TFileRun;
-    ThreadlistMaxAndFocusAction: TAction;
-    BrowserMaxAndFocusAction: TAction;
-    UpBoardButton: TToolButton;
-    SelectTimer: TTimer;
+       SelectTimer: TTimer;
     SelectThreadSave: TMenuItem;
-    SelectItemSaveForHTML: TAction;
-    FileSaveAs1: TFileSaveAs;
     N55: TMenuItem;
     N66: TMenuItem;
     dat1: TMenuItem;
-    SelectItemSaveForDat: TAction;
-    LogFolderOpenAction: TAction;
                OpenLogFolder: TMenuItem;
     Browser: TWebBrowser;
     TabSave: TMenuItem;
        TabOpen: TMenuItem;
-               TabsSaveAction: TAction;
-    TabsOpenAction: TAction;
     ResRangePopupMenu: TPopupMenu;
-    N1001: TMenuItem;
-    N501: TMenuItem;
-    N22: TMenuItem;
-    OnlyAHundredResAction: TAction;
-    OnlyNewResAction: TAction;
-    OnlyKokoResAction: TAction;
-    A14: TMenuItem;
-    BrowsBoradHeadAction: TAction;
-    BrowsBoradHeadAction1: TMenuItem;
-    ThreadRangeAction: TAction;
+    ResRangeHundPMenuItem: TMenuItem;
+    ResRangeKokoPMenuItem: TMenuItem;
+    ResRangeNewPMenuItem: TMenuItem;
+    ResRangeAllPMenuItem: TMenuItem;
+       BrowsBoradHeadAction1: TMenuItem;
     ThreadRangePopupMenu: TPopupMenu;
     A15: TMenuItem;
     L8: TMenuItem;
-    N67: TMenuItem;
+       N67: TMenuItem;
     N68: TMenuItem;
     S6: TMenuItem;
     N69: TMenuItem;
-    S7: TMenuItem;
-    ThreadRangeButton: TToolButton;
-       TabAutoSaveAction: TAction;
-    TabAutoLoadAction: TAction;
+    ResRangeSelectPMenuItem: TMenuItem;
     ListColumnPopupMenu: TPopupMenu;
-    JumpToNumOfResAction: TAction;
-    FavoriteTreeViewCollapseAction: TAction;
+    N70: TMenuItem;
+    ID1: TMenuItem;
+    ID2: TMenuItem;
+    N53: TMenuItem;
+    ID3: TMenuItem;
+    N71: TMenuItem;
+    N72: TMenuItem;
+    N73: TMenuItem;
+    SelectComboBoxPanel: TPanel;
+    SelectComboBoxSplitter: TImage;
+       ToolButton1: TToolButton;
+    N74: TMenuItem;
+    WikiFAQ: TMenuItem;
+    GikoApplicationEvents: TApplicationEvents;
+    N22: TMenuItem;
+    N42: TMenuItem;
+    DAT2: TMenuItem;
+    N75: TMenuItem;
+    DAT3: TMenuItem;
+    N76: TMenuItem;
+    FavoriteTreeItemNameCopyPopupMenu: TMenuItem;
+    N77: TMenuItem;
+    N78: TMenuItem;
+    SaveThreadFile: TMenuItem;
+    N79: TMenuItem;
+    HTML1: TMenuItem;
+    DAT4: TMenuItem;
+    N80: TMenuItem;
+    SameBoardThreadItem: TMenuItem;
+    N81: TMenuItem;
                                procedure FormCreate(Sender: TObject);
                procedure FormDestroy(Sender: TObject);
-               procedure CabinetPanelHide(Sender: TObject);
-               procedure ListViewData(Sender: TObject; Item: TListItem);
-               procedure ListViewDataFind(Sender: TObject; Find: TItemFind;
-                       const FindString: String; const FindPosition: TPoint;
-                       FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection;
-                       Wrap: Boolean; var Index: Integer);
-               procedure ListViewDataHint(Sender: TObject; StartIndex,
-                       EndIndex: Integer);
-               procedure ListViewDataStateChange(Sender: TObject; StartIndex,
-                       EndIndex: Integer; OldState, NewState: TItemStates);
                procedure BrowserStatusTextChange(Sender: TObject;
                        const Text: WideString);
                procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -599,105 +429,29 @@ type
                procedure ListViewKeyDown(Sender: TObject; var Key: Word;
                        Shift: TShiftState);
                procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
-               procedure ListViewSort(Sender: TObject; Column: TListColumn);
                procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
                        Button: TToolButton; State: TCustomDrawState;
                        var DefaultDraw: Boolean);
                procedure BrowserBeforeNavigate2(Sender: TObject;
                        const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
                        Headers: OleVariant; var Cancel: WordBool);
-               procedure ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
-                       Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
-                       var DefaultDraw: Boolean);
                procedure TreeViewCustomDraw(Sender: TCustomTreeView;
                        const ARect: TRect; var DefaultDraw: Boolean);
                procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
                        Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
                procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
-               procedure TreeViewDblClick(Sender: TObject);
                procedure ListViewCustomDraw(Sender: TCustomListView;
                        const ARect: TRect; var DefaultDraw: Boolean);
                procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
                        Shift: TShiftState; X, Y: Integer);
                procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
                procedure MessageListViewResize(Sender: TObject);
-               procedure ExitActionExecute(Sender: TObject);
-               procedure AllSelectActionExecute(Sender: TObject);
-               procedure StdToolBarVisibleActionExecute(Sender: TObject);
-               procedure MsgBarVisibleActionExecute(Sender: TObject);
-               procedure StatusBarVisibleActionExecute(Sender: TObject);
-               procedure LargeIconActionExecute(Sender: TObject);
-               procedure SmallIconActionExecute(Sender: TObject);
-               procedure ListIconActionExecute(Sender: TObject);
-               procedure DetailIconActionExecute(Sender: TObject);
-               procedure SearchActionExecute(Sender: TObject);
-               procedure OptionActionExecute(Sender: TObject);
-               procedure GikoNaviWebPageActionExecute(Sender: TObject);
-               procedure AboutActionExecute(Sender: TObject);
-               procedure CabinetHistoryActionExecute(Sender: TObject);
                procedure       CabinetVisible( isVisible : Boolean );
-               procedure CabinetVisibleActionExecute(Sender: TObject);
-               procedure AllItemActionExecute(Sender: TObject);
-               procedure LogItemActionExecute(Sender: TObject);
-               procedure NewItemActionExecute(Sender: TObject);
-               procedure SelectItemActionExecute(Sender: TObject);
-               procedure ListNumberVisibleActionExecute(Sender: TObject);
-               procedure UpFolderActionExecute(Sender: TObject);
-               procedure IconStyleExecute(Sender: TObject);
-               procedure RoundActionExecute(Sender: TObject);
-               procedure StopActionExecute(Sender: TObject);
-               procedure MsgBarCloseActionExecute(Sender: TObject);
-               procedure BrowserMaxActionExecute(Sender: TObject);
-               procedure ScrollTopActionExecute(Sender: TObject);
-               procedure ScrollLastActionExecute(Sender: TObject);
-               procedure ScrollNewActionExecute(Sender: TObject);
-               procedure ScrollKokoActionExecute(Sender: TObject);
-               procedure EditorActionExecute(Sender: TObject);
-               procedure IEActionExecute(Sender: TObject);
-               procedure ShowThreadActionExecute(Sender: TObject);
-               procedure ShowBoardActionExecute(Sender: TObject);
-               procedure URLCopyActionExecute(Sender: TObject);
-               procedure ItemReloadActionExecute(Sender: TObject);
-               procedure SelectListReloadActionExecute(Sender: TObject);
-               procedure SelectThreadReloadActionExecute(Sender: TObject);
-               procedure SelectListReloadActionUpdate(Sender: TObject);
-               procedure AllItemActionUpdate(Sender: TObject);
-               procedure LogItemActionUpdate(Sender: TObject);
-               procedure NewItemActionUpdate(Sender: TObject);
-               procedure SelectItemActionUpdate(Sender: TObject);
-               procedure UpFolderActionUpdate(Sender: TObject);
                procedure FormResize(Sender: TObject);
-               procedure ScrollTopActionUpdate(Sender: TObject);
-               procedure ScrollLastActionUpdate(Sender: TObject);
-               procedure ScrollNewActionUpdate(Sender: TObject);
-               procedure ScrollKokoActionUpdate(Sender: TObject);
-               procedure EditorActionUpdate(Sender: TObject);
-               procedure IEActionUpdate(Sender: TObject);
-               procedure ShowThreadActionUpdate(Sender: TObject);
-               procedure ShowBoardActionUpdate(Sender: TObject);
-               procedure SelectThreadReloadActionUpdate(Sender: TObject);
-               procedure ItemReloadActionUpdate(Sender: TObject);
-               procedure LogDeleteActionExecute(Sender: TObject);
-               procedure KokomadeActionExecute(Sender: TObject);
-               procedure ZenbuActionExecute(Sender: TObject);
-               procedure KokoResActionExecute(Sender: TObject);
                procedure ListPopupMenuPopup(Sender: TObject);
-               procedure SelectItemURLCopyActionExecute(Sender: TObject);
-               procedure SelectItemURLCopyActionUpdate(Sender: TObject);
-               procedure AllSelectActionUpdate(Sender: TObject);
-               procedure LogDeleteActionUpdate(Sender: TObject);
-               procedure BrowserTabCloseActionExecute(Sender: TObject);
-               procedure NotSelectTabCloseActionExecute(Sender: TObject);
-               procedure TreeSelectBoradReloadExecute(Sender: TObject);
-               procedure TreeSelectThreadReloadExecute(Sender: TObject);
-               procedure TreeSelectURLCopyExecute(Sender: TObject);
                procedure TreePopupMenuPopup(Sender: TObject);
-               procedure ListToolBarVisibleActionExecute(Sender: TObject);
-               procedure BrowserToolBarVisibleActionExecute(Sender: TObject);
                procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
                        var Cancel: WordBool);
-               procedure ListSplitterCanResize(Sender: TObject; var NewSize: Integer;
-                       var Accept: Boolean);
                procedure ListSplitterMoved(Sender: TObject);
                procedure BrowserTabChange(Sender: TObject);
                procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
@@ -709,76 +463,19 @@ type
                        Y: Integer);
                procedure BrowserDocumentComplete(Sender: TObject;
                        const pDisp: IDispatch; var URL: OleVariant);
-               procedure SelectReservActionUpdate(Sender: TObject);
                procedure RoundNamePopupMenuPopup(Sender: TObject);
-               procedure SelectNewRoundNameExecute(Sender: TObject);
-               procedure SelectDeleteRoundExecute(Sender: TObject);
-               procedure SelectReservActionExecute(Sender: TObject);
-               procedure NewBoardActionExecute(Sender: TObject);
-               procedure LoginActionExecute(Sender: TObject);
-               procedure KeySettingActionExecute(Sender: TObject);
-               procedure AllTabCloseActionExecute(Sender: TObject);
-               procedure ArrangeActionExecute(Sender: TObject);
-               procedure NameURLCopyActionExecute(Sender: TObject);
-               procedure SelectItemNameURLCopyActionExecute(Sender: TObject);
-               procedure URLCopyActionUpdate(Sender: TObject);
-               procedure NameURLCopyActionUpdate(Sender: TObject);
-               procedure BrowserTabCloseActionUpdate(Sender: TObject);
-               procedure NotSelectTabCloseActionUpdate(Sender: TObject);
-               procedure AllTabCloseActionUpdate(Sender: TObject);
-               procedure SelectItemNameURLCopyActionUpdate(Sender: TObject);
-               procedure ActiveLogDeleteActionExecute(Sender: TObject);
-               procedure ActiveLogDeleteActionUpdate(Sender: TObject);
-               procedure ListNameBarVisibleActionExecute(Sender: TObject);
-               procedure BrowserNameBarVisibleActionExecute(Sender: TObject);
-               procedure TreeSelectNameURLCopyExecute(Sender: TObject);
-               procedure PaneInitActionExecute(Sender: TObject);
                procedure FormShow(Sender: TObject);
                procedure BrowserTabToolBarResize(Sender: TObject);
-               procedure BrowserMinActionExecute(Sender: TObject);
-               procedure SelectTextClearActionExecute(Sender: TObject);
-               procedure NameTextClearActionExecute(Sender: TObject);
-               procedure MailTextClearActionExecute(Sender: TObject);
-               procedure LeftmostTabSelectActionExecute(Sender: TObject);
-               procedure LeftTabSelectActionExecute(Sender: TObject);
-               procedure RightTabSelectActionExecute(Sender: TObject);
-               procedure RightmostTabSelectActionExecute(Sender: TObject);
-               procedure LeftmostTabSelectActionUpdate(Sender: TObject);
-               procedure LeftTabSelectActionUpdate(Sender: TObject);
-               procedure RightTabSelectActionUpdate(Sender: TObject);
-               procedure RightmostTabSelectActionUpdate(Sender: TObject);
                procedure FavoriteMenuClick(Sender: TObject);
-               procedure FavoriteAddActionExecute(Sender: TObject);
-               procedure FavoriteAddActionUpdate(Sender: TObject);
-               procedure BoardFavoriteAddActionExecute(Sender: TObject);
-               procedure BoardFavoriteAddActionUpdate(Sender: TObject);
-               procedure ThreadFavoriteAddActionExecute(Sender: TObject);
-               procedure ThreadFavoriteAddActionUpdate(Sender: TObject);
-               procedure TreeSelectFavoriteAddActionExecute(Sender: TObject);
-               procedure FavoriteArrangeActionExecute(Sender: TObject);
                procedure MainCoolBarResize(Sender: TObject);
-               procedure MoveToActionExecute(Sender: TObject);
                procedure AddressToolBarResize(Sender: TObject);
                procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
                        Shift: TShiftState);
-               procedure AddressBarVisibleActionExecute(Sender: TObject);
                procedure BrowserEnter(Sender: TObject);
                procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
-               procedure BrowserTabVisibleActionExecute(Sender: TObject);
-               procedure BrowserTabTopActionExecute(Sender: TObject);
-               procedure BrowserTabBottomActionExecute(Sender: TObject);
-               procedure BrowserTabTabStyleActionExecute(Sender: TObject);
-               procedure BrowserTabButtonStyleActionExecute(Sender: TObject);
-               procedure BrowserTabFlatStyleActionExecute(Sender: TObject);
                procedure PreviewTimerTimer(Sender: TObject);
                procedure MessageHideButtonClick(Sender: TObject);
-               procedure MonazillaWebPageActionExecute(Sender: TObject);
-               procedure GikoHelpActionExecute(Sender: TObject);
-               procedure ToolButton18Click(Sender: TObject);
-               procedure KotehanActionExecute(Sender: TObject);
-               procedure LinkBarVisibleActionExecute(Sender: TObject);
-               procedure BBS2chWebPageActionExecute(Sender: TObject);
-               procedure GikoFolderOpenActionExecute(Sender: TObject);
+               procedure HistoryAllClearToolButtonClick(Sender: TObject);
                procedure MainCoolBarBandInfo(Sender: TObject;
                        var BandInfo: PReBarBandInfoA);
                procedure MainCoolBarChevronClick(Sender: TObject;
@@ -792,28 +489,12 @@ type
                procedure BrowserCoolBarChevronClick(Sender: TObject;
                        RebarChevron: PNMRebarChevron);
                procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
-               procedure ThreadEditorActionExecute(Sender: TObject);
-               procedure ThreadEditorActionUpdate(Sender: TObject);
-               procedure ToolBarSettingActionExecute(Sender: TObject);
-               procedure NameCopyActionExecute(Sender: TObject);
-               procedure BoardIEActionExecute(Sender: TObject);
-               procedure SelectItemNameCopyActionExecute(Sender: TObject);
-               procedure SelectItemNameCopyActionUpdate(Sender: TObject);
-               procedure BoardIEActionUpdate(Sender: TObject);
                procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
                        WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
-               procedure NameCopyActionUpdate(Sender: TObject);
                procedure SelectComboBoxChange(Sender: TObject);
                procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
                        Shift: TShiftState);
                procedure SelectComboBoxExit(Sender: TObject);
-               procedure SelectResActionExecute(Sender: TObject);
-               procedure SelectResActionUpdate(Sender: TObject);
-               procedure AllResActionExecute(Sender: TObject);
-               procedure AllResActionUpdate(Sender: TObject);
-               procedure ReloadClick(Sender: TObject);
-               procedure GoBackClick(Sender: TObject);
-               procedure GoFowardClick(Sender: TObject);
                procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
                        Shift: TShiftState; X, Y: Integer);
                procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
@@ -821,14 +502,7 @@ type
                procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
                        Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
                procedure StatusBarResize(Sender: TObject);
-               procedure IndividualAbon1Click(Sender: TObject);
-               procedure IndividualAbon2Click(Sender: TObject);
-               procedure N42Click(Sender: TObject);
                procedure SelectComboBoxEnter(Sender: TObject);
-               procedure AntiIndividualAbonClick(Sender: TObject);
-               procedure N51Click(Sender: TObject);
-               procedure TreeSelectSearchBoardNameExecute(Sender: TObject);
-               procedure CabinetFavoriteActionExecute(Sender: TObject);
                procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
                        Y: Integer);
                procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
@@ -837,155 +511,84 @@ type
                procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
                        Shift: TShiftState);
                procedure FavoriteTreePopupMenuPopup(Sender: TObject);
-               procedure FavoriteTreeViewDeleteActionExecute(Sender: TObject);
-               procedure FavoriteTreeViewRenameActionExecute(Sender: TObject);
-               procedure FavoriteTreeViewNewFolderActionExecute(Sender: TObject);
-               procedure ToolButton19Click(Sender: TObject);
-               procedure FavoriteTreeViewBrowseFolderActionExecute(Sender: TObject);
-               procedure FavoriteTreeViewDblClick(Sender: TObject);
-               procedure FavoriteTreeViewLogDeleteActionExecute(Sender: TObject);
-               procedure FavoriteTreeViewReloadActionExecute(Sender: TObject);
-               procedure FavoriteTreeViewURLCopyActionExecute(Sender: TObject);
-               procedure FavoriteTreeViewNameCopyActionExecute(Sender: TObject);
-               procedure FavoriteTreeViewNameURLCopyActionExecute(Sender: TObject);
                procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer);
                procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton;
                        Shift: TShiftState; X, Y: Integer);
                procedure LinkToolBarDragOver(Sender, Source: TObject; X, Y: Integer;
                        State: TDragState; var Accept: Boolean);
-               procedure ResRangeActionExecute(Sender: TObject);
                procedure FavoriteTreeViewEndDrag(Sender, Target: TObject; X,
                        Y: Integer);
-               procedure ListCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
-                       var Handled: Boolean);
-               procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
-                       var Handled: Boolean);
-               procedure BrowserCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
-                       var Handled: Boolean);
-               procedure ExportFavoriteFileAccept(Sender: TObject);
-               procedure ExportFavoriteFileBeforeExecute(Sender: TObject);
-               procedure CabinetBBSActionExecute(Sender: TObject);
-               procedure FavoriteTreeViewBrowseThreadActionExecute(Sender: TObject);
                procedure FavoriteTreeBrowseBoardPopupMenuClick(Sender: TObject);
-               procedure UpBoardActionExecute(Sender: TObject);
-               procedure UpBoardActionUpdate(Sender: TObject);
     procedure BrowserTabContextPopup(Sender: TObject; MousePos: TPoint;
       var Handled: Boolean);
-    procedure KoreCopyExecute(Sender: TObject);
     procedure BrowserTabPopupMenuPopup(Sender: TObject);
-       procedure MenuToolBarResize(Sender: TObject);
-    procedure StdToolBarResize(Sender: TObject);
-    procedure LinkToolBarResize(Sender: TObject);
-    procedure ListNameToolBarResize(Sender: TObject);
-    procedure ListToolBarResize(Sender: TObject);
-    procedure BrowserNameToolBarResize(Sender: TObject);
-    procedure BrowserToolBarResize(Sender: TObject);
     procedure BrowserTabResize(Sender: TObject);
-       procedure TreeViewClick(Sender: TObject);
     procedure TreeViewKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
     procedure FavoriteTreeViewMouseDown(Sender: TObject;
                        Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
     procedure MessagePanelResize(Sender: TObject);
                procedure OnResized;
-    procedure TreeSelectNameCopyExecute(Sender: TObject);
-    procedure FavoriteTreeViewMouseUp(Sender: TObject;
-      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-    procedure ResRangeActionUpdate(Sender: TObject);
-               procedure SetFocusForBrowserActionExecute(Sender: TObject);
-               procedure SetFocusForBrowserActionUpdate(Sender: TObject);
-    procedure SetFocusForThreadListActionExecute(Sender: TObject);
-    procedure SetFocusForCabinetActionExecute(Sender: TObject);
-       procedure BrowserMaxAndFocusActionExecute(Sender: TObject);
-    procedure BrowserMaxAndFocusActionUpdate(Sender: TObject);
-    procedure ThreadlistMaxAndFocusActionExecute(Sender: TObject);
-    procedure ListViewExit(Sender: TObject);
-    procedure SetFocusForCabinetActionUpdate(Sender: TObject);
-    procedure ListViewSelectItem(Sender: TObject; Item: TListItem;
-      Selected: Boolean);
-    procedure SelectTimerTimer(Sender: TObject);
-    procedure SelectItemSaveForHTMLExecute(Sender: TObject);
-    procedure KidokuActionExecute(Sender: TObject);
-    procedure MidokuActionExecute(Sender: TObject);
-    procedure SelectItemSaveForDatExecute(Sender: TObject);
-    procedure BrowserPanelCanResize(Sender: TObject; var NewWidth,
-      NewHeight: Integer; var Resize: Boolean);
-    procedure LogFolderOpenActionExecute(Sender: TObject);
-    procedure LogFolderOpenActionUpdate(Sender: TObject);
-               procedure TabsSaveActionExecute(Sender: TObject);
-               procedure TabsOpenActionExecute(Sender: TObject);
-               procedure TabsSaveToFileActionExecute(Sender: TObject);
-    procedure TabsOpenFromFileActionExecute(Sender: TObject);
-    procedure OnlyAHundredResActionExecute(Sender: TObject);
-    procedure OnlyKokoResActionExecute(Sender: TObject);
-    procedure OnlyNewResActionExecute(Sender: TObject);
-       procedure BrowsBoradHeadActionExecute(Sender: TObject);
-    procedure BrowsBoradHeadActionUpdate(Sender: TObject);
-    procedure EditNGActionExecute(Sender: TObject);
-    procedure ThreadRangeActionUpdate(Sender: TObject);
-    procedure ThreadRangeActionExecute(Sender: TObject);
-               procedure TabAutoSaveActionExecute(Sender: TObject);
-    procedure TabAutoLoadActionExecute(Sender: TObject);
+       procedure SelectTimerTimer(Sender: TObject);
                procedure ListViewColumnRightClick(Sender: TObject;
       Column: TListColumn; Point: TPoint);
-    procedure JumpToNumOfResActionExecute(Sender: TObject);
-    procedure JumpToNumOfResActionUpdate(Sender: TObject);
-    procedure FavoriteTreeViewCollapseActionExecute(Sender: TObject);
+       procedure ListViewCustomDrawItem(Sender: TCustomListView;
+      Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
+    procedure FormActivate(Sender: TObject);
+    procedure BrowserPanelResize(Sender: TObject);
+    procedure MenuToolBarResize(Sender: TObject);
+    procedure ListToolBarResize(Sender: TObject);
+    procedure BrowserToolBarResize(Sender: TObject);
+       procedure KokoPopupMenuPopup(Sender: TObject);
+       procedure ListViewKeyUp(Sender: TObject; var Key: Word;
+         Shift: TShiftState);
+    procedure FavoriteTreeViewEditing(Sender: TObject; Node: TTreeNode;
+      var AllowEdit: Boolean);
+       procedure CabinetCloseSpeedButtonClick(Sender: TObject);
+    procedure FavoriteArrangeToolButtonClick(Sender: TObject);
+    procedure GikoApplicationEventsMessage(var Msg: tagMSG;
+         var Handled: Boolean);
+    procedure GikoApplicationEventsDeactivate(Sender: TObject);
+    procedure GikoApplicationEventsException(Sender: TObject; E: Exception);
+    procedure TreeViewMouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure GetResURLMenuClick(Sender: TObject);
+    procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
+      var Handled: Boolean);
        private
                { Private \90é\8c¾ }
-        //RoundList : TRoundList;
-               FSortIndex: Integer;
-               FSortOrder: Boolean;
-
                FEnabledCloseButton: Boolean;
-//             ThreadCreate: TThreadCreate;
-
                FClickNode: TTreeNode;
                FHttpState: Boolean;
-               FHint: TResPopup;
                FPreviewBrowser: TPreviewBrowser;
                FPreviewURL: string;
-
                FBrowserSizeHeight: Integer;
                FBrowserSizeWidth: Integer;
-
-//             FFavorite: TFavorite;
                FTabHintIndex: Integer;
                FListStyle: TViewStyle;                         //\83\8a\83X\83g\83A\83C\83R\83\93\83X\83^\83C\83\8b
                FItemNoVisible: Boolean;                        //\83\8a\83X\83g\94Ô\8d\86\95\\8e¦\83t\83\89\83O
                FViewType: TGikoViewType;                       //\83\8a\83X\83g\83A\83C\83e\83\80\95\\8e¦\83^\83C\83v
-               FActiveList: TObject;
+               FActiveList: TObject;
                FActiveContent: TBrowserRecord; //
                FActiveBBS : TBBS;
-               FHistoryList: TList;                                    //\83q\83X\83g\83\8a\83\8a\83X\83g
+               FHistoryList: THistoryList;                                     //\83q\83X\83g\83\8a\83\8a\83X\83g
                FTreeType: TGikoTreeType;
                FWorkCount: Integer;
                FNameCookie: string;
                FMailCookie: string;
-//             FLastRoundTime: TDateTime;
-               BrowserNullTab: TBrowserRecord;
-//             DoubleClickOccurred: array [TMouseButton] of Boolean;
                FDownloadTitle: string;                         //\83_\83E\83\93\83\8d\81[\83h\92\86\82Ì\83^\83C\83g\83\8b\96¼
                FDownloadMax: Integer;                          //\83_\83E\83\93\83\8d\81[\83h\92\86\82Ì\8dÅ\91å\83T\83C\83Y
                FEvent: THTMLDocumentEventSink;//\83u\83\89\83E\83U\83h\83L\83\85\83\81\83\93\83g\83C\83x\83\93\83g
-
-         //    Fkeynum : Integer; //\83L\81[\83{\81[\83h\83\8c\83X\83|\83b\83v\83A\83b\83v\97p
-
                IsDraggingSelectComboBox : Boolean;
                DraggingSelectComboBoxPosition : TPoint;
-
                FSearchDialog: TSearchDialog;
-
                FDropSpaceNode: TTreeNode;
-
                FDragTime : Cardinal;                                                           ///< \83\8a\83\93\83N\82ÌD&D\97p
                FDragButton : TToolButton;                                      ///< \83\8a\83\93\83N\82ÌD&D\97p\82ÉDrag\82µ\82Ä\82éButton\95Û\91
                FDragWFirst : Boolean;                                                  ///< WebTab\82ÌD&D\97p
-
                FListViewBackGroundColor : TColor;      ///< ListView\82ÌBackGroundColor
                FUseOddResOddColor : Boolean;                   ///< \8eæ\93¾\83\8c\83X\90\94\82Æ\83X\83\8c\83b\83h\82Ì\83\8c\83X\90\94\82ª\88á\82Á\82½\82Æ\82«\82É\91¼\82Ì\90F\82Å\95\\8e¦
                FOddColor : TColor;                                                                     ///< \82»\82Ì\90F
-
                FSelectResWord  : string;                                               ///< \83\8c\83X\8di\8d\9e\83\8f\81[\83h
                FIsIgnoreResize : TResizeType;                  ///< \83\8a\83T\83C\83Y\83C\83x\83\93\83g\82ð\96³\8e\8b\82·\82é\82©\82Ç\82¤\82©
                FIsMinimize                     : TMinimizeType;                ///< \8dÅ\8f¬\89»\82µ\82Ä\82¢\82é\8dÅ\92\86\82©
@@ -996,55 +599,30 @@ type
                FResRangeMenuSelect     : Longint;                      ///< ResRangeButton \82Å\91I\91ð\82³\82ê\82Ä\82¢\82é\8d\80\96Ú (\83t\83H\81[\83}\83b\83g\82Í ResRange \8cÝ\8a·)
                FStartUp : Boolean;
                FIsHandledWheel : Boolean;                      ///< \8aù\82É\8eó\82¯\8eæ\82Á\82½ WM_MOUSEWHEEL \82©\82Ç\82¤\82©
-               procedure SetBoardTreeNode( inBBS : TBBS );
-               function SetCategoryListItem(ABBS2ch: TBBS): Integer;
-               function SetBoardListItem(Category: TCategory): Integer;
-               function SetThreadListItem(Board: TBoard): Integer;
-//             function GetRoundName(index: integer): string;
-
+                               DiffComp: Boolean;                      //Add by Genyakun \83X\83\8c\82ª\8dX\90V\82³\82ê\82½\82Æ\82«\82ÉTrue\82É\82È\82é
+               FOrigenCaption: String;                         //\82¨\8bC\82É\93ü\82è\83c\83\8a\81[\82Ì\83A\83C\83e\83\80\95Ò\8fW\8e\9e\82Ì\95Ò\8fW\91O\82Ì\95\8e\9a\97ñ
+               FPreviewBrowserRect: TRect;                     ///< \83v\83\8c\83r\83\85\81[\82Ì\95\\8e¦\88Ê\92u\82ð\8bL\89¯\82·\82é
+               FActionListGroupIndexes: array of Integer;      ///<GikoDM\8fã\82Ì\83A\83N\83V\83\87\83\93\83\8a\83X\83g\82Ì\8ae\83A\83N\83V\83\87\83\93\82É\90Ý\92è\82³\82ê\82½GroupIndex\82ð\95Û\91\82·\82é\94z\97ñ
+        FResPopupBrowser: TResPopupBrowser;
                procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
                procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
                procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
                procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
                procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
-
-
                procedure ListClick;
                procedure ListDoubleClick(Shift: TShiftState);
-               procedure BrowserMovement(const AName: string); overload;
-               procedure BrowserMovement(const AName: string; BrowserRecord: TBrowserRecord); overload;
-               procedure SelectListItem(List: TList);
-//             procedure SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
-               procedure DeleteTab(ThreadItem: TThreadItem); overload;
-               procedure DeleteTab(BrowserRecord: TBrowserRecord); overload;
                function Hook(var Message: TMessage): Boolean;
                procedure AddRoundNameMenu(MenuItem: TMenuItem);
-               procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;
-               procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
-               procedure SetSelectRoundName(Sender: TObject);
-               function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
-
                procedure SetMenuFont;
-//             procedure CreateFavMenu(Folder: TFavoriteFolder);
                procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
                procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;
                procedure FavoriteClick(Sender: TObject); overload;
                procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
-               procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
                function OnDocumentContextMenu(Sender: TObject): WordBool;
-//             function GetThreadText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean): string;
-               procedure SetResPopupText(ThreadItem : TThreadItem; StNum, ToNum: Integer; Title, First: Boolean);
-               procedure ShowTextPopup;
-               //procedure ShowTextPopup(HintData: THintData);
-//             procedure SetStdToolBar;
-//             function GetAction(ActionName: string): TContainedAction;
-               procedure SetLinkBar;
                function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
                procedure MenuBarChevronMenu;
                procedure LinkBarChevronMenu;
                procedure ToolBarChevronMenu(ToolBar: TToolBar);
-               procedure ModifySelectList;
-               procedure FavoriteBrowseFolder( node: TTreeNode );
                procedure LinkToolButtonDragDrop(Sender, Source: TObject; X, Y: Integer);
                procedure LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
                procedure LinkToolButtonOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
@@ -1057,43 +635,61 @@ type
                //
                procedure SetListViewBackGroundColor(value: TColor);
                procedure BBSMenuItemOnClick( Sender : TObject );
-               //
-               procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
                /// CoolBar \82Ì\90Ý\92è\82ð\95Ï\90\94\82É\95Û\91
                procedure       SaveCoolBarSettings;
+               procedure       SaveMainCoolBarSettings;
+               procedure       SaveBoardCoolBarSettings;
+               procedure       SaveBrowserCoolBarSettings;
                /// CoolBar \82Ì\90Ý\92è\82ð\95Ï\90\94\82©\82ç\95\9c\8c³
                procedure       LoadCoolBarSettings;
                /// \8dÅ\8f¬\89»\82³\82ê\82é
                procedure OnMinimize;
                /// \8dÅ\8f¬\89»\82³\82ê\82½
                procedure OnMinimized;
-               /// CoolBar \82ª\83T\83C\83Y\95Ï\8dX\82³\82ê\82½
-               procedure       CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
                /// TreeView \82ª\83N\83\8a\83b\83N\82³\82ê\82½
                procedure TreeClick( Node : TTreeNode );
                /// TreeView \82ª\83_\83u\83\8b\83N\83\8a\83b\83N\82³\82ê\82½
                procedure TreeDoubleClick( Node : TTreeNode );
-               /// \83M\83R\83i\83r\82Ì\83\81\83b\83Z\81[\83W\83\8b\81[\83v\82ð\89¡\8eæ\82è\82µ\82Ü\82·
-               procedure HandleAppMessage(var Msg: TMsg; var Handled: Boolean);
-               /// \83u\83\89\83E\83U\82Ì\83L\81[\83_\83E\83\93\83C\83x\83\93\83g
-               /// \83C\83x\83\93\83g\82ð\8eæ\82è\88µ\82Á\82½\8fê\8d\87\82Í True \82ð\95Ô\82·
-               function BrowserKeydown(var Msg: TMsg; Key: Word; State:TShiftState) : Boolean;
                /// \8ae\8f\8a\82É\82 \82é\83L\83\83\83r\83l\83b\83g\81E BBS \83\81\83j\83\85\81[\82ð\83Z\83b\83g\81^\8dX\90V
                procedure SetBBSMenu;
-               function WebBrowserClick(Sender: TObject): WordBool;
-               procedure SkinorCSSFilesCopy(path: string);
-               /// \83^\83u\8eæ\93¾
-               function GetTabURLs(AStringList: TStringList) : Boolean;
-               /// \83^\83u\95Û\91
-               function SaveTabURLs : Boolean;
-               /// \83^\83u\93Ç\82Ý\8fo\82µ
-               function LoadTabURLs : Boolean;
-               /// \83o\83\93\83h\95\9d\82ð\8dÄ\8cv\8eZ\81E\8dÄ\90Ý\92è\82·\82é
-               procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
-               /// ListView \82Ì Column \82ð\90^\82Ì\83J\83\89\83\80\82É\95Ï\8a·
-               function        ActiveListTrueColumn( column : TListColumn ) : TListColumn;
                /// ListColumnPopupMenu \83A\83C\83e\83\80\82Ì\83N\83\8a\83b\83N\83C\83x\83\93\83g
                procedure       ListColumnPopupMenuOnClick( Sender : TObject );
+               //! \8di\82è\8d\9e\82Ý\95\8e\9a\97ñ\90Ý\92è
+               procedure SetSelectWord( const text : string );
+               //\8c»\8dÝ\82Ì\83J\81[\83\\83\8b\82ð\8eæ\93¾\82·\82é
+               function GetScreenCursor(): TCursor;
+               //\83J\81[\83\\83\8b\82ð\90Ý\92è\82·\82é
+               procedure SetScreenCursor(Cursor : TCursor);
+               //! \83_\83E\83\93\83\8d\81[\83h\83R\83\93\83g\83\8d\81[\83\8b\83X\83\8c\83b\83h\82Ì\90\90¬
+               procedure CreateControlThread();
+               //! \83u\83\89\83E\83U\82Ì\90\90¬
+               procedure CreateBrowsers(count: Integer);
+               //! ActionList\82ÌGroupIndex\82Ì\95Û\91
+               procedure GetGroupIndex(ActionList: TActionList);
+               //! ActionList\82ÌGroupIndex\82Ì\90Ý\92è
+               procedure SetGroupIndex(ActionList: TActionList);
+               //! \8ew\92è\82³\82ê\82½\83X\83\8c\83b\83h\82ð\8aJ\82­(\83\8d\83O\82ª\96³\82¢\82Æ\82« or \8ew\92èJUMP\82Ü\82Å\91«\82è\82È\82¢\82Æ\82«\82ÍDL\82·\82é)
+               procedure OpenThreadItem(Thread: TThreadItem; URL: String);
+               //! ListView\81i\83X\83\8c\83b\83h\88ê\97\97\81j\82ð\8dX\90V\82·\82é
+               procedure RefreshListView(Thread: TThreadItem);
+               //! \83X\83\8c\83b\83h\88ê\97\97\82Ì\95\\8e¦\94Í\88Í\90Ý\92è\83`\83F\83b\83N\83N\83\8a\83A
+               procedure ClearThreadRengeAction;
+        //! \83^\83X\83N\83g\83\8c\83C\82Ì\83A\83C\83R\83\93\8dí\8f\9c\81\95\83t\83H\81[\83\80\95\\8e¦
+        procedure UnStoredTaskTray;
+        //! \83\8c\83X\83G\83f\83B\83^\82Ì\95\\8e¦\94ñ\95\\8e¦
+        procedure ShowEditors(nCmdShow: Integer);
+        //! \82à\82Á\82Æ\82à\8cÃ\82¢Browser\82Ì\8aJ\95ú
+        procedure ReleaseOldestBrowser;
+        //! \83A\83N\83e\83B\83u\82È\83^\83u\82Æ\93¯\82\94Â\82Ì\8aJ\82¢\82Ä\82¢\82é\83X\83\8c\83b\83h\82ð\83\81\83j\83\85\81[\83A\83C\83e\83\80\82É\92Ç\89Á
+        procedure AddMenuSameBoardThread;
+        //!  \83A\83N\83e\83B\83u\82È\83^\83u\82Æ\93¯\82\94Â\82Ì\8aJ\82¢\82Ä\82¢\82é\83X\83\8c\83b\83h\83N\83\8a\83b\83N\83C\83x\83\93\83g
+        procedure SameBoardThreadSubItemOnClick(Sender: TObject);
+        //! \83|\83b\83v\83A\83b\83v\83u\83\89\83E\83U\8dì\90¬
+        procedure CreateResPopupBrowser;
+        //! D&D\82ð\8eó\82¯\8eæ\82é
+        procedure WMDropFiles(var Msg: TWMDropFiles); Message WM_DropFiles;
+        //! \83t\83@\83C\83\8b\83`\83F\83b\83N
+        function isValidFile(FileName: String) : boolean;
        protected
                procedure CreateParams(var Params: TCreateParams); override;
                procedure WndProc(var Message: TMessage); override;
@@ -1103,54 +699,47 @@ type
 
        public
                { Public \90é\8c¾ }
-//             FDownload: TDownload;
+               LastRoundTime: TDateTime;
+               BrowserNullTab: TBrowserRecord;
                FControlThread: TThreadControl;
+        FIconData : TNotifyIconData;
                procedure MoveToURL(const inURL: string);
-               function InsertBrowserTab(
-                       ThreadItem      : TThreadItem;
-                       ActiveTab               : Boolean = True
-               ) : TBrowserRecord;
+               function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
                procedure ReloadBBS;
                function GetHttpState: Boolean;
                procedure SetEnabledCloseButton(Enabled: Boolean);
                function GetTreeNode(Data: TObject): TTreeNode;
-               procedure AppFormDeactivate(Sender: TObject);
-//             procedure CabinetPanelVisible(PanelVisible: Boolean);
                procedure ListViewAllSelect;
-
                property ListStyle: TViewStyle read FListStyle write FListStyle;
                property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
                property ViewType: TGikoViewType read FViewType write FViewType;
-
                property NameCookie: string read FNameCookie write FNameCookie;
                property MailCookie: string read FMailCookie write FMailCookie;
-
+               property ClickNode: TTreeNode read FClickNode write FClickNode;
+               property TreeType: TGikoTreeType read FTreeType write FTreeType;
+               property ActiveContent: TBrowserRecord read FActiveContent write FActiveContent;
+               property ResRangeMenuSelect: Longint read FResRangeMenuSelect write FResRangeMenuSelect;
+               property SelectResWord  : string read FSelectResWord write FSelectResWord;
+               property BrowserSizeWidth: Integer read FBrowserSizeWidth write FBrowserSizeWidth;
+               property BrowserSizeHeight: Integer read FBrowserSizeHeight write FBrowserSizeHeight;
+               property SearchDialog: TSearchDialog read FSearchDialog write FSearchDialog;
+               property ToolBarSettingSender : TToolBarSettingSenderType
+                                                read FToolBarSettingSender write FToolBarSettingSender;
+               property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
+               property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
+               property WorkCount: Integer read FWorkCount write FWorkCount;
                procedure SetContent(inThread: TBrowserRecord);
-               function GetActiveContent: TThreadItem;
+               function GetActiveContent(popup :Boolean = false): TThreadItem;
                function GetActiveList: TObject;
 
-
-//             property LastRoundTime: TDateTime read FLastRoundTime write FLastRoundTime;
-
                procedure SetListViewType(AViewType: TGikoViewType); overload;
                procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
-               procedure DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False);
-               procedure DownloadList(Board: TBoard; ForceDownload: Boolean = False);
                procedure PlaySound(SoundEventName: string);
-
-               function AddHistory( FavItem: TFavoriteThreadItem ): Boolean;
-               procedure DeleteHistory( threadItem: TThreadItem );
-               procedure ClearHistory;
-               procedure       SaveHistory;
-               procedure       LoadHistory;
                procedure ShowBBSTree( inBBS : TBBS );
                procedure ShowBBSTreeOld( inBBS : TBBS );
                procedure ShowHistoryTree;
-               procedure SetHistoryTreeNode;
-//             procedure SelectTreeNode(Item: TObject);
                procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
                procedure SetBrowserTabState;
-//             property Favorite: TFavorite read FFavorite write FFavorite;
                procedure SetToolBarPopup;
                procedure ShowFavoriteAddDialog( Item : TObject );
                procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
@@ -1158,7 +747,6 @@ type
                property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
                property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
                property OddColor : TColor read FOddColor write FOddColor;
-
                function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
                procedure OnPlugInMenuItem( Sender : TObject );
                procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
@@ -1166,6 +754,67 @@ type
                procedure ActiveListColumnSave;
                procedure SetActiveList(Obj: TObject);
                property ActiveList: TObject read GetActiveList write SetActiveList;
+               /// CoolBar \82ª\83T\83C\83Y\95Ï\8dX\82³\82ê\82½
+               procedure       CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
+               //\93¯\88êID\82Ì\82 \82Ú\81`\82ñ
+               procedure IndividualAbonID(Atype : Integer);
+               //\82±\82Ì\83\8c\83X\82 \82Ú\81`\82ñ
+               procedure IndividualAbon(Atag, Atype : Integer);
+               //\83u\83\89\83E\83U\82Ì\8dÄ\95`\89æ true:\91S\82Ä\82Ì\83^\83u false:\83A\83N\83e\83B\83u\82È\83^\83u\82Ì\82Ý
+               procedure RepaintAllTabsBrowser();
+               //\83\8a\83\93\83N\83o\81[\90Ý\92è
+               procedure SetLinkBar;
+               procedure FavoriteBrowseFolder( node: TTreeNode );
+               //\83X\83\8c\83b\83h\82Ì\83_\83E\83\93\83\8d\81[\83h
+               procedure DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False);
+               //\94Â\82Ì\83_\83E\83\93\83\8d\81[\83h
+               procedure DownloadList(Board: TBoard; ForceDownload: Boolean = False);
+               //\97\9a\97ð\82©\82ç\8dí\8f\9c
+               procedure DeleteHistory( threadItem: TThreadItem );
+               //\83^\83u\82ð\8dí\8f\9c \83X\83\8c\83b\83h\8ew\92è
+               procedure DeleteTab(ThreadItem: TThreadItem); overload;
+               //\83^\83u\82ð\8dí\8f\9c \83u\83\89\83E\83U\83\8c\83R\81[\83h\81i\83^\83u\81j\8ew\92è
+               procedure DeleteTab(BrowserRecord: TBrowserRecord); overload;
+        // \83^\83u\8dí\8f\9c\81i\8eÀ\91\95\95\94\81j
+        procedure DeleteTab(index, selectIndex: Integer); overload;
+               //\8c»\8dÝ\95\\8e¦\82µ\82Ä\82¢\82é\83X\83\8c\83b\83h\82ð\83X\83N\83\8d\81[\83\8b
+               procedure BrowserMovement(const AName: string); overload;
+               //\8c»\8dÝ\95\\8e¦\82µ\82Ä\82¢\82é\83X\83\8c\83b\83h\82ð\83X\83N\83\8d\81[\83\8b
+               procedure BrowserMovement(scroll: Integer); overload;
+               //Application\82ÌMainForm\82ð\8eæ\93¾\82·\82é
+               function GetMainForm(): TComponent;
+               procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
+               //! \83}\83E\83X\83W\83F\83X\83`\83\83\81[\8aJ\8en
+               procedure OnGestureStart(Sender: TObject);
+               //! \83}\83E\83X\83W\83F\83X\83`\83\83\81[\92\86
+               procedure OnGestureMove(Sender: TObject);
+               //! \83}\83E\83X\83W\83F\83X\83`\83\83\81[\8fI\97¹
+               procedure OnGestureEnd(Sender: TObject);
+               /// \83o\83\93\83h\95\9d\82ð\8dÄ\8cv\8eZ\81E\8dÄ\90Ý\92è\82·\82é
+               procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
+               //ListView\82Å\91I\91ð\82³\82ê\82Ä\82¢\82é\83A\83C\83e\83\80\82ð\8eæ\93¾\82·\82é
+               procedure SelectListItem(List: TList);
+               //\8ew\92è\82µ\82½\83\8c\83X\82ð\83R\83s\81[\82·\82é
+               procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
+               //
+               procedure ModifySelectList;
+               //
+               procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;
+               //
+               procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
+               //
+               procedure SetSelectRoundName(Sender: TObject);
+               //
+               function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
+               //
+               function WebBrowserClick(Sender: TObject): WordBool;
+               //! \83c\81[\83\8b\83o\81[\82É\83X\83\8c\8di\8d\9e\82Ý\83R\83\93\83{\83{\83b\83N\83X\82ð\90Ý\92è\82·\82é
+               procedure SetSelectComboBox();
+
+        //! \83^\83X\83N\83g\83\8c\83C\82É\8ai\94[\82µ\82½\83A\83C\83R\83\93\82ð\83N\83\8a\83b\83N\82µ\82½\82Æ\82«\82Ì\8f\88\97\9d
+        procedure TaskTrayIconMessage(var Msg : TMsg); message WM_USER + 2010;
+        //! \83^\83X\83N\83g\83\8c\83C\82É\83A\83C\83R\83\93\93o\98^\81\95\83t\83H\81[\83\80\89B\82µ
+        procedure StoredTaskTray;
        published
                property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
        end;
@@ -1191,85 +840,35 @@ type
                property Data: Pointer read FData write FData;
        end;
 
-       TBrowserRecord = class( TObject )
-       private
-               FBrowser        : TWebBrowser;
-               FEvent: THTMLDocumentEventSink; //!< \83u\83\89\83E\83U\83h\83L\83\85\83\81\83\93\83g\83C\83x\83\93\83g
-               FThread         : TThreadItem;
-               FLastSize       : Integer;
-               FRepaint        : Boolean;
-               FMovement       : string;                                                       //!< \83X\83N\83\8d\81[\83\8b\90æ\83A\83\93\83J\81[
-       public
-               destructor      Destroy; override;
-               property        Browser : TWebBrowser   read FBrowser   write FBrowser;
-               property        Thread  : TThreadItem   read FThread    write FThread;
-               property        LastSize        : Integer               read FLastSize  write FLastSize;
-               property        Repaint         : Boolean               read FRepaint   write FRepaint;
-               property        Movement        : string                read FMovement  write FMovement;
-       end;
-
 var
        GikoForm: TGikoForm;
 
 implementation
 
 uses
-       About, Option, Round, Splash, Sort, ListSelect,
-       NewBoard, MojuUtils,Clipbrd;
+       GikoUtil, IndividualAbon, Math, Kotehan, KeySetting,
+       YofUtils, ToolBarUtil, ToolBarSetting,
+       GikoXMLDoc, RoundName, IniFiles, FavoriteAdd,
+       FavoriteArrange, AddressHistory, Gesture,
+       About, Option, Round, Splash, Sort, ListSelect, Imm,
+       NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter,
+       HTMLCreate, ListViewUtils, GikoDataModule, GikoMessage,
+  InputAssistDataModule, Types, ReplaceDataModule;
 
 const
-       CAPTION_NAME: string = '\83M\83R\83i\83r';
        BLANK_HTML: string = 'about:blank';
-       SELECTCOMBOBOX_NAME: string = ''; // '\83X\83\8c\83b\83h\8di\8d\9e\8c\9f\8dõ';
-       SELECTCOMBOBOX_COLOR: TColor = clWindow;
+       BROWSER_COUNT           = 5;    //\83u\83\89\83E\83U\82Ì\90\94
        //D&D臒l
        DandD_THRESHOLD = 5;    //D&D\82Ìè\87\92l\81ipixcel)
-       //\83c\83\8a\81[\81E\83\8a\83X\83g\83A\83C\83R\83\93
-       ITEM_ICON_2CH1                                  = 0;            //2ch\83A\83C\83R\83\93
-       ITEM_ICON_2CH2                                  = 1;            //2ch\83A\83C\83R\83\93
-       ITEM_ICON_CATEGORY1                     = 2;            //\83J\83e\83S\83\8a\83A\83C\83R\83\93
-       ITEM_ICON_CATEGORY2                     = 3;            //\83J\83e\83S\83\8a\83A\83C\83R\83\93
-       ITEM_ICON_BOARD_NOSUBJECT       = 3;    //\93Ç\82Ý\8d\9e\82Ü\82ê\82Ä\82¢\82È\82¢\94Â\83A\83C\83R\83\93
-       ITEM_ICON_BOARD1                                = 4;            //\94Â\83A\83C\83R\83\93
-       ITEM_ICON_BOARD2                                = 5;            //\94Â\83A\83C\83R\83\93
-       ITEM_ICON_THREADLOG1            = 6;            //\83X\83\8c\83A\83C\83R\83\93\81i\83\8d\83O\82 \82è\81j
-       ITEM_ICON_THREADLOG2            = 7;            //\83X\83\8c\83A\83C\83R\83\93\81i\83\8d\83O\82 \82è\81j
-       ITEM_ICON_THREAD1                               = 8;            //\83X\83\8c\83A\83C\83R\83\93\81i\83\8d\83O\82È\82µ\81j
-       ITEM_ICON_THREAD2                               = 9;            //\83X\83\8c\83A\83C\83R\83\93\81i\83\8d\83O\82È\82µ\81j
-       ITEM_ICON_THREADNEW1            = 10;           //\83X\83\8c\83A\83C\83R\83\93\81i\90V\92\85\81j
-       ITEM_ICON_THREADNEW2            = 11;           //\83X\83\8c\83A\83C\83R\83\93\81i\90V\92\85\81j
-       ITEM_ICON_SORT1                                 = 12;           //\83\\81[\83g\83A\83C\83R\83\93
-       ITEM_ICON_SORT2                                 = 13;           //\83\\81[\83g\83A\83C\83R\83\93
-       ITEM_ICON_BOARD_LOG                     = 17;           //\83X\83\8c\83\8d\83O\82 \82è\94Â\83A\83C\83R\83\93
-       ITEM_ICON_BOARD_NEW                     = 18;           //\83X\83\8c\90V\92\85\94Â\83A\83C\83R\83\93
-
-       //\83c\81[\83\8b\83o\81[\83A\83C\83R\83\93
-       TOOL_ICON_HEIGHT_MAX            = 16;           //\8d\82\82³\8dÅ\91å\83A\83C\83R\83\93
-       TOOL_ICON_HEIGHT_MIN            = 17;           //\8d\82\82³\8dÅ\8f¬\83A\83C\83R\83\93
-       TOOL_ICON_HEIGHT_NORMAL = 18;           //\8d\82\82³\95W\8f\80\83A\83C\83R\83\93
-       TOOL_ICON_WIDTH_MAX             = 19;           //\95\9d\8dÅ\91å\83A\83C\83R\83\93
-       TOOL_ICON_WIDTH_MIN             = 20;           //\95\9d\8dÅ\8f¬\83A\83C\83R\83\93
-       TOOL_ICON_WIDTH_NORMAL  = 21;           //\95\9d\95W\8f\80\83A\83C\83R\83\93
-
-       TOOL_ICON_FAV_FOLDER            = 30;           //\82¨\8bC\82É\93ü\82è\83t\83H\83\8b\83_\83A\83C\83R\83\93
-       TOOL_ICON_FAV_BOARD                     = 31;           //\82¨\8bC\82É\93ü\82è\94Â\83A\83C\83R\83\93
-       TOOL_ICON_FAV_THREAD            = 32;           //\82¨\8bC\82É\93ü\82è\83X\83\8c\83A\83C\83R\83\93
-
+       //\83v\83\8c\83r\83\85\81[\83t\83@\83C\83\8b\96¼
        HTML_FILE_NAME  = 'temp_preview.html';
-
-       WM_XBUTTONDOWN                                  = $020B;
-       WM_XBUTTONUP                                            = $020C;
-       WM_XBUTTONDBLCLK                                = $020D;
-       XBUTTON1                                                                = $0001;
-       XBUTTON2                                                                = $0002;
+       //\83\81\83b\83Z\81[\83WID
        USER_TREECLICK                                  = WM_USER + 2000;
        USER_RESIZED            = WM_USER + 2001;
        USER_MINIMIZED                                  = WM_USER + 2002;
        USER_SETLINKBAR                                 = WM_USER + 2003;
        USER_DOCUMENTCOMPLETE           = WM_USER + 2004;       ///< wParam : TWebBrowser
-       SELECTTIME_INTERBAL                             = 110;
-
-       BROWSER_COUNT           = 5;    //\83u\83\89\83E\83U\82Ì\90\94
+    USER_TASKTRAY               = WM_USER + 2010;
 {$R *.DFM}
 
 procedure TGikoForm.CreateParams(var Params: TCreateParams);
@@ -1292,8 +891,6 @@ var
        msg: string;
        i: Integer;
        wp: TWindowPlacement;
-       s: string;
-       newbrowser: TWebBrowser;
 begin
 {$IFDEF DEBUG}
        AllocConsole;
@@ -1304,60 +901,37 @@ begin
        Writeln(' \8fI\97¹\8e\9e\82Í\81A\83M\83R\83i\83r\83E\83B\83\93\83h\83E\82ð\95Â\82\82Ä\82­\82¾\82³\82¢');
        Writeln('============================================================');
 {$ENDIF}
-       FStartUp := false;
-       Application.OnDeactivate := AppFormDeactivate;
-       Self.OnDeactivate := AppFormDeactivate;
-       Application.HookMainWindow(Hook);
-       Application.OnMessage := HandleAppMessage; //\82È\82ñ\82©\96³\82­\82Ä\82à\91å\8fä\95v\82É\82È\82Á\82½\81@by\81@\82à\82\82ã
-//     Self.DoubleBuffered := true;
+//try
+       Sort.SetSortDate(Now());
+       
        FTreeType := gttNone;
-
-       FSearchDialog := nil;
-       BrowserNullTab := TBrowserRecord.Create;
-       BrowserNullTab.Browser := Browser;
-       BrowserNullTab.Browser.Navigate(BLANK_HTML);
-       FBrowsers := TList.Create;
-       for i := 0 to BROWSER_COUNT -1 do begin
-               FBrowsers.Add(TWebBrowser.Create(nil));
-               newBrowser := FBrowsers[FBrowsers.Count - 1];
-               TOleControl(newBrowser).Parent := BrowserPanel;
-               newBrowser.Align := alNone;
-               newBrowser.Left := 0;
-               newBrowser.Top  := 0;
-               newBrowser.StatusBar    := false;
-               newBrowser.MenuBar              := false;
-               newBrowser.AddressBar   := false;
-               newBrowser.OnDocumentComplete   := BrowserDocumentComplete;
-               newBrowser.OnBeforeNavigate2    := BrowserBeforeNavigate2;
-               newBrowser.OnEnter                              := BrowserEnter;
-               newBrowser.OnNewWindow2                 := BrowserNewWindow2;
-               newBrowser.OnStatusTextChange   := BrowserStatusTextChange;
-               newBrowser.Navigate(BLANK_HTML);
-               ShowWindow(newBrowser.Handle, SW_HIDE);
-
-       end;
-       BrowserNullTab.Browser.BringToFront;
-       ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
-
        // \8bN\93®\8e\9e\82É\95Û\91\82³\82ê\82Ä\82µ\82Ü\82¤\91Î\8dô
+       FStartUp := true;
+       Application.HookMainWindow(Hook);
        FIsIgnoreResize := rtResizing;
+       //ActionList\82ÌGuoupIndex\82ð\95Û\91\82µ\82Ä\81A0\82É\83N\83\8a\83A\82·\82é\81B
+       //(\8bN\93®\8e\9e\82É\83c\81[\83\8b\83{\83^\83\93\82ÌDown\83v\83\8d\83p\83e\83B\82ð\94½\89f\82³\82¹\82é\93s\8d\87\8fãGroupIndex\82Í\90Ý\92è\82Å\82«\82È\82¢)
+       //\82±\82ê\88È\8cãSet\81`\82Å\8dÄ\90Ý\92è\82·\82é\82Ü\82Å\81AAction\82ÌChecked\82ð\82¢\82\82é\82Æ\82«\82Í\92\8d\88Ó\81I
+       GetGroupIndex(GikoDM.GikoFormActionList);
+       FSearchDialog := nil;
+    FResPopupBrowser := nil;
+       CreateBrowsers(BROWSER_COUNT);
+    FIconData.uID := 0;
+
+       //\83\81\83j\83\85\81[\83t\83H\83\93\83g
+       SetMenuFont;
 
        //\8eè\82Ì\83J\81[\83\\83\8b
        Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
 
-
        //\83A\83h\83\8c\83X\97\9a\97ð\93Ç\82Ý\8d\9e\82Ý
-       AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
+       AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
 
        EnabledCloseButton := True;
 
        //\83\8a\83X\83g\83X\83^\83C\83\8b
        ListView.ViewStyle := GikoSys.Setting.ListStyle;
 
-       //\83\81\83C\83\93\83N\81[\83\8b\83o\81[\88Ê\92u
-//     MainCoolBar.Top := 0;
-//     MainCoolBar.Left := 0;
-
        //\83A\83j\83\81\83p\83l\83\8b\88Ê\92u
        AnimePanel.Top := 0;
        AnimePanel.Left := 0;
@@ -1368,13 +942,13 @@ begin
        CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
 
        //\83\81\83b\83Z\81[\83W\83o\81[
-       MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
-       MsgBarVisibleActionExecute(nil);
+       GikoDM.MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
+       GikoDM.MsgBarVisibleActionExecute(nil);
        MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
 
        //\83X\83e\81[\83^\83X\83o\81[
-       StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
-       StatusBarVisibleActionExecute(nil);
+       GikoDM.StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
+       GikoDM.StatusBarVisibleActionExecute(nil);
 
        //\83t\83H\83\93\83g\81E\90F\90Ý\92è
        TreeView.Items.BeginUpdate;
@@ -1385,15 +959,18 @@ begin
                TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
                TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
                TreeView.Color := GikoSys.Setting.CabinetBackColor;
-
-               FavoriteTreeView.Font.Name := GikoSys.Setting.CabinetFontName;
-               FavoriteTreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
-               FavoriteTreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
+               FavoriteTreeView.Font.Assign(TreeView.Font);
                FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
 
                ListView.Font.Name := GikoSys.Setting.ListFontName;
                ListView.Font.Size := GikoSys.Setting.ListFontSize;
                ListView.Font.Color := GikoSys.Setting.ListFontColor;
+               ListView.Font.Style := [];
+               if GikoSys.Setting.ListFontBold then
+                       ListView.Font.Style := [fsbold];
+               if GikoSys.Setting.ListFontItalic then
+                       ListView.Font.Style := ListView.Font.Style + [fsitalic];
+
                ListViewBackGroundColor := clWhite;                                                                                             // \83f\83t\83H\83\8b\83g\82É\90Ý\92è\82µ\82½\82Ì\82¿
                ListViewBackGroundColor := GikoSys.Setting.ListBackColor;       // \83\86\81[\83U\92è\8b`\82É\95Ï\8dX
                FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
@@ -1405,16 +982,139 @@ begin
                ListView.Items.EndUpdate;
        end;
        //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
-       ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
+       GikoDM.ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
+
+       //\83~\83\85\81[\83g\82Ì\8fó\91Ô\82ð\90Ý\92è
+       GikoDM.MuteAction.Checked := GikoSys.Setting.Mute;
+
+       // \83\8c\83X\95\\8e¦\94Í\88Í
+       FResRangeMenuSelect := GikoSys.ResRange;
+       case GikoSys.ResRange of
+       Ord( grrAll ):
+               begin
+                       GikoDM.AllResAction.Execute;
+               end;
+       Ord( grrSelect ):
+               begin
+                       SelectComboBox.Text := SelectComboBox.Items[ 1 ];
+                       GikoDM.SelectResAction.Checked := True;
+               end;
+       else
+               case FResRangeMenuSelect of
+               Ord( grrKoko ): GikoDM.OnlyKokoResAction.Checked        := True;
+               Ord( grrNew ):  GikoDM.OnlyNewResAction.Checked := True;
+               100:                    GikoDM.OnlyAHundredResAction.Checked            := True;
+               end;
+       end;
+
+       // \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
+       case GikoSys.Setting.ThreadRange of
+       gtrAll:
+               begin
+                       GikoDM.AllItemAction.Checked := True;
+                       ViewType := gvtAll;
+               end;
+       gtrLog:
+               begin
+                       GikoDM.LogItemAction.Checked := True;
+                       ViewType := gvtLog;
+               end;
+       gtrNew:
+               begin
+                       GikoDM.NewItemAction.Checked := True;
+                       ViewType := gvtNew;
+               end;
+       gtrLive:
+               begin
+                       GikoDM.LiveItemAction.Checked := True;
+                       ViewType := gvtLive;
+               end;
+       gtrArch:
+               begin
+                       GikoDM.ArchiveItemAction.Checked := True;
+                       ViewType := gvtArch;
+               end;
+       end;
+
 
        //\83u\83\89\83E\83U\83^\83u\83t\83H\83\93\83g
        BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
        BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
+       BrowserTab.Font.Style := [];
+       if GikoSys.Setting.BrowserTabFontBold then
+               BrowserTab.Font.Style := [fsBold];
+       if GikoSys.Setting.BrowserTabFontItalic then
+               BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic];
+       BrowserTab.DoubleBuffered := True;
        FDragWFirst := false;
        SetContent(BrowserNullTab);                                                                                                     //\83u\83\89\83E\83U\82ð\8bó\94\92\95\\8e¦
-//     TreeView.TopItem.Expanded := True;                              //\83c\83\8a\81[\83g\83b\83v\8d\80\96Ú\82¾\82¯\82ð\8aJ\82­
-//     TreeView.Selected := TreeView.Items[0];         //\83c\83\8a\81[\82Ì\83g\83b\83v\8d\80\96Ú\82ð\91I\91ð\82·\82é
 
+       //\83u\83\89\83E\83U\83^\83u
+       GikoDM.BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
+
+       if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
+               GikoDM.BrowserTabTopAction.Checked := True;
+       end else begin
+               GikoDM.BrowserTabBottomAction.Checked := True;
+       end;
+
+       if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
+               GikoDM.BrowserTabTabStyleAction.Checked := True;
+       end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
+               GikoDM.BrowserTabButtonStyleAction.Checked := True;
+       end else begin
+               GikoDM.BrowserTabFlatStyleAction.Checked := True;
+       end;
+
+       //\83v\83\8d\83O\83\8c\83X\83o\81[\82Ì\8f\89\8aú\89»
+       ProgressBar.Parent := StatusBar;
+       ProgressBar.Top := 2;
+       ProgressBar.Left := 0;
+       ProgressBar.Width := StatusBar.Panels[0].Width;
+       ProgressBar.Height := StatusBar.Height - 2;
+       ProgressBar.Position := 0;
+
+       // \8aO\95\94\94Â\83v\83\89\83O\83C\83\93\82ð\83\8d\81[\83h(ReadBoardFile, LoadHistory \82æ\82è\90æ\82É\8ds\82¤\82±\82Æ)
+       InitializeBoardPlugIns;
+
+       // \83{\81[\83h\83t\83@\83C\83\8b\97ñ\8b\93(ReadFavorite \82æ\82è\90æ\82É\8ds\82¤\82±\82Æ)
+       GikoSys.ListBoardFile;
+       //\81@\98A\91±\8bN\93®\8e\9e\82É\83X\83v\83\89\83b\83V\83\85\83E\83B\83\93\83h\83E\82Ì\83\81\83\82\83\8a\82ª\95s\92è\82É
+       try
+       // \83X\83v\83\89\83b\83V\83\85\83E\83B\83\93\83h\83E\82Ì\83v\83\8d\83O\83\8c\83X\83o\81[\82Ì\90Ý\92è
+               if (SplashWindow <> nil) then begin
+                       SplashWindow.ProgressBar.Max := Length(BBSs) * 20;
+               end;
+       except
+       end;
+       // \82·\82×\82Ä\82ÌBBS\82ð\93Ç\82Ý\8d\9e\82ñ\82Å\82¨\82­
+       for i := Length(BBSs) - 1 downto 0 do begin
+               if not BBSs[i].IsBoardFileRead then
+                       GikoSys.ReadBoardFile(BBSs[i]);
+
+               if SplashWindow <> nil then begin
+                       SplashWindow.ProgressBar.StepBy(20);
+                       SplashWindow.Update;
+               end;
+       end;
+
+       //\8f\84\89ñ\83f\81[\83^\93Ç\82Ý\8d\9e\82Ý
+       RoundList := TRoundList.Create;
+       RoundList.LoadRoundBoardFile;
+       RoundList.LoadRoundThreadFile;
+
+       //TreeView\82Ì\8e×\96\82\8fL\82¢ToolTip\82ð\94ñ\95\\8e¦
+       Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
+       Style := Style or TVS_NOTOOLTIPS;
+       SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
+
+       // \83c\83\8a\81[\82ð\83\81\83C\83\93\82¾\82¯\95\\8e¦\82É\82µ\82Ä\8dÅ\91å\89»
+       TreeView.Align := alClient;
+       FavoriteTreeView.Align := alClient;
+       FavoriteTreeView.Visible := False;
+
+       // \83\81\83j\83\85\81[\82É\92Ç\89Á
+       SetBBSMenu;
 
        //\8dÅ\91å\89»\81E\83E\83B\83\93\83h\83E\88Ê\92u\95\9c\8c³
        wp.length := sizeof(wp);
@@ -1424,11 +1124,10 @@ begin
        wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
        wp.showCmd := SW_HIDE;
        SetWindowPlacement(Handle, @wp);
+       //Self.Update;
 
-//     SetBounds(GikoSys.Setting.WindowLeft, GikoSys.Setting.WindowTop,
-//                                             GikoSys.Setting.WindowWidth, GikoSys.Setting.WindowHeight);
        if GikoSys.Setting.WindowMax then
-                       WindowState := wsMaximized;
+               WindowState := wsMaximized;
 
        //\83M\83R\83A\83j\83\81
        try
@@ -1442,116 +1141,65 @@ begin
        FNameCookie := '';
        FMailCookie := '';
 
-       //\83X\83\8c\91S\95\94\95\\8e¦\83{\83^\83\93\82ð\89\9f\82³\82ê\82½\8fó\91Ô\82É\82·\82é
-       AllItemAction.Checked := True;
-       AllResAction.Checked := True;
-
-       //TreeView\82Ì\8e×\96\82\8fL\82¢ToolTip\82ð\94ñ\95\\8e¦
-       Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
-       Style := Style or TVS_NOTOOLTIPS;
-       SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
-
-       // \83c\83\8a\81[\82ð\83\81\83C\83\93\82¾\82¯\95\\8e¦\82É\82µ\82Ä\8dÅ\91å\89»
-       TreeView.Align := alClient;
-       FavoriteTreeView.Align := alClient;
-       FavoriteTreeView.Visible := False;
-
        //\83u\83\89\83E\83U\83T\83C\83Y\95Ï\8dX\82Ì\8f\89\8aú\89»
-//     FBrowserSizeFlag := False;
-//     FBrowserSizeHeight := ViewPanel.Height;
-
        FBrowserSizeHeight := GikoSys.Setting.ListHeight;
        FBrowserSizeWidth := GikoSys.Setting.ListWidth;
 
-       // \8aO\95\94\94Â\83v\83\89\83O\83C\83\93\82ð\83\8d\81[\83h(ReadBoardFile, LoadHistory \82æ\82è\90æ\82É\8ds\82¤\82±\82Æ)
-       InitializeBoardPlugIns;
-
-       //\8f\84\89ñ\83f\81[\83^\93Ç\82Ý\8d\9e\82Ý
-       RoundList := TRoundList.Create;
-       RoundList.LoadRoundBoardFile;
-
-       // \83{\81[\83h\83t\83@\83C\83\8b\97ñ\8b\93(ReadFavorite \82æ\82è\90æ\82É\8ds\82¤\82±\82Æ)
-       GikoSys.ListBoardFile;
-
-       RoundList.LoadRoundThreadFile;
-
-       if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then
-               GikoSys.ListBoardFile;
-
-       // \83\81\83j\83\85\81[\82É\92Ç\89Á
-       SetBBSMenu;
 
        // \83q\83X\83g\83\8a\83\8a\83X\83g(LoadHistory \82æ\82è\82à\90æ\82É\8ds\82¤\82±\82Æ)
-       FHistoryList := TList.Create;
+       FHistoryList := THistoryList.Create;
 
        // \97\9a\97ð\93Ç\82Ý\8d\9e\82Ý
-       LoadHistory;
+       FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml',
+        TreeView, FTreeType);
 
        //\82¨\8bC\82É\93ü\82è\93Ç\82Ý\8d\9e\82Ý
-//     FFavorite := TFavorite.Create(FavoriteTreeView);
        FavoriteDM.SetFavTreeView(FavoriteTreeView);
        FavoriteDM.ReadFavorite;
 
-       ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
-       ArrangeAction.Execute;
+       GikoDM.ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
+       GikoDM.ArrangeAction.Execute;
 
        if GikoSys.Setting.ListOrientation = gloHorizontal then begin
                case GikoSys.Setting.ListWidthState of
                        glsMax: begin
                                ViewPanel.Width := 1;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
+                               GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
+                               GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
                        end;
                        glsMin: begin
                                ViewPanel.Width := GikoSys.Setting.ListWidth;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
+                               GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
+                               GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
                        end;
                        else begin
                                ViewPanel.Width := GikoSys.Setting.ListWidth;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
+                               GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
+                               GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
                        end;
                end;
        end else begin
                case GikoSys.Setting.ListHeightState of
                        glsMax: begin
                                ViewPanel.Height := 1;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
+                               GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
+                               GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
                        end;
                        glsMin: begin
                                ViewPanel.Height := GikoSys.Setting.ListHeight;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
+                               GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
+                               GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
                        end;
                        else begin
                                ViewPanel.Height := GikoSys.Setting.ListHeight;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
+                               GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
+                               GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
                        end;
                end;
        end;
 
-       //\83v\83\8d\83O\83\8c\83X\83o\81[\82Ì\8f\89\8aú\89»
-//     ProgressBar.Visible := False;
-       ProgressBar.Parent := StatusBar;
-       ProgressBar.Top := 2;
-       ProgressBar.Left := 0;
-       ProgressBar.Width := StatusBar.Panels[0].Width;
-       ProgressBar.Height := StatusBar.Height - 2;
-       ProgressBar.Position := 0;
-
        //\83_\83E\83\93\83\8d\81[\83h\83I\83u\83W\83F\83N\83g
-       FControlThread := TThreadControl.Create(True);
-       FControlThread.MaxThreadCount := 1;
-       FControlThread.Resume;
-       FControlThread.OnDownloadEnd := DownloadEnd;
-       FControlThread.OnDownloadMsg := DownloadMsg;
-       FControlThread.OnWork := Work;
-       FControlThread.OnWorkBegin := WorkBegin;
-       FControlThread.OnWorkEnd := WorkEnd;
-//     ProgressPanel.Width := FControlThread.MaxThreadCount * 12;
+       CreateControlThread();
 
        // \8di\8d\9e\8c\9f\8dõ\97\9a\97ð
        SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
@@ -1565,97 +1213,25 @@ begin
 
        FTabHintIndex := -1;
 
-       //\83\8a\83\93\83N\83o\81[
-       SetLinkBar;
-
-       //\83\81\83j\83\85\81[\83t\83H\83\93\83g
-       SetMenuFont;
-
-       //\83c\81[\83\8b\83o\81[Wrapable
-       ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
-       BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
-
-       KeepDefaultToolButton(StdToolBar, TmpToolBar);
-       KeepDefaultToolButton(ListToolBar, TmpToolBar);
-       KeepDefaultToolButton(BrowserToolBar, TmpToolBar);
+       //\83c\81[\83\8b\83o\81[Wrapable
+       ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
+       BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
 
        MakeDefaultINIFile();
        //\83c\81[\83\8b\83{\83^\83\93\93Ç\82Ý\8d\9e\82Ý
-       ReadToolBarSetting(ActionList, StdToolBar);
-       ReadToolBarSetting(ActionList, ListToolBar);
-       try
-               for i := ListToolBar.ControlCount - 1 downto 0 do
-               begin
-                       if ListToolBar.Controls[ i ].Action = SelectItemAction then
-                       begin
-                               // \83X\83\8c\83b\83h\8di\8d\9e\82Ì\97×\82É\83Z\83p\83\8c\81[\83^\82ª\82 \82é\8fê\8d\87\82Í\89B\82·
-                               if (i + 1) < ListToolBar.ControlCount then
-                                       if ListToolBar.Controls[ i + 1 ] is TToolButton then
-                                               if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
-                                                       ListToolBar.Controls[ i + 1 ].Visible := False;
-
-                               // \83X\83\8c\83b\83h\8di\8d\9e\83{\83^\83\93\82ð\89B\82·
-                               ListToolBar.Controls[ i ].Visible := False;
-                               // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82ð\91}\93ü
-                               SelectComboBox.Parent := ListToolBar;
-                               SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
-                               SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
-                               // \83X\83\8c\83b\83h\8di\8d\9e\97p\93Æ\8e©\83Z\83p\83\8c\81[\83^\82ð\91}\93ü
-                               SelectComboBoxSplitter.Parent := ListToolBar;
-                               SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
-
-                               break;
-                       end;
-               end;
-       except
-       end;
-       ReadToolBarSetting(ActionList, BrowserToolBar);
+       ReadToolBarSetting(GikoDM.GikoFormActionList, StdToolBar);
+       ReadToolBarSetting(GikoDM.GikoFormActionList, ListToolBar);
+       ReadToolBarSetting(GikoDM.GikoFormActionList, BrowserToolBar);
        SetToolBarPopup;
 
-       // \83\8c\83X\95\\8e¦\94Í\88Í
-       FResRangeMenuSelect := GikoSys.ResRange;
-       case GikoSys.ResRange of
-       Ord( grrAll ):
-               begin
-                       AllResAction.Execute;
-               end;
-       Ord( grrSelect ):
-               begin
-                       SelectComboBox.Text := SelectComboBox.Items[ 1 ];
-                       SelectResAction.Checked := True;
-               end;
-       else
-//             ResRangeAction.Execute;
-               case FResRangeMenuSelect of
-               Ord( grrKoko ): OnlyKokoResAction.Checked       := True;
-               Ord( grrNew ):  OnlyNewResAction.Checked        := True;
-               100:                                            OnlyAHundredResAction.Checked           := True;
-               end;
-       end;
-
-       // \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
-//     ThreadRangeAction.Execute;
-       case GikoSys.Setting.ThreadRange of
-       gtrAll:
-               begin
-                       AllItemAction.Checked := True;
-                       ViewType := gvtAll;
-               end;
-       gtrLog:
-               begin
-                       LogItemAction.Checked := True;
-                       ViewType := gvtLog;
-               end;
-       gtrNew:
-               begin
-                       NewItemAction.Checked := True;
-                       ViewType := gvtNew;
-               end;
-       end;
+       //ListToolBar\82É\82¢\82é\82©\82à\82µ\82ê\82È\82¢\8di\8d\9e\82ÝComboBox\82ð\94z\92u
+       SetSelectComboBox();
 
        //\83A\83h\83\8c\83X\83o\81[
        AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
 
+       //\83\8a\83\93\83N\83o\81[
+       SetLinkBar;
        //\83N\81[\83\8b\83o\81[\95\9c\8c³\82ÍFormShow\82É\88Ú\93®\82µ\82½
 
        //\83{\81[\83h\83t\83@\83C\83\8b\82ª\96³\82¢\8fê\8d\87\82Í\83\81\83b\83Z\81[\83W\95\\8e¦
@@ -1664,76 +1240,102 @@ begin
                                 + '\82±\82ê\82©\82ç\81A\81u\82Q\82¿\82á\82ñ\82Ë\82é\81v\82Ì\83A\83h\83\8c\83X\88ê\97\97\82ð\83_\83E\83\93\83\8d\81[\83h\82µ\82Ü\82·' + #13#10
                                 + '\8e\9f\82É\8fo\82Ä\82­\82é\89æ\96Ê\82Å\81A\81u\8dX\90V\81v\83{\83^\83\93\82ð\89\9f\82µ\82Ä\82­\82¾\82³\82¢\81B';
                MsgBox(SplashWindow.Handle, msg, '\83M\83R\83i\83r', MB_OK or MB_ICONINFORMATION);
-               NewBoardAction.Execute;
+               GikoDM.NewBoardAction.Execute;
        end;
 
        //\83L\81[\90Ý\92è\93Ç\82Ý\8d\9e\82Ý
-       GikoSys.LoadKeySetting(ActionList);
+       GikoSys.LoadKeySetting(GikoDM.GikoFormActionList, GikoSys.GetMainKeyFileName);
 
        //\8dÅ\8fI\8f\84\89ñ\8e\9e\8aÔ
 //     FLastRoundTime := 0;
 
-       //ResHint
-       FHint := TResPopup.Create(Self);
+       ListView.OnData := TListViewUtils.ListViewData;
 
        // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83L\83\83\83r\83l\83b\83g\82Ì\95\9c\8c³
        CabinetVisible( False );
        if GikoSys.Setting.CabinetVisible then begin
                i := CabinetSelectPopupMenu.Items.Count - 1;
                if GikoSys.Setting.CabinetIndex = i - 1 then
-                       CabinetHistoryAction.Execute
+                       GikoDM.CabinetHistoryAction.Execute
                else if GikoSys.Setting.CabinetIndex = i then
-                       CabinetFavoriteAction.Execute
+                       GikoDM.CabinetFavoriteAction.Execute
                else begin
                        if GikoSys.Setting.CabinetIndex < Length( BBSs ) then
                                ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] );
                        // \8bN\93®\8e\9e\82É\95Û\91\82³\82ê\82Ä\82µ\82Ü\82¤\91Î\8dô 2
                        FIsIgnoreResize := rtResizing;
-                       CabinetBBSAction.Execute;
+                       GikoDM.CabinetBBSAction.Execute;
                end;
        end else begin
                ShowBBSTreeOld( BBSs[ 0 ] );
                PostMessage( Handle, USER_TREECLICK, 0, 0 );
        end;
 
-       // \8bN\93®\8e\9e\82É\95Û\91\82³\82ê\82Ä\82µ\82Ü\82¤\91Î\8dô 3
-       FIsIgnoreResize := rtResizing;
-
-       //\83I\81[\83g\83\8d\83O\83C\83\93
-       if GikoSys.Setting.AutoLogin then
-               LoginAction.Execute;
-
        //\88ø\90\94\82ª\82 \82Á\82½\82ç\83X\83\8c\82ð\8aJ\82­\81i\96¢\8eæ\93¾\82È\82ç\83_\83E\83\93\83\8d\81[\83h\81j
        for i := 1 to ParamCount do     begin
                MoveToURL(ParamStr(i));
        end;
-//     SetStdToolBar;
-//     SetLinkBar;
 
-       s := GikoSys.FAbon.NGwordname;
-       StatusBar.Panels[2].Text := s;
-       StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
+       GikoDM.RepaintStatusBar;
        StatusBarResize(Sender);
 
        dummy1.Caption  := ItemReservPMenu.Caption;
        dummy1.Hint     := ItemReservPMenu.Hint;
 
-       //Samba24\82Ì\83t\83@\83C\83\8b\83`\83F\83b\83N
-       GikoSys.SambaFileExists();
+{$IFDEF SPAM_FILTER_ENABLED}
+       // \83X\83p\83\80\83t\83B\83\8b\83^\8aw\8fK\97\9a\97ð
+       GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
+{$ENDIF}
+
+       // \83}\83E\83X\83W\83F\83X\83`\83\83\81[
+       MouseGesture := TMouseGesture.Create;
+       GikoSys.Setting.Gestures.LoadGesture(
+               GikoSys.Setting.GetGestureFileName, GikoDM.GikoFormActionList );
+       MouseGesture.Margin := GikoSys.Setting.Gestures.Margin;
+       MouseGesture.OnGestureStart := OnGestureStart;
+       MouseGesture.OnGestureMove := OnGestureMove;
+       MouseGesture.OnGestureEnd := OnGestureEnd;
+       if GikoSys.Setting.GestureEnabled then
+               MouseGesture.SetHook( Handle );
+
+       //2ch\8c¾\8cê\93Ç\82Ý\8fo\82µ
+       GikoSys.SetGikoMessage;
+
+       //\83I\81[\83g\83\8d\83O\83C\83\93
+       if GikoSys.Setting.AutoLogin then
+               GikoDM.LoginAction.Execute;
+
+       GikoSys.Setting.BeLogin := GikoSys.Setting.BeAutoLogin;
+
+       //\83L\83\83\83v\83V\83\87\83\93\82ª\8fã\8f\91\82«\82³\82ê\82Ä\82µ\82Ü\82¤\82Ì\82Å\81A\82±\82±\82Å\8dÄ\90Ý\92è
+       FavoriteAddToolButton.Caption := '\92Ç\89Á...';
+       AntiIndivAbonMenuItem.Caption := '\8cÂ\95Ê\82 \82Ú\81`\82ñ\89ð\8f\9c';
+
+       //\93ü\97Í\83A\83V\83X\83g\8b@\8d\\82Ì\8f\89\8aú\89»
+       InputAssistDM.Init(GikoSys.GetInputAssistFileName);
 
-        //\82É\82¿\82á\82ñ\8cê\83t\83@\83C\83\8b\93Ç\82Ý\8fo\82µ
+    //\92u\8a·\90Ý\92è\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý
+    ReplaceDM.LoadFromFile(GikoSys.GetReplaceFileName);
+    // D&D\82ð\8eó\82¯\8eæ\82é
+    DragAcceptFiles(Self.Handle, True);
 end;
 
 // CoolBar \82Ì\90Ý\92è\82ð\95Ï\90\94\82É\95Û\91
 procedure TGikoForm.SaveCoolBarSettings;
-var
-       i                               : Integer;
-       CoolSet : TCoolSet;
 begin
 
        if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then
                Exit;
+       SaveMainCoolBarSettings;
+       SaveBoardCoolBarSettings;
+       SaveBrowserCoolBarSettings;
 
+end;
+procedure TGikoForm.SaveMainCoolBarSettings;
+var
+       i : Integer;
+       CoolSet : TCoolSet;
+begin
        //\83N\81[\83\8b\83o\81[\95Û\91¶(Main)
        for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
                CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
@@ -1741,6 +1343,12 @@ begin
                CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
                GikoSys.Setting.MainCoolSet[i] := CoolSet;
        end;
+end;
+procedure TGikoForm.SaveBoardCoolBarSettings;
+var
+       i : Integer;
+       CoolSet : TCoolSet;
+begin
        //\83N\81[\83\8b\83o\81[\95Û\91¶(Board)
        for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
                CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
@@ -1748,6 +1356,12 @@ begin
                CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
                GikoSys.Setting.ListCoolSet[i] := CoolSet;
        end;
+end;
+procedure TGikoForm.SaveBrowserCoolBarSettings;
+var
+       i : Integer;
+       CoolSet : TCoolSet;
+begin
        //\83N\81[\83\8b\83o\81[\95Û\91¶(Browser)
        for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
                CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
@@ -1755,9 +1369,7 @@ begin
                CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
                GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
        end;
-
 end;
-
 // CoolBar \82Ì\90Ý\92è\82ð\95Ï\90\94\82©\82ç\95\9c\8c³
 procedure TGikoForm.LoadCoolBarSettings;
 var
@@ -1807,7 +1419,7 @@ begin
        BrowserCoolBar.Bands.BeginUpdate;
        try
 //             for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
-               for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
+               for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
                        CoolSet := GikoSys.Setting.BrowserCoolSet[i];
                        if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
                                FIsIgnoreResize := rtNone;
@@ -1823,75 +1435,63 @@ begin
        end;
 
 end;
-
-//
-//
 //
 procedure TGikoForm.FormShow(Sender: TObject);
+var
+       item        : TThreadItem;
 begin
-       if not FStartUp then begin
+       if FStartUp then begin
                ShowWindow(Application.Handle, SW_HIDE);
 
                //FormCreate\82Å\82â\82é\82Æ\89Â\8e\8b\90Ý\92è\82ª\94½\89f\82³\82ê\82È\82¢\8fê\8d\87\82ª\82 \82é\82Ì\82ÅFormShow\82Å\82â\82é\82±\82Æ\82É\82µ\82½
                //\83c\81[\83\8b\83o\81[\95\\8e¦
-               StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
-               StdToolBarVisibleActionExecute( nil );
-               AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
-               AddressBarVisibleActionExecute( nil );
-               LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
-               LinkBarVisibleActionExecute( nil );
-               ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
-               ListToolBarVisibleActionExecute( nil );
-               ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
-               ListNameBarVisibleActionExecute( nil );
-               BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
-               BrowserToolBarVisibleActionExecute( nil );
-               BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
-               BrowserNameBarVisibleActionExecute( nil );
-
-               //\83u\83\89\83E\83U\83^\83u
-               BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
-               BrowserTabVisibleActionExecute(nil);
-
-               if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
-                       BrowserTabTopAction.Checked := True;
-                       BrowserTabTopActionExecute(nil);
-               end else begin
-                       BrowserTabBottomAction.Checked := True;
-                       BrowserTabBottomActionExecute(nil);
-               end;
-
-               if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
-                       BrowserTabTabStyleAction.Checked := True;
-                       BrowserTabTabStyleActionExecute(nil);
-               end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
-                       BrowserTabButtonStyleAction.Checked := True;
-                       BrowserTabButtonStyleActionExecute(nil);
-               end else begin
-                       BrowserTabFlatStyleAction.Checked := True;
-                       BrowserTabFlatStyleActionExecute(nil);
-               end;
-
-               // ListView \82Ì\83w\83b\83_\83h\83\89\83b\83O
-//             ListView.FullDrag := True;
+               GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
+               GikoDM.StdToolBarVisibleActionExecute( nil );
+               GikoDM.AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
+               GikoDM.AddressBarVisibleActionExecute( nil );
+               GikoDM.LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
+               GikoDM.LinkBarVisibleActionExecute( nil );
+               GikoDM.ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
+               GikoDM.ListToolBarVisibleActionExecute( nil );
+               GikoDM.ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
+               GikoDM.ListNameBarVisibleActionExecute( nil );
+               GikoDM.BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
+               GikoDM.BrowserToolBarVisibleActionExecute( nil );
+               GikoDM.BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
+               GikoDM.BrowserNameBarVisibleActionExecute( nil );
 
                // CoolBar \95\9c\8c³
                LoadCoolBarSettings;
 
+               //\8fd\97v\81@\82±\82ê\82ª\82È\82¢\82Æ\83c\81[\83\8b\83{\83^\83\93\82Ì\8dX\90V\82ª\82¨\82©\82µ\82­\82È\82é
+//             ResetBandInfo( ListCoolBar, ListToolBar );
                FIsIgnoreResize := rtNone;
 
-               //TabAutoLoad
                //FormCrete\82©\82ç\88Ú\93®\81B
                if GikoSys.Setting.TabAutoLoadSave then begin
-                       TabAutoLoadAction.Execute;
-               end;
-                //\82É\82¿\82á\82ñ\8cê\88Ä\93à\83T\83|\81[\83g\8b@\94\
-                if GikoSys.Setting.GengoSupport then begin
-                //\97\\92è\92n
-                //Test\8cü\82¯
+            GikoDM.TabsOpenAction.Tag := 1;
+                       GikoDM.TabsOpenAction.Execute;
+            GikoDM.TabsOpenAction.Tag := 0;
+            if (GikoSys.Setting.LastCloseTabURL <> '') then begin
+                PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 );
+                if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
+                       while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and
+                               (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
+                               Application.ProcessMessages;
+                    end;
+                       end;
+                item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL );
+                if (item <> nil) and (item.IsLogFile) then begin
+                    OpenThreadItem(item, item.URL);
                 end;
+                GikoSys.Setting.LastCloseTabURL := '';
+            end;
+               end;
 
-               FStartUp := true;
+        //ActionList\82ÌGroupIndex\82ð\8c³\82É\96ß\82·
+               SetGroupIndex(GikoDM.GikoFormActionList);
+
+               FStartUp := false;
        end;
 end;
 
@@ -1899,17 +1499,36 @@ procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
 begin
 //     if GikoForm.WindowState <> wsMinimized then
 //             SaveCoolBarSettings;
+       CanClose := True;
        if ( GikoSys.Setting.ShowDialogForEnd ) and
                        (MessageDlg('\83M\83R\83i\83r\82ð\8fI\97¹\82µ\82Ä\82æ\82ë\82µ\82¢\82Å\82·\82©\81H', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
                CanClose := false;
                        Exit;
-       end else begin
-               CanClose := True;
-               if GikoSys.Setting.TabAutoLoadSave then begin
-                       TabAutoSaveAction.Execute;
+       end;
+
+    GikoSys.Setting.LastCloseTabURL := '';
+       if GikoSys.Setting.TabAutoLoadSave then begin
+               GikoDM.TabsSaveAction.Execute;
+        if (GetActiveContent <> nil) and
+            (GetActiveContent.IsLogFile) then begin
+            GikoSys.Setting.LastCloseTabURL := GetActiveContent.URL;
+        end;
+       end;
+
+       if (SearchDialog <> nil) then begin
+               if (SearchDialog.Visible) then begin
+                       SearchDialog.Close;
+                       try
+                               SearchDialog.Release;
+                       except
+                       end;
+                       SearchDialog := nil;
                end;
        end;
-       //Application.HookMainWindow(Hook);
+
+       //\83X\83N\83\8a\81[\83\93\8fã\82Ì\91S\82Ä\82Ì\83t\83H\81[\83\80\82©\82ç\81AEditorForm\82ð\95Â\82\82é
+    GikoDM.CloseAllEditorAction.Execute;
+
        Application.UnhookMainWindow(Hook);
        Application.Terminate;
 end;
@@ -1921,8 +1540,11 @@ var
        wp                      : TWindowPlacement;
        tmpBool : Boolean;
 begin
-//     Application.OnDeactivate := nil;
-//     Self.OnDeactivate := nil;
+       // \83}\83E\83X\83W\83F\83X\83`\83\83\81[\8aJ\95ú
+       try
+               MouseGesture.UnHook;
+       except
+       end;
        try
                ActiveListColumnSave;
        except
@@ -1938,11 +1560,11 @@ begin
                GikoSys.Setting.WindowMax := WindowState = wsMaximized;
 
                GikoSys.Setting.ListStyle := ListView.ViewStyle;
-               GikoSys.Setting.CabinetVisible := CabinetVisibleAction.Checked;
+               GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked;
                GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
                GikoSys.Setting.ListHeight := FBrowserSizeHeight;
                GikoSys.Setting.ListWidth := FBrowserSizeWidth;
-               if ArrangeAction.Checked then
+               if GikoDM.ArrangeAction.Checked then
                        GikoSys.Setting.ListOrientation := gloVertical
                else
                        GikoSys.Setting.ListOrientation := gloHorizontal;
@@ -1956,20 +1578,23 @@ begin
                        GikoSys.Setting.ResRange := FResRangeMenuSelect;
        except
        end;
-
-       // \83\8a\83A\83\8b\83^\83C\83\80\82É\95Û\91\82³\82ê\82é\82Ì\82Å\81A\82Ü\82½\81A\83E\83B\83\93\83h\83E\83T\83C\83Y\82ª CoolBar \82æ\82è
-       // \8f¬\82³\82­\82È\82Á\82Ä\82¢\82é\82Æ\82«\82É\95Û\91\82·\82é\82Æ\92l\82ª\8fã\8f\91\82«\82³\82ê\82Ä\82µ\82Ü\82¤\82Ì\82Å\82±\82±\82Å\82Í\95Û\91\82µ\82È\82¢
-       {
-               // \81ªFormDestroy\92\86\82É\88Ú\93®\82µ\82½\82Ì\82Å\81A\82±\82±\82Å\95Û\91\82µ\82È\82¢\82Æ\82¢\82¯\82È\82¢\82Æ\8ev\82¤\81B\81i\82à\82\82ã\81@2004/04/09\81j
-       // CoolBar \95Û\91
-       if GikoForm.WindowState <> wsMinimized then
-               SaveCoolBarSettings;
-       }
+       if WindowState <> wsNormal then
+               WindowState := wsNormal;
+       SaveCoolBarSettings;
        try
                GikoSys.Setting.WriteWindowSettingFile;
                GikoSys.Setting.WriteNameMailSettingFile;
        except
        end;
+       // \83\8a\83A\83\8b\83^\83C\83\80\82É\95Û\91\82³\82ê\82é\82Ì\82Å\81A\82Ü\82½\81A\83E\83B\83\93\83h\83E\83T\83C\83Y\82ª CoolBar \82æ\82è
+       // \8f¬\82³\82­\82È\82Á\82Ä\82¢\82é\82Æ\82«\82É\95Û\91\82·\82é\82Æ\92l\82ª\8fã\8f\91\82«\82³\82ê\82Ä\82µ\82Ü\82¤\82Ì\82Å\82±\82±\82Å\82Í\95Û\91\82µ\82È\82¢
+
+               // \81ªFormDestroy\92\86\82É\88Ú\93®\82µ\82½\82Ì\82Å\81A\82±\82±\82Å\95Û\91\82µ\82È\82¢\82Æ\82¢\82¯\82È\82¢\82Æ\8ev\82¤\81B\81i\82à\82\82ã\81@2004/04/09\81j
+       // CoolBar \95Û\91
+       //if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then
+
+       //\93ü\97Í\83A\83V\83X\83g\8b@\8d\\82Ì\90Ý\92è\82Ì\95Û\91
+       InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName);
 
        //\82¨\8bC\82É\93ü\82è\95Û\91
        try
@@ -1978,17 +1603,16 @@ begin
                FavoriteDM.Clear;
        except
        end;
-
+       LockWindowUpdate(Self.Handle);
        try
                //\83^\83u\83N\83\8d\81[\83Y
                tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
                GikoSys.Setting.ShowDialogForAllTabClose := false;
-               AllTabCloseAction.Execute;
-        GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
+               GikoDM.AllTabCloseAction.Execute;
+               GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
        except
        end;
        try
-               LockWindowUpdate(Self.Handle);
                for i := FBrowsers.Count - 1 downto 0 do begin
                        TWebBrowser(FBrowsers[i]).Free;
                end;
@@ -2006,7 +1630,7 @@ begin
                end;
        except
        end;
-       LockWindowUpdate(0);
+
        try
                TreeView.Items.BeginUpdate;
                TreeView.Items.GetFirstNode.Free;
@@ -2018,18 +1642,18 @@ begin
        //\83A\83h\83\8c\83X\97\9a\97ð\95Û\91
        try
                //AddressHistoryDM\82Í\8e©\93®\90\90¬\83t\83H\81[\83\80\82È\82Ì\82Å\81A\89ð\95ú\82Í\8e©\93®\93I\82É\82³\82ê\82é\81B
-               AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
+               AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
        except
        end;
 
        //\83q\83X\83g\83\8a\83\8a\83X\83g\95Û\91
        try
-               SaveHistory;
+               FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
        except
        end;
        try
                try
-                       ClearHistory;
+                       FHistoryList.Clear;
                except
                end;
        finally
@@ -2059,10 +1683,21 @@ begin
        finally
                FControlThread.Free;
        end;
+    // \83v\83\89\83O\83C\83\93\82É\82æ\82Á\82Ä\92Ç\89Á\82³\82ê\82½\83\81\83j\83\85\81[\82ð\8aJ\95ú\82·\82é
+    for i := GikoForm.PlugInMenu.Count - 1 downto 0 do begin
+               GikoForm.PlugInMenu.items[i].Free;
+       end;
+    GikoForm.PlugInMenu.Clear;
+
 
        // TBBS \82Í\95Û\8e\9d\82µ\82Ä\82¢\82é TCategory, TBoard, TThreadItem \82·\82×\82Ä\82ð\8aJ\95ú\82·\82é
        // TBoard, TThreadItem \82Ì\83f\83X\83g\83\89\83N\83^\82Í\83v\83\89\83O\83C\83\93\82É\94j\8aü\82ð\93`\82¦\82é\82Ì\82Å
        // BoardPluteIns \82Ì\8aJ\95ú\82æ\82è\90æ\82É\8ds\82¤\82±\82Æ
+       for i := Length(BoardGroups) - 1 downto 0 do begin
+               //BoardGroups[i].Clear;
+               BoardGroups[i].Free;
+       end;
+
        try
                for i := Length( BBSs ) - 1 downto 0 do begin
                        if BBSs[ i ] <> nil then
@@ -2073,39 +1708,26 @@ begin
        end;
 
        try
-               for i := Length( BoardPlugIns ) - 1 downto  0 do begin
-                       if BoardPlugIns[ i ] <> nil then
-                               BoardPlugIns[ i ].Free;
-                       BoardPlugIns[ i ] := nil;
-               end;
-       except
-       end;
-
-       try
                if FEvent <> nil then
                        FEvent.Free;
 
-               //Hint\94j\8aü
-               if FHint <> nil then begin
-                       FHint.ReleaseHandle;
-                       FHint.Free;
-                       FHint := nil;
-               end;
+        // TODO \83\8c\83X\83|\83b\83v\83A\83b\83v\82Ì\94j\8aü
+        try
+            if FResPopupBrowser <> nil then  begin
+                TOleControl(FResPopupBrowser).Parent := nil;
+                FResPopupBrowser.Free;
+            end;
+
+        except
+        end;
                //Preview\94j\8aü
-               if TPreviewBrowser <> nil then begin
+               if FPreviewBrowser <> nil then begin
                        FPreviewBrowser.Free;
                        FPreviewBrowser := nil;
                end;
        except
        end;
-
-end;
-
-//\83L\83\83\83r\83l\83b\83g\81~\83{\83^\83\93\83N\83\8a\83b\83N
-procedure TGikoForm.CabinetPanelHide(Sender: TObject);
-begin
-       CabinetVisibleAction.Execute;
-//     CabinetPanelVisible(false);
+       LockWindowUpdate(0);
 end;
 
 // \8ae\8f\8a\82É\82 \82é\83L\83\83\83r\83l\83b\83g\81E BBS \83\81\83j\83\85\81[\82ð\83Z\83b\83g\81^\8dX\90V
@@ -2156,16 +1778,49 @@ var
        i                       : Integer;
        tmpBool: Boolean;
 begin
+    LockWindowUpdate(Self.Handle);
+
        //\83^\83u\83N\83\8d\81[\83Y
        tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
        GikoSys.Setting.ShowDialogForAllTabClose := false;
-       AllTabCloseAction.Execute;
+       GikoDM.AllTabCloseAction.Execute;
        GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
-
        SetContent(BrowserNullTab);
        //TreeView\83N\83\8a\83A\81iBBS2ch.Free\82Ì\8cã\82É\83N\83\8a\83A\82·\82é\82ÆXP\83X\83^\83C\83\8b\8e\9e\82É\83G\83\89\81[\8fo\82é\81j
        TreeView.Items.Clear;
 
+       //\8f\84\89ñ\83\8a\83X\83g\95Û\91
+       try
+               RoundList.SaveRoundFile;
+       except
+       end;
+       //\8f\84\89ñ\83\8a\83X\83g\82ð\94j\8aü
+       try
+               RoundList.Clear;
+       except
+       end;
+
+       //\97\9a\97ð\82Ì\95Û\91\82Æ\94j\8aü
+       try
+               FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
+               FHistoryList.Clear;
+       except
+       end;
+
+       //\82¨\8bC\82É\93ü\82è\82Ì\95Û\91\82Æ\94j\8aü
+       try
+               FavoriteDM.WriteFavorite;
+               FavoriteDM.Clear;
+       except
+       end;
+
+       //\94Â\81E\83X\83\8c\81EPLUGIN\82Ì\94j\8aü
+       for i := Length(BoardGroups) - 1 downto 0 do begin
+               try
+                       BoardGroups[i].Free;
+               except
+               end;
+       end;
        //BBS\94j\8aü
        try
                for i := Length( BBSs ) - 1 downto 0 do begin
@@ -2180,668 +1835,141 @@ begin
 
        FTreeType := gttNone;
 
+       //============\82±\82±\82©\82ç\89º\82Å\81A\8dÄ\90¶================================//
+
+       // \8aO\95\94\94Â\83v\83\89\83O\83C\83\93\82ð\83\8d\81[\83h(ReadBoardFile, LoadHistory \82æ\82è\90æ\82É\8ds\82¤\82±\82Æ)
+       InitializeBoardPlugIns;
+
        GikoSys.ListBoardFile;          //\83{\81[\83h\83t\83@\83C\83\8b\93Ç\8d\9e
 
+       // \82·\82×\82Ä\82ÌBBS\82ð\93Ç\82Ý\8d\9e\82ñ\82Å\82¨\82­
+       for i := Length(BBSs) - 1 downto 0 do begin
+               if not BBSs[i].IsBoardFileRead then
+                       GikoSys.ReadBoardFile(BBSs[i]);
+       end;
+
        // BBS \83\81\83j\83\85\81[\82Ì\8dX\90V
        SetBBSMenu;
 
        ShowBBSTree( BBSs[ 0 ] );
 
        // \97\9a\97ð\93Ç\82Ý\8d\9e\82Ý
-       SaveHistory;
-       ClearHistory;
-       LoadHistory;
+    FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml',
+        TreeView, FTreeType);
 
        //\82¨\8bC\82É\93ü\82è\93Ç\82Ý\8d\9e\82Ý
-       FavoriteDM.WriteFavorite;
-       FavoriteDM.Clear;
        FavoriteDM.ReadFavorite;
 
        SetLinkBar;
 
+       //\8f\84\89ñ\82Ì\93Ç\82Ý\8d\9e\82Ý
+       RoundList.LoadRoundBoardFile;
+       RoundList.LoadRoundThreadFile;
+
+       LockWindowUpdate(0);
 end;
 
-//\83{\81[\83h\83c\83\8a\81[\90Ý\92è
-procedure TGikoForm.SetBoardTreeNode(
-       inBBS : TBBS
-);
+{!
+\todo \89½\8cÌ IE 7 \82Å\82Í about:.. \82É\82È\82é\82Ì\82©
+      (IE 7 \82ª about:.. \82ð\92Ç\89Á\82µ\82Ä\82¢\82é\82Ì\82©\81A\83M\83R\83i\83r\82ª\92Ç\89Á\82µ\82Ä\82¢\82é\82Ì\82©)
+      \92²\8d¸\82·\82é\82±\82Æ
+}
+procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
 var
-       i, j, k: integer;
-       Root: TTreeNode;
-       CategoryNode: TTreeNode;
-       BoardNode: TTreeNode;
-       Category: TCategory;
-       Board: TBoard;
-begin
-       // \94Â\83\8a\83X\83g\82Ì\90Ý\92è
-       FActiveBBS := inBBS;
-       TreeView.Items.BeginUpdate;
-       TreeView.Items.Clear;
-       try
-               if not inBBS.IsBoardFileRead then
-                       GikoSys.ReadBoardFile( inBBS );
-               try
-                       if SplashWindow <> nil then
-                               SplashWindow.ProgressBar.Max := inBBS.Count;
-               except
-               end;
+       p: TPoint;
+       s: string;
+       tmp2: string;
+       URL: string;
+       ATitle: Boolean;
 
-               // \83L\83\83\83r\83l\83b\83g\95\\8e¦\91O\82É\8dÄ\83\\81[\83g
-               if ( GikoSys.Setting.BBSSortIndex <> 0 ) or ( GikoSys.Setting.BBSSortOrder <> true ) then begin
-                       Sort.SortOrder := true;
-                       Sort.SortIndex := 0;
-                       Sort.SortNoFlag := true;
-                       inBBS.Sort(CategorySortProc);
-               end;
-
-               Root                                                            := TreeView.Items.Add( nil, inBBS.Title );
-               Root.ImageIndex                 := ITEM_ICON_2CH1;
-               Root.SelectedIndex      := ITEM_ICON_2CH2;
-               Root.Data                                               := inBBS;
-               for i := inBBS.Count - 1 downto 0 do begin
-                       Category := TCategory(inBBS.Items[i]);
-                       CategoryNode := TreeView.Items.AddChildFirst(Root, Category.Title);
-                       CategoryNode.Data := Category;
-                       CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
-                       CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
-
-                       // \83L\83\83\83r\83l\83b\83g\95\\8e¦\91O\82É\8dÄ\83\\81[\83g
-                       if ( GikoSys.Setting.CategorySortIndex <> 0 ) or ( GikoSys.Setting.CategorySortOrder <> true ) then begin
-                               Sort.SortOrder := true;
-                               Sort.SortIndex := 0;
-                               Sort.SortNoFlag := true;
-                               Category.CustomSort(BoardSortProc);
-                       end;
+       threadItem      : TThreadItem;
+       board                           : TBoard;
+       Protocol, Host, Path, Document, Port, Bookmark: string;
 
-                       for j := Category.Count - 1 downto 0 do begin
-                               Board := TBoard(Category.Items[j]);
-                               Board.BeginUpdate;
-                               BoardNode := TreeView.Items.AddChildFirst(CategoryNode, Board.Title);
-                               BoardNode.Data := Board;
-                               //if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then begin
-                               if not Board.IsLogFile then begin
-                                       BoardNode.ImageIndex := ITEM_ICON_BOARD_NOSUBJECT;
-                                       BoardNode.SelectedIndex := ITEM_ICON_BOARD_NOSUBJECT;
-                               end else begin
-                                       BoardNode.ImageIndex := ITEM_ICON_BOARD1;
-                                       BoardNode.SelectedIndex := ITEM_ICON_BOARD2;
-                                       for k := 0 to Board.Count - 1 do begin
-                                               if Board.Items[ k ].IsLogFile then begin
-                                                       BoardNode.ImageIndex := ITEM_ICON_BOARD_LOG;
-                                                       BoardNode.SelectedIndex := ITEM_ICON_BOARD_LOG;
-
-                                                       Break;
-                                               end;
-                                       end;
+       wkInt: Integer;
+       wkIntSt: Integer;
+       wkIntTo: Integer;
+       ActiveFileName: string;
+       e: IHTMLElement;
+       Ext: string;
+       PathRec: TPathRec;
+  Text2: string;
+    cResPopup: TResPopupBrowser;
+begin
+       // \83M\83R\83i\83r\82Í\83\8c\83X\83A\83\93\83J\81[\82ª about:blank.. \82Å\8en\82Ü\82é\82±\82Æ\82ð\8aú\91Ò\82µ\82Ä\82¢\82é\82ª
+  // IE 7 \82Å\82Í about:blank.. \82Å\82Í\82È\82­ about:.. \82É\82È\82é\82Ì\82Å\81A\92u\8a·\82·\82é(\93\8a\82°\82â\82è)
+       if Pos('about:..', Text) = 1 then
+       Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) )
+  else
+       Text2 := Text;
+       if not( TObject(Sender) is TWebBrowser )then
+               Exit;
+       try
+               try
+                       if (TWebBrowser(Sender) <> nil) and (not TWebBrowser(Sender).Busy) and (Assigned(TWebBrowser(Sender).Document)) then begin
+                               if LowerCase(OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset) <> 'shift_jis' then begin
+                                       OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset := 'shift_jis';
                                end;
-                               Board.EndUpdate;
-                       end;
-
-                       CategoryNode.Expanded := Category.NodeExpand;
-
-                       if SplashWindow <> nil then begin
-                               SplashWindow.ProgressBar.StepIt;
-                               Application.ProcessMessages;
                        end;
+               except
                end;
        finally
-               TreeView.Items.EndUpdate;
        end;
-end;
-
-function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS): Integer;
-var
-       TitleColumn     : TListColumn;
-       ListColumn      : TListColumn;
-       i, id, idx      : Integer;
-begin
-       ListView.Items.BeginUpdate;
+       if PreviewTimer.Enabled then
+               PreviewTimer.Enabled := False;
+       Application.CancelHint;
        try
-               Screen.Cursor := crHourGlass;
+               if GetActiveContent <> nil then
+                       ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
+               else
+                       ActiveFileName := '';
+       except
+               FActiveContent := nil;
+               Exit;
+       end;
+    // \91O\89ñ\82Æ\93¯\82\8fê\8d\87\8fI\97¹
+    if (StatusBar.Panels[1].Text = Text2) then begin
+        if Text2 = '' then begin
+            if FResPopupBrowser <> nil then begin
+                if not(Sender is TResPopupBrowser) then
+                    FResPopupBrowser.Clear
+                else begin
+                    TResPopupBrowser(Sender).ChildClear;
+                end;
+            end;
+        end;
+        Exit;
+    end;
+       StatusBar.Panels[1].Text := Text2;
 
-               ListView.Columns.Clear;
-               TitleColumn := ListView.Columns.Add;
-               TitleColumn.Caption := GikoBBSColumnCaption[ Ord( gbbscTitle ) ];
-               TitleColumn.Width := GikoSys.Setting.BBSColumnWidth[ Ord( gbbscTitle ) ];
-               idx := 0;
-               for i := 0 to GikoSys.Setting.BBSColumnOrder.Count - 1 do begin
-                       if GikoSys.Setting.BBSColumnOrder[ i ] = gbbscTitle then begin
-                               TitleColumn.Tag := i;
-                               idx := i;
-                       end else begin
-                               id := Ord( GikoSys.Setting.BBSColumnOrder[ i ] );
-                               if (Integer( Low( TGikoBBSColumnID ) ) <= id) and
-                                       (id <= Integer( High( TGikoBBSColumnID ) )) then begin
-                                       ListColumn := ListView.Columns.Add;
-       //                                      ListColumn.Tag := id;
-                                               ListColumn.Tag := i;
-                                       ListColumn.Caption := GikoBBSColumnCaption[ id ];
-                                       ListColumn.Width := GikoSys.Setting.BBSColumnWidth[ id ];
-                               end;
-                       end;
-               end;
-               TitleColumn.Index := idx;
-
-               ListView.Items.Count := 0;
-               ListView.Items.Clear;
-               ListView.Items.Count := ABBS2ch.Count;
-
-//             UpFolderAction.Enabled := False;
-//             AllItemAction.Enabled := False;
-//             LogItemAction.Enabled := False;
-//             NewItemAction.Enabled := False;
-//             SelectItemAction.Enabled := False;
-//             ListDownloadToolButton.Enabled := False;
-//             BoardReservToolButton.Enabled := False;
-//             ListThreadDownloadToolButton.Enabled := False;
-
-               ListNameLabel.Caption := ABBS2ch.Title;
-               FolderImage.Picture := nil;
-               ItemIcon16.GetBitmap(1, FolderImage.Picture.Bitmap);
-
-               FSortIndex := GikoSys.Setting.BBSSortIndex;
-               FSortOrder := GikoSys.Setting.BBSSortOrder;
-               for i := ListView.Columns.Count - 1 downto 0 do begin
-                       idx := ListView.Column[ i ].Tag;
-                       if FSortIndex = Ord( GikoSys.Setting.BBSColumnOrder[ idx ] ) then
-                               ListViewSort( nil, ListView.Column[ i ] );
-               end;
-
-               Result := ABBS2ch.Count;
-       finally
-               Screen.Cursor := crDefault;
-               ListView.Items.EndUpdate;
-       end;
-end;
-
-function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
-var
-       TitleColumn     : TListColumn;
-       ListColumn      : TListColumn;
-       i, id, idx      : Integer;
-begin
-       ListView.Items.BeginUpdate;
-       try
-               Screen.Cursor := crHourGlass;
-
-               ListView.Columns.Clear;
-               TitleColumn := ListView.Columns.Add;
-               TitleColumn.Caption := GikoCategoryColumnCaption[ Ord( gccTitle ) ];
-               TitleColumn.Width := GikoSys.Setting.CategoryColumnWidth[ Ord( gccTitle ) ];
-               idx := 0;
-               for i := 0 to GikoSys.Setting.CategoryColumnOrder.Count - 1 do begin
-                       if GikoSys.Setting.CategoryColumnOrder[ i ] = gccTitle then begin
-                               TitleColumn.Tag := i;
-                               idx := i;
-                       end else begin
-                               id := Ord( GikoSys.Setting.CategoryColumnOrder[ i ] );
-                               if (Integer( Low( TGikoCategoryColumnID ) ) <= id) and
-                                       (id <= Integer( High( TGikoCategoryColumnID ) )) then begin
-                                       ListColumn := ListView.Columns.Add;
-//                                             ListColumn.Tag := id;
-                                       ListColumn.Tag := i;
-                                       ListColumn.Caption := GikoCategoryColumnCaption[ id ];
-                                       ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[ id ];
-                               end;
-                       end;
-               end;
-               TitleColumn.Index := idx;
-
-               ListView.Items.Count := 0;
-               ListView.Items.Clear;
-               ListView.Items.Count := Category.Count;
-
-//             UpFolderAction.Enabled := True;
-//             AllItemAction.Enabled := False;
-//             LogItemAction.Enabled := False;
-//             NewItemAction.Enabled := False;
-//             SelectItemAction.Enabled := False;
-//             ListDownloadToolButton.Enabled := False;
-//             BoardReservToolButton.Enabled := False;
-//             ListThreadDownloadToolButton.Enabled := False;
-
-               ListNameLabel.Caption := Category.Title;
-               FolderImage.Picture := nil;
-               ItemIcon16.GetBitmap(3, FolderImage.Picture.Bitmap);
-
-               FSortIndex := GikoSys.Setting.CategorySortIndex;
-               FSortOrder := GikoSys.Setting.CategorySortOrder;
-               for i := ListView.Columns.Count - 1 downto 0 do begin
-                       idx := ListView.Column[ i ].Tag;
-                       if FSortIndex = Ord( GikoSys.Setting.CategoryColumnOrder[ idx ] ) then
-                               ListViewSort( nil, ListView.Column[ i ] );
-               end;
-
-               Result := Category.Count;
-       finally
-               Screen.Cursor := crDefault;
-               ListView.Items.EndUpdate;
-       end;
-end;
-
-function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
-var
-       TitleColumn     : TListColumn;
-       ListColumn      : TListColumn;
-       i, id, idx      : Integer;
-begin
-       ListView.Items.BeginUpdate;
-       try
-               Screen.Cursor := crHourGlass;
-
-{*
-               // \83`\83\89\82Â\82«\96h\8e~\82Ì\82½\82ß\81A\95Ï\8dX\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82Ì\82Ý
-               // \81¦\96¼\8fÌ\82Í\88á\82¤\82ª\83J\83\89\83\80\90\94\82ª\93¯\82\81A\82Æ\82¢\82Á\82½\8fê\8d\87\82É\91Î\8f\88\82Å\82«\82È\82¢\82Ì\82Å\92\8d\88Ó
-               if ListView.Columns.Count <> GikoSys.Setting.BoardColumnOrder.Count then
-*}
-               begin
-                       ListView.Columns.Clear;
-                       TitleColumn := ListView.Columns.Add;
-                       TitleColumn.Caption := GikoBoardColumnCaption[ Ord( gbcTitle ) ];
-                       TitleColumn.Width := GikoSys.Setting.BoardColumnWidth[ Ord( gbcTitle ) ];
-                       idx := 0;
-                       for i := 0 to GikoSys.Setting.BoardColumnOrder.Count - 1 do begin
-                               if GikoSys.Setting.BoardColumnOrder[ i ] = gbcTitle then begin
-                                       TitleColumn.Tag := i;
-                                       idx := i;
-                               end else begin
-                                       id := Ord( GikoSys.Setting.BoardColumnOrder[ i ] );
-                                       if (Integer( Low( TGikoBoardColumnID ) ) <= id) and
-                                               (id <= Integer( High( TGikoBoardColumnID ) )) then begin
-                                               ListColumn := ListView.Columns.Add;
-                                               ListColumn.Caption := GikoBoardColumnCaption[ id ];
-       //                                      ListColumn.Tag := id;
-                                               ListColumn.Tag := i;
-                                               ListColumn.Width := GikoSys.Setting.BoardColumnWidth[ id ];
-                                               ListColumn.Alignment := GikoBoardColumnAlignment[ id ];
-                                       end;
-                               end;
-                       end;
-                       TitleColumn.Index := idx;
-               end;
-
-               ListView.Items.Count := 0;
-               ListView.Items.Clear;
-
-               case GikoForm.ViewType of
-                       gvtAll: ListView.Items.Count := Board.Count;
-                       gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
-                       gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
-                       gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
-               end;
-
-               ListNameLabel.Caption := Board.Title;
-               FolderImage.Picture := nil;
-               ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
-
-               FSortIndex := GikoSys.Setting.BoardSortIndex;
-               FSortOrder := GikoSys.Setting.BoardSortOrder;
-               for i := ListView.Columns.Count - 1 downto 0 do begin
-                       idx := ListView.Column[ i ].Tag;
-                       if FSortIndex = Ord( GikoSys.Setting.BoardColumnOrder[ idx ] ) then
-                               ListViewSort( nil, ListView.Column[ i ] );
-               end;
-
-               Result := Board.Count;
-       finally
-               Screen.Cursor := crDefault;
-               ListView.Items.EndUpdate;
-       end;
-end;
-
-procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
-var
-//     FileName: string;
-//     DateTime: TDateTime;
-       BoardCnt: Integer;
-       BBS: TBBS;
-       Category: TCategory;
-       Board: TBoard;
-       ThreadItem: TThreadItem;
-       RepStr: string;
-               ActivListObj : TObject;
-       i, idx : Integer;
-begin
-       ActivListObj := ActiveList;
-       if ActivListObj is TBBS then begin
-               //===== \83J\83e\83S\83\8a\83\8a\83X\83g =====
-               BBS := TBBS(ActivListObj);
-
-               ListView.StateImages := nil;
-
-               if BBS = nil then Exit;
-               if BBS.Count <= 0 then Exit;
-               if Item = nil then Exit;
-               if Item.Index >= BBS.Count then Exit;
-               if ListView.Items.Count = 0 then Exit;
-
-               if not (BBS.Items[Item.index] is TCategory) then Exit;
-               Category := TCategory(BBS.Items[Item.index]);
-
-               if Category = nil then Exit;
-
-               if ListNumberVisibleAction.Checked then
-                       Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
-               else
-                       Item.Caption := Category.Title;
-
-               Item.ImageIndex := ITEM_ICON_CATEGORY1;
-               Item.Data := Category;
-
-       end else if ActivListObj is TCategory then begin
-
-               //===== \94Â\83\8a\83X\83g =====
-               Category := TCategory(ActivListObj);
-
-               ListView.StateImages := nil;
-
-               if Category = nil then Exit;
-               if Category.Count <= 0 then Exit;
-               if Item = nil then Exit;
-               if Item.Index >= Category.Count then Exit;
-               if ListView.Items.Count = 0 then Exit;
-
-               if not (Category.Items[Item.Index] is TBoard) then Exit;
-               Board := TBoard(Category.Items[Item.Index]);
-
-               if Board = nil then Exit;
-
-               if ListNumberVisibleAction.Checked then
-                       Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
-               else
-                       Item.Caption := Board.Title;
-
-               if Item.SubItems.Count <> ListView.Columns.Count then begin
-                       Item.SubItems.Clear;
-                       for i := GikoSys.Setting.CategoryColumnOrder.Count - 1 downto 1 do
-                               Item.SubItems.Add('');
-               end;
-
-               Item.ImageIndex := ITEM_ICON_BOARD1;
-
-               idx := 0;
-               for i := 0 to ListView.Columns.Count - 1 do begin
-                       if GikoSys.Setting.CategoryColumnOrder.Count <= i then
-                               Break;
-//                             case TGikoCategoryColumnID( ListView.Column[ i ].Tag ) of
-                       case GikoSys.Setting.CategoryColumnOrder[ i ] of
-                       gccTitle:
-                               // Item.Caption \82Í SubItems \82É\8aÜ\82Ü\82ê\96³\82¢\82Ì\82Å
-                               Dec( idx );
-
-                       gccRoundName:
-                               if Board.Round then
-                                       Item.SubItems[ idx ] := Board.RoundName // '\97\\96ñ'
-                               else
-                                       Item.SubItems[ idx ] := '';
-
-                       gccLastModified:
-                               if Board.RoundDate = ZERO_DATE then begin
-                                       Item.SubItems[ idx ] := '';
-                               end else
-                                       Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
-                       end;
-                       Inc( idx );
-               end;
-
-               Item.Data := Board;
-
-       end else if ActivListObj is TBoard then begin
-
-               //===== \83X\83\8c\83\8a\83X\83g =====
-               Board := TBoard(ActivListObj);
-
-               if GikoSys.Setting.ListIconVisible then
-                       ListView.StateImages := StateIconImageList
-               else
-                       ListView.StateImages := nil;
-
-               case GikoForm.ViewType of
-                       gvtAll: BoardCnt := Board.Count;
-                       gvtLog: BoardCnt := Board.GetLogThreadCount;
-                       gvtNew: BoardCnt := Board.GetNewThreadCount;
-                       gvtUser: BoardCnt := Board.GetUserThreadCount;
-                       else
-                               BoardCnt := 0;
-               end;
-
-//             if Board = nil then Exit;
-               if BoardCnt <= 0 then Exit;
-               if Item = nil then Exit;
-               if Item.Index > BoardCnt then Exit;
-               if ListView.Items.Count = 0 then Exit;
-
-//             if not (Board.Items[Item.Index] is TThreadItem) then Exit;
-
-               ThreadItem := nil;
-               case GikoForm.ViewType of
-                       gvtAll: if Item.Index >= Board.Count then Exit else
-                                                               ThreadItem := TThreadItem(Board.Items[Item.Index]);
-                       gvtLog:         ThreadItem := Board.GetLogThread(Item.Index);
-                       gvtNew:         ThreadItem := Board.GetNewThread(Item.Index);
-                       gvtUser:        ThreadItem := Board.GetUserThread(Item.Index);
-               end;
-
-               if ThreadItem = nil then Exit;
-
-//             if ListNumberVisibleAction.Checked then
-//                     RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title
-//             else
-               RepStr := ThreadItem.Title;
-               RepStr := CustomStringReplace(RepStr, '&lt;', '<' );
-               RepStr := CustomStringReplace(RepStr, '&gt;', '>' );
-               RepStr := CustomStringReplace(RepStr, '&quot;', '"' );
-               RepStr := CustomStringReplace(RepStr, '&amp;', '&' );
-               //RepStr := StringReplace(RepStr, '\81\97\81M', ',', [rfReplaceAll]);
-
-               if Item.SubItems.Count <> ListView.Columns.Count then begin
-                       Item.SubItems.Clear;
-                       for i := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 1 do
-                               Item.SubItems.Add('');
-               end;
-
-               if ListNumberVisibleAction.Checked then
-                       Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
-               else
-                       Item.Caption := RepStr;
-
-               case ThreadItem.AgeSage of
-                       gasNone: Item.StateIndex := -1;
-                       gasNew: Item.StateIndex := 0;
-                       gasAge: Item.StateIndex := 1;
-                       gasSage: Item.StateIndex := 2;
-               end;
-
-               if ThreadItem.IsLogFile then begin
-                       idx := 0;
-                       for i := 0 to ListView.Columns.Count - 1 do begin
-                       if GikoSys.Setting.BoardColumnOrder.Count <= i then
-                               Break;
-//                             case TGikoBoardColumnID( ListView.Column[ i ].Tag ) of
-                               case GikoSys.Setting.BoardColumnOrder[ i ] of
-                               gbcTitle:
-                                       // Item.Caption \82Í SubItems \82É\8aÜ\82Ü\82ê\96³\82¢\82Ì\82Å
-                                       Dec( idx );
-
-                               gbcAllCount:
-                                       Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount);
-
-                               gbcLocalCount:
-                                       Item.SubItems[ idx ] := IntToStr(ThreadItem.Count);
-
-                               gbcNonAcqCount:
-                                       Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount - ThreadItem.Count);
-
-                               gbcNewCount:
-                                       if ThreadItem.NewResCount = 0 then
-                                               Item.SubItems[ idx ] := ''
-                                       else
-                                               Item.SubItems[ idx ] := IntToStr(ThreadItem.NewResCount);
-
-                               gbcUnReadCount:
-                                       Item.SubItems[ idx ] := '';
-
-                               gbcRoundName:
-                                       if ThreadItem.Round then
-                                               Item.SubItems[ idx ] := ThreadItem.RoundName
-                                       else
-                                               Item.SubItems[ idx ] := '';
-
-                               gbcRoundDate://gbcLastModified:
-                                       if (ThreadItem.RoundDate = ZERO_DATE)  then begin
-                                               Item.SubItems[ idx ] := '';
-                                       end else
-                                               Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
-
-                               gbcCreated:
-                                       if ThreadItem.CreateDate = ZERO_DATE then begin
-                                               Item.SubItems[ idx ] := '';
-                                       end else
-                                               Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
 
-                               gbcLastModified:
-                                       if (ThreadItem.LastModified = ZERO_DATE)  then begin
-                                               Item.SubItems[ idx ] := '';
-                                       end else
-                                               Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.LastModified);
-
-
-                               end;
-                               Inc( idx );
-                       end;
-
-                       if ThreadItem.NewArrival then
-                               Item.ImageIndex := ITEM_ICON_THREADNEW1
-                       else
-                               Item.ImageIndex := ITEM_ICON_THREADLOG1;
-               end else begin
-                       idx := 0;
-                       for i := 0 to GikoSys.Setting.BoardColumnOrder.Count - 1 do begin
-//                             case TGikoBoardColumnID( ListView.Column[ i ].Tag ) of
-                               case GikoSys.Setting.BoardColumnOrder[ i ] of
-                               gbcTitle:
-                                       // Item.Caption \82Í SubItems \82É\8aÜ\82Ü\82ê\96³\82¢\82Ì\82Å
-                                       Dec( idx );
-
-                               gbcAllCount:
-                                       Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount);
-
-                               gbcRoundDate://gbcLastModified:
-                                       Item.SubItems[ idx ] := '';
-
-                               gbcCreated:
-                                       if ThreadItem.CreateDate = ZERO_DATE then begin
-                                               Item.SubItems[ idx ] := '';
-                                       end else
-                                               Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
-
-                               gbcLastModified:
-                                       Item.SubItems[ idx ] := '';
-
-                               else
-                                       Item.SubItems[ idx ] := '';
-                               end;
-                               Inc( idx );
-                       end;
-
-                       if ThreadItem.NewArrival then
-                               Item.ImageIndex := ITEM_ICON_THREADNEW1
-                       else
-                               Item.ImageIndex := ITEM_ICON_THREAD1;
-               end;
-
-               Item.Data := ThreadItem;
-
-       end;
-end;
-
-procedure TGikoForm.ListViewDataFind(Sender: TObject; Find: TItemFind;
-       const FindString: String; const FindPosition: TPoint; FindData: Pointer;
-       StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
-       var Index: Integer);
-begin
-
-//
-end;
-
-procedure TGikoForm.ListViewDataHint(Sender: TObject; StartIndex,
-       EndIndex: Integer);
-begin
-//
-end;
-
-procedure TGikoForm.ListViewDataStateChange(Sender: TObject; StartIndex,
-       EndIndex: Integer; OldState, NewState: TItemStates);
-begin
-//
-end;
-
-procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
-var
-       p: TPoint;
-       s: string;
-       tmp2: string;
-       URL: string;
-       ATitle: Boolean;
-
-       threadItem      : TThreadItem;
-       board                           : TBoard;
-       Protocol, Host, Path, Document, Port, Bookmark: string;
-
-       wkInt: Integer;
-       wkIntSt: Integer;
-       wkIntTo: Integer;
-       ActiveFileName: string;
-       e: IHTMLElement;
-       Ext: string;
-       buf, buf2: string;
-       PathRec: TPathRec;
-begin
-       if not( TObject(Sender) is TWebBrowser )then
-               Exit;
-       try
-               try
-                       if (TWebBrowser(Sender) <> nil) and (not TWebBrowser(Sender).Busy) and (Assigned(TWebBrowser(Sender).Document)) then begin
-                               if LowerCase(OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset) <> 'shift_jis' then begin
-                                       OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset := 'shift_jis';
-                               end;
-                       end;
-               except
-               end;
-       finally
-       end;
-       if PreviewTimer.Enabled then
-               PreviewTimer.Enabled := False;
-       Application.CancelHint;
-       try
-               if GetActiveContent <> nil then
-                       ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
-               else
-                       ActiveFileName := '';
-       except
-               FActiveContent := nil;
-               Exit;
-       end;
-
-       StatusBar.Panels[1].Text := Text;
-
-       if FHint <> nil then begin
-               FHint.ReleaseHandle;
-               FHint.ClearAllRes;
-       end;
        if FPreviewBrowser <> nil then
                ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
 
-       if not GikoSys.Setting.UnActivePopup then
-               if not GikoForm.Active then
-                       Exit;
+    if FResPopupBrowser <> nil then begin
+        if not(Sender is TResPopupBrowser) then begin
+            if (FResPopupBrowser.Visible) then begin
+                FResPopupBrowser.Clear;
+            end;
+        end else begin
+            TResPopupBrowser(Sender).ChildClear;
+        end;
+    end;
+    cResPopup := nil;
+    
+    if not(Sender is TResPopupBrowser) then
+       if not GikoSys.Setting.UnActivePopup then
+               if not GikoForm.Active then
+                       Exit;
+
+
 
 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
 
        s := '';
-       Ext := AnsiLowerCase(ExtractFileExt(Text));
-       if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
+       Ext := AnsiLowerCase(ExtractFileExt(Text2));
+       if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
                        ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
                if FPreviewBrowser = nil then begin
                        FPreviewBrowser := TPreviewBrowser.Create(Self);
@@ -2849,64 +1977,35 @@ begin
                        TOleControl(FPreviewBrowser).Parent := nil;
                end;
                FPreviewBrowser.Navigate(BLANK_HTML);//\91O\89ñ\82Ì\83v\83\8c\83r\83\85\81[\89æ\91\9c\8fÁ\8b\8e\97p
-               FPreviewURL := Text;
+               FPreviewURL := Text2;
                PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
                PreviewTimer.Enabled := True;
-       end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
-               if Pos('mailto:', Text) = 1 then begin
-                       s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
+       end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin
+               if Pos('mailto:', Text2) = 1 then begin
+                       s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]);
                        //\83M\83R\83i\83r\83X\83\8c \83p\81[\83g3\82Ì466\8e\81\82É\8a´\8eÓ
                        GetCursorPos(p);
                        p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
                        p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
                        e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
                        if (Assigned(e)) then begin
+                CreateResPopupBrowser;
+                cResPopup := FResPopupBrowser.CreateNewBrowser;
                                tmp2 := ZenToHan(e.Get_outerText);
                                if (GikoSys.IsNumeric(tmp2)) then begin
                                        //\82\93\82Í\83\8c\83X\94Ô\8d\86\82Á\82Û\82¢\82Á\82·\81B
-                                       wkIntSt := StrToInt(tmp2);
-                                       wkIntTo := StrToInt(tmp2);
-                                               //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
-                                       FHint.PopupType := gptThread;
-                                       SetResPopupText(GetActiveContent, wkIntSt, wkIntTo, False, False);
+                                       wkIntSt := StrToInt64(tmp2);
+                                       wkIntTo := StrToInt64(tmp2);
+                    cResPopup.PopupType := gptThread;
+                                       HTMLCreater.SetResPopupText(cResPopup, GetActiveContent(true), wkIntSt, wkIntTo, False, False);
                                end else begin
-                                       FHint.PopupType := gptRaw;
-                                       FHint.Caption := s;
+                    cResPopup.PopupType := gptRaw;
+                    cResPopup.Title := s;
                                end;
                        end;
                end else begin
-                       threadItem := GetActiveContent;
-                       if Pos('about:blank..', Text) = 1 then begin
-                               wkInt := LastDelimiter( '/', threadItem.URL );
-                               if Pos( '?', Copy( threadItem.URL, wkInt, MaxInt ) ) = 0 then begin
-                                       // Thread.URL \82Í PATH_INFO \93n\82µ
-                                       URL := Copy( threadItem.URL, 1,  LastDelimiter( '/', threadItem.URL ) );
-                                       wkInt := LastDelimiter( '/', Text );
-                                       if Pos( '?', Copy( Text, wkInt, MaxInt ) ) = 0 then
-                                               // Text \82à PATH_INFO \93n\82µ
-                                               URL := URL + Copy( Text, LastDelimiter( '/', Text ) + 1, MaxInt )
-                                       else
-                                               // Text \82Í QUERY_STRING \93n\82µ
-                                               URL := URL + Copy( Text, LastDelimiter( '?', Text ) + 1, MaxInt );
-                               end else begin
-                                       // Thread.URL \82Í QUERY_STRING \93n\82µ
-                                       URL := Copy( threadItem.URL, 1,  LastDelimiter( '?', threadItem.URL ) );
-                                       wkInt := LastDelimiter( '/', Text );
-                                       if Pos( '?', Copy( Text, wkInt, MaxInt ) ) = 0 then begin
-                                               // Text \82Í PATH_INFO \93n\82µ
-                                               // URL \82É\94Â\82Æ\83L\81[\82ª\91«\82ç\82È\82¢\82Ì\82Å Text \82©\82ç\92¸\91Õ\82·\82é
-                                               wkInt := LastDelimiter( '/', Copy( Text, 1, wkInt - 1 ) );
-                                               wkInt := LastDelimiter( '/', Copy( Text, 1, wkInt - 1 ) );
-                                               URL := Copy( URL, 1, Length( URL ) - 1 ) + Copy( Text, wkInt, MaxInt );
-                                       end else begin
-                                               // Text \82à QUERY_STRING \93n\82µ
-                                               URL := URL + Copy( Text, LastDelimiter( '?', Text ) + 1, MaxInt )
-                                       end;
-                               end;
-                       end else begin
-                               URL := Text;
-                       end;
-
+                       threadItem := GetActiveContent(true);
+                       URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL);
                        PathRec := Gikosys.Parse2chURL2(URL);
                        if (PathRec.FNoParam) then begin
                                PathRec.FSt := 1;
@@ -2934,18 +2033,6 @@ begin
                                        wkIntTo := wkIntSt;
                                        wkIntSt := wkInt;
                                end;
-                               //if wkIntSt = 0 then
-                               //      wkIntSt := 1;
-                               //if wkINtTo = 0 then
-                               //      wkIntTo := 1;
-                               //if PathRec.FFirst then
-                               //      wkIntSt := 1;
-                               //if PathRec.FStBegin then //http://\81`\81`\81`\81`/-50\82Æ\82¢\82¤\82Æ\82«
-                               //      wkIntSt := 1;          //
-                               //if PathRec.FToEnd then   //http://\81`\81`\81`\81`/50-\82Æ\82¢\82¤\82Æ\82«
-                               //      wkIntTo := 9999;       // \82Ç\82¿\82ç\82Ì\8fê\8d\87\82à\81AGetPopupResNumber\82Å\82¤\82Ü\82­\94Ô\8d\86\82ð\92²\90®\82·\82é\82Ì\82Å\82Ó\82æ\82¤\81B
-
-                               //ATitle := ActiveFileName <> PathRec.FKey;
                                if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
                                        ATitle := false
                                else
@@ -2964,43 +2051,48 @@ begin
 
                                if threadItem <> nil then begin
                                        //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
-                                       FHint.PopupType := gptThread;
-                                       SetResPopupText( threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
+                                       //URL\82Ì\8dÅ\8cã\82É/\82ª\95t\82¢\82Ä\82¢\82È\82¢\82Æ\82«\97p
+                                       if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin
+                                               wkIntSt := 1;
+                                               wkIntTo := 1;
+                                       end;
+                    CreateResPopupBrowser;
+                    cResPopup := FResPopupBrowser.CreateNewBrowser;
+                    cResPopup.PopupType := gptThread;
+                                       HTMLCreater.SetResPopupText(cResPopup, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
                                end;
                        end;
                end;
-
-               //if s <> '' then
-               //      ShowTextPopup(s);
-               if FHint.PopupType = gptRaw then begin
-                       if FHint.Caption <> '' then
-                               ShowTextPopup;
-               end else begin
-                       if (FHint.ResCount <> 0) or (FHint.Title <> '') then
-                               ShowTextPopup;
-               end;
+        if (cResPopup <> nil) then begin
+            if cResPopup.PopupType = gptRaw then begin
+                if cResPopup.Title <> '' then begin
+                    cResPopup.TitlePopup;
+                end;
+            end else begin
+                if cResPopup.RawDocument <> '' then begin
+                    cResPopup.Popup;
+                end else if cResPopup.Title <> '' then begin
+                    cResPopup.TitlePopup;
+                end;
+            end;
+        end;
        end;
 end;
 
 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
 var
        SysMenu: HMenu;
-       //SysMenuApp: HMenu;
 begin
        FEnabledCloseButton := Enabled;
        SysMenu := GetSystemMenu(Handle, False);
-       //SysMenuApp := GetSystemMenu(Application.Handle, False);
 
        if Enabled then begin
                EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
-               //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
        end else begin
                EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
-               //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
        end;
 
        DrawMenuBar(Handle);
-       //DrawMenuBar(Application.Handle);
 end;
 
 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
@@ -3060,137 +2152,40 @@ begin
        Result := FHttpState;
 end;
 
-{*!
-\brief         ListView \82Ì Column \82ð\90^\82Ì\83J\83\89\83\80\82É\95Ï\8a·
-
-Delphi 6 Personal \82Å\82Ì ListView \82Å\82Í ListViewColumnClick \83C\83x\83\93\83g\82Å
-\90³\82µ\82¢\83J\83\89\83\80\82ª\93n\82³\82ê\82È\82¢\82½\82ß\81A\90³\82µ\82¢\83J\83\89\83\80\82É\95Ï\8a·\82µ\82Ü\82·\81B
-*}
-function       TGikoForm.ActiveListTrueColumn( column : TListColumn ) : TListColumn;
-{*
+procedure TGikoForm.ListViewColumnClick(Sender: TObject;
+       Column: TListColumn);
 var
-       i, idx          : Integer;
-       orderList       : TList;
-*}
+       id, idx                 : Integer;
+       orderList               : TList;
+       vSortIndex              : Integer;
+       vSortOrder              : Boolean;
 begin
+       idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
+       if TObject( FActiveList ) is TBBS then begin
+               orderList := GikoSys.Setting.BBSColumnOrder;
+               vSortIndex := GikoSys.Setting.BBSSortIndex;
+               vSortOrder := GikoSys.Setting.BBSSortOrder;
+       end else if TObject( FActiveList ) is TCategory then begin
+               orderList := GikoSys.Setting.CategoryColumnOrder;
+               vSortIndex := GikoSys.Setting.CategorySortIndex;
+               vSortOrder := GikoSys.Setting.CategorySortOrder;
+       end else if TObject( FActiveList ) is TBoard then begin
+               orderList := GikoSys.Setting.BoardColumnOrder;
+               vSortIndex := GikoSys.Setting.BoardSortIndex;
+               vSortOrder := GikoSys.Setting.BoardSortOrder;
+       end else
+               Exit;
 
-       // \90³\82µ\82­\95Ï\8a·\82·\82é\95û\96@\82ª\95ª\82©\82ç\82È\82¢\82Ì\82Å\95Û\97¯
-       Result := column;
-       Exit;
-{*
-       Result := column;
+       id := Integer( orderList[ idx ] );
 
-       if TObject( FActiveList ) is TBBS then
-               orderList := GikoSys.Setting.BBSColumnOrder
-       else if TObject( FActiveList ) is TCategory then
-               orderList := GikoSys.Setting.CategoryColumnOrder
-       else if TObject( FActiveList ) is TBoard then
-               orderList := GikoSys.Setting.BoardColumnOrder
-       else
-               Exit;
-
-       idx := column.Tag;
-
-       for i := 0 to ListView.Columns.Count - 1 do begin
-               if Integer( orderList[ ListView.Column[ i ].Tag ] ) = 0 then begin
-                       if idx = 0 then
-                               Result := ListView.Column[ i ]
-                       else if idx <= i then
-                               Result := ListView.Column[ idx - 1 ];
-                       Exit;
-               end;
-       end;
-*}
-
-end;
-
-procedure TGikoForm.ListViewColumnClick(Sender: TObject;
-       Column: TListColumn);
-var
-       id, idx                 : Integer;
-       orderList               : TList;
-begin
-       idx := ActiveListTrueColumn( Column ).Tag;
-
-       if TObject( FActiveList ) is TBBS then
-               orderList := GikoSys.Setting.BBSColumnOrder
-       else if TObject( FActiveList ) is TCategory then
-               orderList := GikoSys.Setting.CategoryColumnOrder
-       else if TObject( FActiveList ) is TBoard then
-               orderList := GikoSys.Setting.BoardColumnOrder
-       else
-               Exit;
-
-       id := Integer( orderList[ idx ] );
-
-       if FSortIndex = id then
-               FSortOrder := not FSortOrder
-       else
-               FSortOrder := False;
-
-       ListViewSort(Sender, Column);
-end;
-
-procedure TGikoForm.ListViewSort(Sender: TObject; Column: TListColumn);
-var
-       i, id, idx      : Integer;
-       orderList               : TList;
-       wkBBS: TBBS;
-       wkCategory: TCategory;
-       wkBoard: TBoard;
-begin
-       idx := ActiveListTrueColumn( Column ).Tag;
-
-       for i := 0 to ListView.Columns.Count - 1 do begin
-               ListView.Column[i].ImageIndex := -1;
-       end;
-
-       if FSortOrder then
-               ListView.Column[ idx ].ImageIndex := ITEM_ICON_SORT1
-       else
-               ListView.Column[ idx ].ImageIndex := ITEM_ICON_SORT2;
-
-       Sort.SortNoFlag := ListNumberVisibleAction.Checked;
 
-       //if TObject(TreeView.Selected.Data) is TBBS then begin
-       if TObject( FActiveList ) is TBBS then begin
-               //wkBBS := TBBS(TreeView.Selected.Data);
-               wkBBS := TBBS( FActiveList );
-               orderList := GikoSys.Setting.BBSColumnOrder;
-               id := Integer( orderList[ idx ] );
-               Sort.SortOrder := FSortOrder;
-               Sort.SortIndex := id;
-               GikoSys.Setting.BBSSortIndex := id;
-               GikoSys.Setting.BBSSortOrder := FSortOrder;
-               wkBBS.Sort(CategorySortProc);
-       //end else if TObject(TreeView.Selected.Data) is TCategory then begin
-       end else if TObject( FActiveList ) is TCategory then begin
-               //wkCategory := TCategory(TreeView.Selected.Data);
-               wkCategory := TCategory( FActiveList );
-               orderList := GikoSys.Setting.CategoryColumnOrder;
-               id := Integer( orderList[ idx ] );
-               Sort.SortOrder := FSortOrder;
-               Sort.SortIndex := id;
-               GikoSys.Setting.CategorySortIndex := id;
-               GikoSys.Setting.CategorySortOrder := FSortOrder;
-               wkCategory.CustomSort(BoardSortProc);
-       //end else if TObject(TreeView.Selected.Data) is TBoard then begin
-       end else if TObject( FActiveList ) is TBoard then begin
-               //wkBoard := TBoard(TreeView.Selected.Data);
-               wkBoard := TBoard( FActiveList );
-               orderList := GikoSys.Setting.BoardColumnOrder;
-               id := Integer( orderList[ idx ] );
-               Sort.SortOrder := FSortOrder;
-               Sort.SortIndex := id;
-               GikoSys.Setting.BoardSortIndex := id;
-               GikoSys.Setting.BoardSortOrder := FSortOrder;
-               wkBoard.CustomSort(ThreadItemSortProc);
-       end else begin
-               id := 0;
+       if vSortIndex = id then
+               vSortOrder := not vSortOrder
+       else begin
+               vSortOrder := id = 0;
        end;
 
-       ListView.Refresh;
-       FSortIndex := id;
+       TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, vSortOrder);
 end;
 
 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
@@ -3238,7 +2233,9 @@ var
 const
        kMenuName: string = 'menu:';
 begin
-
+{$IFDEF DEBUG}
+       Writeln(URL);
+{$ENDIF}
        if Pos(kMenuName, URL) <> 0 then begin
                sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
                
@@ -3246,6 +2243,9 @@ begin
 
                Cancel := True;
                GetCursorpos(p);
+        KokoPopupMenu.PopupComponent := nil;
+        if (Sender is TComponent) then
+            KokoPopupMenu.PopupComponent := TComponent(Sender);
                KokoPopupMenu.Tag := StrToInt(sNo);
                KokoPopupMenu.Popup(p.x, p.y);
        end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
@@ -3254,45 +2254,6 @@ begin
 
 end;
 
-procedure TGikoForm.ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
-       Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
-       var DefaultDraw: Boolean);
-var
-       ThreadItem: TThreadItem;
-begin
-//     TListView(Sender).Canvas.Font.Style := [];
-       if TObject(Item.Data) is TThreadItem then begin
-               ThreadItem := TThreadItem(Item.Data);
-               if ( FUseOddResOddColor ) and ( ThreadItem.Count <> 0 ) and ( ThreadItem.AllResCount <> ThreadItem.Count) then begin
-                       ListView.Canvas.Brush.Color := FOddColor;
-               end else begin
-                       ListView.Canvas.Brush.Color := FListViewBackGroundColor;
-               end;
-//             if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then
-               if ThreadItem.UnRead then
-                       TListView(Sender).Canvas.Font.Style := [fsBold];
-       end;
-end;
-
-procedure TGikoForm.AppFormDeactivate(Sender: TObject);
-begin
-    Application.ProcessMessages;
-       if Application.Terminated then
-               Exit;
-       if PreviewTimer.Enabled then
-               PreviewTimer.Enabled := False;
-       //\83t\83H\81[\83J\83X\82ª\91¼\82Ì\83A\83v\83\8a\82É\95Ï\82í\82Á\82½\82Æ\82«\82É\83q\83\93\83g\82ð\8fÁ\8b\8e
-       if FHint <> nil then begin
-               FHint.ReleaseHandle;
-               FHint.ClearAllRes;
-//             FHint.Free;
-//             FHint := nil;
-       end;
-       if FPreviewBrowser <> nil then
-               ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
-
-end;
-
 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
        const ARect: TRect; var DefaultDraw: Boolean);
 var
@@ -3339,6 +2300,7 @@ begin
                end else if TObject(TreeView.Items[i].Data) is TBoard then begin
                        IsBoardNode := True;
                        Board := TBoard(TreeView.Items[i].Data);
+
                        Cnt := Board.UnRead;
                        if Cnt <= 0 then
                                continue;
@@ -3422,44 +2384,25 @@ begin
        end;
 end;
 
-{procedure TGikoForm.CabinetPanelVisible(PanelVisible: Boolean);
-begin
-       TreeSplitter.Visible := PanelVisible;
-       CabinetPanel.Visible := PanelVisible;
-       CabinetToolButton.Down := PanelVisible;
-end;}
-
 procedure TGikoForm.ListViewAllSelect;
 begin
        ListView.SetFocus;
        ListView.SelectAll;
 end;
-
-procedure TGikoForm.TreeViewDblClick(Sender: TObject);
-var
-       APoint: TPoint;
-       HitTest: THitTests;
-begin
-       GetCursorPos(APoint);
-       APoint := TreeView.ScreenToClient(APoint);
-       HitTest := TreeView.GetHitTestInfoAt(APoint.x, APoint.y);
-       if not (htOnLabel in HitTest) then Exit;
-
-       TreeDoubleClick( TreeView.Selected );
-end;
-
 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
 begin
        AddMessageList(Msg, nil, Icon);
 end;
-
+// *************************************************************************
+//! \83_\83E\83\93\83\8d\81[\83h\82ª\8a®\97¹\82µ\82½\82Æ\82«\82É\94­\90\82·\82é\83C\83x\83\93\83g
+// *************************************************************************
 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
 var
        ATitle: string;
        s: string;
        boardPlugIn : TBoardPlugIn;
        i: Integer;
-       browserRec      : TBrowserRecord;
+       Res : TResRec;
 begin
        try
                if Item.DownType = gdtBoard then
@@ -3467,31 +2410,42 @@ begin
                else
                        ATitle := Item.ThreadItem.Title;
                if ATitle = '' then
-                       ATitle := '\81i\96¼\8fÌ\95s\96¾\81j';
+                       ATitle := GikoSys.GetGikoMessage(gmUnKnown);
 
                if Item.State in [gdsComplete, gdsDiffComplete] then begin
                        //\90³\8fí\8fI\97¹
                        if Item.DownType = gdtBoard then begin
                                //\94Â
                                Item.SaveListFile;
-                               AddMessageList(ATitle + ' [\83X\83\8c\88ê\97\97\8eæ\93¾\8a®\97¹]', nil, gmiOK);
+                               AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureItiran), nil, gmiOK);
                                if GetActiveList = Item.Board then begin
                                        FActiveList := nil;
+                                       //\8e©\93®\83\\81[\83g\82Ì\8fê\8d\87\94Â\88ê\97\97\82Ì\83\\81[\83g\8f\87\82ð\83N\83\8a\83A\82·\82é
+                                       if (GikoSys.Setting.AutoSortThreadList) then begin
+                                               GikoSys.Setting.BoardSortIndex := 0;
+                                               GikoSys.Setting.BoardSortOrder := True;
+                                       end;
+                                       Sort.SetSortDate(Now());
                                        SetActiveList(Item.Board);
                                end;
                                Item.Board.Modified := True;
                                Item.Board.IsThreadDatRead := True;
                                PlaySound('New');
+                               ListView.Refresh;
                        end else if Item.DownType = gdtThread then begin
                                //\83X\83\8c
                                Item.SaveItemFile;
                                Item.ThreadItem.NewArrival := True;
-                               if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
-                                       boardPlugIn             := Item.ThreadItem.BoardPlugIn;
-                                       Item.ThreadItem.Title := GikoSys.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 )).FTitle;
+                               //if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
+                               if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
+                                       //boardPlugIn           := Item.ThreadItem.BoardPlugIn;
+                                       boardPlugIn             := Item.ThreadItem.ParentBoard.BoardPlugIn;
+                                       THTMLCreate.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 ), @Res);
+                                       Item.ThreadItem.Title := Res.FTitle;
                                        ATitle := Item.ThreadItem.Title;
                                end else if ATitle = '\81i\96¼\8fÌ\95s\96¾\81j' then begin
-                                       ATitle := GikoSys.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1)).FTitle;
+                                       THTMLCreate.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1), @Res);
+                                       ATitle := Res.FTitle;
                                end;
                                for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
                                        if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin
@@ -3501,56 +2455,74 @@ begin
                                end;
                                if GikoSys.Setting.BrowserTabVisible then begin
                                        if GetActiveContent = Item.ThreadItem then
-                                               browserRec := InsertBrowserTab(Item.ThreadItem)
+                                               InsertBrowserTab(Item.ThreadItem)
                                        else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then
-                                               browserRec := InsertBrowserTab(Item.ThreadItem, True)
+                                               InsertBrowserTab(Item.ThreadItem, True)
                                        else
-                                               browserRec := InsertBrowserTab(Item.ThreadItem, False);
-                                       if browserRec.Thread = BrowserNullTab.Thread then begin
-                                               browserRec.Movement := BrowserNullTab.Movement;
-                                               BrowserNullTab.Movement := '';
-                                       end;
+                                               InsertBrowserTab(Item.ThreadItem, False);
+
                                end else begin
                                        if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then
-                       InsertBrowserTab(Item.ThreadItem);
+                                                                                               InsertBrowserTab(Item.ThreadItem);
                                end;
-                Application.ProcessMessages;
+
+                                                               Application.ProcessMessages;
+
                                if Item.State = gdsComplete then begin
                                        PlaySound('New');
-                                       AddMessageList(ATitle + ' [\83X\83\8c\8eæ\93¾\8a®\97¹]', nil, gmiOK);
+                                                                               AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureSyutoku), nil, gmiOK);
+                                                                               //Add by Genyakun
+                                                                               DiffComp := True;
                                end else begin
                                        PlaySound('NewDiff');
-                                       AddMessageList(ATitle + ' [\83X\83\8c\8d·\95ª\8eæ\93¾\8a®\97¹]', nil, gmiOK);
+                                                                               AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureDiff), nil, gmiOK);
+                                                                               //Add by Genyakun
+                                                                               DiffComp := True;
                                end;
 
                                //\8f\84\89ñ\82 \82è\82Ì\8fê\8d\87\81\95\82P\82O\82O\82O\92´\82Í\8f\84\89ñ\8dí\8f\9c
                                if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
                                        Item.ThreadItem.Round := False;
-                                       Item.ThreadItem.RoundName := '';
+                                       //Item.ThreadItem.RoundName := '';
                                        AddMessageList('\81\9a1000\94­\8c¾\82ð\92´\82¦\82½\82Ì\82Å\8f\84\89ñ\82ð\8dí\8f\9c\82µ\82Ü\82µ\82½ - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
                                end;
-
                                TreeView.Refresh;
+                               //ListView\82Å\82±\82Ì\83X\83\8c\82ª\8aÜ\82Ü\82ê\82é\94Â\82ð\95\\8e¦\82µ\82Ä\82¢\82é\82Æ\82«\82Ì\8dX\90V\8f\88\97\9d
+                               if (ActiveList <> nil) and (ActiveList is TBoard) then begin
+                                       TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount;
+                                       TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount;
+                                       TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount;
+                    //ListView\82Ì\83A\83C\83e\83\80\82Ì\8cÂ\90\94\82à\8dX\90V
+                                       case GikoForm.ViewType of
+                                               gvtAll: ListView.Items.Count := TBoard(ActiveList).Count;
+                                               gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount;
+                                               gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount;
+                                               gvtArch: ListView.Items.Count := TBoard(ActiveList).ArchiveThreadCount;
+                                               gvtLive: ListView.Items.Count := TBoard(ActiveList).LiveThreadCount;
+                                               gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount;
+                                       end;
+                               end;
+                               RefreshListView(Item.ThreadItem);
                        end;
-                       ListView.Refresh;
+
                end else if Item.State = gdsNotModify then begin
                        //\95Ï\8dX\83i\83V
 {                      if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
                                //SetContent(Item.ThreadItem);
                                InsertBrowserTab(Item.ThreadItem);
                        end;}
-                       AddMessageList(ATitle + ' [\96¢\8dX\90V]', nil, gmiSAD);
+                                               AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmNotMod), nil, gmiSAD);
                        PlaySound('NoChange');
                        Screen.Cursor := crDefault;
                end else if Item.State = gdsAbort then begin
                        //\92\86\92f
-                       AddMessageList(ATitle + ' [\92\86\92f]', nil, gmiSAD);
+                                               AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
                end else if Item.State = gdsError then begin
                        //\83G\83\89\81[
                        s := Item.ErrText;
                        if s <> '' then
                                s := ':' + s;
-                       AddMessageList(ATitle + ' [\83G\83\89\81[(' + IntToStr(Item.ResponseCode) + s + ')]', nil, gmiNG);
+                        AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmError) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG);
 //                     if Item.ResponseCode = 302 then
 //                             AddMessageList('\94Â\82ª\88Ú\93]\82µ\82½\82©\82à\82µ\82ê\82È\82¢\82Ì\82Å\94Â\8dX\90V\82ð\8ds\82Á\82Ä\82­\82¾\82³\82¢\81B', nil, gmiNG);
                        PlaySound('Error');
@@ -3595,21 +2567,6 @@ begin
        StatusBar.Panels[1].Text := FDownloadTitle + ' - \83_\83E\83\93\83\8d\81[\83h\92\86 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
 end;
 
-{
-procedure TGikoForm.SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
-var
-       Component: TComponent;
-begin
-       Component := FindComponent('ProgressBar' + IntToStr(Number + 1));
-       if Component <> nil then begin
-               if not (Component is TProgressBar) then Exit;
-               if Max <> -1 then
-                       TProgressBar(Component).Max := Max;
-               TProgressBar(Component).Position := Value;
-       end;
-end;
-}
-
 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
 var
        ListItem: TListItem;
@@ -3631,16 +2588,19 @@ begin
        end;
 end;
 
-{procedure TGikoForm.BrowserTabChange(Sender: TObject);
+//! \82à\82Á\82Æ\82à\8cÃ\82¢Browser\82Ì\8aJ\95ú
+procedure TGikoForm.ReleaseOldestBrowser;
 var
-       index: Integer;
-       ThreadItem: TThreadItem;
+    i: Integer;
 begin
-       ThreadItem := GetActiveContent;
-       if ThreadItem <> nil then begin
-               SetContent(ThreadItem);
-       end;
-end;}
+    for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
+        if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
+                TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
+            ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
+            break;
+        end;
+    end;
+end;
 
 function TGikoForm.InsertBrowserTab(
        ThreadItem      : TThreadItem;
@@ -3650,6 +2610,7 @@ var
        i, j, idx               : Integer;
        favItem                 : TFavoriteThreadItem;
        newBrowser      : TBrowserRecord;
+    ins : Integer;
 begin
 
        Result := nil;
@@ -3658,32 +2619,24 @@ begin
        if ThreadItem.IsLogFile then begin
                //\82¨\8bC\82É\93ü\82è\82Ì\91S\82Ä\8aJ\82­\82Æ\82©\82â\82é\82Æ\81A\8d¡\8aJ\82¢\82Ä\82é\83X\83\8c\82Ìbrowser\82ð\95t\82¯\91Ö\82¦\82é\8b°\82ê\82ª\82 \82é
                //\8fí\82É\82S\94Ô\96Ú\82ÉActive\82Ì\83u\83\89\83E\83U\82ª\97\88\82È\82¢\82æ\82¤\82É\88Ú\93®\82³\82¹\82é
-               if (FActiveContent <> nil) and (FActiveContent.FBrowser <> nil) and
-                       (FActiveContent.FBrowser <> BrowserNullTab.Browser)then begin
-                       j := FBrowsers.IndexOf(FActiveContent.FBrowser);
+               if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
+                       (FActiveContent.Browser <> BrowserNullTab.Browser)then begin
+                       j := FBrowsers.IndexOf(FActiveContent.Browser);
                        if j = BROWSER_COUNT - 1 then
                                FBrowsers.Move(BROWSER_COUNT - 1, 0);
                end;
                favItem := TFavoriteThreadItem.Create(ThreadItem.URL, ThreadItem.Title );
-               if not AddHistory( favItem ) then
+               if not FHistoryList.AddHistory( favItem, TreeView, FTreeType ) then
                        favItem.Free;
 
                for i := 0 to BrowserTab.Tabs.Count - 1 do begin
                        if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin
                                if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
-                                       Result := TBrowserRecord( BrowserTab.Tabs.Objects[j] );
-                                       if TBrowserRecord(BrowserTab.Tabs.Objects[i]).FBrowser = nil then begin
-                                               for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                                                       if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
-                                                               TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser := nil;
-                                                               if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent <> nil then begin
-                                                                       TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent.Free;
-                                                                       TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent := nil;
-                                                               end;
-                                                               break;
-                                                       end;
-                                               end;
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[i]).FBrowser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
+                                       Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] );
+                                       if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin
+                        //\88ê\94Ô\8cÃ\82¢\83u\83\89\83E\83U\82ð\8aJ\95ú\82·\82é
+                        ReleaseOldestBrowser;
+                                               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
                                                TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
                                                FBrowsers.Move(BROWSER_COUNT - 1, 0);
                                        end;
@@ -3697,25 +2650,15 @@ begin
                        end;
                end;
                idx := BrowserTab.TabIndex;
-               if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
-                       newBrowser := TBrowserRecord.Create;
-                       for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                               if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
-                                       TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser := nil;
-                                       if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent <> nil then begin
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent.Free;
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent := nil;
-                                       end;
-                                       break;
-                               end;
-                       end;
-                       newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
-                       FBrowsers.Move(BROWSER_COUNT - 1, 0);
-                       //newBrowser.Browser.Navigate(BLANK_HTML);
-                       newBrowser.thread := ThreadItem;
-                       newBrowser.Repaint := true;
-//                     newBrowser.OnlyHundred := GikoSys.OnlyAHundredRes;
+        newBrowser := TBrowserRecord.Create;
+        // \88ê\94Ô\8cÃ\82¢\83u\83\89\83E\83U\82ð\8aJ\95ú\82·\82é
+        ReleaseOldestBrowser;
+        newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
+        FBrowsers.Move(BROWSER_COUNT - 1, 0);
+        newBrowser.thread := ThreadItem;
+        newBrowser.Repaint := true;
 
+               if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
                        BrowserTab.Tabs.InsertObject(0, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
                        if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
                                DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
@@ -3725,26 +2668,7 @@ begin
                        if ActiveTab then begin
                                BrowserTab.TabIndex := 0;
                        end;
-
-               end else begin
-                       newBrowser := TBrowserRecord.Create;
-                       for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                               if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
-                                       TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser := nil;
-                                       if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent <> nil then begin
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent.Free;
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent := nil;
-                                       end;
-                                       break;
-                               end;
-                       end;
-                       newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
-                       FBrowsers.Move(BROWSER_COUNT - 1, 0);
-                       //newBrowser.Browser.Navigate(BLANK_HTML);
-                       newBrowser.thread := ThreadItem;
-//                     newBrowser.OnlyHundred := GikoSys.OnlyAHundredRes;
-                       newBrowser.Repaint := true;
-
+               end else if GikoSys.Setting.BrowserTabAppend = gtaLast then begin
                        i := BrowserTab.Tabs.AddObject(GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
                        if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
                                DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
@@ -3757,7 +2681,40 @@ begin
                                else
                                        BrowserTab.TabIndex := i;
                        end;
-               end;
+               end else begin
+            // \83^\83u\88Ê\92u\82ð\8eæ\93¾
+            ins := -1;
+            for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
+            if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
+                    TWebBrowser(FBrowsers[1]) then begin
+                    ins := i;
+                    break;
+                end;
+            end;
+            if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
+                Inc(ins);
+                   end;
+            // \83^\83u\82ª\96³\82¢\82Æ\82«\82È\82Ç\91Î\8dô
+            if (ins < 0) then begin
+                ins := 0;
+            end;
+                       BrowserTab.Tabs.InsertObject(ins, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
+                       if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
+                if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
+                               DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
+                end else begin
+                    DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
+                end;
+                       end;
+                       //end;
+                       BrowserTab.Repaint;
+                       if ActiveTab then begin
+                               if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
+                                       BrowserTab.TabIndex := 0
+                               else
+                                       BrowserTab.TabIndex := ins;
+                       end;
+        end;
                Result := newBrowser;
                if(ActiveTab) or (idx = -1) then begin
                        BrowserTab.OnChange(nil);
@@ -3767,6 +2724,9 @@ begin
                        BrowserNullTab := TBrowserRecord.Create;
                        BrowserNullTab.Browser := Browser;
                end;
+//             if BrowserNullTab.thread <> ThreadItem then begin
+//                     BrowserNullTab.Movement := '';
+//             end;
                BrowserNullTab.thread := ThreadItem;
                Result := BrowserNullTab;
                BrowserTab.TabIndex := -1;
@@ -3783,31 +2743,24 @@ var
        BBSID: string;
        FileName: string;
        sTitle: string;
-//     HtmlName: string;
-       doc:  Variant;
+       doc: Variant;
        s: string;
-//     OldCursor: TCursor;
-       i: Integer;
        idx: Integer;
        ThreadItem: TThreadItem;
        Thread: TBrowserRecord;
        ThreadTitle, ThreadPTitle: string;
-       ThreadScrollTop: Integer;
-       ThreadIsLog, ThreadUnRead, ThreadNewArraical: boolean;
+       ThreadIsLog, {ThreadUnRead,} ThreadNewArraical: boolean;
 begin
-//     AddMessageList('SetContent', nil, gmiWhat);
        Thread := inThread;
        idx := BrowserTab.TabIndex;
-       if (FActiveContent <> nil) and
+       if  (not FStartUp) and
+        (FActiveContent <> nil) and
                (FActiveContent.Thread <> Thread.Thread) and
+               (FActiveContent.Browser <> nil) and
                (Assigned(FActiveContent.Browser.Document)) then begin
                try
                try
-                       Sleep(1);
-                       //Application.ProcessMessages;
                        FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document).Body).ScrollTop;
-                       //if FActiveContent.Browser <> BrowserNullTab.Browser then
-                       //      TOleControl(FActiveContent.Browser).Visible := false;
                except
                        on E: Exception do
                                MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0);
@@ -3821,7 +2774,7 @@ begin
                ItemBoardImage.Picture := nil;
                BrowserNameLabel.Caption := '';
                ItemImage.Picture := nil;
-               BrowserNullTab.Thread := nil;
+        BrowserNullTab.Thread := nil;
                //TOleControl(BrowserNullTab.Browser).Visible := true;
                ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
                FActiveContent := nil;
@@ -3829,26 +2782,19 @@ begin
        end     else if Thread.Browser = nil then begin
                if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then
                        FBrowsers.Move(BROWSER_COUNT - 1, 0);
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                       if TBrowserRecord(BrowserTab.Tabs.Objects[i]).FBrowser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
-                               TBrowserRecord(BrowserTab.Tabs.Objects[i]).FBrowser := nil;
-                               if TBrowserRecord(BrowserTab.Tabs.Objects[i]).FEvent <> nil then begin
-                                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).FEvent.Free;
-                                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).FEvent := nil;
-                               end;
-                               break;
-                       end;
-               end;
+        // \88ê\94Ô\8cÃ\82¢\83u\83\89\83E\83U\82ð\8aJ\95ú\82·\82é
+        ReleaseOldestBrowser;
                Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
                FBrowsers.Move(BROWSER_COUNT - 1, 0);
        end;
+
        ThreadTitle := Thread.Thread.Title;
        ThreadPTitle := Thread.Thread.ParentBoard.Title;
-       ThreadScrollTop := Thread.Thread.ScrollTop;
+       //ThreadScrollTop := Thread.Thread.ScrollTop;
        ThreadIsLog := Thread.Thread.IsLogFile;
        ThreadItem := Thread.Thread;
        ThreadNewArraical :=  Thread.Thread.NewArrival;
-       ThreadUnRead := Thread.Thread.UnRead;
+       //ThreadUnRead := Thread.Thread.UnRead;
        BBSID := ThreadItem.ParentBoard.BBSID;
        FileName := ThreadItem.FileName;
 
@@ -3859,21 +2805,14 @@ begin
 
 
        try
-               if ThreadItem.UnRead then begin
-                       ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1;
-                       if ThreadItem.ParentBoard.UnRead < 0 then ThreadItem.ParentBoard.UnRead := 0;
-                       TreeView.Refresh;
-               end;
                if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin
                        if (FActiveContent.Browser <> BrowserNullTab.Browser) then
                                ShowWindow(FActiveContent.Browser.Handle, SW_HIDE);
                end;
-
-               ShowWindow(Thread.FBrowser.Handle, SW_SHOW);
+               ShowWindow(Thread.Browser.Handle, SW_SHOW);
                if (not Assigned(Thread.Browser.Document)) then begin
                        Thread.Browser.Navigate('about:blank');
                end;
-               FActiveContent := Thread;
                while (Thread.Browser.ReadyState <> READYSTATE_COMPLETE) and
                                (Thread.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
                        Application.ProcessMessages;
@@ -3881,9 +2820,33 @@ begin
                                Exit;
                        end;
                end;
+
+               if (Thread <> nil) and (ThreadItem <>nil) then begin
+                       BrowserBoardNameLabel.Caption := ThreadPTitle;
+                       ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap);
+                       BrowserNameLabel.Caption := ThreadTitle;
+                       ItemImage.Picture := nil;
+                       if ThreadIsLog then
+                               if ThreadNewArraical then
+                                       ItemImageList.GetBitmap(2, ItemImage.Picture.Bitmap)
+                               else
+                                       ItemImageList.GetBitmap(0, ItemImage.Picture.Bitmap)
+                       else
+                               ItemImageList.GetBitmap(1, ItemImage.Picture.Bitmap);
+
+                       ItemImage.Left := BrowserBoardNameLabel.Left + BrowserBoardNameLabel.Width + 8;
+                       BrowserNameLabel.Left := ItemImage.Left + 20;
+
+               end;
+               //ActiveContent\81@\82Ì\8dX\90V
+               FActiveContent := Thread;
+
                if not ThreadIsLog then begin
-                       Self.Caption := CAPTION_NAME ;
+                       Self.Caption := GikoDataModule.CAPTION_NAME ;
+                       //\83X\83e\81[\83^\83X\83o\81[\82É\95\\8e¦\82µ\82Ä\82¢\82é\83X\83\8c\82Ì\97e\97Ê\82ð\8fÁ\8b\8e
+                       StatusBar.Panels[THREADSIZE_PANEL].Text := '';
                        try
+                               Thread.Browser.BringToFront;
                                s := '<HTML><BODY><CENTER>\82±\82Ì\83X\83\8c\83b\83h\82Í\8eæ\93¾\82µ\82Ä\82¢\82Ü\82¹\82ñ</CENTER></BODY></HTML>';
                                doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2;
                                doc.open;
@@ -3891,67 +2854,49 @@ begin
                                doc.Write(s);
                                doc.Close;
                        finally
+                               
                        end;
                end else begin
-                       Self.Caption := CAPTION_NAME + ' - [' + ThreadTitle + ']';
+                       Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + ThreadTitle + ']';
+                       //\83X\83e\81[\83^\83X\83o\81[\82É\95\\8e¦\82µ\82Ä\82¢\82é\83X\83\8c\82Ì\97e\97Ê\82ð\95\\8e¦
+                       StatusBar.Panels[THREADSIZE_PANEL].Text := Format('%6.2f kB', [ThreadItem.Size / 1024]);
+                       StatusBar.Panels[THREADSIZE_PANEL].Width :=
+                               Max(StatusBar.Canvas.TextWidth(StatusBar.Panels[THREADSIZE_PANEL].Text), 70);
                        //Thread.Repaint\82Í\81A\83X\83L\83\93\93\99\82Ì\90Ý\92è\82ð\95Ï\8dX\82µ\82½\82Æ\82«\81AThread\82ð\83_\83E\83\93\83\8d\81[\83h\82µ\82½\82Æ\82«
                        //\90V\8bK\82ÉThread\82ð\8aJ\82¢\82½\82Æ\82«\82É\90^\82É\82È\82Á\82Ä\82¢\82é\81B
                        if Thread.Repaint then begin
-                               //Thread.LastSize := ThreadItem.Size;
                                Thread.Repaint := false;
 
                                Thread.Browser.OnStatusTextChange := nil;
-                               doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2;
-                               GikoSys.CreateHTML2(doc, ThreadItem, sTitle);
+                               LockWindowUpdate(Thread.Browser.ParentWindow);
+                               HTMLCreater.CreateHTML2(Thread.Browser, ThreadItem, sTitle);
                                Thread.Browser.OnStatusTextChange := BrowserStatusTextChange;
                                PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( Thread.Browser ), 0 );
-                               if ThreadItem = nil then begin
-                                       FActiveContent := nil;
-                                       BrowserTab.Repaint;
-                                       Exit;
-                               end;
                        end;
-                       ListView.Refresh;
                end;
-               if (Assigned(Thread)) and (Assigned(Thread.Thread)) and (Thread <> nil) and (ThreadItem <>nil) then begin
-                       //FActiveContent := Thread;
-
-                       BrowserBoardNameLabel.Caption := ThreadPTitle;
-                       ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap);
-                       BrowserNameLabel.Caption := ThreadTitle;
-                       ItemImage.Picture := nil;
-                       if ThreadIsLog then
-                               if ThreadNewArraical then
-                                       ItemImageList.GetBitmap(2, ItemImage.Picture.Bitmap)
-                               else
-                                       ItemImageList.GetBitmap(0, ItemImage.Picture.Bitmap)
-                       else
-                               ItemImageList.GetBitmap(1, ItemImage.Picture.Bitmap);
 
-                       ItemImage.Left := BrowserBoardNameLabel.Left + BrowserBoardNameLabel.Width + 8;
-                       BrowserNameLabel.Left := ItemImage.Left + 20;
-               end else begin
-                       FActiveContent := nil;
-               end;
+               RefreshListView(ThreadItem);
        finally
                Screen.Cursor := crDefault;
        end;
 end;
 
-function TGikoForm.GetActiveContent: TThreadItem;
+function TGikoForm.GetActiveContent(popup :Boolean = false): TThreadItem;
 begin
        try
-               if( Assigned(FActiveContent) ) and (Assigned(FActiveContent.Thread))
-                       and (FActiveContent <> nil) and (FActiveContent.Thread <> nil) then
-                       Result := FActiveContent.Thread
-               else begin
-            FActiveContent := nil;
+               if FActiveContent <> nil then begin
+                       Result := FActiveContent.Thread;
+            if (popup) and
+                (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then
+                if (FResPopupBrowser.CurrentBrowser.Thread <> nil) then begin
+                    Result := FResPopupBrowser.CurrentBrowser.Thread;
+                end;
+               end else
                        Result := nil;
-               end;
        except
-               FActiveContent := nil;
                Result := nil;
        end;
+
 end;
 
 procedure TGikoForm.SetActiveList(Obj: TObject);
@@ -3960,30 +2905,53 @@ var
 begin
 //     if FActiveList <> Obj then begin
                FActiveList := Obj;
-
-               if ListView.Selected <> nil then
-                       idx := ListView.Selected.Index
-               else
-                       idx := -1;
+        try
+                       if ListView.Selected <> nil then
+                               idx := ListView.Selected.Index
+                       else
+                               idx := -1;
+        except
+               idx := -1;
+        end;
                ListView.Items.Count := 0;
                ListView.Items.Clear;
                ListView.Selected := nil;
 //     ListView.Columns.Clear;
-
-               Self.Caption := CAPTION_NAME;
+               if (FActiveContent <> nil) and (FActiveContent.Thread <> nil)
+                       and (FActiveContent.Thread.IsLogFile) then begin
+                       try
+                               Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + FActiveContent.Thread.Title + ']'
+                       except
+                               on E: Exception do begin
+                                       //\83X\83\8c\88ê\97\97DL\8cã\82È\82Ç\82ÉFActiveContent\82Ì\8e\9d\82ÂThread\82ª
+                                       //\8dí\8f\9c\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82ª\82 \82é\82Ì\82Å\82±\82±\82Ä\8f\88\97\9d\82·\82é
+                                       ReleaseBrowser(FActiveContent);
+                                       FActiveContent.Thread := nil;
+                                       Self.Caption := GikoDataModule.CAPTION_NAME;
+                               end;
+                       end;
+               end else
+                       Self.Caption := GikoDataModule.CAPTION_NAME;
                //Application.Title := CAPTION_NAME;
 
 //             ActiveListColumnSave;
 
-               if Obj is TBBS then begin
-                       SetCategoryListItem(TBBS(Obj));
-               end else if Obj is TCategory then begin
-                       SetBoardListItem(TCategory(Obj));
-               end else if Obj is TBoard then begin
-                       SetThreadListItem(TBoard(Obj));
+               Screen.Cursor := crHourGlass;
+               try
+                       if Obj is TBBS then begin
+                               TListViewUtils.SetCategoryListItem(TBBS(obj), ListView, GikoDM.ListNumberVisibleAction.Checked);
+                       end else if Obj is TCategory then begin
+                               TListViewUtils.SetBoardListItem(TCategory(Obj), ListView, GikoDM.ListNumberVisibleAction.Checked);
+                       end else if Obj is TBoard then begin
+                               TListViewUtils.SetThreadListItem(TBoard(Obj), ListView,  GikoDM.ListNumberVisibleAction.Checked);
+                       end;
+               finally
+                       Screen.Cursor := crDefault;
                end;
 
-               if idx >= 0 then begin
+               if idx >= 0  then begin
+                       if idx >= ListView.Items.Count then
+                               idx := ListView.Items.Count - 1;
                        ListView.ItemIndex := idx;
                        ListView.ItemFocused := ListView.Items.Item[ idx ];
                end;
@@ -4006,17 +2974,26 @@ end;
 procedure TGikoForm.SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean);
 var
        Board: TBoard;
+       i: Integer;
 begin
+       for i := Length( BBSs ) - 1 downto 0 do begin
+               BBSs[i].SelectText := SelectText;
+               BBSs[i].KubetsuChk := KubetsuChk;
+       end;
+       ViewType := AViewType;
        if ActiveList is TBoard then begin
                Board := TBoard(ActiveList);
+               case ViewType of
+                       //gvtAll: ListView.Items.Count := Board.Count;
+                       gvtLog: Board.LogThreadCount := Board.GetLogThreadCount;
+                       gvtNew: Board.NewThreadCount := Board.GetNewThreadCount;
+                       gvtArch: Board.ArchiveThreadCount := Board.GetArchiveThreadCount;
+                       gvtLive: Board.LiveThreadCount := Board.GetLiveThreadCount;
+                       gvtUser: Board.UserThreadCount:= Board.GetUserThreadCount;
+
+               end;
 
-               Board.ParentCategory.ParenTBBS.SelectText := SelectText;
-               Board.ParentCategory.ParenTBBS.KubetsuChk := KubetsuChk;
-//             Board.SelectText := SelectText;
-//             Board.KubetsuChk := KubetsuChk;
-               ViewType := AViewType;
                SetActiveList(Board);
-               SetThreadListItem(Board);
        end;
 end;
 
@@ -4028,8 +3005,7 @@ var
 //     Board: TBoard;
 begin
        if ListView.Items.Count = 0 then begin
-               DefaultDraw := True;
-
+               DefaultDraw := true;
                ListView.Canvas.Brush.Color := ListView.Color;
                ListView.Canvas.FillRect(ARect);
 
@@ -4046,6 +3022,14 @@ begin
                                ListView.Canvas.Font.Color := clGreen;
                                s := '\82±\82Ì\83r\83\85\81[\82É\82Í\90V\92\85\83A\83C\83e\83\80\82ª\82 \82è\82Ü\82¹\82ñ\81B';
                        end;
+                       gvtArch: begin
+                               ListView.Canvas.Font.Color := clFuchsia;
+                               s := '\82±\82Ì\83r\83\85\81[\82É\82ÍDAT\97\8e\82¿\83A\83C\83e\83\80\82ª\82 \82è\82Ü\82¹\82ñ\81B';
+                       end;
+                       gvtLive: begin
+                               ListView.Canvas.Font.Color := clMaroon;
+                               s := '\82±\82Ì\83r\83\85\81[\82É\82Í\90\91\83A\83C\83e\83\80\82ª\82 \82è\82Ü\82¹\82ñ\81B';
+                       end;
                        gvtUser: begin
                                ListView.Canvas.Font.Color := clNavy;
                                s := '\82±\82Ì\83r\83\85\81[\82É\82Í\83^\83C\83g\83\8b\82ª\81u%s\81v\82ð\8aÜ\82Þ\83A\83C\83e\83\80\82ª\82 \82è\82Ü\82¹\82ñ\81B';
@@ -4077,12 +3061,7 @@ begin
                Item.Board := Board;
                Item.DownType := gdtBoard;
                Item.ForceDownload := ForceDownload;
-//             AbortToolButton.Enabled := True;
-//             Animate.Active := True;
-//             FDownload.Add(Item);
                FControlThread.AddItem(Item);
-//             Animate.Active := False;
-//             AbortToolButton.Enabled := False;
                if FWorkCount = 0 then begin
                        try
                                Animate.Active := True;
@@ -4105,12 +3084,7 @@ begin
                Item.ThreadItem := ThreadItem;
                Item.DownType := gdtThread;
                Item.ForceDownload := ForceDownload;
-//             AbortToolButton.Enabled := True;
-//             Animate.Active := True;
-//             FDownload.Add(Item);
                FControlThread.AddItem(Item);
-//             Animate.Active := False;
-//             AbortToolButton.Enabled := False;
                if FWorkCount = 0 then begin
                        try
                                Animate.Active := True;
@@ -4128,192 +3102,31 @@ procedure TGikoForm.PlaySound(SoundEventName: string);
 var
        FileName: string;
 begin
-       FileName := GikoSys.Setting.FindSoundFileName(SoundEventName);
-       if FileExists(FileName) then begin
-               if not sndPlaySound(PChar(FileName), SND_ASYNC or SND_NOSTOP) then begin
-                       sndPlaySound(nil, SND_SYNC);
-                       Application.ProcessMessages;
-                       Sleep(10);
-                       sndPlaySound(PChar(FileName), SND_ASYNC);
-               end;
-       end;
-end;
-
-function TGikoForm.AddHistory( favItem : TFavoriteThreadItem ): Boolean;
-var
-       i: Integer;
-       Item: TFavoriteThreadItem;
-       Node: TTreeNode;
-begin
-//     Result := False;
-//     if (GetActiveContent = ThreadItem) and
-//                     (ThreadItem.Count <= ThreadItem.Kokomade) then
-//             Exit;
-//     if GetActiveContent = ThreadItem then
-//             Exit;
-
-       Result := True;
-       if FTreeType = gttHistory then
-       TreeView.Selected := nil;
-
-       for i := 0 to FHistoryList.Count - 1 do begin
-               if TObject(FHistoryList[i]) is TFavoriteThreadItem then begin
-                       Item := TFavoriteThreadItem(FHistoryList[i]);
-                       if Item.URL = favItem.URL then begin
-//                             SetContent(ThreadItem);
-                               FHistoryList.Move(i, 0);
-                               if FTreeType = gttHistory then
-                                       if TreeView.Items.GetFirstNode <> TreeView.Items[ i ] then
-                                               TreeView.Items[ i ].MoveTo( TreeView.Items.GetFirstNode, naInsert );
-                                                               Result := false;
-                               Exit;
+       if not GikoSys.Setting.Mute then begin
+               FileName := GikoSys.Setting.FindSoundFileName(SoundEventName);
+               if FileExists(FileName) then begin
+                       if not sndPlaySound(PChar(FileName), SND_ASYNC or SND_NOSTOP) then begin
+                               sndPlaySound(nil, SND_SYNC);
+                               Application.ProcessMessages;
+                               Sleep(10);
+                               sndPlaySound(PChar(FileName), SND_ASYNC);
                        end;
                end;
        end;
-
-       if FHistoryList.Count > 0 then
-               FHistoryList.Insert( 0, favItem )
-       else
-               FHistoryList.Add( favItem );
-//     SetContent(ThreadItem);
-
-       if FTreeType = gttHistory then begin
-               Node := TreeView.Items.Add( nil, favItem.Title );
-               Node.MoveTo( TreeView.Items.GetFirstNode, naInsert );
-               {
-               if favItem.NewArrival then begin
-                       Node.ImageIndex := ITEM_ICON_THREADNEW1;
-                       Node.SelectedIndex := ITEM_ICON_THREADNEW2;
-               end else begin
-                       Node.ImageIndex := ITEM_ICON_THREADLOG1;
-                       Node.SelectedIndex := ITEM_ICON_THREADLOG2;
-               end;
-               }
-               // \95\89\89×\82ð\82©\82¯\82½\82­\82È\82¢\82Ì\82Å NewArrival \82Ì\83`\83F\83b\83N\82ð\8ds\82í\82È\82¢
-               // \81¦favItem.Item \83v\83\8d\83p\83e\83B\82Í dat \82Ì\93Ç\82Ý\8d\9e\82Ý\82ð\95K\97v\82Æ\82·\82é
-               Node.ImageIndex := ITEM_ICON_THREADLOG1;
-               Node.SelectedIndex := ITEM_ICON_THREADLOG2;
-               Node.Data := favItem;
-       end;
 end;
 
+//\97\9a\97ð\82©\82ç\8dí\8f\9c
 procedure TGikoForm.DeleteHistory( threadItem: TThreadItem );
-var
-       i: Integer;
 begin
-       for i := 0 to FHistoryList.Count - 1 do begin
-               if threadItem.URL = TFavoriteThreadItem( FHistoryList.Items[i] ).URL then begin
-                       TFavoriteThreadItem( FHistoryList.Items[ i ] ).Free;
-                       FHistoryList.Delete(i);
-            FHistoryList.Capacity := FHistoryList.Count;
-                       Break;
-               end;
-       end;
+    FHistoryList.DeleteHistory( threadItem, TreeView, TreeType );
 end;
 
-procedure TGikoForm.ClearHistory;
+procedure TGikoForm.ShowBBSTreeOld(
+       inBBS : TBBS
+);
 var
-       i : Integer;
-begin
-       //FHistoryList.Clear;
-
-       try
-               for i := FHistoryList.Count - 1 downto 0 do begin
-                       if TObject(FHistoryList[ i ]) is TFavoriteThreadItem then
-               TFavoriteThreadItem(FHistoryList[ i ]).Free
-            else if TObject(FHistoryList[ i ]) is TFavoriteBoardItem then
-                TFavoriteBoardItem(FHistoryList[ i ]).Free;
-
-                       //FHistoryList.Delete(i);
-        end;
-       except
-       end;
-
-       FHistoryList.Clear;
-    FHistoryList.Capacity := FHistoryList.Count;
-
-end;
-
-procedure TGikoForm.SaveHistory;
-var
-       i, bound        : Integer;
-       saveList        : TstringList;
-begin
-
-       saveList := TStringList.Create;
-       try
-               FHistoryList.Pack;
-        FHistoryList.Capacity := FHistoryList.Count;
-               saveList.Add('<?xml version="1.0" encoding="Shift_JIS" standalone="yes"?>');
-               saveList.Add('<address>');
-               bound := FHistoryList.Count - 1;
-               for i := bound downto 0 do begin
-                       // title \82Í\8d¡\82Ì\82Æ\82±\82ë\8eg\82Á\82Ä\82¢\82È\82¢
-                       saveList.Add(
-                               '<history url="' + HtmlEncode( TFavoriteThreadItem( FHistoryList[ i ] ).URL ) + '"' +
-                               ' title="' + HtmlEncode( TFavoriteThreadItem( FHistoryList[ i ] ).Title ) + '"/>');
-               end;
-               saveList.Add('</address>');
-               saveList.SaveToFile( GikoSys.GetConfigDir + 'History.xml' );
-       finally
-               saveList.Free;
-       end;
-
-end;
-
-procedure TGikoForm.LoadHistory;
-var
-       i, bound                : Integer;
-       fileName                : string;
-       XMLDoc                  : IXMLDocument;
-       XMLNode                 : IXMLNode;
-       HistoryNode     : IXMLNode;
-       s                                               : string;
-       favItem                 : TFavoriteThreadItem;
-begin
-
-       fileName := GikoSys.GetConfigDir + 'History.xml';
-
-       if FileExists( fileName ) then begin
-               try
-            XMLDoc := IXMLDocument.Create;
-                       //XMLDoc := LoadXMLDocument(FileName);
-            LoadXMLDocument(FileName, XMLDoc);
-                       try
-                               XMLNode := XMLDoc.DocumentElement;
-
-                               if XMLNode.NodeName = 'address' then begin
-                                       bound := XMLNode.ChildNodes.Count - 1;
-                                       for i := 0 to bound do begin
-                                               HistoryNode := XMLNode.ChildNodes[i];
-                                               if HistoryNode.NodeName = 'history' then begin
-                                                       //if FReadCount >= sl.Count then begin
-                                                               s := Trim(HistoryNode.Attributes['url']);
-                                                               if s <> '' then begin
-                                                                       favItem := TFavoriteThreadItem.Create(
-                                                                               s, HistoryNode.Attributes[ 'title' ] );
-                                                                       if not AddHistory( favItem ) then
-                                       favItem.Free;
-                                                               end;
-                                                       //end;
-                                               end;
-                                       end;
-                               end;
-                       finally
-                               XMLDoc.Free;
-                       end;
-               except
-               end;
-       end;
-
-end;
-
-procedure TGikoForm.ShowBBSTreeOld(
-       inBBS : TBBS
-);
-var
-       i, b            : Integer;
-       item            : TMenuItem;
+       i, b            : Integer;
+       item            : TMenuItem;
 begin
        try
                FavoriteTreeView.Visible := False;
@@ -4338,13 +3151,14 @@ begin
                end;
                CabinetSelectToolButton.Caption := inBBS.Title;
 
-               CabinetHistoryAction.Checked := False;
-               CabinetFavoriteAction.Checked := False;
+               GikoDM.CabinetHistoryAction.Checked := False;
+               GikoDM.CabinetFavoriteAction.Checked := False;
 
                if (FTreeType <> gtt2ch) or (FActiveBBS <> inBBS) then begin
                        FTreeType := gtt2ch;
                        HistoryToolBar.Hide;
-                       SetBoardTreeNode( inBBS );
+                       FActiveBBS := inBBS;
+                       TListViewUtils.SetBoardTreeNode(inBBS, TreeView);
                        TreeView.Items.GetFirstNode.Expanded := True;                           //?c???[?g?b?v???????J??
                        //?c???[??g?b?v?????I????
                        if GetActiveList = nil then
@@ -4395,13 +3209,15 @@ begin
                end;
                CabinetSelectToolButton.Caption := inBBS.Title;
 
-               CabinetHistoryAction.Checked := False;
-               CabinetFavoriteAction.Checked := False;
+               GikoDM.CabinetHistoryAction.Checked := False;
+               GikoDM.CabinetFavoriteAction.Checked := False;
 
-               if (FTreeType <> gtt2ch) or (FActiveBBS <> inBBS) then begin
+               if (FTreeType <> gtt2ch) or (FActiveBBS <> inBBS)
+                       or (not (CabinetPanel.Visible)) then begin
                        FTreeType := gtt2ch;
                        HistoryToolBar.Hide;
-                       SetBoardTreeNode( inBBS );
+                       FActiveBBS := inBBS;
+                       TListViewUtils.SetBoardTreeNode(inBBS, TreeView);
                        TreeView.Items.GetFirstNode.Expanded := True;                           //\83c\83\8a\81[\83g\83b\83v\8d\80\96Ú\82¾\82¯\82ð\8aJ\82­
                        //\83c\83\8a\81[\82Ì\83g\83b\83v\8d\80\96Ú\82ð\91I\91ð\82·\82é
                        if GetActiveList = nil then begin
@@ -4432,13 +3248,13 @@ begin
        if CabinetPanel.Visible then begin
                if FTreeType = gttHistory then begin
                        CabinetVisible( False );
-                       CabinetHistoryAction.Checked := False;
+                       GikoDM.CabinetHistoryAction.Checked := False;
                end else begin
-                       CabinetHistoryAction.Checked := True;
+                       GikoDM.CabinetHistoryAction.Checked := True;
                end;
        end else begin
-               CabinetVisible( True );
-               CabinetHistoryAction.Checked := True;
+               CabinetVisible( True );
+               GikoDM.CabinetHistoryAction.Checked := True;
        end;
 
        // BBS...BBS, History, Favorite
@@ -4447,8 +3263,8 @@ begin
        FavoriteTreeView.Visible := False;
        TreeView.Visible := True;
 
-       CabinetBBSAction.Checked := False;
-       CabinetFavoriteAction.Checked := False;
+       GikoDM.CabinetBBSAction.Checked := False;
+       GikoDM.CabinetFavoriteAction.Checked := False;
 
        if FTreeType <> gttHistory then begin
                b := CabinetSelectPopupMenu.Items.Count - 1;
@@ -4464,43 +3280,11 @@ begin
                FTreeType := gttHistory;
                HistoryToolBar.Show;
                FavoriteToolBar.Hide;
-               SetHistoryTreeNode;
+        FHistoryList.SetTreeNode( TreeView );
                CabinetSelectToolButton.Caption := '\97\9a\97ð\83\8a\83X\83g';
        end;
 end;
 
-procedure TGikoForm.SetHistoryTreeNode;
-var
-       i: Integer;
-       Node: TTreeNode;
-       Item: TFavoriteThreadItem;
-begin
-       TreeView.Items.BeginUpdate;
-       try
-               TreeView.Items.Clear;
-               for i := 0 to FHistoryList.Count - 1 do begin
-                       Item := TFavoriteThreadItem(FHistoryList[i]);
-                       Node := TreeView.Items.Add(nil, Item.Title);
-                       {
-                       if Item.Item.NewArrival then begin
-                               Node.ImageIndex := ITEM_ICON_THREADNEW1;
-                               Node.SelectedIndex := ITEM_ICON_THREADNEW2;
-                       end else begin
-                               Node.ImageIndex := ITEM_ICON_THREADLOG1;
-                               Node.SelectedIndex := ITEM_ICON_THREADLOG2;
-                       end;
-                       }
-                       // \95\89\89×\82ð\82©\82¯\82½\82­\82È\82¢\82Ì\82Å NewArrival \82Ì\83`\83F\83b\83N\82ð\8ds\82í\82È\82¢
-                       // \81¦Item.Item \83v\83\8d\83p\83e\83B\82Í dat \82Ì\93Ç\82Ý\8d\9e\82Ý\82ð\95K\97v\82Æ\82·\82é
-                       Node.ImageIndex := ITEM_ICON_THREADLOG1;
-                       Node.SelectedIndex := ITEM_ICON_THREADLOG2;
-                       Node.Data := Item;
-               end;
-       finally
-               TreeView.Items.EndUpdate;
-       end;
-end;
-
 procedure TGikoForm.SelectTreeNode(Item: TObject; CallEvent: Boolean);
 var
        ChangeEvent: TTVChangedEvent;
@@ -4549,7 +3333,6 @@ begin
        end else begin
                if Item <> FActiveList then begin
                        ActiveListColumnSave;
-
                        if (Item is TBBS) or (Item is TCategory) then begin
                                ListView.Columns.Clear;
                                SetActiveList( Item );
@@ -4563,6 +3346,7 @@ begin
                                                Screen.Cursor := crDefault;
                                        end;
                                end;
+                               Sort.SetSortDate(Now());
                                SetActiveList( Item );
                        end;
                end;
@@ -4571,13 +3355,13 @@ begin
        if Item is TBoard then begin // not TCategory
                if GikoSys.Setting.ListOrientation = gloHorizontal then begin
                        if GikoSys.Setting.ListWidthState = glsMax then begin
-                               BrowserMinAction.Execute;
+                               GikoDM.BrowserMinAction.Execute;
                                if GikoForm.Visible then
                                        ListView.SetFocus;
                        end;
                end else begin
                        if GikoSys.Setting.ListHeightState = glsMax then begin
-                               BrowserMinAction.Execute;
+                               GikoDM.BrowserMinAction.Execute;
                                if GikoForm.Visible then
                                        ListView.SetFocus;
                        end;
@@ -4608,7 +3392,7 @@ begin
                end;
        mbLeft:
                begin
-            //\82±\82±\82ÅDblClick\8fE\82í\82È\82¢\82Æ\81AClick\83C\83x\83\93\83g\82ª\97D\90æ\82µ\82Ä\8bN\82«\82Ä\82µ\82Ü\82¤\82Ì\82Å
+                       //\82±\82±\82ÅDblClick\8fE\82í\82È\82¢\82Æ\81AClick\83C\83x\83\93\83g\82ª\97D\90æ\82µ\82Ä\8bN\82«\82Ä\82µ\82Ü\82¤\82Ì\82Å
                        if (ssDouble in Shift) then
                                ListDoubleClick(Shift)
                        else
@@ -4622,31 +3406,7 @@ begin
                        ListPopupMenu.Popup( pos.X, pos.Y );
                end;
        end;
-{      if ssDouble in Shift then begin
-               DoubleClickOccurred[Button] := True;
-       end else begin
-               DoubleClickOccurred[Button] := False;
-               t := GetTickCount+GetDoubleClickTime;
-               while GetTickCount < t do begin
-                       Application.ProcessMessages;
-                       if DoubleClickOccurred[Button] then
-                               Exit;
-               end;
-       end;
 
-       if ssDouble in Shift then begin
-               case Button of
-                       mbLeft: ListDoubleClick;
-//                     mbMiddle: ;
-//                     mbRight:        ;
-               end;
-       end else begin
-               case Button of
-                       mbLeft: ListClick;
-//                     mbMiddle: ;
-//                     mbRight:        ;
-               end;
-       end;}
 end;
 
 procedure TGikoForm.ListClick;
@@ -4661,23 +3421,20 @@ begin
 
        ThreadItem := TThreadItem(ListItem.Data);
        if ThreadItem.IsLogFile then begin
-//             if AddHistory(ThreadItem) then
-//             SetContent(ThreadItem);
                InsertBrowserTab(ThreadItem);
                ListView.UpdateItems(ListItem.Index, ListItem.Index);
        end else begin
-//             SetContent(ThreadItem);
                InsertBrowserTab(ThreadItem);
        end;
 
        if GikoSys.Setting.BrowserAutoMaximize = gbmClick then begin
                if GikoSys.Setting.ListOrientation = gloHorizontal then begin
                        if GikoSys.Setting.ListWidthState = glsMin then begin
-                               BrowserMaxAndFocusAction.Execute;
+                               GikoDM.BrowserMaxAndFocusAction.Execute;
                        end;
                end else begin
                        if GikoSys.Setting.ListHeightState = glsMin then begin
-                               BrowserMaxAndFocusAction.Execute;
+                               GikoDM.BrowserMaxAndFocusAction.Execute;
                        end;
                end;
        end;
@@ -4694,103 +3451,45 @@ begin
 
        if TObject(ListView.Selected.Data) is TCategory then begin
                SelectTreeNode(ListView.Selected.Data, True);
-//             TreeView.Selected.Expanded := True;
-//             TreeView.Selected.Item[ListView.Selected.Index].Selected := True;
-               //TreeViewChange(nil, TreeView.Selected);
        end else if TObject(ListView.Selected.Data) is TBoard then begin
-               SelectTreeNode(ListView.Selected.Data, True);
-//             TreeView.Selected.Expanded := True;
-//             TreeView.Selected.Item[ListView.Selected.Index].Selected := True;
-               //TreeViewChange(nil, TreeView.Selected);
+               SelectTreeNode(ListView.Selected.Data, True)
        end else if TObject(ListView.Selected.Data) is TThreadItem then begin
-               //if TObject(ListView.Selected.Data) is TThreadItem then begin
-                       Application.ProcessMessages;
-                       ThreadItem := TThreadItem(ListView.Selected.Data);
-                       DownloadContent(ThreadItem, shiftDown);
-               //end;
-               
+               Application.ProcessMessages;
+               ThreadItem := TThreadItem(ListView.Selected.Data);
+               DownloadContent(ThreadItem, shiftDown);
+
                if GikoSys.Setting.BrowserAutoMaximize = gbmDoubleClick then begin
                        if GikoSys.Setting.ListOrientation = gloHorizontal then begin
                                if GikoSys.Setting.ListWidthState = glsMin then begin
-//                                     BrowserMaxAndFocusAction.Execute;
-                                       BrowserMaxAction.Execute;
-                                       SetFocusForBrowserAction.Execute;
+                                       GikoDM.BrowserMaxAction.Execute;
+                                       GikoDM.SetFocusForBrowserAction.Execute;
                                end;
                        end else begin
                                if GikoSys.Setting.ListHeightState = glsMin then begin
-//                                     BrowserMaxAndFocusAction.Execute;
-                                       BrowserMaxAction.Execute;
-                                       SetFocusForBrowserAction.Execute;
+                                       GikoDM.BrowserMaxAction.Execute;
+                                       GikoDM.SetFocusForBrowserAction.Execute;
                                end;
                        end;
                end;
        end;
 end;
-procedure TGikoForm.BrowserMovement(const AName: string; BrowserRecord: TBrowserRecord);
-var
-       top: Integer;
-       item: OleVariant;
-       nm: OleVariant;
-       activeBrower :TWebBrowser;
-begin
-//     OleVariant(Browser.Document).parentWindow.location.hash := AName;
-
-       while (BrowserRecord.Browser.ReadyState <> READYSTATE_COMPLETE) and
-                               (BrowserRecord.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
-               Application.ProcessMessages;
-       end;
 
+procedure TGikoForm.BrowserMovement(const AName: string);
+begin
        // Access Violation \82ª\8bN\82«\82é\8e\96\82ª\82 \82é\82Ì\82Å\8d¡\8cã\97v\83`\83F\83b\83N
-       if(BrowserRecord <> nil) and (BrowserRecord.FBrowser <> nil) then begin
-               activeBrower := BrowserRecord.FBrowser;
-               try
-                       top := 0;
-                       nm := AName;
-                       item := OleVariant( activeBrower.Document as IHTMLDocument2).anchors.item(nm);
-                       item.focus();
-                       repeat
-                               top := top + item.offsetTop;
-                               item := item.offsetParent;
-                       until AnsiCompareText(item.tagName, 'body' ) = 0;
-                       OleVariant(activeBrower.Document as IHTMLDocument2).body.scrollTop := top;
-               except
-               end;
+       if(BrowserTab.Tabs.Count > 0) and (BrowserTab.TabIndex >= 0)
+               and (FActiveContent <> nil) then begin
+               FActiveContent.Move(AName);
        end;
 end;
-
-procedure TGikoForm.BrowserMovement(const AName: string);
-var
-       top: Integer;
-       item: OleVariant;
-       nm: OleVariant;
-       activeBrower :TWebBrowser;
+//\8c»\8dÝ\95\\8e¦\82µ\82Ä\82¢\82é\83X\83\8c\83b\83h\82ð\83X\83N\83\8d\81[\83\8b
+procedure TGikoForm.BrowserMovement(scroll: Integer);
 begin
-//     OleVariant(Browser.Document).parentWindow.location.hash := AName;
-       {
-       while (Browser.ReadyState <> READYSTATE_COMPLETE) and
-                               (Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
-               Application.ProcessMessages;
-       end;
-       }
-       // Access Violation \82ª\8bN\82«\82é\8e\96\82ª\82 \82é\82Ì\82Å\8d¡\8cã\97v\83`\83F\83b\83N
-       if(BrowserTab.Tabs.Count > 0) and (BrowserTab.TabIndex >= 0) then begin
-               activeBrower := FActiveContent.Browser;
-               try
-                       top := 0;
-                       nm := AName;
-                       item := OleVariant( activeBrower.Document as IHTMLDocument2).anchors.item(nm);
-            item.focus();
-                       repeat
-                               top := top + item.offsetTop;
-                               item := item.offsetParent;
-                       until AnsiCompareText(item.tagName, 'body' ) = 0;
-
-                       OleVariant(activeBrower.Document as IHTMLDocument2).body.scrollTop := top;
-               except
-               end;
+       if(BrowserTab.Tabs.Count > 0) and (BrowserTab.TabIndex >= 0)
+               and (FActiveContent <> nil) then begin
+               FActiveContent.Move(scroll);
        end;
 end;
-
 procedure TGikoForm.TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
 begin
        if TObject(Node.Data) is TBBS then begin
@@ -4800,1410 +3499,184 @@ begin
        end else if TObject(Node.Data) is TBoard then begin
                TBoard(Node.Data).NodeExpand := False;
        end;
+       if (TreeView.Selected <> nil) and (TreeView.Selected = Node) then begin
+       TreeClick(TreeView.Selected);
+       end;
 end;
 
 procedure TGikoForm.MessageListViewResize(Sender: TObject);
 begin
 //     MessageListView.Column[0].Width := MessageListView.ClientWidth - 16;
 end;
+procedure      TGikoForm.CabinetVisible( isVisible : Boolean );
+begin
+       TreeSplitter.Visible := isVisible;
+       CabinetPanel.Visible := isVisible;
+       GikoDM.CabinetVisibleAction.Checked := isVisible;
+end;
 
 procedure TGikoForm.SelectListItem(List: TList);
 var
-//     TmpTreeNode: TTreeNode;
        TmpListItem: TListItem;
 begin
        List.Clear;
+       List.Capacity := 0;
        TmpListItem := ListView.Selected;
        while TmpListItem <> nil do begin
                List.Add(TmpListItem.Data);
                TmpListItem := ListView.GetNextItem(TmpListItem, sdAll, [isSelected]);
        end;
-    
-end;
-
-procedure TGikoForm.ExitActionExecute(Sender: TObject);
-begin
-       Close;
-end;
-
-procedure TGikoForm.AllSelectActionExecute(Sender: TObject);
-begin
-       ListViewAllSelect;
-end;
-
-procedure TGikoForm.StdToolBarVisibleActionExecute(Sender: TObject);
-var
-       CoolBand: TCoolBand;
-begin
-       CoolBand := GetCoolBand(MainCoolBar, StdToolBar);
-       if CoolBand = nil then
-               Exit;
-       GikoSys.Setting.StdToolBarVisible := StdToolBarVisibleAction.Checked;
-       CoolBand.Visible := GikoSys.Setting.StdToolBarVisible;
-//     StdToolBar.Visible := StdToolBarVisibleAction.Checked;
-//     AnimePanel.Visible := StdToolBar.Visible or ListToolBar.Visible;
-
-       //StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
-       StdToolBarVisiblePMenu.Checked := GikoSys.Setting.StdToolBarVisible;
-end;
-
-procedure TGikoForm.AddressBarVisibleActionExecute(Sender: TObject);
-var
-       CoolBand: TCoolBand;
-begin
-       CoolBand := GetCoolBand(MainCoolBar, AddressToolBar);
-       if CoolBand = nil then
-               Exit;
-       GikoSys.Setting.AddressBarVisible := AddressBarVisibleAction.Checked;
-       CoolBand.Visible := GikoSys.Setting.AddressBarVisible;
-       //AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
-       AddressToolBarVisiblePMenu.Checked := GikoSys.Setting.AddressBarVisible;
-end;
-
-procedure TGikoForm.LinkBarVisibleActionExecute(Sender: TObject);
-var
-       CoolBand: TCoolBand;
-begin
-       CoolBand := GetCoolBand(MainCoolBar, LinkToolBar);
-       if CoolBand = nil then
-               Exit;
-       GikoSys.Setting.LinkBarVisible := LinkBarVisibleAction.Checked;
-       CoolBand.Visible := GikoSys.Setting.LinkBarVisible;
-                               //LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
-                               LinkToolBarVisiblePMenu.Checked := GikoSys.Setting.LinkBarVisible;
-end;
 
-procedure TGikoForm.ListToolBarVisibleActionExecute(Sender: TObject);
-var
-       CoolBand: TCoolBand;
-begin
-       CoolBand := GetCoolBand(ListCoolBar, ListToolBar);
-       if CoolBand = nil then
-               Exit;
-       CoolBand.Visible := ListToolBarVisibleAction.Checked;
-//     ListToolBar.Visible := ListToolBarVisibleAction.Checked;
-//     AnimePanel.Visible := StdToolBar.Visible or ListToolBar.Visible;
-       GikoSys.Setting.ListToolBarVisible := ListToolBarVisibleAction.Checked;
-end;
-
-procedure TGikoForm.ListNameBarVisibleActionExecute(Sender: TObject);
-var
-       CoolBand: TCoolBand;
-begin
-       CoolBand := GetCoolBand(ListCoolBar, ListNameToolBar);
-       if CoolBand = nil then
-               Exit;
-       CoolBand.Visible := ListNameBarVisibleAction.Checked;
-       GikoSys.Setting.ListNameBarVisible := ListNameBarVisibleAction.Checked;
-end;
-
-procedure TGikoForm.BrowserToolBarVisibleActionExecute(Sender: TObject);
-var
-       CoolBand: TCoolBand;
-begin
-       CoolBand := GetCoolBand(BrowserCoolBar, BrowserToolBar);
-       if CoolBand = nil then
-               Exit;
-       CoolBand.Visible := BrowserToolBarVisibleAction.Checked;
-//     BrowserToolBar.Visible := BrowserToolBarVisibleAction.Checked;
-       GikoSys.Setting.BrowserToolBarVisible := BrowserToolBarVisibleAction.Checked;
 end;
 
-procedure TGikoForm.BrowserNameBarVisibleActionExecute(Sender: TObject);
-var
-       CoolBand: TCoolBand;
-begin
-       CoolBand := GetCoolBand(BrowserCoolBar, BrowserNameToolBar);
-       if CoolBand = nil then
-               Exit;
-       CoolBand.Visible := BrowserNameBarVisibleAction.Checked;
-       GikoSys.Setting.BrowserNameBarVisible := BrowserNameBarVisibleAction.Checked;
-end;
-
-procedure TGikoForm.MsgBarVisibleActionExecute(Sender: TObject);
+procedure TGikoForm.FormResize(Sender: TObject);
 begin
-       MessageSplitter.Visible := MsgBarVisibleAction.Checked;
-       MessagePanel.Top := MessageSplitter.Top + MessageSplitter.Height;
-       MessageSplitter.Top := MessagePanel.Top + 1;
-       MessagePanel.Visible := MsgBarVisibleAction.Checked;
-       GikoSys.Setting.MessageBarVisible := MsgBarVisibleAction.Checked;
-end;
 
-procedure TGikoForm.StatusBarVisibleActionExecute(Sender: TObject);
-begin
-       StatusBar.Visible := StatusBarVisibleAction.Checked;
-       GikoSys.Setting.StatusBarVisible := StatusBarVisibleAction.Checked;
-end;
+       MessageListView.Column[0].Width := MessageListView.ClientWidth - 32;
+       MainCoolBar.Width := TopPanel.Width - TopRightPanel.Width;
 
-procedure TGikoForm.IconStyleExecute(Sender: TObject);
-begin
-       case ListView.ViewStyle of
-               vsIcon: SmallIconAction.Execute;
-               vsSmallIcon: ListIconAction.Execute;
-               vsList: DetailIconAction.Execute;
-               vsReport: LargeIconAction.Execute;
+       if GikoSys.Setting.ListOrientation = gloHorizontal then begin
+               if GikoSys.Setting.ListWidthState = glsMin then begin
+                       // \8dÅ\8f¬\95\\8e¦\82É\82·\82é
+                       ViewPanel.Width := ThreadMainPanel.Width - 80;
+               end;
+       end else begin
+               if GikoSys.Setting.ListHeightState = glsMin then begin
+                       // \8dÅ\8f¬\95\\8e¦\82É\82·\82é
+                       ViewPanel.Height := ThreadMainPanel.Height - BrowserCoolBar.Height - 7;
+               end;
        end;
-end;
 
-procedure TGikoForm.LargeIconActionExecute(Sender: TObject);
-begin
-       ListView.ViewStyle := vsIcon;
-       LargeIconAction.Checked := True;
-end;
-
-procedure TGikoForm.SmallIconActionExecute(Sender: TObject);
-begin
-       ListView.ViewStyle := vsSmallIcon;
-       SmallIconAction.Checked := True;
-end;
+       FIsIgnoreResize := rtResizing;
+       PostMessage( Handle, USER_RESIZED, 0, 0 );
 
-procedure TGikoForm.ListIconActionExecute(Sender: TObject);
-begin
-       ListView.ViewStyle := vsList;
-       ListIconAction.Checked := True;
-end;
 
-procedure TGikoForm.DetailIconActionExecute(Sender: TObject);
-begin
-       ListView.ViewStyle := vsReport;
-       DetailIconAction.Checked := True;
 end;
 
-procedure TGikoForm.SearchActionExecute(Sender: TObject);
+procedure TGikoForm.DeleteTab(BrowserRecord: TBrowserRecord);
 var
-       chk: TObject;
+       i: Integer;
 begin
-
-       if FSearchDialog = nil then begin
-               if (GikoForm.GetActiveList is TCategory) or (GikoForm.GetActiveList is TBoard) then
-                       chk := GikoForm.GetActiveList
-               else
-                       chk := nil;
-
-               FSearchDialog := TSearchDialog.Create(Self, chk);
-               FSearchDialog.SearchComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
-       end;
-
-       try
-               FSearchDialog.Show;
-       except
+       FTabHintIndex := -1;
+       for i := 0 to BrowserTab.Tabs.Count - 1 do begin
+               if TBrowserRecord(BrowserTab.Tabs.Objects[i]) = BrowserRecord then begin
+            DeleteTab(i, BrowserTab.TabIndex);
+                       Break;
+               end;
        end;
-       
 end;
-
-procedure TGikoForm.OptionActionExecute(Sender: TObject);
+procedure TGikoForm.DeleteTab(ThreadItem: TThreadItem);
 var
-       Dlg: TOptionDialog;
+       i: Integer;
 begin
-       Dlg := TOptionDialog.Create(Self);
-       try
-               Dlg.ShowModal;
-       finally
-               Dlg.Release;
+       FTabHintIndex := -1;
+       for i := 0 to BrowserTab.Tabs.Count - 1 do begin
+               if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
+            DeleteTab(i, BrowserTab.TabIndex);
+                       Break;
+               end;
        end;
 end;
-
-procedure TGikoForm.GikoNaviWebPageActionExecute(Sender: TObject);
-const
-       URL_GIKONAVI: string = 'http://gikonavi.sourceforge.jp/';
-begin
-       GikoSys.OpenBrowser(URL_GIKONAVI, gbtAuto);
-end;
-
-procedure TGikoForm.MonazillaWebPageActionExecute(Sender: TObject);
-const
-       URL_MONAZILLA: string = 'http://www.monazilla.org/';
-begin
-       GikoSys.OpenBrowser(URL_MONAZILLA, gbtAuto);
-end;
-
-procedure TGikoForm.BBS2chWebPageActionExecute(Sender: TObject);
-const
-       URL_2ch: string = 'http://www.2ch.net/';
-begin
-       GikoSys.OpenBrowser(URL_2ch, gbtAuto);
-end;
-
-procedure TGikoForm.GikoFolderOpenActionExecute(Sender: TObject);
-begin
-//     GikoSys.OpenBrowser(GikoSys.GetAppDir, gbtIE);
-       GikoSys.CreateProcess('explorer.exe', '/e,"' + GikoSys.GetAppDir + '"');
-end;
-
-procedure TGikoForm.AboutActionExecute(Sender: TObject);
+procedure TGikoForm.DeleteTab(index, selectIndex: Integer);
 var
-       Dlg: TAboutDialog;
-begin
-       Dlg := TAboutDialog.Create(Self);
-       try
-               Dlg.ShowModal;
-       finally
-               Dlg.Release;
-       end;
-end;
-
-procedure TGikoForm.CabinetHistoryActionExecute(Sender: TObject);
+    doc: Variant;
+    j: Integer;
 begin
-       ShowHistoryTree;
-end;
+    try
+        if TBrowserRecord(BrowserTab.Tabs.Objects[index]).Browser <> nil then begin
+            doc := TBrowserRecord(BrowserTab.Tabs.Objects[index]).Browser.Document;
+            TBrowserRecord(BrowserTab.Tabs.Objects[index]).Thread.ScrollTop := doc.Body.ScrollTop;
+        end;
+    except
+        TBrowserRecord(BrowserTab.Tabs.Objects[index]).Thread.ScrollTop := 0;
+    end;
+    if(FActiveContent = TBrowserRecord(BrowserTab.Tabs.Objects[index])) then
+        FActiveContent := nil;
+    if TBrowserRecord(BrowserTab.Tabs.Objects[index]).Browser <> nil then begin
+        j := FBrowsers.IndexOf(TBrowserRecord(BrowserTab.Tabs.Objects[index]).Browser);
+        if j <> -1 then
+            FBrowsers.Move(j, BROWSER_COUNT - 1);
+    end;
+    BrowserTab.Tabs.BeginUpdate;
+    try
+        GikoSys.Setting.LastCloseTabURL :=
+            TBrowserRecord(BrowserTab.Tabs.Objects[index]).Thread.URL;
+        TBrowserRecord(BrowserTab.Tabs.Objects[index]).Free;
+        if ( BrowserTab.Tabs.Count - 1 = index ) and
+            ( BrowserTab.TabRect(index).Left
+                <= BrowserTab.DisplayRect.Left ) then begin
+            BrowserTab.ScrollTabs(-1);
+        end;
+        BrowserTab.Tabs.Delete(index);
+        if selectIndex > index then begin
+            BrowserTab.TabIndex := selectIndex - 1;
+        end else begin
+            if BrowserTab.Tabs.Count -1 >= selectIndex then
+                BrowserTab.TabIndex := selectIndex
+            else
+                BrowserTab.TabIndex := BrowserTab.Tabs.Count - 1;
+        end;
+    finally
+        BrowserTab.Tabs.EndUpdate;
+    end;
+    if BrowserTab.Tabs.Count = 0 then begin
+        BrowserNullTab.Thread := nil;
+    end;
+    if(BrowserTab.TabIndex <> -1) and
+        ( TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser = nil) then begin
+        // \88ê\94Ô\8cÃ\82¢\83u\83\89\83E\83U\82ð\8aJ\95ú\82·\82é
+        ReleaseOldestBrowser;
+
+        TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser
+             :=  TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
+        TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Repaint := true;
+        FBrowsers.Move(BROWSER_COUNT - 1, 0);
+    end;
 
-procedure      TGikoForm.CabinetVisible( isVisible : Boolean );
-begin
-       TreeSplitter.Visible := isVisible;
-       CabinetPanel.Visible := isVisible;
-       CabinetVisibleAction.Checked := isVisible;
+    if( FActiveContent = nil) then
+        BrowserTab.OnChange(nil);
 end;
-
-procedure TGikoForm.CabinetVisibleActionExecute(Sender: TObject);
+function TGikoForm.Hook(var Message: TMessage): Boolean;
 begin
-       case FTreeType of
-       gttHistory:             CabinetHistoryAction.Execute;
-       gttFavorite:    CabinetFavoriteAction.Execute;
-       else
-               CabinetBBSAction.Execute;
+       //\83T\83u\83t\83H\81[\83\80\82ª\83\81\83C\83\93\83\81\83j\83\85\81[\82ð\8e\9d\82½\82È\82¢\82Æ\82«\82É\81A\83\81\83C\83\93\83t\83H\81[\83\80\82Ì
+       //\83\81\83j\83\85\81[\82Ì\83V\83\87\81[\83g\83J\83b\83g\83L\81[\82ª\83T\83u\83\81\83j\83\85\81[\82©\82ç\93ü\97Í\82³\82ê\82é\82Ì\82ð\89ñ\94ð
+       Result := False;
+       case Message.Msg of
+       CM_APPKEYDOWN:
+               Result := True;         //\83V\83\87\81[\83g\83J\83b\83g\83L\81[\96³\8cø
+       CM_APPSYSCOMMAND:
+               Result := True;  // \83A\83N\83Z\83\89\83\8c\81[\83^\82ð\96³\8cø\82É\82·\82é
        end;
 end;
 
-procedure TGikoForm.AllItemActionExecute(Sender: TObject);
-begin
-       try
-               if ViewType <> gvtAll then
-                       SetListViewType(gvtAll);
-               GikoSys.Setting.ThreadRange := gtrAll;
-               AllItemAction.Checked           := True;
-               // SelectComboBox \82Ì\97\9a\97ð\82ð\8dX\90V\82µ\82Ä\82¨\82­
-               ModifySelectList;
-               // SelectComboBox \82Ì\92l\82ð\83N\83\8a\83A
-               if SelectComboBox.Parent <> nil then begin
-                       SelectComboBox.Text := SELECTCOMBOBOX_NAME;
-                       SelectComboBox.Color := SELECTCOMBOBOX_COLOR;
-                       ListView.SetFocus;
-               end;
-       except
-       end;
+procedure TGikoForm.ListPopupMenuPopup(Sender: TObject);
+var
+    bBoard, bCategory : Boolean;
+begin
+    bBoard := (GetActiveList is TBoard);
+    bCategory := (GetActiveList is TCategory);
+       ItemRoundPMenu.Visible := bBoard;
+       ItemReservPMenu.Visible := bBoard;
+       LPMSep01.Visible := bBoard;
+       ListRoundPMenu.Visible := bCategory;// or (GetActiveList is TBoard);
+       ListReservPMenu.Visible := bCategory;// or (GetActiveList is TBoard);
+       LPMSep02.Visible := bCategory or bBoard;
+       KidokuPMenu.Visible := bBoard;
+       MidokuPMenu.Visible := bBoard;
+       UrlCopyPMenu.Visible := bCategory or bBoard;
+       NameUrlCopyPMenu.Visible := bCategory or bBoard;
+       AllSelectPMenu.Visible := bCategory or bBoard;
+       LPMSep05.Visible := bCategory or bBoard;
+       DeletePMenu.Visible := bBoard;
+       LPMSep06.Visible := bCategory or bBoard;
+       BoardFavoriteAddMenu.Visible := bCategory;
+       ThreadFavoriteAddMenu.Visible := bBoard;
+    SaveThreadFile.Visible := bBoard;
+       AddRoundNameMenu(ItemReservPMenu);
+       AddRoundNameMenu(ListReservPMenu);
 end;
 
-procedure TGikoForm.LogItemActionExecute(Sender: TObject);
-begin
-       try
-               if ViewType <> gvtLog then
-                       SetListViewType(gvtLog);
-               GikoSys.Setting.ThreadRange     := gtrLog;
-               LogItemAction.Checked := True;
-               // SelectComboBox \82Ì\97\9a\97ð\82ð\8dX\90V\82µ\82Ä\82¨\82­
-               ModifySelectList;
-               // SelectComboBox \82Ì\92l\82ð\83N\83\8a\83A
-               if SelectComboBox.Parent <> nil then begin
-                       SelectComboBox.Text := SELECTCOMBOBOX_NAME;
-                       SelectComboBox.Color := SELECTCOMBOBOX_COLOR;
-                       ListView.SetFocus;
-               end;
-       except
-       end;
-end;
-
-procedure TGikoForm.NewItemActionExecute(Sender: TObject);
-begin
-       try
-
-               if ViewType <> gvtNew then
-                       SetListViewType(gvtNew);
-               GikoSys.Setting.ThreadRange     := gtrNew;
-               NewItemAction.Checked := True;
-               // SelectComboBox \82Ì\97\9a\97ð\82ð\8dX\90V\82µ\82Ä\82¨\82­
-               ModifySelectList;
-               // SelectComboBox \82Ì\92l\82ð\83N\83\8a\83A
-               if SelectComboBox.Parent <> nil then begin
-                       SelectComboBox.Text := SELECTCOMBOBOX_NAME;
-                       SelectComboBox.Color := SELECTCOMBOBOX_COLOR;
-                       ListView.SetFocus;
-               end;
-       except
-       end;
-end;
-
-procedure TGikoForm.SelectItemActionExecute(Sender: TObject);
-var
-       idx: Integer;
-       Dlg: TListSelectDialog;
-begin
-       try
-               if SelectComboBox.Parent <> nil then begin
-                       if SelectComboBox.Left + SelectComboBox.Width < ListToolBar.Width then begin
-                               // SelectComboBox \82ª\82 \82é\8fê\8d\87\82Í\83t\83H\81[\83J\83X\82ð\88Ú\82·
-                               if GikoSys.Setting.ListOrientation = gloHorizontal then begin
-                                       if GikoSys.Setting.ListWidthState = glsMax then
-                                               BrowserMinAction.Execute;
-                               end else begin
-                                       if GikoSys.Setting.ListHeightState = glsMax then
-                                               BrowserMinAction.Execute;
-                               end;
-                               SelectComboBox.SetFocus;
-                               exit;
-                       end;
-               end;
-       except
-       end;
-
-       if SelectComboBox.Text = SELECTCOMBOBOX_NAME then begin
-               SelectComboBox.Text := '';
-               SelectComboBox.Color := clWindow;
-       end;
-
-       AllItemAction.Checked := False;
-       LogItemAction.Checked := False;
-       NewItemAction.Checked := False;
-       //SelectItemAction.Checked := True;
-       ModifySelectList;
-       Dlg := TListSelectDialog.Create(Self);
-       try
-               Dlg.SelectComboBox.Items.Assign(GikoSys.Setting.SelectTextList);
-               Dlg.SelectComboBox.Text := SelectComboBox.Text;
-               Dlg.ShowModal;
-               if Dlg.ModalResult = mrCancel then begin
-                       if Length( SelectComboBox.Text ) = 0 then begin
-                               AllItemAction.Checked := True;
-                               SelectComboBox.Text := SELECTCOMBOBOX_NAME;
-                               SelectComboBox.Color := SELECTCOMBOBOX_COLOR;
-                       end;
-
-                       if GetActiveList is TBoard then
-                               SetListViewType(gvtUser, TBoard(GetActiveList).ParentCategory.ParenTBBS.SelectText , Dlg.KubetsuCheckBox.Checked);
-               end else begin
-                       idx := GikoSys.Setting.SelectTextList.IndexOf(Dlg.SelectComboBox.Text);
-                       if idx <> -1 then
-                               GikoSys.Setting.SelectTextList.Delete(idx);
-                       GikoSys.Setting.SelectTextList.Insert(0, Dlg.SelectComboBox.Text);
-                       while Dlg.SelectComboBox.Items.Count > 100 do begin
-                               Dlg.SelectComboBox.Items.Delete(Dlg.SelectComboBox.Items.Count - 1);
-                       end;
-
-                       if Length( Dlg.SelectComboBox.Text ) = 0 then begin
-                               SelectComboBox.Text := SELECTCOMBOBOX_NAME;
-                               SelectComboBox.Color := SELECTCOMBOBOX_COLOR;
-                       end else begin
-                               SelectComboBox.Text := Dlg.SelectComboBox.Text;
-                               SelectComboBox.Color := clWindow;
-                       end;
-                       SetListViewType(gvtUser, Dlg.SelectComboBox.Text, Dlg.KubetsuCheckBox.Checked);
-               end;
-       finally
-               Dlg.Release;
-       end;
-end;
-
-procedure TGikoForm.ListNumberVisibleActionExecute(Sender: TObject);
-begin
-       GikoSys.Setting.ListViewNo := ListNumberVisibleAction.Checked;
-       ListView.Refresh;
-end;
-
-procedure TGikoForm.UpFolderActionExecute(Sender: TObject);
-begin
-       if GetActiveList is TBoard then begin
-//             if FTreeType = gtt2ch then
-                       SelectTreeNode(TBoard(GetActiveList).ParentCategory, True);
-               //SetActiveList(TBoard(GetActiveList).ParentCategory);
-       end else if GetActiveList is TCategory then begin
-//             if FTreeType = gtt2ch then
-                       SelectTreeNode(TCategory(GetActiveList).ParenTBBS, True);
-               //SetActiveList(TCategory(GetActiveList).ParenTBBS);
-       end;
-//     if TreeView.Selected = nil then Exit;
-//     if TreeView.Selected.Level = 0 then Exit;
-//     TreeView.Selected.Parent.Selected := True;
-end;
-
-procedure TGikoForm.RoundActionExecute(Sender: TObject);
-var
-       Dlg: TRoundDialog;
-begin
-       Dlg := TRoundDialog.Create(Self);
-       try
-               Dlg.ShowModal;
-       finally
-               Dlg.Release;
-       end;
-end;
-
-procedure TGikoForm.StopActionExecute(Sender: TObject);
-begin
-       FControlThread.DownloadAbort;
-       if FWorkCount <> 0 then FWorkCount := 0;
-       try
-               Animate.Active := False;
-       except
-       end;
-       Screen.Cursor := crDefault;
-end;
-
-procedure TGikoForm.MsgBarCloseActionExecute(Sender: TObject);
-begin
-//     MessagePanel.Visible := False;
-//     MessageSplitter.Visible := False;
-//     MsgBarVisibleAction.Checked := False;
-       MsgBarVisibleAction.Execute;
-end;
-
-procedure TGikoForm.BrowserMaxActionExecute(Sender: TObject);
-begin
-       if GikoSys.Setting.ListOrientation = gloHorizontal then begin
-               case GikoSys.Setting.ListWidthState of
-                       glsMax: begin
-                               //\92Ê\8fí\95\\8e¦\82É\82·\82é
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //\95`\89æ\92â\8e~
-                               ViewPanel.Width := FBrowserSizeWidth;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
-                               GikoSys.Setting.ListWidthState := glsNormal;
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //\95`\89æ
-                       end;
-                       glsMin, glsNormal: begin
-                               //\8dÅ\91å\95\\8e¦\82É\82·\82é
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //\95`\89æ\92â\8e~
-                               if GikoSys.Setting.ListWidthState = glsNormal then
-                                       FBrowserSizeWidth := ViewPanel.Width;
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //\95`\89æ
-                               ViewPanel.Width := 1;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
-                               GikoSys.Setting.ListWidthState := glsMax;
-                       end;
-               end;
-       end else begin
-               case GikoSys.Setting.ListHeightState of
-                       glsMax: begin
-                               //\92Ê\8fí\95\\8e¦\82É\82·\82é
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //\95`\89æ\92â\8e~
-                               ViewPanel.Height := FBrowserSizeHeight;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
-                               GikoSys.Setting.ListHeightState := glsNormal;
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //\95`\89æ
-                       end;
-                       glsMin, glsNormal: begin
-                               //\8dÅ\91å\95\\8e¦\82É\82·\82é
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //\95`\89æ\92â\8e~
-                               if GikoSys.Setting.ListHeightState = glsNormal then
-                                       FBrowserSizeHeight := ViewPanel.Height;
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //\95`\89æ
-                               ViewPanel.Height := 1;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
-                               GikoSys.Setting.ListHeightState := glsMax;
-                       end;
-               end;
-       end;
-//     Mouse.CursorPos := BrowserSizeButton.ClientToScreen(Point(
-//                                                                                             System.Round(BrowserToolBar.ButtonWidth div 2),
-//                                                                                             System.Round(BrowserToolBar.ButtonHeight div 2)));
-       //BrowserTab.OnChange(nil);
-end;
-
-procedure TGikoForm.BrowserMinActionExecute(Sender: TObject);
-begin
-
-       if GikoSys.Setting.ListOrientation = gloHorizontal then begin
-               case GikoSys.Setting.ListWidthState of
-                       glsMax, glsNormal: begin
-                               //\8dÅ\8f¬\95\\8e¦\82É\82·\82é
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //\95`\89æ\92â\8e~
-                               if GikoSys.Setting.ListWidthState = glsNormal then
-                                       FBrowserSizeWidth := ViewPanel.Width;
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //\95`\89æ
-                               ViewPanel.Width := ThreadMainPanel.Width - 80;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
-                               GikoSys.Setting.ListWidthState := glsMin;
-                       end;
-                       glsMin: begin
-                               //\92Ê\8fí\95\\8e¦\82É\82·\82é
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //\95`\89æ\92â\8e~
-                               ViewPanel.Width := FBrowserSizeWidth;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
-                               GikoSys.Setting.ListWidthState := glsNormal;
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //\95`\89æ
-                       end;
-               end;
-       end else begin
-               case GikoSys.Setting.ListHeightState of
-                       glsMax, glsNormal: begin
-                               //\8dÅ\8f¬\95\\8e¦\82É\82·\82é
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //\95`\89æ\92â\8e~
-                               if GikoSys.Setting.ListHeightState = glsNormal then
-                                       FBrowserSizeHeight := ViewPanel.Height;
-                               ViewPanel.Height := ThreadMainPanel.Height - BrowserCoolBar.Height - 7;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
-                               GikoSys.Setting.ListHeightState := glsMin;
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //\95`\89æ
-                       end;
-                       glsMin: begin
-                               //\92Ê\8fí\95\\8e¦\82É\82·\82é
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //\95`\89æ\92â\8e~
-                               ViewPanel.Height := FBrowserSizeHeight;
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
-                               GikoSys.Setting.ListHeightState := glsNormal;
-                               if FActiveContent <> nil then
-                                       SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //\95`\89æ
-                       end;
-               end;
-       end;
-end;
-
-procedure TGikoForm.ScrollTopActionExecute(Sender: TObject);
-begin
-       BrowserMovement('top');
-end;
-
-procedure TGikoForm.ScrollLastActionExecute(Sender: TObject);
-begin
-       BrowserMovement('bottom');
-end;
-
-procedure TGikoForm.ScrollNewActionExecute(Sender: TObject);
-begin
-       BrowserMovement('new');
-end;
-
-procedure TGikoForm.ScrollKokoActionExecute(Sender: TObject);
-begin
-       BrowserMovement('koko');
-end;
-
-procedure TGikoForm.EditorActionExecute(Sender: TObject);
-var
-       Editor: TEditorForm;
-       Item: TThreadItem;
-begin
-       Item := GetActiveContent;
-       if Item = nil then Exit;
-       Editor := TEditorForm.Create(Self);
-       Editor.SetThreadItem(Item);
-    GikoSys.LoadEditorKeySetting(Editor.ActionList);
-       Editor.Show;
-       Editor.BodyEdit.SetFocus;
-end;
-
-procedure TGikoForm.IEActionExecute(Sender: TObject);
-begin
-       ShowThreadAction.Execute;
-end;
-
-procedure TGikoForm.ShowThreadActionExecute(Sender: TObject);
-var
-       ThreadItem: TThreadItem;
-begin
-       ThreadItem := GetActiveContent;
-       if ThreadItem = nil then Exit;
-       GikoSys.OpenBrowser(ThreadItem.URL, gbtAuto);
-end;
-
-procedure TGikoForm.ShowBoardActionExecute(Sender: TObject);
-var
-       ThreadItem: TThreadItem;
-begin
-       ThreadItem := GetActiveContent;
-       if ThreadItem = nil then Exit;
-       GikoSys.OpenBrowser(ThreadItem.ParentBoard.URL, gbtAuto);
-end;
-
-//(Thread)URL\82ð\83R\83s\81[
-procedure TGikoForm.URLCopyActionExecute(Sender: TObject);
-var
-       s: string;
-begin
-       s := '';
-       if TObject(GetActiveContent) is TBoard then
-               s := s + TBoard(GetActiveContent).URL + #13#10
-       else if TObject(GetActiveContent) is TThreadItem then
-               s := s + TThreadItem(GetActiveContent).URL + #13#10;
-       if s <> '' then
-               Clipboard.AsText := s;
-end;
-
-//(Thread)\83X\83\8c\83b\83h\96¼\82ð\83R\83s\81[
-procedure TGikoForm.NameCopyActionExecute(Sender: TObject);
-var
-       s: string;
-begin
-       s := '';
-       if TObject(GetActiveContent) is TBoard then
-               s := s + TBoard(GetActiveContent).Title + #13#10
-       else if TObject(GetActiveContent) is TThreadItem then
-               s := s + TThreadItem(GetActiveContent).Title + #13#10;
-       if s <> '' then
-               Clipboard.AsText := s;
-end;
-
-//(Thread)\83X\83\8c\83b\83h\96¼\82ÆURL\82ð\83R\83s\81[
-procedure TGikoForm.NameURLCopyActionExecute(Sender: TObject);
-var
-       s: string;
-begin
-       s := '';
-       if TObject(GetActiveContent) is TBoard then
-               s := s + TBoard(GetActiveContent).Title + #13#10 + TBoard(GetActiveContent).URL + #13#10
-       else if TObject(GetActiveContent) is TThreadItem then
-               s := s + TThreadItem(GetActiveContent).Title + #13#10 + TThreadItem(GetActiveContent).URL + #13#10;
-       if s <> '' then
-               Clipboard.AsText := s;
-end;
-
-procedure TGikoForm.ItemReloadActionExecute(Sender: TObject);
-var
-       ThreadItem: TThreadItem;
-       shiftDown: Boolean;
-begin
-       ThreadItem := GetActiveContent;
-       shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
-       if ThreadItem <> nil then
-               DownloadContent(ThreadItem, shiftDown);
-end;
-
-procedure TGikoForm.SelectListReloadActionExecute(Sender: TObject);
-var
-       i: Integer;
-       List: TList;
-       msg: string;
-       shiftDown: Boolean;
-begin
-       shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
-       if GetActiveList is TCategory then begin
-               List := TList.Create;
-               try
-                       SelectListItem(List);
-                       if List.Count > 5 then begin
-                               msg := '5\8cÂ\88È\8fã\82Í\8ew\92è\82Å\82«\82Ü\82¹\82ñ' + #13#10
-                                                + '\82Q\82¿\82á\82ñ\82Ë\82é\95\89\89×\8cy\8c¸\82É\82²\8b¦\97Í\82­\82¾\82³\82¢';
-                               MsgBox(Handle, msg, '\8cx\8d\90', MB_ICONEXCLAMATION);
-                               Exit;
-                       end;
-                       for i := 0 to List.Count - 1 do begin
-                               if TObject(List[i]) is TBoard then
-                                       DownloadList(TBoard(List[i]), shiftDown);
-                       end;
-               finally
-                       List.Free;
-               end;
-       end else if GetActiveList is TBoard then begin
-               DownloadList(TBoard(GetActiveList), shiftDown);
-       end;
-end;
-
-procedure TGikoForm.SelectThreadReloadActionExecute(Sender: TObject);
-var
-       List: TList;
-       i: Integer;
-       msg: string;
-       shiftDown: Boolean;
-begin
-       shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
-       List := TList.Create;
-       try
-               SelectListItem(List);
-               if List.Count > 10 then begin
-                       msg := '10\8cÂ\88È\8fã\82Í\8ew\92è\82Å\82«\82Ü\82¹\82ñ' + #13#10
-                                        + '\82Q\82¿\82á\82ñ\82Ë\82é\95\89\89×\8cy\8c¸\82É\82²\8b¦\97Í\82­\82¾\82³\82¢';
-                       MsgBox(Handle, msg, '\8cx\8d\90', MB_ICONEXCLAMATION);
-                       Exit;
-               end;
-               for i := 0 to List.Count - 1 do begin
-                       if TObject(List[i]) is TThreadItem then
-                               DownloadContent(TThreadItem(List[i]), shiftDown);
-               end;
-       finally
-               List.Free;
-       end;
-end;
-
-procedure TGikoForm.SelectListReloadActionUpdate(Sender: TObject);
-begin
-       if (GetActiveList is TCategory) and (ListView.SelCount > 0) then
-               SelectListReloadAction.Enabled := True
-       else if GetActiveList is TBoard then
-               SelectListReloadAction.Enabled := True
-       else
-               SelectListReloadAction.Enabled := False;
-end;
-
-procedure TGikoForm.SelectThreadReloadActionUpdate(Sender: TObject);
-begin
-       if (GetActiveList is TBoard) and (ListView.SelCount > 0) then
-               SelectThreadReloadAction.Enabled := True
-       else
-               SelectThreadReloadAction.Enabled := False;
-end;
-
-procedure TGikoForm.AllItemActionUpdate(Sender: TObject);
-begin
-       AllItemAction.Enabled := (GetActiveList is TBoard);
-end;
-
-procedure TGikoForm.LogItemActionUpdate(Sender: TObject);
-begin
-       LogItemAction.Enabled := (GetActiveList is TBoard);
-end;
-
-procedure TGikoForm.NewItemActionUpdate(Sender: TObject);
-begin
-       NewItemAction.Enabled := (GetActiveList is TBoard);
-end;
-
-procedure TGikoForm.SelectItemActionUpdate(Sender: TObject);
-begin
-       SelectItemAction.Enabled := (GetActiveList is TBoard);
-end;
-
-procedure TGikoForm.UpFolderActionUpdate(Sender: TObject);
-begin
-       UpFolderAction.Enabled := not (GetActiveList is TBBS);
-end;
-
-procedure TGikoForm.ThreadEditorActionUpdate(Sender: TObject);
-begin
-       ThreadEditorAction.Enabled := (GetActiveList is TBoard);
-end;
-
-procedure TGikoForm.FormResize(Sender: TObject);
-begin
-
-       MessageListView.Column[0].Width := MessageListView.ClientWidth - 32;
-       MainCoolBar.Width := TopPanel.Width - TopRightPanel.Width;
-
-       if GikoSys.Setting.ListOrientation = gloHorizontal then begin
-               if GikoSys.Setting.ListWidthState = glsMin then begin
-                       // \8dÅ\8f¬\95\\8e¦\82É\82·\82é
-                       ViewPanel.Width := ThreadMainPanel.Width - 80;
-               end;
-       end else begin
-               if GikoSys.Setting.ListHeightState = glsMin then begin
-                       // \8dÅ\8f¬\95\\8e¦\82É\82·\82é
-                       ViewPanel.Height := ThreadMainPanel.Height - BrowserCoolBar.Height - 7;
-               end;
-       end;
-
-       FIsIgnoreResize := rtResizing;
-       PostMessage( Handle, USER_RESIZED, 0, 0 );
-
-
-end;
-
-procedure TGikoForm.ScrollTopActionUpdate(Sender: TObject);
-begin
-       ScrollTopAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
-end;
-
-procedure TGikoForm.ScrollLastActionUpdate(Sender: TObject);
-begin
-       ScrollLastAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
-end;
-
-procedure TGikoForm.ScrollNewActionUpdate(Sender: TObject);
-begin
-       ScrollNewAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
-end;
-
-procedure TGikoForm.ScrollKokoActionUpdate(Sender: TObject);
-begin
-       ScrollKokoAction.Enabled := (GetActiveContent <> nil)
-                                                                                                       and (GetActiveContent.IsLogFile)
-                                                                                                       and (GetActiveContent.Kokomade <> -1);
-
-end;
-
-procedure TGikoForm.EditorActionUpdate(Sender: TObject);
-begin
-       EditorAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.IEActionUpdate(Sender: TObject);
-begin
-       IEAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.ShowThreadActionUpdate(Sender: TObject);
-begin
-       ShowThreadAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.ShowBoardActionUpdate(Sender: TObject);
-begin
-       ShowBoardAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.ItemReloadActionUpdate(Sender: TObject);
-begin
-       ItemReloadAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.URLCopyActionUpdate(Sender: TObject);
-begin
-       URLCopyAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.NameCopyActionUpdate(Sender: TObject);
-begin
-       NameCopyAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.NameURLCopyActionUpdate(Sender: TObject);
-begin
-       NameURLCopyAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.BrowserTabCloseActionUpdate(Sender: TObject);
-begin
-       BrowserTabCloseAction.Enabled := (BrowserTab.Tabs.Count > 0);
-end;
-
-procedure TGikoForm.NotSelectTabCloseActionUpdate(Sender: TObject);
-begin
-       NotSelectTabCloseAction.Enabled := (BrowserTab.Tabs.Count > 1);
-end;
-
-procedure TGikoForm.AllTabCloseActionUpdate(Sender: TObject);
-begin
-       AllTabCloseAction.Enabled := (BrowserTab.Tabs.Count > 0);
-end;
-
-procedure TGikoForm.ActiveLogDeleteActionUpdate(Sender: TObject);
-begin
-       ActiveLogDeleteAction.Enabled := GetActiveContent <> nil;
-end;
-
-procedure TGikoForm.LogDeleteActionExecute(Sender: TObject);
-const
-       DEL_MSG = '\81g^0\81h\82Ì\83\8d\83O\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_SAME_MSG = '\82±\82ê\82ç ^0 \8cÂ\82Ì\83X\83\8c\83b\83h\82Ì\83\8d\83O\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_TITLE = '\8dí\8f\9c\8am\94F';
-var
-       ThreadItem: TThreadItem;
-       TmpListItem: TListItem;
-       List: TList;
-       i: Integer;
-begin
-       List := TList.Create;
-       try
-               TmpListItem := ListView.Selected;
-               while TmpListItem <> nil do begin
-                       if TObject(TmpListItem.Data) is TThreadItem then begin
-                               ThreadItem := TThreadItem(TmpListItem.Data);
-                               if ThreadItem.IsLogFile then
-                                       List.Add(ThreadItem);
-                       end;
-                       TmpListItem := ListView.GetNextItem(TmpListItem, sdAll, [isSelected]);
-               end;
-
-               if GikoSys.Setting.DeleteMsg and (List.Count > 0) then begin
-                       if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then begin
-                               if List.Count = 1 then begin
-                                       if MsgBox(Handle, StringReplace( DEL_MSG, '^0', TThreadItem( List[ 0 ] ).Title, [rfReplaceAll] ) , DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
-                                               Exit;
-                               end else begin
-                                       if MsgBox(Handle, StringReplace( DEL_SAME_MSG, '^0', IntToStr( List.Count ), [rfReplaceAll] ), DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> IDYES then
-                                               Exit;
-                               end;
-                       end;
-               end;
-
-               for i := 0 to List.Count - 1 do begin
-                       ThreadItem := TThreadItem(List[i]);
-                       DeleteHistory(ThreadItem);
-                       DeleteTab(ThreadItem);
-                       ThreadItem.DeleteLogFile;
-                       
-                       TreeView.Refresh;       // UnRead \82Ì\95\\8e¦\82ð\8dX\90V
-               end;
-               ListView.Refresh;
-       finally
-               List.Free;
-       end;
-end;
-procedure TGikoForm.DeleteTab(BrowserRecord: TBrowserRecord);
-var
-       i, j, idx: Integer;
-       doc: Variant;
-begin
-       idx := BrowserTab.TabIndex;
-       FTabHintIndex := -1;
-       for i := 0 to BrowserTab.Tabs.Count - 1 do begin
-               if TBrowserRecord(BrowserTab.Tabs.Objects[i]) = BrowserRecord then begin
-                       BrowserTab.Tabs.BeginUpdate;
-                       try
-                               if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser <> nil then begin
-                                       doc := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser.Document;
-                                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ScrollTop := doc.Body.ScrollTop;
-                               end;
-                       except
-                               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ScrollTop := 0;
-                       end;
-                       if( FActiveContent = TBrowserRecord(BrowserTab.Tabs.Objects[i]) ) then
-                               FActiveContent := nil;
-                       if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser <> nil then begin
-                               j := FBrowsers.IndexOf(TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser);
-                               if j <> -1 then
-                                       FBrowsers.Move(j, BROWSER_COUNT - 1);
-                       end;
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Free;
-                       BrowserTab.Tabs.Delete(i);
-                       if idx > i then begin
-                               BrowserTab.TabIndex := idx - 1;
-                       end else begin
-                               if BrowserTab.Tabs.Count -1 >= idx then
-                                       BrowserTab.TabIndex := idx
-                               else
-                                       BrowserTab.TabIndex := BrowserTab.Tabs.Count - 1;
-                       end;
-                       if BrowserTab.Tabs.Count = 0 then begin
-                               BrowserNullTab.Thread := nil;
-                       end;
-                       if(BrowserTab.TabIndex <> -1) and
-                               ( TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser = nil) then begin
-                               for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                                       if(TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser
-                                                = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) )then
-                                       begin
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser := nil;
-                                               if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent <> nil then begin
-                                                       TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent.Free;
-                                                       TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent := nil;
-                                               end;
-                                               break;
-                                       end;
-                               end;
-                               TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser
-                                        :=  TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
-                               TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Repaint := true;
-                               FBrowsers.Move(BROWSER_COUNT - 1, 0);
-                       end;
-                       BrowserTab.Tabs.EndUpdate;
-                       if( FActiveContent = nil) then
-                               BrowserTab.OnChange(nil);
-                       Exit;
-               end;
-       end;
-end;
-procedure TGikoForm.DeleteTab(ThreadItem: TThreadItem);
-var
-       i, j, idx: Integer;
-       doc: Variant;
-begin
-       idx := BrowserTab.TabIndex;
-       FTabHintIndex := -1;
-       for i := 0 to BrowserTab.Tabs.Count - 1 do begin
-               if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
-                       BrowserTab.Tabs.BeginUpdate;
-                       try
-                               if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser <> nil then begin
-                                       doc := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser.Document;
-                                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ScrollTop := doc.Body.ScrollTop;
-
-                               end;
-                       except
-                               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ScrollTop := 0;
-                       end;
-                       if(FActiveContent = TBrowserRecord(BrowserTab.Tabs.Objects[i])) then
-                               FActiveContent := nil;
-                       if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser <> nil then begin
-                               j := FBrowsers.IndexOf(TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser);
-                               if j <> -1 then
-                                       FBrowsers.Move(j, BROWSER_COUNT - 1);
-                       end;
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Free;
-                       BrowserTab.Tabs.Delete(i);
-                       if idx > i then begin
-                               BrowserTab.TabIndex := idx - 1;
-                       end else begin
-                               if BrowserTab.Tabs.Count -1 >= idx then
-                                       BrowserTab.TabIndex := idx
-                               else
-                                       BrowserTab.TabIndex := BrowserTab.Tabs.Count - 1;
-                       end;
-                       if(BrowserTab.TabIndex <> -1) and
-                               ( TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser = nil) then begin
-                               for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                                       if(TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser
-                                                = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) )then
-                                       begin
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser := nil;
-                                               if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent <> nil then begin
-                                                       TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent.Free;
-                                                       TBrowserRecord(BrowserTab.Tabs.Objects[j]).FEvent := nil;
-                                               end;
-                                               break;
-                                       end;
-                               end;
-                               TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser
-                                        :=  TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
-                               TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Repaint := true;
-                               FBrowsers.Move(BROWSER_COUNT - 1, 0);
-                       end;
-
-                       BrowserTab.Tabs.EndUpdate;
-                       if( FActiveContent = nil) then
-                               BrowserTab.OnChange(nil);
-                       Exit;
-               end;
-       end;
-end;
-
-procedure TGikoForm.KokomadeActionExecute(Sender: TObject);
-var
-       No: Integer;
-       ThreadItem: TThreadItem;
-begin
-       No := KokoPopupMenu.Tag;
-       if No = 0 then Exit;
-       ThreadItem := GetActiveContent;
-       if ThreadItem = nil then Exit;
-       ThreadItem.Kokomade := No;
-       FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
-       FActiveContent.FRepaint := true;
-       InsertBrowserTab(FActiveContent.Thread, true);
-       Application.ProcessMessages;
-end;
-
-procedure TGikoForm.ZenbuActionExecute(Sender: TObject);
-var
-       ThreadItem: TThreadItem;
-begin
-       ThreadItem := GetActiveContent;
-       if ThreadItem = nil then Exit;
-       ThreadItem.Kokomade := -1;
-       FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
-       FActiveContent.FRepaint := true;
-       InsertBrowserTab(FActiveContent.Thread, true);
-       Application.ProcessMessages;
-end;
-
-function TGikoForm.Hook(var Message: TMessage): Boolean;
-begin
-       Result := False;
-       case Message.Msg of
-       CM_APPKEYDOWN:
-               Result := True;
-       end;
-end;
-
-procedure TGikoForm.KokoResActionExecute(Sender: TObject);
-var
-       Editor: TEditorForm;
-       Item: TThreadItem;
-       Number: Integer;
-begin
-       Number := KokoPopupMenu.Tag;
-       if Number = 0 then Exit;
-       Item := GetActiveContent;
-       if Item = nil then Exit;
-
-       Editor := TEditorForm.Create(Self);
-       Editor.SetThreadItem(Item);
-    GikoSys.LoadEditorKeySetting(Editor.ActionList);
-       Editor.BodyEdit.Text := '>>' + IntToStr(Number) + #13#10;
-       Editor.Show;
-       Editor.BodyEdit.SetFocus;
-end;
-
-procedure TGikoForm.ListPopupMenuPopup(Sender: TObject);
-begin
-       ItemRoundPMenu.Visible := (GetActiveList is TBoard);
-       ItemReservPMenu.Visible := (GetActiveList is TBoard);
-       LPMSep01.Visible := (GetActiveList is TBoard);
-       ListRoundPMenu.Visible := (GetActiveList is TCategory);// or (GetActiveList is TBoard);
-       ListReservPMenu.Visible := (GetActiveList is TCategory);// or (GetActiveList is TBoard);
-       LPMSep02.Visible := (GetActiveList is TCategory) or (GetActiveList is TBoard);
-       KidokuPMenu.Visible := (GetActiveList is TBoard);
-       MidokuPMenu.Visible := (GetActiveList is TBoard);
-       UrlCopyPMenu.Visible := (GetActiveList is TCategory) or (GetActiveList is TBoard);
-       NameUrlCopyPMenu.Visible := (GetActiveList is TCategory) or (GetActiveList is TBoard);
-       AllSelectPMenu.Visible := (GetActiveList is TCategory) or (GetActiveList is TBoard);
-       LPMSep05.Visible := (GetActiveList is TCategory) or (GetActiveList is TBoard);
-       DeletePMenu.Visible := (GetActiveList is TBoard);
-       LPMSep06.Visible := (GetActiveList is TCategory) or (GetActiveList is TBoard);
-       BoardFavoriteAddMenu.Visible := (GetActiveList is TCategory);
-       ThreadFavoriteAddMenu.Visible := (GetActiveList is TBoard);
-
-       AddRoundNameMenu(ItemReservPMenu);
-       AddRoundNameMenu(ListReservPMenu);
-end;
-
-procedure TGikoForm.BoardIEActionExecute(Sender: TObject);
-var
-       URL: string;
-begin
-       if GetActiveList is TBoard then begin
-               URL := TBoard(GetActiveList).URL;
-               GikoSys.OpenBrowser(URL, gbtAuto);
-       end;
-end;
-
-procedure TGikoForm.SelectItemURLCopyActionExecute(Sender: TObject);
-var
-       List: TList;
-       i: Integer;
-       s: string;
-begin
-       s := '';
-       List := TList.Create;
-       try
-               SelectListItem(List);
-               for i := 0 to List.Count - 1 do begin
-                       if TObject(List[i]) is TBoard then
-                               s := s + TBoard(List[i]).URL + #13#10
-                       else if TObject(List[i]) is TThreadItem then
-                               s := s + TThreadItem(List[i]).URL + #13#10;
-               end;
-               if s <> '' then
-                       Clipboard.AsText := s;
-       finally
-               List.Free;
-       end;
-end;
-
-procedure TGikoForm.SelectItemNameCopyActionExecute(Sender: TObject);
-var
-       List: TList;
-       i: Integer;
-       s: string;
-begin
-       s := '';
-       List := TList.Create;
-       try
-               SelectListItem(List);
-               for i := 0 to List.Count - 1 do begin
-                       if TObject(List[i]) is TBoard then
-                               s := s + TBoard(List[i]).Title + #13#10
-                       else if TObject(List[i]) is TThreadItem then
-                               s := s + TThreadItem(List[i]).Title + #13#10;
-               end;
-               if s <> '' then
-                       Clipboard.AsText := s;
-       finally
-               List.Free;
-       end;
-end;
-
-procedure TGikoForm.SelectItemNameURLCopyActionExecute(Sender: TObject);
-var
-       List: TList;
-       i: Integer;
-       s: string;
-begin
-       s := '';
-       List := TList.Create;
-       try
-               SelectListItem(List);
-               for i := 0 to List.Count - 1 do begin
-                       if TObject(List[i]) is TBoard then
-                               s := s + TBoard(List[i]).Title + #13#10 + TBoard(List[i]).URL + #13#10
-                       else if TObject(List[i]) is TThreadItem then
-                               s := s + TThreadItem(List[i]).Title + #13#10 + TThreadItem(List[i]).URL + #13#10;
-               end;
-               if s <> '' then
-                       Clipboard.AsText := s;
-       finally
-               List.Free;
-       end;
-end;
-
-procedure TGikoForm.BoardIEActionUpdate(Sender: TObject);
-begin
-       if GetActiveList is TBoard then
-               BoardIEAction.Enabled := True
-       else
-               BoardIEAction.Enabled := False;
-end;
-
-procedure TGikoForm.SelectItemURLCopyActionUpdate(Sender: TObject);
-begin
-       if ((GetActiveList is TBoard) or (GetActiveList is TCategory))and (ListView.SelCount > 0) then
-               SelectItemURLCopyAction.Enabled := True
-       else
-               SelectItemURLCopyAction.Enabled := False;
-end;
-
-procedure TGikoForm.SelectItemNameCopyActionUpdate(Sender: TObject);
-begin
-       if ((GetActiveList is TBoard) or (GetActiveList is TCategory))and (ListView.SelCount > 0) then
-               SelectItemNameCopyAction.Enabled := True
-       else
-               SelectItemNameCopyAction.Enabled := False;
-end;
-
-procedure TGikoForm.SelectItemNameURLCopyActionUpdate(Sender: TObject);
-begin
-       if ((GetActiveList is TBoard) or (GetActiveList is TCategory))and (ListView.SelCount > 0) then
-               SelectItemNameURLCopyAction.Enabled := True
-       else
-               SelectItemNameURLCopyAction.Enabled := False;
-end;
-
-procedure TGikoForm.AllSelectActionUpdate(Sender: TObject);
-begin
-       if ListView.SelCount > 0 then
-               AllSelectAction.Enabled := True
-       else
-               AllSelectAction.Enabled := False;
-end;
-
-procedure TGikoForm.LogDeleteActionUpdate(Sender: TObject);
-begin
-       if (GetActiveList is TBoard) and (ListView.SelCount > 0) then
-               LogDeleteAction.Enabled := True
-       else
-               LogDeleteAction.Enabled := False;
-end;
-
-procedure TGikoForm.BrowserTabCloseActionExecute(Sender: TObject);
-var
-       idx: Integer;
-//     ThreadItem: TThreadItem;
-begin
-       idx := BrowserTab.TabIndex;
-       if idx <> -1 then begin
-               if BrowserTab.Tabs.Objects[idx] <> nil then begin
-                       //ThreadItem := TThreadItem(BrowserTab.Tabs.Objects[idx]);
-                       DeleteTab(TBrowserRecord(BrowserTab.Tabs.Objects[idx]));
-               end;
-       end;
-end;
-
-procedure TGikoForm.NotSelectTabCloseActionExecute(Sender: TObject);
-var
-       i: Integer;
-       idx: Integer;
-begin
-       idx := BrowserTab.TabIndex;
-       if idx = -1 then Exit;
-       BrowserTab.Tabs.BeginUpdate;
-       for i := BrowserTab.Tabs.Count - 1 downto BrowserTab.TabIndex + 1 do begin
-               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Free;
-               BrowserTab.Tabs.Delete(i);
-       end;
-       if idx > 0 then begin
-               for i := BrowserTab.TabIndex - 1 downto 0 do begin
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Free;
-                       BrowserTab.Tabs.Delete(i);
-               end;
-       end;
-       BrowserTab.Tabs.EndUpdate;
-end;
-
-procedure TGikoForm.AllTabCloseActionExecute(Sender: TObject);
-var
-       i: Integer;
-begin
-       if GikoSys.Setting.ShowDialogForAllTabClose then
-               if(MessageDlg('\91S\82Ä\82Ì\83^\83u\82ð\95Â\82\82Ä\82æ\82ë\82µ\82¢\82Å\82·\82©\81H', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then
-                       Exit;
-
-       FActiveContent := nil;
-       BrowserNullTab.Thread := nil;
-       BrowserTab.OnChange := nil;
-       BrowserTab.Tabs.BeginUpdate;
-       for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
-               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Free;
-       end;
-       BrowserTab.Tabs.Clear;
-       BrowserTab.Tabs.EndUpdate;
-       BrowserTab.OnChange := BrowserTabChange;
-       SetContent(BrowserNullTab);
-       Self.Caption := CAPTION_NAME ;
-end;
-
-procedure TGikoForm.TreeSelectBoradReloadExecute(Sender: TObject);
-var
-       Board: TBoard;
-       TmpTreeNode: TTreeNode;
-begin
-       TmpTreeNode := FClickNode;
-       TreeView.Selected := FClickNode;
-       Board := nil;
-
-       if TObject(TmpTreeNode.Data) is TBoard then
-               Board := TBoard(TmpTreeNode.Data)
-       else if TObject(TmpTreeNode.Data) is TFavoriteBoardItem then
-               Board := TFavoriteBoardItem(TmpTreeNode.Data).Item;
-
-       if Board <> nil then
-               DownloadList(Board);
-end;
-
-procedure TGikoForm.TreeSelectThreadReloadExecute(Sender: TObject);
-var
-       ThreadItem: TThreadItem;
-       TmpTreeNode: TTreeNode;
-begin
-       TmpTreeNode := FClickNode;
-       TreeView.Selected := FClickNode;
-       ThreadItem := nil;
-
-       if TObject(TmpTreeNode.Data) is TThreadItem then
-               ThreadItem := TThreadItem(TmpTreeNode.Data)
-       else if TObject(TmpTreeNode.Data) is TFavoriteThreadItem then
-               ThreadItem := TFavoriteThreadItem(TmpTreeNode.Data).Item;
-
-       if ThreadItem <> nil then
-               DownloadContent(ThreadItem);
-end;
-
-procedure TGikoForm.TreeSelectURLCopyExecute(Sender: TObject);
-var
-       TmpTreeNode: TTreeNode;
-       s: string;
-begin
-       TmpTreeNode := FClickNode;
-       TreeView.Selected := FClickNode;
-       if TObject(TmpTreeNode.Data) is TBoard then begin
-               s := TBoard(TmpTreeNode.Data).URL + #13#10;
-       end else if TObject(TmpTreeNode.Data) is TFavoriteBoardItem then begin
-               s := TFavoriteBoardItem(TmpTreeNode.Data).URL + #13#10;
-       end else if (TObject(TmpTreeNode.Data) is TThreadItem) then begin
-               s := TThreadItem(TmpTreeNode.Data).URL + #13#10;
-       end else if TObject(TmpTreeNode.Data) is TFavoriteThreadItem then begin
-               s := TFavoriteThreadItem(TmpTreeNode.Data).URL + #13#10;
-       end;
-       Clipboard.AsText := s;
-end;
-
-procedure TGikoForm.TreeSelectNameURLCopyExecute(Sender: TObject);
-var
-       TmpTreeNode: TTreeNode;
-       s: string;
-begin
-       TmpTreeNode := FClickNode;
-       TreeView.Selected := FClickNode;
-       if TObject(TmpTreeNode.Data) is TBoard then begin
-               s := TBoard(TmpTreeNode.Data).Title + #13#10 + TBoard(TmpTreeNode.Data).URL + #13#10;
-       end else if TObject(TmpTreeNode.Data) is TFavoriteBoardItem then begin
-               s := TFavoriteBoardItem(TmpTreeNode.Data).Item.Title + #13#10 + TFavoriteBoardItem(TmpTreeNode.Data).URL + #13#10;
-       end else if (TObject(TmpTreeNode.Data) is TThreadItem) then begin
-               s := TThreadItem(TmpTreeNode.Data).Title + #13#10 + TThreadItem(TmpTreeNode.Data).URL + #13#10;
-       end else if TObject(TmpTreeNode.Data) is TFavoriteThreadItem then begin
-               s := TFavoriteThreadItem(TmpTreeNode.Data).Item.Title + #13#10 + TFavoriteThreadItem(TmpTreeNode.Data).URL + #13#10;
-       end;
-       Clipboard.AsText := s;
-end;
-
-procedure TGikoForm.TreePopupMenuPopup(Sender: TObject);
+procedure TGikoForm.TreePopupMenuPopup(Sender: TObject);
 begin
        FClickNode := TreeView.Selected;
        if FClickNode = nil then begin
@@ -6298,37 +3771,70 @@ var
        idx: Integer;
        wkIntSt: Integer;
        wkIntTo: Integer;
+    BNum, BRes: string;
+    threadItem: TThreadItem;
+    aElement : IHTMLElement;
 begin
-
+{$IFDEF DEBUG}
+       Writeln(IntToStr(Integer(ppDisp)));
+{$ENDIF}
        Cancel := True;
-       if (IHTMLDocument2(TWebBrowser(Sender).Document).activeElement <> nil) then begin
-               Text := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement.Get_outerText;
-               Html := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement.Get_outerHTML;
+    aElement := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement;
+       if ( aElement <> nil) then begin
+               Text := aElement.Get_outerText;
+               Html := aElement.Get_outerHTML;
                if(AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1)
                        or (AnsiPos('\81\84\81\84', Text) = 1) or (AnsiPos('\81\84', Text) = 1) then begin
                        if GikoSys.Setting.ResAnchorJamp then begin
-                               Text := ZenToHan(Text);
+
+                               Text := ZenToHan(Trim(Text));
 
                                if(AnsiPos('>>', Text) = 1) then begin
-                                       Text := Copy(Text, 3, Length(Text) - 2);
+                                       //Text := Copy(Text, 3, Length(Text) - 2);
+                                       Delete(Text, 1, 2);
                                end else begin
-                                       Text := Copy(Text, 2, Length(Text) - 1);
+                                       //Text := Copy(Text, 2, Length(Text) - 1);
+                                       Delete(Text, 1, 1);
                                end;
+
                                if AnsiPos('-', Text) <> 0 then begin
                                        wkIntSt := StrToIntDef(Copy(Text, 1, AnsiPos('-', Text) - 1), 0);
                                        Text := Copy(Text, AnsiPos('-', Text) + 1, Length(Text));
                                        wkIntTo := StrToIntDef(Text, 0);
                                        if wkIntTo < wkIntSt then
                                                wkIntSt := wkIntTo;
-                               end else
+                               end else begin
                                        wkIntSt := StrToIntDef(Text, 0);
+                               end;
 
-                               if wkIntSt <> 0 then
-                                       BrowserMovement(IntToStr(wkIntSt));
+                               if wkIntSt <> 0 then begin
+                       FActiveContent.IDAnchorPopup('');
+                    MoveHisotryManager.pushItem(FActiveContent);
+                    if (Sender is TResPopupBrowser) then begin
+                        TResPopupBrowser(Sender).ChildClear;
+                        OpenThreadItem(
+                            GetActiveContent(true),
+                            GetActiveContent(true).URL + '&st=' +
+                                 IntToStr(wkIntSt) + '&to=' + IntToStr(wkIntSt));
+                    end else begin
+                                       BrowserMovement(IntToStr(wkIntSt));
+                    end;
+                end;
                        end;
                end else begin
+            ////'http://be.2ch.net/test/p.php?i='+id+'&u=d:'+bas+num
+
                        URL := GikoSys.GetHRefText(Html);
                        URL := GikoSys.HTMLDecode(URL);
+            if AnsiPos('BE:', URL) = 1 then begin
+                               BNum := Copy(URL, 4, AnsiPos('/', URL) - 4);
+                               BRes := Copy(URL, AnsiPos('/', URL) + 1,  Length(URL));
+                threadItem := FActiveContent.Thread;
+                if threadItem = nil then Exit;
+                URL := BE_PHP_URL + BNum + '&u=d'
+                       + CustomStringReplace(threadItem.URL, 'l50', '') + BRes;
+            end;
+
                        if( AnsiPos('http://', URL) = 1) or (AnsiPos('https://', URL) = 1) or
                                ( AnsiPos('ftp://', URL) = 1) then begin
                                //\83A\83h\83\8c\83X\83o\81[\82Ì\97\9a\97ð
@@ -6343,89 +3849,60 @@ begin
                                                AddressComboBox.Items.Insert(0, URL);
                                        end;
                                end;
+                if (Sender is TResPopupBrowser) then begin
+                    TResPopupBrowser(Sender).ChildClear
+                end;
+
+                MoveHisotryManager.pushItem(FActiveContent);
                                MoveToURL( URL );
                        end;
                end;
-       end;
-
-{      ShiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
-       CtrlDown := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);
-
-       if ShiftDown then
-               Memo1.Lines.Add('ShiftDown');
-       if CtrlDown then
-               Memo1.Lines.Add('CtrlDown');
-
-       if      (IHTMLDocument2(TWebBrowser(Sender).Document).activeElement <> nil) then        begin
-               Text := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement.Get_outerText;
-               Url := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement.Get_outerHTML;
-
-
-
-               URL := GetHRefText(URL);
-
-               ParseURI(URL, Protocol, Host, path, Document, Port, Bookmark);
-
-               b := Parse2chURL(path, document, bbs, num);
-               memo1.Lines.Add('bbs: ' + bbs);
-               memo1.Lines.Add('key: ' + num);
-               if b then
-                       Memo1.Lines.Add('Parse2chURL: True')
-               else
-                       Memo1.Lines.Add('Parse2chURL: False');
-
-//     AppPath := 'C:\Borland\Projects\Test\TestBrowser\TestBrowser.exe';
+    end;
 
-       end;}
 end;
 
-procedure TGikoForm.ListSplitterCanResize(Sender: TObject;
-       var NewSize: Integer; var Accept: Boolean);
+procedure TGikoForm.ListSplitterMoved(Sender: TObject);
 begin
+       if Mouse.Capture <> 0 then
+               Exit;
+       if GikoSys.Setting.ListOrientation = gloHorizontal then begin
+               if (ViewPanel.Width > 1) and (ViewPanel.Width <= (ThreadMainPanel.Width - 80)) then
+                       FBrowserSizeWidth := ViewPanel.Width;
+       end else begin
+               if (ViewPanel.Height > 1) and (ViewPanel.Height <= (ThreadMainPanel.Height - BrowserCoolBar.Height)) then
+                       FBrowserSizeHeight := ViewPanel.Height;
+       end;
        if GikoSys.Setting.ListOrientation = gloHorizontal then begin
                if ViewPanel.Width < 2 then begin
                        ViewPanel.Width := 1;
-                       BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
-                       BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
+                       GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
+                       GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
                        GikoSys.Setting.ListWidthState := glsMax;
                end else if ViewPanel.Width > (ThreadMainPanel.Width - 80) then begin
-                       BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                       BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
+                       GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
+                       GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
                        GikoSys.Setting.ListWidthState := glsMin;
                end else begin
-                       BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                       BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
+                       GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
+                       GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
                        GikoSys.Setting.ListWidthState := glsNormal;
                end;
        end else begin
                if ViewPanel.Height < 2 then begin
                        ViewPanel.Height := 1;
-                       BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
-                       BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
+                       GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
+                       GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
                        GikoSys.Setting.ListHeightState := glsMax;
                end else if ViewPanel.Height > (ThreadMainPanel.Height - BrowserCoolBar.Height - 7) then begin
-                       BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                       BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
+                       GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
+                       GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
                        GikoSys.Setting.ListHeightState := glsMin;
                end else begin
-                       BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                       BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
+                       GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
+                       GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
                        GikoSys.Setting.ListHeightState := glsNormal;
                end;
        end;
-end;
-
-procedure TGikoForm.ListSplitterMoved(Sender: TObject);
-begin
-       if Mouse.Capture <> 0 then
-               Exit;
-       if GikoSys.Setting.ListOrientation = gloHorizontal then begin
-               if (ViewPanel.Width > 1) and (ViewPanel.Width <= (ThreadMainPanel.Width - 80)) then
-                       FBrowserSizeWidth := ViewPanel.Width;
-       end else begin
-               if (ViewPanel.Height > 1) and (ViewPanel.Height <= (ThreadMainPanel.Height - BrowserCoolBar.Height)) then
-                       FBrowserSizeHeight := ViewPanel.Height;
-       end;
 {      if (Mouse.Capture = 0) and (ViewPanel.Height > 1) and (not ArrangeAction.Checked) then
                FBrowserSizeHeight := ViewPanel.Height
        else if (Mouse.Capture = 0) and (ViewPanel.Width > 1) and (ArrangeAction.Checked) then
@@ -6434,63 +3911,53 @@ end;
 
 procedure TGikoForm.BrowserTabChange(Sender: TObject);
 var
-       i, j: Integer;
+       j: Integer;
        idx: Integer;
 begin
+       BrowserTab.Tabs.BeginUpdate;
+       try
+               if not BrowserTab.Dragging then begin
+                       FTabHintIndex := -1;
+                       BrowserTab.Hint := '';
+                       idx := BrowserTab.TabIndex;
+                       if idx = -1 then begin
+                               SetContent(BrowserNullTab);
+
+                       end else if(BrowserTab.Tabs.Objects[idx] <> nil) and (BrowserTab.Tabs.Objects[idx] is TBrowserRecord) then begin
+                               if TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser <> nil then begin
+                                       j := FBrowsers.IndexOf(TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser);
+                                       if j <> -1 then
+                                               FBrowsers.Move(j ,0);
+                               end else begin
+                                       if( FActiveContent <> nil ) and (FActiveContent.Browser <> nil) and
+                                               (FActiveContent.Browser <> BrowserNullTab.Browser) and
+                                               (FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1])) then
+                                               FBrowsers.Move(BROWSER_COUNT - 1, 0);
 
-//     if NewTab = -1 then
-//     ThreadItem := nil;
-       if not BrowserTab.Dragging then begin
-               FTabHintIndex := -1;
-               BrowserTab.Hint := '';
-               idx := BrowserTab.TabIndex;
-               if idx = -1 then begin
-                       BrowserNullTab.Thread := nil;
-                       SetContent(BrowserNullTab);
-
-               end else if(BrowserTab.Tabs.Objects[idx] <> nil) and (BrowserTab.Tabs.Objects[idx] is TBrowserRecord) then begin
-                       if TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser <> nil then begin
-                               j := FBrowsers.IndexOf(TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser);
-                               if j <> -1 then
-                                       FBrowsers.Move(j ,0);
-                       end else begin
-                               if( FActiveContent <> nil ) and (FActiveContent.Browser <> nil) and
-                                       (FActiveContent.Browser <> BrowserNullTab.Browser) and
-                                       (FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1])) then
-                                       FBrowsers.Move(BROWSER_COUNT - 1, 0);
+                    // \88ê\94Ô\8cÃ\82¢\83u\83\89\83E\83U\82ð\8aJ\95ú\82·\82é
+                    ReleaseOldestBrowser;
 
-                               for i := 0 to BrowserTab.Tabs.Count - 1 do begin
-                                       if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := nil;
-                                               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-                                               if TBrowserRecord(BrowserTab.Tabs.Objects[i]).FEvent <> nil then begin
-                                                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).FEvent.Free;
-                                                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).FEvent := nil;
-                                               end;
-                                       end;
+                                       TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
+                                       TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Repaint := true;
+                                       FBrowsers.Move(BROWSER_COUNT - 1, 0);
                                end;
-                               TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
-                               TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Repaint := true;
-                               FBrowsers.Move(BROWSER_COUNT - 1, 0);
-                       end;
-                       TOleControl(TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser).BringToFront;
-//                     GikoSys.OnlyAHundredRes := TBrowserRecord(BrowserTab.Tabs.Objects[idx]).OnlyHundred;
-//                     OnlyAHundredRes.Checked := TBrowserRecord(BrowserTab.Tabs.Objects[idx]).OnlyHundred;
-                       SetContent(TBrowserRecord(BrowserTab.Tabs.Objects[idx]));
-
-                       if (GikoSys.Setting.URLDisplay) and (GetActiveContent <> nil) then
-                               AddressComboBox.Text := GetActiveContent.URL;
+                               MoveWindow(TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser.Handle, 0, 0, BrowserPanel.Width, BrowserPanel.Height, false);
+                               TOleControl(TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser).BringToFront;
+                               SetContent(TBrowserRecord(BrowserTab.Tabs.Objects[idx]));
 
-                       if ((TreeView.Visible) and (TreeView.Focused)) or ((FavoriteTreeView.Visible) and (FavoriteTreeView.Focused)) or
-                               (ListView.Focused) or (SelectComboBox.Focused) or (AddressComboBox.Focused)
-                       then
-                       else
-               SetFocusForBrowserAction.Execute;       
+                               if (GikoSys.Setting.URLDisplay) and (GetActiveContent <> nil) then
+                                       AddressComboBox.Text := GetActiveContent.URL;
 
+                               if ((TreeView.Visible) and (TreeView.Focused)) or ((FavoriteTreeView.Visible) and (FavoriteTreeView.Focused)) or
+                                       (ListView.Focused) or (SelectComboBox.Focused) or (AddressComboBox.Focused)
+                               then
+                               else
+                                       GikoDM.SetFocusForBrowserAction.Execute;
+                       end;
                end;
-
+       finally
+               BrowserTab.Tabs.EndUpdate;
        end;
-
 end;
 
 
@@ -6509,26 +3976,7 @@ begin
                idx := BrowserTab.IndexOfTabAt(p.X, p.Y);
                if idx <> -1 then
                        DeleteTab(TBrowserRecord(BrowserTab.Tabs.Objects[idx]));
-       //end else if Button = mbRight then begin
-       //PopupMenu\82ÅBrowserTabPoupMenu\82ð\8ew\92è\82µ\82Ä\82¢\82é\82Ì\82Å\82±\82±\82Å\82í\82´\82í\82´\8cÄ\82Ñ\8fo\82·\82Æ\82Q\8fd\82É\82È\82é
-       //OnContextPopup\82Å\82à\82µ\82àActive\82ÈTab\88È\8aO\82Å\8cÄ\82Ñ\8fo\82³\82ê\82½\82çTab\82ð\90Ø\82è\91Ö\82¦\82é\82æ\82¤\82É\82µ\82½\81B
-{              // \83}\83E\83X\89E\83{\83^\83\93
-               GetCursorPos(p);
-               p2 := p;
-//             GetCursorPos(p2);
-               p := BrowserTab.ScreenToClient(p);
-//             idx := BrowserTab.ItemAtPos(p);
-               idx := BrowserTab.IndexOfTabAt(p.X, p.Y);
-               if idx <> -1 then begin
-                       OldIndex := BrowserTab.TabIndex;
-                       BrowserTab.TabIndex := idx;
-                       if OldIndex <> idx then
-                               BrowserTab.OnChange(nil);
-                       BrowserTabPopupMenu.Tag := idx;
-                       BrowserTabPopupMenu.Popup(p2.X, p2.Y);
-               end;
-}
-       end else if BUtton = mbLeft then begin
+       end else if Button = mbLeft then begin
                FDragWFirst := true;
                FMouseDownPos.X := X;
                FMouseDownPos.Y := Y;
@@ -6538,55 +3986,52 @@ end;
 
 procedure TGikoForm.SetBrowserTabState;
 var
-//     i: Integer;
        CoolBand: TCoolBand;
 begin
        BrowserBottomPanel.AutoSize := False;
        if GikoSys.Setting.BrowserTabVisible then begin
-               if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
-                       BrowserTab.Style := tsTabs;
-                       if GikoSys.Setting.BrowserTabPosition = gtpTop then
-                               BrowserTab.TabPosition := tpTop
-                       else
-                               BrowserTab.TabPosition := tpBottom;
-               end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
-                       BrowserTab.TabPosition := tpTop;
-                       BrowserTab.Style := tsButtons;
-               end else begin
-                       BrowserTab.TabPosition := tpTop;
-                       BrowserTab.Style := tsFlatButtons
-               end;
-
-               if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
-                       BrowserTab.Parent := BrowserTabToolBar;
-                       BrowserBottomPanel.Hide;
-                       CoolBand := GetCoolBand(BrowserCoolBar, BrowserTabToolBar);
-                       if CoolBand <> nil then
-                               CoolBand.Visible := True;
-//                     BrowserTab.Parent := BrowserTopPanel;
-//                     BrowserTab.Parent := BrowserCoolBar;
-//                     BrowserTab.Top := 26;
-//                     BrowserTopPanel.Height := 44;
+               BrowserTab.Hide;
+               BrowserTab.Tabs.BeginUpdate;
+               try
+                       if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
+                               BrowserTab.Style := tsTabs;
+                               if GikoSys.Setting.BrowserTabPosition = gtpTop then
+                                       BrowserTab.TabPosition := tpTop
+                               else
+                                       BrowserTab.TabPosition := tpBottom;
+                       end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
+                               BrowserTab.TabPosition := tpTop;
+                               BrowserTab.Style := tsButtons;
+                       end else begin
+                               BrowserTab.TabPosition := tpTop;
+                               BrowserTab.Style := tsFlatButtons
+                       end;
 
-               end else begin
-                       BrowserTab.Parent := BrowserBottomPanel;
-                       BrowserTab.Top := 0;
-                       BrowserTab.Left := 0;
-                       BrowserBottomPanel.Show;
-                       CoolBand := GetCoolBand(BrowserCoolBar, BrowserTabToolBar);
-                       if CoolBand <> nil then
-                               CoolBand.Visible := False;
-//                     BrowserTopPanel.Height := 26;
-               end;
-               BrowserTab.Show;
+                       if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
+                               BrowserTab.Parent := BrowserTabToolBar;
+                               BrowserBottomPanel.Hide;
+                               CoolBand := GetCoolBand(BrowserCoolBar, BrowserTabToolBar);
+                               if CoolBand <> nil then
+                                       CoolBand.Visible := True;
+                       end else begin
+                               BrowserTab.Parent := BrowserBottomPanel;
+                               BrowserTab.Top := 0;
+                               BrowserTab.Left := 0;
+                               BrowserBottomPanel.Show;
+                               CoolBand := GetCoolBand(BrowserCoolBar, BrowserTabToolBar);
+                               if CoolBand <> nil then
+                                       CoolBand.Visible := False;
+                       end;
+               finally
+                       BrowserTab.Tabs.EndUpdate;
+                       BrowserTab.Show;
+               end;
        end else begin
                CoolBand := GetCoolBand(BrowserCoolBar, BrowserTabToolBar);
                if CoolBand <> nil then
                        CoolBand.Visible := False;
                BrowserBottomPanel.Visible := False;
-//             BrowserTab.Visible := False;
-//             BrowserTopPanel.Height := 26;
-               AllTabCloseAction.Execute;
+               GikoDM.AllTabCloseAction.Execute;
        end;
 end;
 
@@ -6604,6 +4049,7 @@ procedure TGikoForm.BrowserTabDragDrop(Sender, Source: TObject; X,
 var
        idx: Integer;
 begin
+    FDragWFirst := False;
        idx := BrowserTab.IndexOfTabAt(X, Y);
        if idx <> -1 then
                BrowserTab.Tabs.Move(BrowserTab.TabIndex, idx);
@@ -6618,14 +4064,11 @@ begin
 
        TabIdx := BrowserTab.IndexOfTabAt(x, y);
 
-       if ( ssLeft in Shift ) and ( BrowserTab.Style = tsTabs ) then begin
-               if FDragWFirst = false then begin
-                       FDragWFirst := true;
-               end else begin
+       if ( ssLeft in Shift ) then begin
+        if (FDragWFirst) then begin
                        BrowserTab.EndDrag(false);
                        BrowserTab.BeginDrag(false, DandD_THRESHOLD);
-                       FDragWFirst := false;
-               end;
+        end;
        end else begin
                BrowserTab.EndDrag(false);
                FDragWFirst := false;
@@ -6655,7 +4098,6 @@ var
        doc                                     : Variant;
        threadItem      : TThreadItem;
 begin
-//     AddMessageList('DocumentComplete', nil, gmiWhat);
        if TObject(Sender) is TWebBrowser then begin
                BrowserRecord := nil;
                if TWebBrowser(Sender) <> Browser then begin
@@ -6666,12 +4108,12 @@ begin
                                end;
                        end;
                        if BrowserRecord <> nil then begin
-                               if BrowserRecord.FEvent <> nil then
-                                       BrowserRecord.FEvent.Free;
+                               if BrowserRecord.Event <> nil then
+                                       BrowserRecord.Event.Free;
                                FDispHtmlDocument := Idispatch(OleVariant(BrowserRecord.Browser.ControlInterface).Document) as DispHTMLDocument;
-                               BrowserRecord.FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
-                               BrowserRecord.FEvent.OnContextMenu := OnDocumentContextMenu;
-                               BrowserRecord.FEvent.OnClick := WebBrowserClick;  //\92Ç\89Á\82µ\82½OnClick\83C\83x\83\93\83g
+                               BrowserRecord.Event := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
+                               BrowserRecord.Event.OnContextMenu := OnDocumentContextMenu;
+                               BrowserRecord.Event.OnClick := WebBrowserClick;  //\92Ç\89Á\82µ\82½OnClick\83C\83x\83\93\83g
                        end;
                end else begin
                        if GetActiveContent <> nil then begin
@@ -6681,21 +4123,39 @@ begin
                                FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
                                FEvent.OnContextMenu := OnDocumentContextMenu;
                                FEvent.OnClick := WebBrowserClick;  //\92Ç\89Á\82µ\82½OnClick\83C\83x\83\93\83g
+                       end else begin
+                               if FEvent <> nil then begin
+                                       FEvent.Free;
+                                       FEvent := nil;
+                               end;
                        end;
+
                end;
 
                if (BrowserRecord <> nil) and
                         Assigned( BrowserRecord.Thread ) then begin
                        threadItem := BrowserRecord.Thread;
 
-                       if (BrowserRecord <> nil) and (Length( BrowserRecord.Movement ) > 0) then begin
-                threadItem.UnRead := False;
-                               BrowserMovement( BrowserRecord.Movement, BrowserRecord );
-                               BrowserRecord.Movement := '';
+                       if (threadItem.JumpAddress > 0) then begin
+                               if threadItem.UnRead then begin
+                                       threadItem.UnRead := False;
+                                       TreeView.Refresh;
+                                       RefreshListView(threadItem);
+                               end;
+                               // \83X\83N\83\8d\81[\83\8b\90æ\82ª\8eæ\93¾\8aO\82Ì\83\8c\83X\82Ì\8e\9e\82Í\8fI\92[\82É\88Ú\93®
+                               //if (StrToIntDef(BrowserRecord.Movement, 0) <= BrowserRecord.Thread.Count) then begin
+                               if (threadItem.JumpAddress <= BrowserRecord.Thread.Count) then begin
+                                       BrowserRecord.Move(IntToStr(threadItem.JumpAddress));
+                                       threadItem.JumpAddress := 0;
+                               end else begin
+                                       BrowserRecord.Move(IntToStr(BrowserRecord.Thread.Count));
+                               end;
+
                        end else if threadItem.UnRead then begin
                                threadItem.UnRead := False;
-                               BrowserMovement( 'new', BrowserRecord );
-                               ListView.Refresh;
+                               TreeView.Refresh;
+                               BrowserRecord.Move('new');
+                               RefreshListView(threadItem);
                        end else if threadItem.ScrollTop <> 0 then begin
                                try
                                        doc := Idispatch( OleVariant( BrowserRecord.Browser.ControlInterface ).Document ) as IHTMLDocument2;
@@ -6705,513 +4165,116 @@ begin
                                                MsgBox(Handle, E.Message, 'SetContent[ScrollTop<-]', 0);
                                end;
                        end;
-               end;
-       end;
-end;
-
-procedure TGikoForm.SelectReservActionUpdate(Sender: TObject);
-var
-       i: Integer;
-       List: TList;
-begin
-       if (GetActiveList is TBoard) and (ListView.SelCount > 0) then begin
-               List := TList.Create;
-               try
-                       SelectListItem(List);
-                       for i := 0 to List.Count - 1 do begin
-                               if TObject(List[i]) is TThreadItem then begin
-                                       if TThreadItem(List[i]).IsLogFile then begin
-                                               SelectReservAction.Enabled := True;
-                                               Exit;
-                                       end;
-                               end;
-                       end;
-                       SelectReservAction.Enabled := False;
-               finally
-                       List.Free;
-               end;
-       end else if (GetActiveList is TCategory) and (ListView.SelCount > 0) then
-               SelectReservAction.Enabled := True
-       else
-               SelectReservAction.Enabled := False;
-end;
-
-procedure TGikoForm.RoundNamePopupMenuPopup(Sender: TObject);
-begin
-       AddRoundNameMenu(RoundNamePopupMenu.Items);
-end;
-
-procedure TGikoForm.AddRoundNameMenu(MenuItem: TMenuItem);
-var
-       i: Integer;
-       Item: TMenuItem;
-begin
-       MenuItem.Clear;
-       Item := TMenuItem.Create(Self);
-       Item.Caption := '\90V\82µ\82¢\96¼\91O\82Å\8f\84\89ñ\97\\96ñ(&N)...';
-       Item.OnClick := SelectNewRoundNameExecute;
-       MenuItem.Add(Item);
-       Item := TMenuItem.Create(Self);
-       Item.Caption := '\8f\84\89ñ\83\8a\83X\83g\82©\82ç\8dí\8f\9c(&D)';
-       Item.OnClick := SelectDeleteRoundExecute;
-       MenuItem.Add(Item);
-       Item := TMenuItem.Create(Self);
-       Item.Caption := '-';
-       MenuItem.Add(Item);
-       for i := 0 to RoundList.RoundNameList.Count - 1 do begin
-               Item := TMenuItem.Create(Self);
-               Item.Caption := RoundList.RoundNameList[i];
-               Item.OnClick := SetSelectRoundName;
-               MenuItem.Add(Item);
-       end;
-end;
-
-procedure TGikoForm.SelectNewRoundNameExecute(Sender: TObject);
-var
-       s: string;
-       Dlg: TRoundNameDialog;
-
-begin
-       Dlg := TRoundNameDialog.Create(Self);
-       try
-               Dlg.ShowModal;
-               if Dlg.ModalResult <> mrCancel then begin
-                       s := Trim(Dlg.RoundNameEdit.Text);
-                       RoundList.RoundNameList.Add(s);
-                       SetSelectItemRound(True, s, TMenuItem(Sender).Parent.Name);
-            ListView.Refresh;
-               end;
-       finally
-               Dlg.Free;
-       end;
-end;
-procedure TGikoForm.SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string);
-var
-    threadItem : TThreadItem;
-begin
-    if ParentName <> 'dummy1' then begin
-       SetSelectItemRound(RoundFlag, RoundName);
-    end else begin
-       threadItem := GetActiveContent;
-               if threadItem <> nil then begin
-               threadItem.RoundName := RoundName;
-            threadItem.Round := RoundFlag;
-        end;
-    end;
-end;
-
-procedure TGikoForm.SetSelectItemRound(RoundFlag: Boolean; RoundName: string);
-var
-       i: Integer;
-       List: TList;
-begin
-       List := TList.Create;
-       try
-               SelectListItem(List);
-               for i := 0 to List.Count - 1 do begin
-                       if TObject(List[i]) is TBoard then begin
-                               TBoard(List[i]).RoundName := RoundName;
-                               TBoard(List[i]).Round := RoundFlag;
-                       end else if TObject(List[i]) is TThreadItem then begin
-                               if TThreadItem(List[i]).IsLogFile then begin
-                                       TThreadItem(List[i]).RoundName := RoundName;
-                                       TThreadItem(List[i]).Round := RoundFlag;
-                               end;
-                       end;
-               end;
-       finally
-               List.Free;
-       end;
-end;
-
-procedure TGikoForm.SelectDeleteRoundExecute(Sender: TObject);
-begin
-       SetSelectItemRound(False, '', TMenuItem(Sender).Parent.Name);
-       ListView.Refresh;
-end;
-
-procedure TGikoForm.SelectReservActionExecute(Sender: TObject);
-begin
-       // \82±\82Ì\83R\83\81\83\93\83g\8dí\8f\9c\82µ\82Ä\82Í\91Ê\96Ú
-end;
-
-procedure TGikoForm.SetSelectRoundName(Sender: TObject);
-var
-       MenuItem: TMenuItem;
-begin
-       if Sender is TMenuItem then begin
-               MenuItem := TMenuItem(Sender);
-               SetSelectItemRound(True, StripHotKey(MenuItem.Caption), TMenuItem(Sender).Parent.Name);
-               ListView.Refresh;
-       end;
-end;
-
-procedure TGikoForm.NewBoardActionExecute(Sender: TObject);
-var
-       Dlg: TNewBoardDialog;
-       Msg: string;
-       i: Integer;
-begin
-       for i := 0 to Screen.CustomFormCount - 1 do begin
-               if TObject(Screen.CustomForms[i]) is TEditorForm then begin
-                       Msg := '\83\8c\83X\83G\83f\83B\83^\82ð\91S\82Ä\95Â\82\82Ä\82­\82¾\82³\82¢';
-                       MsgBox(Handle, Msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
-                       Exit;
-               end;
-       end;
-       Dlg := TNewBoardDialog.Create(Self);
-       try
-               Dlg.ShowModal;
-       finally
-               Dlg.Release;
-       end;
-end;
-
-procedure TGikoForm.LoginActionExecute(Sender: TObject);
-var
-       TmpCursor: TCursor;
-       msg : String;
-begin
-       if GikoSys.Dolib.Connected then begin
-               //\83\8d\83O\83A\83E\83g
-               GikoSys.Dolib.Disconnect;
-               LoginAction.Checked := False;
-               AddMessageList('\83\8d\83O\83A\83E\83g\82µ\82Ü\82µ\82½', nil, gmiOK);
-               LoginAction.Caption := '\83\8d\83O\83C\83\93(&L)';
-       end else begin
-               TmpCursor := Screen.Cursor;
-               Screen.Cursor := crHourGlass;
-               try
-            //\92Ê\8fí\83\8d\83O\83C\83\93
-            if not GikoSys.Setting.ForcedLogin then begin
-                               GikoSys.Dolib.ClientUA := 'gikoNavi/1.00';
-                               GikoSys.Dolib.UserName := GikoSys.Setting.UserID;
-                               GikoSys.Dolib.Password := GikoSys.Setting.Password;
-                               if GikoSys.Setting.ReadProxy then begin
-                                       GikoSys.Dolib.ProxyAddress := GikoSys.Setting.ReadProxyAddress;
-                                       GikoSys.Dolib.ProxyPort := GikoSys.Setting.ReadProxyPort;
-                               end else begin
-                                       GikoSys.Dolib.ProxyAddress := '';
-                                       GikoSys.Dolib.ProxyPort := 0;
-                               end;
-                               if GikoSys.Dolib.Connect then begin
-                                       LoginAction.Checked := True;
-                                       AddMessageList('\83\8d\83O\83C\83\93\82µ\82Ü\82µ\82½ - ' + GikoSys.Setting.UserID, nil, gmiOK);
-                                       LoginAction.Caption := '\83\8d\83O\83A\83E\83g(&L)';
-                    LoginToolButton.Style := tbsCheck;
-                               end else begin
-               //                      MsgBox(Handle, '\83\8d\83O\83C\83\93\8fo\97\88\82Ü\82¹\82ñ\82Å\82µ\82½', '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
-                                       AddMessageList(GikoSys.Dolib.ErrorMsg, nil, gmiNG);
-                                       PlaySound('Error');
-                                       LoginAction.Checked := False;
-                                       LoginToolButton.Down := False;
-                                       LoginToolButton.Style := tbsButton;
-                               end;
-               end else begin
-                               msg := '\8b­\90§\83\8d\83O\83C\83\93\83\82\81[\83h\82Å\82Í\81C\83T\81[\83o\82Ì\8fØ\96¾\8f\91\82Ì\97L\8cø\90«\82ð\83`\83F\83b\83N\82µ\82Ü\82¹\82ñ\81B' + #13#10
-                                               + '\8bU\91\95\83T\81[\83o\82Ì\8fê\8d\87\81A\82 \82È\82½\82Ì\83p\83X\83\8f\81[\83h\93\90\82Ü\82ê\82é\89Â\94\\90«\82ª\82 \82è\82Ü\82·\81B' + #13#10
-                        + '\82±\82Ì\83\82\81[\83h\82Å\83\8d\83O\83C\83\93\82ð\8e\8e\82Ý\82Ü\82·\82©\81H' + #13#10;
-                if MsgBox(Handle, msg, '\8cx\8d\90', MB_YESNO or MB_ICONEXCLAMATION) = IDYES  then begin
-                    GikoSys.Dolib.ClientUA := 'gikoNavi/1.00';
-                    GikoSys.Dolib.UserName := GikoSys.Setting.UserID;
-                    GikoSys.Dolib.Password := GikoSys.Setting.Password;
-                    if GikoSys.Setting.ReadProxy then begin
-                        GikoSys.Dolib.ProxyAddress := GikoSys.Setting.ReadProxyAddress;
-                        GikoSys.Dolib.ProxyPort := GikoSys.Setting.ReadProxyPort;
-                    end else begin
-                        GikoSys.Dolib.ProxyAddress := '';
-                        GikoSys.Dolib.ProxyPort := 0;
-                    end;
-                    //SSL\8fá\8aQ\97p\8b­\90§\83\8d\83O\83C\83\93
-                    GikoSys.Dolib.ForcedConnect;
-                    if GikoSys.Dolib.Connect then begin
-                        LoginAction.Checked := True;
-                        AddMessageList('\8b­\90§\83\8d\83O\83C\83\93\82µ\82Ü\82µ\82½ - ' + GikoSys.Setting.UserID, nil, gmiOK);
-                        LoginAction.Caption := '\83\8d\83O\83A\83E\83g(&L)';
-                        LoginToolButton.Style := tbsCheck;
-                    end else begin
-            //                 MsgBox(Handle, '\83\8d\83O\83C\83\93\8fo\97\88\82Ü\82¹\82ñ\82Å\82µ\82½', '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
-                        AddMessageList(GikoSys.Dolib.ErrorMsg, nil, gmiNG);
-                        PlaySound('Error');
-                                               LoginAction.Checked := False;
-                        LoginToolButton.Down := False;
-                        LoginToolButton.Style := tbsButton;
-                    end;
-               end else begin
-                       LoginAction.Checked := False;
-                    LoginToolButton.Down := False;
-                    LoginToolButton.Style := tbsButton;
-                end;
-            end;
-               finally
-                       Screen.Cursor := TmpCursor;
-               end;
-       end;
-end;
-
-procedure TGikoForm.KeySettingActionExecute(Sender: TObject);
-var
-       Dlg: TKeySettingForm;
-begin
-       Dlg := TKeySettingForm.Create(Self);
-       try
-               if Dlg.ShowModal = mrOk then
-                       GikoSys.SaveKeySetting(ActionList);
-            GikoSys.SaveEditorKeySetting(Dlg.EditorForm.ActionList);
-       finally
-               Dlg.Release;
-       end;
-end;
-
-procedure TGikoForm.ArrangeActionExecute(Sender: TObject);
-begin
-       if ArrangeAction.Checked then begin
-               //\8fc
-               ViewPanel.Align := alNone;
-               ListSplitter.Align := alNone;
-               ThreadPanel.Align := alNone;
-
-               ViewPanel.Width := FBrowserSizeWidth;
-               ViewPanel.Align := alLeft;
-
-               ListSplitter.Width := 5;
-               ListSplitter.Align := alLeft;
-
-               ViewPanel.Left := -10;
-
-               ThreadPanel.Align := alClient;
-
-               GikoSys.Setting.ListOrientation := gloHorizontal;
-               case GikoSys.Setting.ListWidthState of
-                       glsMax: begin
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
-                               ViewPanel.Width := 1;
-                       end;
-                       glsNormal: begin
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
-                       end;
-                       glsMin: begin
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
-                               ViewPanel.Width := ThreadMainPanel.Width - 80;
-                       end;
-               end;
-       end else begin
-               //\89¡
-               ViewPanel.Align := alNone;
-               ListSplitter.Align := alNone;
-               ThreadPanel.Align := alNone;
-
-               ViewPanel.Height := FBrowserSizeHeight;
-               ViewPanel.Align := alTop;
-
-               ListSplitter.Height := 5;
-               ListSplitter.Align := alTop;
-
-               ViewPanel.Top := -10;
-
-               ThreadPanel.Align := alClient;
-               GikoSys.Setting.ListOrientation := gloVertical;
-               case GikoSys.Setting.ListHeightState of
-                       glsMax: begin
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
-                               ViewPanel.Height := 1;
-                       end;
-                       glsNormal: begin
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
-                       end;
-                       glsMin: begin
-                               BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                               BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
-                               ViewPanel.Height := ThreadMainPanel.Height - BrowserCoolBar.Height - 7;
-                       end;
-               end;
-       end;
-
-end;
-
-procedure TGikoForm.PaneInitActionExecute(Sender: TObject);
-begin
-       CabinetPanel.Width := 150;
-       MessagePanel.Height := 40;
-
-       FBrowserSizeWidth := 200;
-       FBrowserSizeHeight := 200;
-       if ArrangeAction.Checked then begin
-               ViewPanel.Width := FBrowserSizeWidth;
-       end else begin
-               ViewPanel.Height := FBrowserSizeHeight;
-       end;
-       if GikoSys.Setting.ListOrientation = gloHorizontal then begin
-               if GikoSys.Setting.ListHeightState = glsMax then begin
-                       BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
-                       GikoSys.Setting.ListHeightState := glsNormal;
-               end;
-       end else begin
-               if GikoSys.Setting.ListWidthState = glsMax then begin
-                       BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
-                       GikoSys.Setting.ListWidthState := glsNormal;
-               end;
-       end;
-end;
-
-procedure TGikoForm.ActiveLogDeleteActionExecute(Sender: TObject);
-const
-       DEL_MSG = '\81g^0\81h\82Ì\83\8d\83O\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_TITLE = '\8dí\8f\9c\8am\94F';
-var
-       idx: Integer;
-       ThreadItem: TThreadItem;
-begin
-       idx := BrowserTab.TabIndex;
-       if idx <> -1 then begin
-               if BrowserTab.Tabs.Objects[idx] <> nil then begin
-                       ThreadItem := TBrowserRecord(BrowserTab.Tabs.Objects[idx]).FThread;
-                       if GikoSys.Setting.DeleteMsg then
-                               if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then
-                                       if MsgBox(Handle, StringReplace( DEL_MSG, '^0', ThreadItem.Title, [rfReplaceAll] ) , DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
-                                               Exit;
-                       DeleteTab(TBrowserRecord(BrowserTab.Tabs.Objects[idx]));
-                       ThreadItem.DeleteLogFile;
-                       if ThreadItem.ParentBoard = FActiveList then
-                               ListView.Refresh;
-               end;
-       end;
-end;
-
-function TGikoForm.GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
-var
-       i: Integer;
-begin
-       Result := nil;
-       if CoolBar = nil then
-               Exit;
-       for i := 0 to CoolBar.Bands.Count - 1 do begin
-               if CoolBar.Bands[i].Control = Control then begin
-                       Result := CoolBar.Bands[i];
-                       Exit;
-               end;
-       end;
-end;
-
-procedure TGikoForm.BrowserTabToolBarResize(Sender: TObject);
-begin
-       if BrowserTab.Parent = BrowserTabToolBar then
-               BrowserTab.Width := BrowserTabToolBar.Width;
-end;
-
-procedure TGikoForm.SelectTextClearActionExecute(Sender: TObject);
-const
-       DEL_MSG = '\8di\8d\9e\82Ý\97\9a\97ð\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_TITLE = '\8dí\8f\9c\8am\94F';
-begin
-       if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then
-               if MsgBox(Handle, DEL_MSG, DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
-                       Exit;
-       GikoSys.Setting.SelectTextList.Clear;
-       SelectComboBox.Items.Clear;
-       SelectComboBox.Text := '';
-       SetListViewType( gvtAll );
-end;
-
-procedure TGikoForm.NameTextClearActionExecute(Sender: TObject);
-var
-       i: Integer;
-const
-       DEL_MSG = '\83\8c\83X\83G\83f\83B\83^\96¼\91O\97\9a\97ð\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_TITLE = '\8dí\8f\9c\8am\94F';
-begin
-       if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then
-               if MsgBox(Handle, DEL_MSG, DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
-                       Exit;
-       GikoSys.Setting.NameList.Clear;
-       for i := 0 to Screen.CustomFormCount - 1 do begin
-               if TObject(Screen.CustomForms[i]) is TEditorForm then
-                       TEditorForm(Screen.CustomForms[i]).NameComboBox.Items.Clear;
+               end;
        end;
+       LockWindowUpdate(0);
 end;
 
-procedure TGikoForm.MailTextClearActionExecute(Sender: TObject);
-var
-       i: Integer;
-const
-       DEL_MSG = '\83\8c\83X\83G\83f\83B\83^\83\81\81[\83\8b\97\9a\97ð\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_TITLE = '\8dí\8f\9c\8am\94F';
+procedure TGikoForm.RoundNamePopupMenuPopup(Sender: TObject);
 begin
-       if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then
-               if MsgBox(Handle, DEL_MSG, DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
-                       Exit;
-       GikoSys.Setting.MailList.Clear;
-       for i := 0 to Screen.CustomFormCount - 1 do begin
-               if TObject(Screen.CustomForms[i]) is TEditorForm then
-                       TEditorForm(Screen.CustomForms[i]).MailComboBox.Items.Clear;
-       end;
+       AddRoundNameMenu(RoundNamePopupMenu.Items);
 end;
 
-procedure TGikoForm.LeftmostTabSelectActionExecute(Sender: TObject);
+procedure TGikoForm.AddRoundNameMenu(MenuItem: TMenuItem);
+var
+       i: Integer;
+       Item: TMenuItem;
 begin
-       if BrowserTab.Tabs.Count > 0 then begin
-               BrowserTab.TabIndex := 0;
-               BrowserTab.OnChange(nil);
+       MenuItem.Clear;
+       Item := TMenuItem.Create(Self);
+       Item.Caption := '\90V\82µ\82¢\96¼\91O\82Å\8f\84\89ñ\97\\96ñ(&N)...';
+       Item.OnClick := GikoDM.SelectNewRoundNameExecute;
+       MenuItem.Add(Item);
+       Item := TMenuItem.Create(Self);
+       Item.Caption := '\8f\84\89ñ\83\8a\83X\83g\82©\82ç\8dí\8f\9c(&D)';
+       Item.OnClick := GikoDM.SelectDeleteRoundExecute;
+       MenuItem.Add(Item);
+       Item := TMenuItem.Create(Self);
+       Item.Caption := '-';
+       MenuItem.Add(Item);
+       for i := 0 to RoundList.RoundNameList.Count - 1 do begin
+               Item := TMenuItem.Create(Self);
+               Item.Caption := RoundList.RoundNameList[i];
+               Item.OnClick := SetSelectRoundName;
+               MenuItem.Add(Item);
        end;
 end;
 
-procedure TGikoForm.LeftTabSelectActionExecute(Sender: TObject);
+procedure TGikoForm.SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string);
+var
+       threadItem : TThreadItem;
 begin
-       if BrowserTab.Tabs.Count > 0 then begin
-               if BrowserTab.TabIndex = -1 then begin
-                       BrowserTab.TabIndex := 0;
-                       BrowserTab.OnChange(nil);
-               end else if BrowserTab.TabIndex > 0 then begin
-                       BrowserTab.TabIndex := BrowserTab.TabIndex - 1;
-                       BrowserTab.OnChange(nil);
+       if ParentName <> 'dummy1' then begin
+               SetSelectItemRound(RoundFlag, RoundName);
+       end else begin
+               threadItem := GetActiveContent;
+               if threadItem <> nil then begin
+                       threadItem.RoundName := RoundName;
+                       if RoundFlag then
+                               RoundList.RoundNameList.Add(RoundName);
+                       threadItem.Round := RoundFlag;
                end;
        end;
 end;
 
-procedure TGikoForm.RightTabSelectActionExecute(Sender: TObject);
+procedure TGikoForm.SetSelectItemRound(RoundFlag: Boolean; RoundName: string);
+var
+       i{, idx}: Integer;
+       List: TList;
 begin
-       if BrowserTab.Tabs.Count > 0 then begin
-               if BrowserTab.TabIndex = -1 then begin
-                       BrowserTab.TabIndex := BrowserTab.Tabs.Count - 1;
-                       BrowserTab.OnChange(nil);
-               end else if BrowserTab.TabIndex < (BrowserTab.Tabs.Count - 1) then begin
-                       BrowserTab.TabIndex := BrowserTab.TabIndex + 1;
-                       BrowserTab.OnChange(nil);
+       List := TList.Create;
+       try
+               SelectListItem(List);
+               for i := 0 to List.Count - 1 do begin
+                       if TObject(List[i]) is TBoard then begin
+                               TBoard(List[i]).RoundName := RoundName;
+                               if RoundFlag then
+                                       RoundList.RoundNameList.Add(RoundName);
+                               TBoard(List[i]).Round := RoundFlag;
+                       end else if TObject(List[i]) is TThreadItem then begin
+                               if TThreadItem(List[i]).IsLogFile then begin
+                                       TThreadItem(List[i]).RoundName := RoundName;
+                                       if RoundFlag then
+                                               RoundList.RoundNameList.Add(RoundName);
+                                       TThreadItem(List[i]).Round := RoundFlag;
+                               end;
+                       end;
                end;
+       finally
+               List.Free;
        end;
 end;
 
-procedure TGikoForm.RightmostTabSelectActionExecute(Sender: TObject);
+procedure TGikoForm.SetSelectRoundName(Sender: TObject);
+var
+       MenuItem: TMenuItem;
 begin
-       if BrowserTab.Tabs.Count > 0 then begin
-               BrowserTab.TabIndex := BrowserTab.Tabs.Count - 1;
-               BrowserTab.OnChange(nil);
+       if Sender is TMenuItem then begin
+               MenuItem := TMenuItem(Sender);
+               SetSelectItemRound(True, StripHotKey(MenuItem.Caption), TMenuItem(Sender).Parent.Name);
+               ListView.Refresh;
        end;
 end;
 
-procedure TGikoForm.LeftmostTabSelectActionUpdate(Sender: TObject);
-begin
-       LeftmostTabSelectAction.Enabled := (BrowserTab.TabIndex <> 0) and (BrowserTab.Tabs.Count > 0);
-end;
-
-procedure TGikoForm.LeftTabSelectActionUpdate(Sender: TObject);
-begin
-       LeftTabSelectAction.Enabled := (BrowserTab.TabIndex <> 0) and (BrowserTab.Tabs.Count > 0);
-end;
-
-procedure TGikoForm.RightTabSelectActionUpdate(Sender: TObject);
+function TGikoForm.GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
+var
+       i: Integer;
 begin
-       RightTabSelectAction.Enabled := (BrowserTab.TabIndex <> BrowserTab.Tabs.Count - 1) and (BrowserTab.Tabs.Count > 0);
+       Result := nil;
+       if CoolBar = nil then
+               Exit;
+       for i := 0 to CoolBar.Bands.Count - 1 do begin
+               if CoolBar.Bands[i].Control = Control then begin
+                       Result := CoolBar.Bands[i];
+                       Exit;
+               end;
+       end;
 end;
 
-procedure TGikoForm.RightmostTabSelectActionUpdate(Sender: TObject);
+procedure TGikoForm.BrowserTabToolBarResize(Sender: TObject);
 begin
-       RightmostTabSelectAction.Enabled := (BrowserTab.TabIndex <> BrowserTab.Tabs.Count - 1) and (BrowserTab.Tabs.Count > 0);
+       if BrowserTab.Parent = BrowserTabToolBar then
+               BrowserTab.Width := BrowserTabToolBar.Width;
 end;
 
 procedure TGikoForm.WMSettingChange(var Message: TWMWinIniChange);
@@ -7240,50 +4303,58 @@ procedure TGikoForm.FavoriteMenuClick(Sender: TObject);
 var
        NewMenu: TMenuItem;
 begin
-       FavoriteMenu.Clear;
-
-       //\82¨\8bC\82É\93ü\82è\82Ì\92Ç\89Á
-       NewMenu := TMenuItem.Create(MainMenu);
-       NewMenu.Action := FavoriteAddAction;
-       FavoriteMenu.Add(NewMenu);
-       //\82¨\8bC\82É\93ü\82è\82Ì\90®\97\9d
-       NewMenu := TMenuItem.Create(FavoriteMenu);
-       NewMenu.Action := FavoriteArrangeAction;
-       FavoriteMenu.Add(NewMenu);
-       //\83Z\83p\83\8c\81[\83^
-       NewMenu := TMenuItem.Create(FavoriteMenu);
-       NewMenu.Caption := '-';
-       FavoriteMenu.Add(NewMenu);
+       if FavoriteDM.Modified then begin
+               FavoriteMenu.Clear;
 
-       CreateFavMenu(FavoriteDM.TreeView.Items.GetFirstNode, FavoriteMenu);
+               //\82¨\8bC\82É\93ü\82è\82Ì\92Ç\89Á
+               NewMenu := TMenuItem.Create(MainMenu);
+               NewMenu.Action := GikoDM.FavoriteAddAction;
+               FavoriteMenu.Add(NewMenu);
+               //\82¨\8bC\82É\93ü\82è\82Ì\90®\97\9d
+               NewMenu := TMenuItem.Create(FavoriteMenu);
+               NewMenu.Action := GikoDM.FavoriteArrangeAction;
+               FavoriteMenu.Add(NewMenu);
+               //\83Z\83p\83\8c\81[\83^
+               FavoriteMenu.InsertNewLineAfter(NewMenu);
+               CreateFavMenu(FavoriteDM.TreeView.Items.GetFirstNode, FavoriteMenu);
+               FavoriteDM.Modified := false;
+       end;
 end;
 
 procedure TGikoForm.CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
 var
        i: Integer;
-       NewMenu: TMenuItem;
+       NewMenu: array of TMenuItem;
 begin
-       for i := 0 to Node.Count - 1 do begin
-               NewMenu := TFavoriteMenuItem.Create(Self);
-               NewMenu.AutoHotkeys := maAutomatic;
-               NewMenu.Caption := CustomStringReplace(Node.Item[i].Text, '&', '&&');
-               TFavoriteMenuItem(NewMenu).Data := Node.Item[i].Data;
-               MenuItem.Add(NewMenu);
+       SetLength(NewMenu, Node.Count);
+       Node := Node.getFirstChild;
+       i := 0;
+       while ( Node <> nil ) do begin
+               NewMenu[i] := TFavoriteMenuItem.Create(nil);
+               NewMenu[i].AutoHotkeys := maAutomatic;
+               NewMenu[i].Caption := CustomStringReplace(Node.Text, '&', '&&');
+               TFavoriteMenuItem(NewMenu[i]).Data := Node.Data;
 
-               if TObject(Node.Item[i].Data) is TFavoriteFolder then begin
-                       NewMenu.ImageIndex := TOOL_ICON_FAV_FOLDER;
-                       CreateFavMenu(Node.Item[i], NewMenu);
-               end else if TObject(Node.Item[i].Data) is TFavoriteBoardItem then begin
-                       NewMenu.ImageIndex := TOOL_ICON_FAV_BOARD;
-                       NewMenu.OnClick := FavoriteClick;
-               end else if TObject(Node.Item[i].Data) is TFavoriteThreadItem then begin
-                       NewMenu.ImageIndex := TOOL_ICON_FAV_THREAD;
-                       NewMenu.OnClick := FavoriteClick;
+               if TObject(Node.Data) is TFavoriteFolder then begin
+                       NewMenu[i].ImageIndex := GikoDataModule.TOOL_ICON_FAV_FOLDER;
+                       CreateFavMenu(Node, NewMenu[i]);
+               end else if TObject(Node.Data) is TFavoriteBoardItem then begin
+                       NewMenu[i].ImageIndex := GikoDataModule.TOOL_ICON_FAV_BOARD;
+                       NewMenu[i].OnClick := FavoriteClick;
+               end else if TObject(Node.Data) is TFavoriteThreadItem then begin
+                       NewMenu[i].ImageIndex := GikoDataModule.TOOL_ICON_FAV_THREAD;
+                       NewMenu[i].OnClick := FavoriteClick;
                end;
+        Inc(i);
+               Node := Node.getNextSibling;
        end;
+       MenuItem.Add(NewMenu);
 end;
 
 procedure TGikoForm.ShowFavoriteAddDialog( Item : TObject );
+const
+       MsgAdd : String = '\8aù\82É\82¨\8bC\82É\93ü\82è\82É\93o\98^\82³\82ê\82Ä\82¢\82Ü\82·\81B\82»\82ê\82Å\82à\92Ç\89Á\82µ\82Ü\82·\82©\81H';
+       TitleAdd: String =  '\82¨\8bC\82É\93ü\82è\82Ì\92Ç\89Á';
 var
        Dlg                     : TFavoriteAddDialog;
        ItemURL : string;
@@ -7303,7 +4374,7 @@ begin
                        Data := Node.Data;
                        if TObject( Data ) is TFavoriteBoardItem then begin
                                if ItemURL = TFavoriteBoardItem( Data ).URL then begin
-                                       if Application.MessageBox( '\8aù\82É\82¨\8bC\82É\93ü\82è\82É\93o\98^\82³\82ê\82Ä\82¢\82Ü\82·\81B\82»\82ê\82Å\82à\92Ç\89Á\82µ\82Ü\82·\82©\81H', '\82¨\8bC\82É\93ü\82è\82Ì\92Ç\89Á', MB_YESNO ) = IDNO then
+                                       if Application.MessageBox(PChar(MsgAdd) , PChar(TitleAdd), MB_YESNO ) = IDNO then
                                                Exit;
                                        Break;
                                end;
@@ -7323,7 +4394,7 @@ begin
                        Data := Node.Data;
                        if TObject( Data ) is TFavoriteThreadItem then begin
                                if ItemURL = TFavoriteThreadItem( Data ).URL then begin
-                                       if Application.MessageBox( '\8aù\82É\82¨\8bC\82É\93ü\82è\82É\93o\98^\82³\82ê\82Ä\82¢\82Ü\82·\81B\82»\82ê\82Å\82à\92Ç\89Á\82µ\82Ü\82·\82©\81H', '\82¨\8bC\82É\93ü\82è\82Ì\92Ç\89Á', MB_YESNO ) = IDNO then
+                                       if Application.MessageBox( PChar(MsgAdd), PChar(TitleAdd), MB_YESNO ) = IDNO then
                                                Exit;
                                        Break;
                                end;
@@ -7342,16 +4413,9 @@ begin
        SetLinkBar;
 end;
 
-procedure TGikoForm.FavoriteAddActionExecute(Sender: TObject);
-begin
-       ShowFavoriteAddDialog(GetActiveContent);
-end;
-
 procedure TGikoForm.FavoriteClick(Sender: TObject);
 begin
-
        FavoriteClick( Sender, True );
-
 end;
 
 procedure TGikoForm.FavoriteClick(Sender: TObject; ActiveTab: Boolean);
@@ -7390,61 +4454,16 @@ begin
 
                if GikoSys.Setting.ListOrientation = gloHorizontal then begin
                        if GikoSys.Setting.ListWidthState = glsMin then begin
-                               BrowserMaxAndFocusAction.Execute;
+                               GikoDM.BrowserMaxAndFocusAction.Execute;
                        end;
                end else begin
                        if GikoSys.Setting.ListHeightState = glsMin then begin
-                               BrowserMaxAndFocusAction.Execute;
+                               GikoDM.BrowserMaxAndFocusAction.Execute;
                        end;
                end;
        end;
 end;
 
-procedure TGikoForm.FavoriteAddActionUpdate(Sender: TObject);
-begin
-       FavoriteAddAction.Enabled := (GetActiveContent <> nil);
-end;
-
-procedure TGikoForm.BoardFavoriteAddActionExecute(Sender: TObject);
-begin
-       if TObject(ListView.Selected.Data) is TBoard then
-               ShowFavoriteAddDialog(TObject(ListView.Selected.Data));
-end;
-
-procedure TGikoForm.BoardFavoriteAddActionUpdate(Sender: TObject);
-begin
-       BoardFavoriteAddAction.Enabled := (GetActiveList is TCategory) and (ListView.SelCount > 0);
-end;
-
-procedure TGikoForm.ThreadFavoriteAddActionExecute(Sender: TObject);
-begin
-       if TObject(ListView.Selected.Data) is TThreadItem then
-               ShowFavoriteAddDialog(TObject(ListView.Selected.Data));
-end;
-
-procedure TGikoForm.ThreadFavoriteAddActionUpdate(Sender: TObject);
-begin
-       ThreadFavoriteAddAction.Enabled := (GetActiveList is TBoard) and (ListView.SelCount > 0);
-end;
-
-procedure TGikoForm.TreeSelectFavoriteAddActionExecute(Sender: TObject);
-begin
-       ShowFavoriteAddDialog(TObject(FClickNode.Data));
-end;
-
-procedure TGikoForm.FavoriteArrangeActionExecute(Sender: TObject);
-var
-       Dlg: TFavoriteArrangeDialog;
-begin
-       Dlg := TFavoriteArrangeDialog.Create(Self);
-       try
-               Dlg.ShowModal;
-       finally
-               Dlg.Release;
-       end;
-       PostMessage( Handle, USER_SETLINKBAR, 0, 0 );
-end;
-
 procedure TGikoForm.BBSMenuItemOnClick(
        Sender  : TObject
 );
@@ -7458,24 +4477,47 @@ end;
 procedure TGikoForm.MainCoolBarResize(Sender: TObject);
 begin
        TopPanel.Height := Max(MainCoolBar.Height, AnimePanel.Height);
-end;
-
-procedure TGikoForm.MoveToActionExecute(Sender: TObject);
-var
-       URL: string;
-       idx: Integer;
-begin
-       URL := Trim(AddressComboBox.Text);
-       MoveToURL(URL);
 
-       idx := AddressComboBox.Items.IndexOf(URL);
-       if idx = -1 then begin
-               AddressComboBox.Items.Insert(0, URL);
-               if AddressComboBox.Items.Count > GikoSys.Setting.AddressHistoryCount then
-                       AddressComboBox.Items.Delete(AddressComboBox.Items.Count - 1);
-       end else begin
-               AddressComboBox.Items.Delete(idx);
-               AddressComboBox.Items.Insert(0, URL);
+end;
+//! \8ew\92è\82³\82ê\82½\83X\83\8c\83b\83h\82ð\8aJ\82­(\83\8d\83O\82ª\96³\82¢\82Æ\82« or \8ew\92èJUMP\82Ü\82Å\91«\82è\82È\82¢\82Æ\82«\82ÍDL\82·\82é)
+procedure TGikoForm.OpenThreadItem(Thread: TThreadItem; URL: String);
+var
+       stRes, edRes : Int64;
+       browserRec : TBrowserRecord;
+       threadNumber : String;
+       doc : Variant;
+begin
+       stRes := 0;
+       edRes := 0;
+       Thread.JumpAddress := 0;
+       // \83^\83u\82ð\90\90¬
+       browserRec := InsertBrowserTab(Thread);
+       if (browserRec <> nil) then begin
+               // JUMP\82·\82×\82«\83\8c\83X\94Ô\8d\86\82ª\82 \82é\82©\83`\83F\83b\83N\82·\82é
+               threadNumber := ChangeFileExt(Thread.FileName, '');
+               GikoSys.GetPopupResNumber( URL, stRes, edRes );
+               // \83X\83\8c\82Ì\94Ô\8d\86\82ð\83\8c\83X\94Ô\82Æ\8cë\82Á\82Ä\94F\8e¯\82µ\82Ä\82¢\82é\82Ì\82ð\83N\83\8a\83A
+               if (StrToInt64(threadNumber) = stRes) then begin
+                       if not (AnsiEndsText(threadNumber + '/' + threadNumber, URL))
+                               and (Pos('&st=' + threadNumber , URL) = 0) then begin
+                               stRes := 0;
+                       end;
+               end;
+               if ( stRes > 0 ) then begin
+                       Thread.JumpAddress := stRes;
+               end;
+               // \83\8d\83O\82ð\8e\9d\82Á\82Ä\82¢\82È\82¢\82© JUMP\82·\82×\82«\83\8c\83X\94Ô\8d\86\82Ü\82Å\8eæ\93¾\82µ\82Ä\82¢\82È\82¢\82Æ\82«\82ÍDL\82·\82é
+               if (not Thread.IsLogFile) or (stRes > Thread.Count) then begin
+                       DownloadContent(Thread);
+               end else if (not browserRec.Repaint) and (stRes > 0) then begin
+                       browserRec.Move(IntToStr(stRes));
+                       Thread.JumpAddress := 0;
+                       try
+                               doc := Idispatch( OleVariant( browserRec.Browser.ControlInterface ).Document ) as IHTMLDocument2;
+                               Thread.ScrollTop := doc.Body.ScrollTop;
+                       except
+                       end;
+               end;
        end;
 end;
 
@@ -7485,18 +4527,13 @@ var
        URL, protocol2, host2, path2, document2, port2, bookmark2 : string;
        tmp1, tmp2: string;
        BBSID, BBSKey: string;
-       tmpBoard, Board: TBoard;
+       {tmpBoard,} Board: TBoard;
        ThreadItem: TThreadItem;
        i, bi                                   : Integer;
        boardURL                        : string;
        tmpThread                       : TThreadItem;
-//     category                        : TCategory;
-//     categoryNode    : TTreeNode;
-//     boardNode                       : TTreeNode;
        shiftDown                       : Boolean;
        ctrlDown                        : Boolean;
-       stRes, edRes    : Int64;
-       browserRec              : TBrowserRecord;
 begin
 
        GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
@@ -7516,17 +4553,18 @@ begin
        //===== \83v\83\89\83O\83C\83\93
        try
                //\8dì\8bÆ\92\86//
-               bi := High( BoardPlugIns );
-               for i := Low( BoardPlugIns ) to bi do begin
-                       if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin
-                               case BoardPlugIns[ i ].AcceptURL( inURL ) of
+               bi := Length(BoardGroups) - 1;
+               for i := 1 to bi do begin
+                       if (BoardGroups[i].BoardPlugIn <> nil) and (Assigned(Pointer(BoardGroups[i].BoardPlugIn.Module))) then begin
+                               case BoardGroups[i].BoardPlugIn.AcceptURL( inURL ) of
                                atThread:
                                        begin
-                                               tmpThread               := TThreadItem.Create( BoardPlugIns[ i ], inURL );
-                                               boardURL                := tmpThread.BoardPlugIn.GetBoardURL( DWORD( tmpThread ) );
-                                               Board                           := BBSsFindBoardFromURL( boardURL );
+                                               boardURL        := BoardGroups[i].BoardPlugIn.ExtractBoardURL( inURL );
+                                               Board           := BBSsFindBoardFromURL( boardURL );
+
+
                                                if Board = nil then begin
-                            //break;
+                                                       //break;
                                                        // \81¦\8dì\82Á\82Ä\82à\92Ç\89Á\82·\82é\82Æ\82±\82ë\82ª\96³\82¢\82Ì\82Å\8c\83\82µ\82­\95Û\97¯
                                                        //GikoSys.OpenBrowser(inURL, gbtUserApp);
                                                        //Exit;
@@ -7536,46 +4574,34 @@ begin
                                                                ShowBBSTree( BBSs[ 1 ] );
                                                        }
                                                end else begin
+                                                       tmpThread               := TThreadItem.Create( BoardGroups[i].BoardPlugIn, Board, inURL );
                                                        if not Board.IsThreadDatRead then begin
                                                                GikoSys.ReadSubjectFile( Board );
+                                                               tmpThread.Free;
                                                                Exit;
                                                        end;
                                                        ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName );
                                                        if ThreadItem = nil then begin
+                                                               //tmpThread\82ð\82±\82Á\82¿\82Í\8aJ\95ú\82µ\82Ä\82Í\82¢\82¯\82È\82¢
                                                                ThreadItem := tmpThread;
                                                                Board.Insert( 0, ThreadItem );
                                                                if ActiveList is TBoard then begin
                                                                        if TBoard(ActiveList) = Board then
                                                                                ListView.Items.Count := ListView.Items.Count + 1;
                                                                end;
-                                                               GikoSys.GetPopupResNumber( inURL, stRes, edRes );
-                                                               browserRec := InsertBrowserTab( ThreadItem );
-                                                               if (browserRec <> nil) and (stRes > 0) then
-                                                                       browserRec.Movement := IntToStr( stRes );
-                                                               DownloadContent( ThreadItem );
-                                                               Exit;
                                                        end else begin
                                                                tmpThread.Free;
-                                                               GikoSys.GetPopupResNumber( inURL, stRes, edRes );
-                                                               browserRec := InsertBrowserTab( ThreadItem );
-                                                               if ThreadItem.IsLogFile then begin
-                                                                       if (browserRec <> nil) and (stRes > 0) then
-                                                                               BrowserMovement( IntToStr( stRes ), browserRec );
-                                                               end else begin
-                                                                       if (browserRec <> nil) and (stRes > 0) then
-                                                                               browserRec.Movement := IntToStr( stRes );
-                                                                       DownloadContent( ThreadItem );
-                                                               end;
-                                                               Exit;
                                                        end;
+                                                       OpenThreadItem(ThreadItem, inURL);
+                                                       Exit;
                                                end;
                                        end;
 
                                atBoard:
                                        begin
-                                               tmpBoard := TBoard.Create(BoardPlugIns[ i ], inURL);
-                                               Board := BBSsFindBoardFromURL( tmpBoard.URL );
-                                               tmpBoard.Free;
+                                               Board := BBSsFindBoardFromURL(
+                                                                       BoardGroups[i].BoardPlugIn.ExtractBoardURL( inURL )
+                                                                       );
                                                if Board <> nil then begin
                                                        if FActiveBBS <> Board.ParentCategory.ParenTBBS then
                                                                ShowBBSTree( Board.ParentCategory.ParenTBBS );
@@ -7594,14 +4620,6 @@ begin
        if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin
                boardURL := GikoSys.Get2chThreadURL2BoardURL( inURL );
                Board := BBSsFindBoardFromURL( boardURL );
-               if Board = nil then
-                       Board := BBSsFindBoardFromBBSID( BBSID );
-
-               if Board = nil then begin
-                       // \81¦\8dì\82Á\82Ä\82à\92Ç\89Á\82·\82é\82Æ\82±\82ë\82ª\96³\82¢\82Ì\82Å\8c\83\82µ\82­\95Û\97¯
-                       //\81@\89ß\8b\8e\83\8d\83O\91q\8cÉ\82©\82ç\81A\83_\83E\83\\82µ\82½\83X\83\8c\82ª\94­\8c©\82Å\82«\82È\82¢\82Ì\82Å\82±\82±\82Å\92T\82·\82æ\82¤\82É\82·\82é (2004/01/22)
-                       Board := BBSs[ 0 ].FindBBSID( Copy(BBSID, 1 , Length(BBSID) - 1) );
-               end;
                if Board = nil then begin
                         // \93ü\82é\82×\82«\94Â\82ª\8c©\82Â\82©\82ç\82È\82©\82Á\82½\82Ì\82Å\81A\95\81\92Ê\82Ì\83u\83\89\83E\83U\82Å\8aJ\82­
                         GikoSys.OpenBrowser(inURL, gbtUserApp);
@@ -7626,62 +4644,36 @@ begin
                if ThreadItem = nil then begin
                        ThreadItem := Board.FindThreadFromFileName( BBSKey + '.dat' );
                end;
-
-               if ThreadItem = nil then begin
-                       //shift -> \90Ý\92è\83u\83\89\83E\83U\81i\96³\82¯\82ê\82ÎIE\81j
-                       //ctrl  -> IE
-                       {shiftDown      := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
-                       ctrlDown        := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);
-                       if shiftDown then
-                               GikoSys.OpenBrowser(URL1, gbtUserApp)
-                       else if ctrlDown then
-                               GikoSys.OpenBrowser(URL1, gbtIE)
-                       else begin
-                       }
-                       ThreadItem := TThreadItem.Create( nil, URL );
-                       ThreadItem.FileName := ChangeFileExt(BBSKey, '.dat');
-                       if AnsiPos(Host, Board.URL) = 0 then
-                               ThreadItem.DownloadHost := Host
-                       else
-                               ThreadItem.DownloadHost := '';
-                       Board.Insert(0, ThreadItem);
-                       if ActiveList is TBoard then begin
-                               if TBoard(ActiveList) = Board then
-                                       ListView.Items.Count := ListView.Items.Count + 1;
+               try
+                       // \83X\83\8c\83b\83h\83A\83C\83e\83\80\82ª\82È\82¢\82È\82ç\90\90¬\82·\82é\81B
+                       if ThreadItem = nil then begin
+                               ThreadItem := TThreadItem.Create( nil, Board, URL );
+                               ThreadItem.FileName := ChangeFileExt(BBSKey, '.dat');
+                               Board.Insert(0, ThreadItem);
+                               if ActiveList is TBoard then begin
+                                       if TBoard(ActiveList) = Board then
+                                               ListView.Items.Count := ListView.Items.Count + 1;
+                               end;
                        end;
-                       GikoSys.GetPopupResNumber( inURL, stRes, edRes );
-                       browserRec := InsertBrowserTab(ThreadItem);
-                       if (browserRec <> nil) and (stRes > 0) then
-                               browserRec.Movement := IntToStr( stRes );
-                       DownloadContent(ThreadItem);
-                       {end;}
-               end else begin
-                       if ThreadItem.IsLogFile then begin
-                               GikoSys.GetPopupResNumber( inURL, stRes, edRes );
-                               browserRec := InsertBrowserTab(ThreadItem);
-                               if (browserRec <> nil) and (stRes > 0) then
-                                       browserRec.Movement := IntToStr( stRes );
-                       end else begin
+                       // \83\8d\83O\82È\82µ\83X\83\8c\83b\83h\82Ì\82Æ\82«\82Í\81A\83z\83X\83g\96¼\82Ì\83`\83F\83b\83N\82ð\82·\82é
+                       if (not ThreadItem.IsLogFile) then begin
                                if AnsiPos(Host, Board.URL) = 0 then
                                        ThreadItem.DownloadHost := Host
                                else
                                        ThreadItem.DownloadHost := '';
-                               GikoSys.GetPopupResNumber( inURL, stRes, edRes );
-                               browserRec := InsertBrowserTab(ThreadItem);
-                               if (browserRec <> nil) and (stRes > 0) then
-                                       browserRec.Movement := IntToStr( stRes );
-                               DownloadContent(ThreadItem);
                        end;
+                       OpenThreadItem(ThreadItem, inURL);
+               except
                end;
        end else begin
                Board := BBSsFindBoardFromURL( inURL );
-    if Board = nil then begin
+               if Board = nil then begin
                        GikoSys.OpenBrowser(inURL, gbtAuto);
-    end else begin
-         if FActiveBBS <> Board.ParentCategory.ParenTBBS then
-        ShowBBSTree( Board.ParentCategory.ParenTBBS );
-      SelectTreeNode( Board, True );
-    end;
+               end else begin
+                       if FActiveBBS <> Board.ParentCategory.ParenTBBS then
+                               ShowBBSTree( Board.ParentCategory.ParenTBBS );
+                       SelectTreeNode( Board, True );
+               end;
        end;
 end;
 
@@ -7695,12 +4687,12 @@ procedure TGikoForm.AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
        Shift: TShiftState);
 begin
        if Key = VK_RETURN then
-               MoveToAction.Execute;
+               GikoDM.MoveToAction.Execute;
 end;
 
 procedure TGikoForm.BrowserEnter(Sender: TObject);
 begin
-       Browser.DoObjectVerb(OLEIVERB_UIACTIVATE);
+    Browser.DoObjectVerb(OLEIVERB_UIACTIVATE);
 end;
 
 procedure TGikoForm.WMCopyData(var Message: TWMCopyData);
@@ -7732,14 +4724,21 @@ begin
                        if not (ssAlt in KeyDataToShiftState(TWMChar(Message).KeyData)) then
                                Exit;
                WM_SYSCOMMAND:
-                       if Message.WParam = SC_MINIMIZE then
+                       if Message.WParam = SC_MINIMIZE then begin
                                OnMinimize;
+                PostMessage(Handle, USER_MINIMIZED, 0, 0);
+            end;
                USER_TREECLICK:
                        TreeClick( TreeView.Selected );
                USER_RESIZED:
                        OnResized;
                USER_MINIMIZED:
-                       OnMinimized;
+            begin
+                if (GikoSys.Setting.StoredTaskTray) then begin
+                    StoredTaskTray;
+                end;
+                OnMinimized;
+            end;
                USER_SETLINKBAR:
                        SetLinkBar;
                USER_DOCUMENTCOMPLETE:
@@ -7757,232 +4756,115 @@ end;
 
 procedure TGikoForm.FormShortCut(var Msg: TWMKey; var Handled: Boolean);
 var
-       hComboEdit: THandle;
-//     KeyData: Integer;
+       handle: THandle;
 begin
        Handled := False;
-       if AddressComboBox.Focused or SelectComboBox.Focused then begin
+       //\83A\83h\83\8c\83X\82à\82µ\82­\82Í\8di\82è\8d\9e\82Ý\83R\83\93\83{\83{\83b\83N\83X\82à\82µ\82­\82Í\82¨\8bC\82É\93ü\82è\82ª\95Ò\8fW\92\86\82Í
+       //\83V\83\87\81[\83g\83J\83b\83g\82È\82Ç\82ð\96³\8cø\82É\82·\82é
+       if ((FavoriteTreeView.Visible) and (FavoriteTreeView.IsEditing)) then begin
                if Msg.CharCode in [VK_BACK] then begin
-                       hComboEdit := GetFocus;
-                       if hComboEdit <> 0 then
-                               SendMessage(hComboEdit, WM_CHAR, Msg.CharCode, Msg.KeyData);
-//                             SendMessage(hComboEdit, WM_CHAR, Msg.CharCode, $000E0001);
+                       //BS\82ª\82Q\89ñ\91\97\82ç\82ê\82é\95s\8bï\8d\87\89ñ\94ð
+                       if Msg.KeyData > 0 then begin
+                               handle := GetFocus;
+                               if handle <> 0 then
+                                       SendMessage(handle, WM_CHAR, Msg.CharCode, Msg.KeyData);
+                               Handled := True;
+                       end;
+               end else
+               //\82¨\8bC\82É\93ü\82è\82ÍESC\82Å\92E\8fo\82µ\82½\82¢\82Ì\82Å\81A\82»\82ê\82à\91\97\82é
+               if Msg.CharCode in [VK_INSERT, VK_DELETE, VK_HOME, VK_END, VK_PRIOR, VK_NEXT, VK_ESCAPE] then begin
+                       handle := GetFocus;
+                       if handle <> 0 then
+                               SendMessage(handle, WM_KEYDOWN, Msg.CharCode, Msg.KeyData);
                        Handled := True;
                end;
-               if Msg.CharCode in [VK_INSERT, VK_DELETE, VK_HOME, VK_END, VK_PRIOR, VK_NEXT] then begin
-                       hComboEdit := GetFocus;
-                       if hComboEdit <> 0 then
-                               SendMessage(hComboEdit, WM_KEYDOWN, Msg.CharCode, Msg.KeyData);
+       end     else if (AddressComboBox.Focused) or (SelectComboBox.Focused) then begin
+               if Msg.CharCode in [VK_BACK] then begin
+                       //BS\82ª\82Q\89ñ\91\97\82ç\82ê\82é\95s\8bï\8d\87\89ñ\94ð
+                       if Msg.KeyData > 0 then begin
+                               handle := GetFocus;
+                               if handle <> 0 then
+                                       SendMessage(handle, WM_CHAR, Msg.CharCode, Msg.KeyData);
+                               Handled := True;
+                       end;
+               end else if Msg.CharCode in [VK_INSERT, VK_DELETE, VK_HOME, VK_END, VK_PRIOR, VK_NEXT] then begin
+                       handle := GetFocus;
+                       if handle <> 0 then
+                               SendMessage(handle, WM_KEYDOWN, Msg.CharCode, Msg.KeyData);
                        Handled := True;
                end;
-{      end else begin
-               //\83\81\83j\83\85\81[\82Ì\83t\83@\83C\83\8b(F)\82Æ\82©\82ÅF\82ð\92P\91Ì\82Å\89\9f\82µ\82½\82Æ\82«\82É\91I\91ð\82³\82ê\82Ä\82µ\82Ü\82¤\8c»\8fÛ\82ð\89ñ\94ð
-               KeyData := Msg.KeyData;
-               if (KeyData and $20000000) = 0 then begin
-                       if Msg.CharCode in [Ord('F'), Ord('V'), Ord('B'), Ord('R'),
-                                                                                                       Ord('A'), Ord('T'), Ord('H')] then begin
-                               if not ActionList.IsShortCut(Msg) then begin
-                                       Handled := True;
-                               end;
-                       end;
-               end;}
+       end else begin
+               Handled := GikoDM.GikoFormActionList.IsShortCut(Msg);
        end;
 end;
 
-procedure TGikoForm.BrowserTabVisibleActionExecute(Sender: TObject);
-begin
-       GikoSys.Setting.BrowserTabVisible := BrowserTabVisibleAction.Checked;
-       SetBrowserTabState;
-end;
-
-procedure TGikoForm.BrowserTabTopActionExecute(Sender: TObject);
-begin
-       BrowserTabBottomAction.Checked := False;
-       BrowserTabTopAction.Checked := True;
-       GikoSys.Setting.BrowserTabPosition := gtpTop;
-       SetBrowserTabState;
-end;
-
-procedure TGikoForm.BrowserTabBottomActionExecute(Sender: TObject);
-begin
-       BrowserTabTopAction.Checked := False;
-       BrowserTabBottomAction.Checked := True;
-       GikoSys.Setting.BrowserTabPosition := gtpBottom;
-       SetBrowserTabState;
-end;
-
-procedure TGikoForm.BrowserTabTabStyleActionExecute(Sender: TObject);
-begin
-       BrowserTabButtonStyleAction.Checked := False;
-       BrowserTabFlatStyleAction.Checked := False;
-       BrowserTabTabStyleAction.Checked := True;
-       GikoSys.Setting.BrowserTabStyle := gtsTab;
-       SetBrowserTabState;
-end;
-
-procedure TGikoForm.BrowserTabButtonStyleActionExecute(Sender: TObject);
-begin
-       BrowserTabTabStyleAction.Checked := False;
-       BrowserTabFlatStyleAction.Checked := False;
-       BrowserTabButtonStyleAction.Checked := True;
-       GikoSys.Setting.BrowserTabStyle := gtsButton;
-       SetBrowserTabState;
-end;
-
-procedure TGikoForm.BrowserTabFlatStyleActionExecute(Sender: TObject);
-begin
-       BrowserTabFlatStyleAction.Checked := True;
-       BrowserTabTabStyleAction.Checked := False;
-       BrowserTabButtonStyleAction.Checked := False;
-       GikoSys.Setting.BrowserTabStyle := gtsFlat;
-       SetBrowserTabState;
-end;
-
 procedure TGikoForm.PreviewTimerTimer(Sender: TObject);
 var
        p: TPoint;
        ARect: TRect;
-       sl: TStringList;
-       html: string;
-       HtmlFileName: string;
-
-       NavURL: OleVariant;
-       Flags: OleVariant;
-       TargetFrameName: OleVariant;
-       PostData: OleVariant;
-       Headers: OleVariant;
-       WindowHeight: Integer;
-       WindowWidth: Integer;
-
-//     Style: Longint;
-       Referer: string;
-       Protocol, Host, Path, Document, Port, Bookmark: string;
 begin
        PreviewTimer.Enabled := False;
 
        GetCursorpos(p);
 
-       case GikoSys.Setting.PreviewSize of
-               gpsXSmall: begin
-                       WindowWidth := 128;
-                       WindowHeight := 96;
-               end;
-               gpsSmall: begin
-                       WindowWidth := 256;
-                       WindowHeight := 192;
-               end;
-               gpsLarge: begin
-                       WindowWidth := 512;
-                       WindowHeight := 384;
-               end;
-               gpsXLarge: begin
-                       WindowWidth := 640;
-                       WindowHeight := 480;
-               end;
-               else begin      //gpsMedium
-                       WindowWidth := 384;
-                       WindowHeight := 288;
-               end;
-       end;
-
-       ARect := Rect(0, 0, WindowWidth, WindowHeight);
-
-       case GikoSys.Setting.PopupPosition of
-               gppRightTop:            OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - (ARect.Bottom - ARect.Top) -     15);
-               gppRight:                       OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - ((ARect.Bottom - ARect.Top) div 2));
-               gppRightBottom: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y + 15);
-               gppTop:                                 OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - (ARect.Bottom - ARect.Top) -  15);
-               gppCenter:                      OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - ((ARect.Bottom - ARect.Top) div 2));
-               gppBottom:                      OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y + 15);
-               gppLeftTop:                     OffsetRect(ARect, p.x + 15, p.y - (ARect.Bottom - ARect.Top) -  15);
-               gppLeft:                                OffsetRect(ARect, p.x + 15, p.y - ((ARect.Bottom - ARect.Top) div 2));
-               gppLeftBottom:  OffsetRect(ARect, p.x + 15, p.y + 15);          //\83M\83R\83i\83r\83X\83\8c \83p\81[\83g\82P\82Ì453\8e\81\82É\8a´\8eÓ
-       end;
-
-       html := '<html><head>'#13#10
-                               + '<SCRIPT>'#13#10
-                               + 'function init() {'#13#10
-                               + '     if ((document.body.clientHeight >= Image1.height) && (document.body.clientWidth >= Image1.width)) {'#13#10
-                               + '     } else {'#13#10
-                               + '             var dh, ih;'#13#10
-                               + '             dh = document.body.clientWidth / document.body.clientHeight;'#13#10
-                               + '             ih = Image1.width / Image1.height;'#13#10
-                               + '             if (document.body.clientWidth < document.body.clientHeight) {'#13#10
-                               + '                     if (ih > dh)'#13#10
-                               + '                             Image1.width = document.body.clientWidth;'#13#10
-                               + '                     else'#13#10
-                               + '                             Image1.height = document.body.clientHeight;'#13#10
-                               + '             } else {'#13#10
-                               + '                     if (ih < dh)'#13#10
-                               + '                             Image1.height = document.body.clientHeight;'#13#10
-                               + '                     else'#13#10
-                               + '                             Image1.width = document.body.clientWidth;'#13#10
-                               + '             }'#13#10
-                               + '     }'#13#10
-                               + '     Message.style.display = "none";'#13#10
-                               + '}'#13#10
-                               + '</SCRIPT>'#13#10
-                               + '</head>'#13#10
-                               + '<body topmargin="0" leftmargin="0" style="border-width: 1px; overflow:hidden; border-style: solid;" onLoad="init()">'#13#10
-                               + '<div align="center" id="Message">\83v\83\8c\83r\83\85\81[\8dì\90¬\92\86</div>'#13#10
-                               + '<div align="center"><img name="Image1" border="0" src="%ImageURL%"></div>'#13#10
-                               + '</body></html>';
-       sl := TStringList.Create;
-       try
-               try
-                       HtmlFileName := GikoSys.GetAppDir + HTML_FILE_NAME;
-                       sl.Text := AnsiReplaceStr(html, '%ImageURL%', FPreviewURL);
-                       sl.SaveToFile(HtmlFileName);
-               finally
-                       sl.Free;
-               end;
-       except
-       end;
+    ARect := FPreviewBrowser.GetWindowRect(p);
 
-       NavURL := HtmlFileName;
-       Flags := 0;
-       TargetFrameName := '';
-       PostData := '';
-
-       GikoSys.ParseURI(FPreviewURL, Protocol, Host, Path, Document, Port, Bookmark);
-       Referer := Protocol + '://' + Host;
-       if Port <> '' then
-               Referer := Referer + ':' + Port;
-       Referer := Referer + Path;
-       Headers := 'Referer: ' + Referer;
-       FPreviewBrowser.Navigate(NavURL, Flags, TargetFrameName, PostData, Headers);
-       if ARect.Top + WindowHeight > Screen.DesktopHeight then
-               ARect.Top := Screen.DesktopHeight - WindowHeight;
-       if ARect.Left + WindowWidth > Screen.DesktopWidth then
-               ARect.Left := Screen.DesktopWidth - WindowWidth;
-       if ARect.Left < Screen.DesktopLeft then ARect.Left := Screen.DesktopLeft;
-       if ARect.Bottom < Screen.DesktopTop then ARect.Bottom := Screen.DesktopTop;
-
-       SetWindowPos(FPreviewBrowser.Handle, HWND_TOPMOST, ARect.Left, ARect.Top, WindowWidth, WindowHeight, SWP_NOACTIVATE or SWP_HIDEWINDOW);
-       ShowWindow(FPreviewBrowser.Handle, SW_SHOWNOACTIVATE);
+    FPreviewBrowser.PreviewImage(FPreviewURL);
+
+       if ARect.Bottom > Screen.DesktopHeight then begin
+        OffsetRect(ARect, 0, -(ARect.Bottom - Screen.DesktopHeight));
+    end;
+       if (ARect.Right > Screen.DesktopWidth) then begin
+        OffsetRect(ARect, -(ARect.Right - Screen.DesktopWidth), 0);
+    end;
+       if (ARect.Left < Screen.DesktopLeft) then begin
+        OffsetRect(ARect, +(Screen.DesktopLeft - ARect.Left), 0);
+    end;
+       if (ARect.Top < Screen.DesktopTop) then begin
+        OffsetRect(ARect, 0, (Screen.DesktopTop - ARect.Top));
+    end;
 
-//     Style := GetWindowLong(FPreviewBrowser.Handle, GWL_EXSTYLE);
-//     SetWindowLong(FPreviewBrowser.Handle, GWL_EXSTYLE, Style xor WS_EX_APPWINDOW);
+       SetWindowPos(FPreviewBrowser.Handle, HWND_TOPMOST,
+        ARect.Left, ARect.Top,
+        (ARect.Right - ARect.Left), (ARect.Bottom - ARect.Top),
+        SWP_NOACTIVATE or SWP_HIDEWINDOW);
 
+       ShowWindow(FPreviewBrowser.Handle, SW_SHOWNOACTIVATE);
+       FPreviewBrowserRect := ARect;
 end;
 
 procedure TGikoForm.WMSetCursor(var Message: TWMSetCursor);
+var
+       Pos : TPoint;
 begin
        if PreviewTimer.Enabled then
                PreviewTimer.Enabled := False;
-       if (FHint <> nil) and (IsWindowVisible(FHint.Handle)) then begin
-               FHint.ReleaseHandle;
-               FHint.ClearAllRes;
+
+       if (FResPopupBrowser <> nil) and (IsWindowVisible(FResPopupBrowser.Handle)) then begin
+        FResPopupBrowser.Clear;
+       end;
+
+       if (FPreviewBrowser <> nil)
+               and (IsWindowVisible(FPreviewBrowser.Handle)) then begin
+        //\82±\82±\82Å\8fÁ\82³\82ê\82é\82Ì\82ª\96â\91è
+        //\82½\82Ô\82ñ\82±\82ê\82Å\95\\8e¦\94Í\88Í\94»\92è\82Å\82«\82Ä\82¢\82é\82Í\82¸
+               Pos := Mouse.CursorPos;
+               Pos.X := Pos.X + Left;
+               Pos.Y := Pos.Y + Top;
+               if (FPreviewBrowserRect.Left > Pos.X) or
+                       (FPreviewBrowserRect.Right < Pos.X) or
+                       (FPreviewBrowserRect.Top > Pos.Y) or
+                       (FPreviewBrowserRect.Bottom < Pos.Y) then begin
+                       ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
+               end;
        end;
-       if (FPreviewBrowser <> nil) and (IsWindowVisible(FPreviewBrowser.Handle)) then
-               ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
+
        Message.Result := 1;
        inherited;
 end;
-
 procedure TGikoForm.MessageHideButtonClick(Sender: TObject);
 begin
-       MsgBarCloseAction.Execute;
+       GikoDM.MsgBarCloseAction.Execute;
 end;
 
 function TGikoForm.OnDocumentContextMenu(Sender: TObject): WordBool;
@@ -7994,208 +4876,44 @@ var
        ThreadItem: TThreadItem;
 begin
        Result := False;
-       Doc := FactiveContent.FBrowser.Document as IHtmlDocument2;
+       FactiveContent.IDAnchorPopup('');
+       Doc := FactiveContent.Browser.Document as IHtmlDocument2;
        if Assigned(Doc) then begin
                Range := Doc.selection.createRange as IHTMLTxtRange;
                s := CustomStringReplace(Range.text, '\81@', ' ');//\91S\8ap\8bó\94\92\82ð\94¼\8ap\8bó\94\92\82É
                s := ZenToHan(Trim(s));
                if GikoSys.IsNumeric(s) then begin
-
-                       ThreadItem := GetActiveContent;
-                       if ThreadItem <> nil then begin
-                               Num := StrToInt(s);
-                               FHint.PopupType := gptThread;
-                               SetResPopupText(ThreadItem, Num, Num, False, False);
-                               if FHint.ResCount <> 0 then
-                                       ShowTextPopup;
+                       Num := StrToInt64(s);
+                       ThreadItem := GetActiveContent(true);
+                       if (ThreadItem <> nil) and (Num <= ThreadItem.Count)
+                and (Num > 0)then begin
+                CreateResPopupBrowser;
+                FResPopupBrowser.CreateNewBrowser.PopupType := gptThread;
+                               HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False);
+                FResPopupBrowser.Popup;
                                Result := False;
                        end else
                                Result := True;
-               end else begin
-                       Result := True;
-               end;
-       end;
-end;
-
-procedure TGikoForm.SetResPopupText(threadItem: TThreadItem; StNum, ToNum: Integer; Title, First: Boolean);
-var
-       i: Integer;
-       tmp: string;
-       FileName: string;
-       Line: Integer;
-
-       wkInt: Integer;
-
-       Res: TResRec;
-       Header: string;
-       Body: string;
-    boardPlugIn : TBoardPlugIn;
-begin
-       try
-               if StNum > ToNum then begin
-                       wkInt := StNum;
-                       StNum := ToNum;
-                       ToNum := wkInt;
-               end;
-
-               //\8dÅ\91å10\83\8c\83X\82Ü\82Å\95\\8e¦
-               if StNum + MAX_POPUP_RES < ToNum then
-                       ToNum := StNum + MAX_POPUP_RES;
-
-               //\83^\83C\83g\83\8b\95\\8e¦
-               if Title then
-                               if ThreadItem <> nil then
-                                       FHint.Title := ThreadItem.Title;
-
-        if ThreadItem <> nil then begin
-            if ThreadItem.IsBoardPlugInAvailable then begin
-                //===== \83v\83\89\83O\83C\83\93\82É\82æ\82é\95\\8e¦
-                boardPlugIn            := ThreadItem.BoardPlugIn;
-
-                // \83t\83H\83\93\83g\82â\83T\83C\83Y\82Ì\90Ý\92è
-                // \95\8e\9a\83R\81[\83h\82Í\83v\83\89\83O\83C\83\93\82É\94C\82¹\82é
-                for i := StNum to ToNum do begin
-                    Line := i;
-                                       //\82±\82±\82Å\82Q\82¿\82á\82ñ\82Ë\82é\82Ìdat\82Ì\8c`\8e®\82Å\82P\8ds\93Ç\82Ý\8d\9e\82ß\82ê\82Î¥¥¥\81B\81«\93Ç\82ß\82é\82æ\82¤\82É\82È\82Á\82½
-                                       tmp := boardPlugIn.GetDat( DWORD( threadItem ), i );
-                    if (tmp <> '') And ( not GikoSys.FAbon.CheckAbonPopupRes(tmp) And( not GikoSys.FAbon.CheckIndividualAbonList(line))) then begin
-                        Res := GikoSys.DivideStrLine(tmp);
-                        if (GikoSys.Setting.ShowMail = false) or (Length(res.FMailTo) = 0) then
-                               Header := IntToStr(Line) + ' \96¼\91O\81F ' + Res.FName + ' \93\8a\8de\93ú\81F ' + Res.FDateTime
-                        else
-                               Header := IntToStr(Line) + ' \96¼\91O\81F ' + Res.FName + ' [' + res.FMailTo + '] \93\8a\8de\93ú\81F ' + Res.FDateTime;
-
-
-                        Body := CustomStringReplace(Res.FBody, '<br> ', #10,true);
-                        Body := CustomStringReplace(Body, '<br>', #10,true);
-                        Body := CustomStringReplace(Body, '</a>', '',true);
-                        Body := GikoSys.DeleteLink(Body);
-                        Body := CustomStringReplace(Body, '&lt;', '<');
-                        Body := CustomStringReplace(Body, '&gt;', '>');
-                        Body := CustomStringReplace(Body, '&quot;', '"');
-                        Body := CustomStringReplace(Body, '&amp;', '&');
-                        Body := CustomStringReplace(Body, '&nbsp;', ' ');
-
-                        FHint.Add(Header, Body);
-                        //FHint.Title := '';
-                    end;
-                end;
-            end else begin
-                for i := StNum to ToNum do begin
-                    Line := i;
-                    FileName := ThreadItem.FilePath;
-                    tmp := GikoSys.ReadThreadFile(FileName, Line);
-                    if (tmp <> '') And ( not GikoSys.FAbon.CheckAbonPopupRes(tmp) And( not GikoSys.FAbon.CheckIndividualAbonList(line))) then begin
-                        Res := GikoSys.DivideStrLine(tmp);
-                        if (GikoSys.Setting.ShowMail = false) or (Length(res.FMailTo) = 0) then 
-                               Header := IntToStr(Line) + ' \96¼\91O\81F ' + Res.FName + ' \93\8a\8de\93ú\81F ' + Res.FDateTime
-                        else
-                               Header := IntToStr(Line) + ' \96¼\91O\81F ' + Res.FName + ' [' + res.FMailTo + '] \93\8a\8de\93ú\81F ' + Res.FDateTime; 
-
-                        Body := CustomStringReplace(Res.FBody, '<br> ', #10,true);
-                        Body := CustomStringReplace(Body, '<br>', #10,true);
-                        Body := CustomStringReplace(Body, '</a>', '',true);
-                        Body := GikoSys.DeleteLink(Body);
-                        Body := CustomStringReplace(Body, '&lt;', '<');
-                        Body := CustomStringReplace(Body, '&gt;', '>');
-                        Body := CustomStringReplace(Body, '&quot;', '"');
-                        Body := CustomStringReplace(Body, '&amp;', '&');
-                         Body := CustomStringReplace(Body, '&nbsp;', ' ');
-                        FHint.Add(Header, Body);
-                        //FHint.Title := '';    //\82½\82Ô\82ñ\82±\82ê\82Í\82¢\82ç\82È\82¢\82ñ\82¾\82¯\82Ç\82Ë\81B\82à\82\82ã   \82â\82Á\82Ï\82è\82¢\82ç\82È\82©\82Á\82½\81i2004/01/13\81j
-                    end;
-                end;
-            end;
-        end;
-    finally
-    end;
-end;
-
-procedure TGikoForm.ShowTextPopup;
-var
-       p: TPoint;
-       ARect: TRect;
-begin
-//     if Trim(s) = '' then
-//             Exit;
-       try
-               FHint.Font.Name := GikoSys.Setting.HintFontName;
-               FHint.Font.Size := GikoSys.Setting.HintFontSize;
-               FHint.Font.Color := GikoSys.Setting.HintFontColor;
-               FHint.Color := GikoSys.Setting.HintBackColor;
-               FHint.HeaderBold := GikoSys.Setting.ResPopupHeaderBold;
-               GetCursorpos(p);
-               if FHint.PopupType = gptRaw then
-                       ARect := FHint.CalcHintRect(Screen.Width, FHint.Caption, nil)
-               else
-                       ARect := FHint.CalcHintRect(Screen.Width, '', nil);
-               case GikoSys.Setting.PopupPosition of
-                       gppRightTop:            OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - (ARect.Bottom - ARect.Top) -     15);
-                       gppRight:                       OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - ((ARect.Bottom - ARect.Top) div 2));
-                       gppRightBottom: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y + 15);
-                       gppTop:                                 OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - (ARect.Bottom - ARect.Top) -  15);
-                       gppCenter:                      OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - ((ARect.Bottom - ARect.Top) div 2));
-                       gppBottom:                      OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y + 15);
-                       gppLeftTop:                     OffsetRect(ARect, p.x + 15, p.y - (ARect.Bottom - ARect.Top) -  15);
-                       gppLeft:                                OffsetRect(ARect, p.x + 15, p.y - ((ARect.Bottom - ARect.Top) div 2));
-                       gppLeftBottom:  OffsetRect(ARect, p.x + 15, p.y + 15);          //\83M\83R\83i\83r\83X\83\8c \83p\81[\83g\82P\82Ì453\8e\81\82É\8a´\8eÓ
-               end;
-               //FHint.ActivateHint(ARect, s);
-               if FHint.PopupType = gptRaw then
-                       FHint.ActivateHint(ARect, FHint.Caption)
-               else
-                       FHint.ActivateHint(ARect, '');
-       except
-               FHint.ReleaseHandle;
-               FHint.ClearAllRes;
-       end;
-end;
-
-procedure TGikoForm.GikoHelpActionExecute(Sender: TObject);
-var
-       FileName: string;
-begin
-       FileName := GikoSys.GetAppDir + 'batahlp.chm';
-       if not FileExists(FileName) then begin
-               MsgBox(
-                       Handle,
-                       '\83w\83\8b\83v\82ª\8c©\82Â\82©\82è\82Ü\82¹\82ñ\82Å\82µ\82½' + #13#10 +
-                       '\83w\83\8b\83v\83t\83@\83C\83\8b\82ð\83M\83R\83i\83r\82Ì\83t\83H\83\8b\83_\82É\92u\82¢\82Ä\82­\82¾\82³\82¢' + #13#10 +
-                       '\83w\83\8b\83v\82Í\83M\83R\83i\83r\82Ì\83T\83C\83g\82É\92u\82¢\82Ä\82 \82è\82Ü\82·',
-                       '\83G\83\89\81[',
-                       MB_ICONSTOP);
-               Exit;
+               end else begin
+                       Result := True;
+               end;
        end;
-       ShellExecute(Handle, 'open', PChar(FileName), '', PChar(GikoSys.GetAppDir), SW_SHOW);
 end;
 
-procedure TGikoForm.ToolButton18Click(Sender: TObject);
+procedure TGikoForm.HistoryAllClearToolButtonClick(Sender: TObject);
 const
-       DEL_MSG = '\97\9a\97ð\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
+       DEL_MSG = '\91S\97\9a\97ð\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
        DEL_TITLE = '\8dí\8f\9c\8am\94F';
 begin
        if FTreeType = gttHistory then begin
                if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then
                        if MsgBox(Handle, DEL_MSG, DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
                                Exit;
-               ClearHistory;
                FHistoryList.Clear;
                TreeView.Items.Clear;
        end;
 end;
 
-procedure TGikoForm.KotehanActionExecute(Sender: TObject);
-var
-       Dlg: TKotehanDialog;
-begin
-       Dlg := TKotehanDialog.Create(Self);
-       try
-               Dlg.ShowModal;
-       finally
-               Dlg.Release;
-       end;
-end;
-
 procedure TGikoForm.SetLinkBar;
 var
        i: Integer;
@@ -8211,7 +4929,7 @@ begin
                LinkBarPopupMenu.Items.Clear;
                for i := LinkToolBar.ButtonCount - 1 downto 0 do
                        //LinkToolBar.RemoveControl(LinkToolBar.Buttons[i]);
-            LinkToolBar.Buttons[i].Free;
+                       LinkToolBar.Buttons[i].Free;
                for i := 0 to FavoriteTreeView.Items.Count - 1 do begin
                        if FavoriteTreeView.Items[i].Text = Favorite.FAVORITE_LINK_NAME then begin
                                for j := 0 to FavoriteTreeView.Items[i].Count - 1 do begin
@@ -8222,12 +4940,12 @@ begin
                                                CreateFavMenu(FavoriteTreeView.Items[i].Item[j], MenuItem);
                                                LinkBarPopupMenu.Items.Add(MenuItem);
                                                ToolButton.MenuItem := MenuItem;
-                                               ToolButton.ImageIndex := TOOL_ICON_FAV_FOLDER;
+                                               ToolButton.ImageIndex := GikoDataModule.TOOL_ICON_FAV_FOLDER;
                                        end else if TObject(FavoriteTreeView.Items[i].Item[j].Data) is TFavoriteBoardItem then begin
-                                               ToolButton.ImageIndex := TOOL_ICON_FAV_BOARD;
+                                               ToolButton.ImageIndex := GikoDataModule.TOOL_ICON_FAV_BOARD;
                                                ToolButton.OnClick := FavoriteClick;
                                        end else if TObject(FavoriteTreeView.Items[i].Item[j].Data) is TFavoriteThreadItem then begin
-                                               ToolButton.ImageIndex := TOOL_ICON_FAV_THREAD;
+                                               ToolButton.ImageIndex := GikoDataModule.TOOL_ICON_FAV_THREAD;
                                                ToolButton.OnClick := FavoriteClick;
                                        end;
                                        ToolButton.Caption := FavoriteTreeView.Items[i].Item[j].Text;
@@ -8342,9 +5060,11 @@ begin
 
        LinkToolButton := TLinkToolButton( Sender );
        SenderNode := TreeNodeDataFind( FavoriteTreeView.Items.GetFirstNode, LinkToolButton.Data );
-
+       SenderNode.Selected := False;
        FavoriteDragDrop( SenderNode, Source );
 
+       SetLinkBar;
+
 end;
 
 procedure TGikoForm.LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
@@ -8561,28 +5281,29 @@ begin
        if ToolBar.Width < bw then begin
                w := 0;
                for i := 0 to ToolBar.ButtonCount - 1 do begin
-                       w := w + ToolBar.Buttons[i].Width;
+                       if ToolBar.Buttons[i].Visible then
+                               w := w + ToolBar.Buttons[i].Width;
                        if ToolBar.Width <= w then begin
-                               Case ToolBar.Buttons[i].Tag of
-                               0:
-                                       begin
-                                               Item := TMenuItem.Create(Self);
-                                               if ToolBar.Buttons[i].Style = tbsSeparator then
-                                                       Item.Caption := '-'
-                                               else begin
+                               if ToolBar.Buttons[i].Tag = 0 then begin
+                                       Item := TMenuItem.Create(Self);
+                                       if ToolBar.Buttons[i].Style = tbsSeparator then
+                                               Item.Caption := '-'
+                                       else begin
+                                               //\83X\83\8c\8di\8d\9e\82ÝComBox\82ÌTPanel\82ð\94r\8f\9c\82·\82é
+                                               if TObject(ToolBar.Buttons[i]) is TPanel then begin
+                                                       Continue;
+                                               end else begin
                                                        Item.Caption := ToolBar.Buttons[i].Caption;
                                                        Item.Action := ToolBar.Buttons[i].Action;
-                                                       //Item.Visible := True;
-                                               end;
-                                               ChevronPopupMenu.Items.Add(Item);
-                                               if ToolBar.Buttons[i].DropdownMenu <> nil then begin
-                                                       Item.Action := nil;
-                                                       Item.OnClick := nil;
-                                                       SetSubMenu(ToolBar.Buttons[i].DropdownMenu, Item);
                                                end;
+                                               //Item.Visible := True;
+                                       end;
+                                       ChevronPopupMenu.Items.Add(Item);
+                                       if ToolBar.Buttons[i].DropdownMenu <> nil then begin
+                                               Item.Action := nil;
+                                               Item.OnClick := nil;
+                                               SetSubMenu(ToolBar.Buttons[i].DropdownMenu, Item);
                                        end;
-                               else
-                                       // \8f«\97\88\82Ì\82½\82ß\82Ì\97\\96ñ
                                end;
                        end;
                end;
@@ -8768,110 +5489,17 @@ begin
        end;
 end;
 
-procedure TGikoForm.ThreadEditorActionExecute(Sender: TObject);
-var
-       Editor: TEditorForm;
-begin
-       if not (GetActiveList is TBoard) then
-               Exit;
-       Editor := TEditorForm.Create(Self);
-       Editor.SetBoard(TBoard(GetActiveList));
-       Editor.Show;
-       Editor.BodyEdit.SetFocus;
-end;
-
-procedure TGikoForm.ToolBarSettingActionExecute(Sender: TObject);
-var
-       Dlg: TToolBarSettingDialog;
-       i: Integer;
-       //Component: TComponent;
-begin
-       Dlg := TToolBarSettingDialog.Create(Self, ActionList);
-       try
-               Dlg.AddToolBar(StdToolBar, gttStandard);
-               Dlg.AddToolBar(ListToolBar, gttList);
-               Dlg.AddToolBar(BrowserToolBar, gttBrowser);
-               case FToolBarSettingSender of
-               tssMain:                Dlg.ToolBarIndex := 0;
-               tssList:                Dlg.ToolBarIndex := 1;
-               tssBrowser: Dlg.ToolBarIndex := 2;
-               end;
-               {
-               if ToolBarSettingAction.ActionComponent.GetParentComponent is TPopupMenu then begin
-                       Component := TPopupMenu( ToolBarSettingAction.ActionComponent.GetParentComponent ).PopupComponent;
-
-                       if Component = MainCoolBar then
-                               Dlg.ToolBarComboBox.ItemIndex := 0
-                       else if Component = ListCoolBar then
-                               Dlg.ToolBarComboBox.ItemIndex := 1
-                       else if Component = BrowserCoolBar then
-                               Dlg.ToolBarComboBox.ItemIndex := 2;
-               end;
-               }
-               if Dlg.ShowModal = mrOK then begin
-                       SetToolBarPopup;
-
-                       //\8dÅ\93K\95\9d\82ð\8dÄ\90Ý\92è\82·\82é\82½\82ß\82É\93K\93\96\82È\83v\83\8d\83p\83e\83B\82ð\82¢\82\82­\82é
-                       for i := 0 to MainCoolBar.Bands.Count - 1 do begin
-                               MainCoolBar.Bands[i].MinWidth := MainCoolBar.Bands[i].MinWidth + 1;
-                               MainCoolBar.Bands[i].MinWidth := MainCoolBar.Bands[i].MinWidth - 1;
-                       end;
-                       for i := 0 to ListCoolBar.Bands.Count - 1 do begin
-                               ListCoolBar.Bands[i].MinWidth := ListCoolBar.Bands[i].MinWidth + 1;
-                               ListCoolBar.Bands[i].MinWidth := ListCoolBar.Bands[i].MinWidth - 1;
-                       end;
-                       for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
-                               BrowserCoolBar.Bands[i].MinWidth := BrowserCoolBar.Bands[i].MinWidth + 1;
-                               BrowserCoolBar.Bands[i].MinWidth := BrowserCoolBar.Bands[i].MinWidth - 1;
-                       end;
-                       SaveToolBarSetting(StdToolBar);
-                       SaveToolBarSetting(ListToolBar);
-                       for i := ListToolBar.ControlCount - 1 downto 0 do
-                       begin
-                               if ListToolBar.Controls[ i ].Action = SelectItemAction then
-                               begin
-                                       // \83X\83\8c\83b\83h\8di\8d\9e\82Ì\97×\82É\83Z\83p\83\8c\81[\83^\82ª\82 \82é\8fê\8d\87\82Í\89B\82·
-                                       if (i + 1) < ListToolBar.ControlCount then
-                                               if ListToolBar.Controls[ i + 1 ] is TToolButton then
-                                                       if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
-                                                               ListToolBar.Controls[ i + 1 ].Visible := False;
-
-                                       // \83X\83\8c\83b\83h\8di\8d\9e\83{\83^\83\93\82ð\89B\82·
-                                       ListToolBar.Controls[ i ].Visible := False;
-                                       // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82ð\91}\93ü
-                                       SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
-                                       SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
-                                       SelectComboBox.Parent := ListToolBar;
-                                       // \83X\83\8c\83b\83h\8di\8d\9e\97p\93Æ\8e©\83Z\83p\83\8c\81[\83^\82ð\91}\93ü
-                                       SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
-                                       SelectComboBoxSplitter.Parent := ListToolBar;
-
-                                       break;
-                               end;
-                       end;
-                       ResetBandInfo( ListCoolBar, ListToolBar );
-                       SaveToolBarSetting(BrowserToolBar);
-               end;
-       finally
-               Dlg.Release;
-               FToolBarSettingSender := tssNone;
-       end;
-end;
-
 function TGikoForm.FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
 var
        i : Integer;
 begin
-
+       Result := nil;
        for i := bar.ButtonCount - 1 downto 0 do begin
                if bar.Buttons[ i ].Action = action then begin
                        Result := bar.Buttons[ i ];
-                       Exit;
+                       Break;
                end;
        end;
-
-       Result := nil;
-
 end;
 
 procedure TGikoForm.SetToolBarPopup;
@@ -8885,21 +5513,21 @@ begin
        for i := 0 to StdToolBar.ButtonCount - 1 do begin
        end;
        for i := 0 to ListToolBar.ButtonCount - 1 do begin
-               if ListToolBar.Buttons[i].Action = IconStyle then
+               if ListToolBar.Buttons[i].Action = GikoDM.IconStyle then
                        ListToolBar.Buttons[i].DropdownMenu := ListIconPopupMenu;
-               if ListToolBar.Buttons[i].Action = SelectReservAction then
+               if ListToolBar.Buttons[i].Action = GikoDM.SelectReservAction then
                        ListToolBar.Buttons[i].DropdownMenu := RoundNamePopupMenu;
        end;
-       aIEButton                                       := FindToolBarButton( BrowserToolBar, IEAction );
+       aIEButton                                       := FindToolBarButton( BrowserToolBar, GikoDM.IEAction );
        if aIEButton <> nil then
                aIEButton.DropdownMenu                                  := BrowserPopupMenu;
-       aCabinetBBSButton       := FindToolBarButton( StdToolBar, CabinetBBSAction );
+       aCabinetBBSButton       := FindToolBarButton( StdToolBar, GikoDM.CabinetBBSAction );
        if aCabinetBBSButton <> nil then
                aCabinetBBSButton.DropdownMenu  := BBSSelectPopupMenu;
-       aResRangeButton         := FindToolBarButton( BrowserToolBar, ResRangeAction );
+       aResRangeButton         := FindToolBarButton( BrowserToolBar, GikoDM.ResRangeAction );
        if aResRangeButton <> nil then
                aResRangeButton.DropdownMenu            := ResRangePopupMenu;
-       aThreadRangeButton:= FindToolBarButton( ListToolBar, ThreadRangeAction );
+       aThreadRangeButton:= FindToolBarButton( ListToolBar, GikoDM.ThreadRangeAction );
        if aThreadRangeButton <> nil then
                aThreadRangeButton.DropdownMenu := ThreadRangePopupMenu;
 end;
@@ -8936,79 +5564,89 @@ begin
                        else
                                Handled := False;
 
-{
-//                     if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
-                               // TWebBrowser \82Ì Handle \82Æ\94ä\8ar\82µ\82Ä\82à\88ê\92v\82µ\82È\82¢\82Ì\82Å\8dÀ\95W\82Å TWebBrowser \82©\82Ç\82¤\82©\94»\92è
-                               browserPos.X := 0;
-                               browserPos.Y := 0;
-                               Windows.ClientToScreen( Browser.Handle, browserPos );
-                               if (Longword(Mouse.CursorPos.X - browserPos.X) >= Browser.Width)
-                               or (Longword(Mouse.CursorPos.Y - browserPos.Y) >= Browser.Height)
-                               or (Longword(Mouse.CursorPos.Y - browserPos.Y) < 0)
-                               or (Longword(Mouse.CursorPos.Y - browserPos.Y) < 0) then begin
-//                             or not FActiveContent.Browser.Focused then
-                                       // TWebBrowser \82Í\96³\8cÀ\83\8b\81[\83v\82·\82é\82Ì\82Å\82»\82ê\88È\8aO\82È\82ç\83R\83\93\83g\83\8d\81[\83\8b\82É\91\97\90M
-                                       if (Wnd <> BrowserToolBar.Handle) and (Wnd <> BrowserNameToolBar.Handle) then
-                                               SendMessage( Wnd, WM_MOUSEWHEEL, WheelDelta shl 16, (Mouse.CursorPos.X shl 16) or Mouse.CursorPos.Y )
-                                       else
-                                               Handled := False;
-                               end else begin
-                                       Handled := False;
-                               end;
-//                     end else begin
-//                             SendMessage( Wnd, WM_MOUSEWHEEL, WheelDelta shl 16, (MousePos.X shl 16) or MousePos.Y );
-//                     end;
-}              end;
+               end;
        end;
 end;
 
-
-procedure TGikoForm.SelectComboBoxChange(Sender: TObject);
+procedure TGikoForm.SetSelectWord( const text : string );
 begin
-       if Length( SelectComboBox.Text ) = 0 then
+       // \83X\83\8c\88ê\97\97\82Ì\94Í\88Í\8ew\92è\82ð\89ð\8f\9c
+       ClearThreadRengeAction;
+
+       if Length( text ) = 0 then
        begin
-               AllItemAction.Checked := True;
-               LogItemAction.Checked := False;
-               NewItemAction.Checked := False;
+               GikoDM.AllItemAction.Checked := True;
+               SetListViewType( gvtAll )
        end else begin
-               // \83`\83\89\82Â\82­\82Æ\8c\99\82¾\82©\82ç\81A\88ê\89\9e\89\9f\82µ\82Ä\82 \82é\82Æ\82«\82¾\82¯\8f\88\97\9d\82·\82é
-               if AllItemAction.Checked then
-                                               AllItemAction.Checked := False;
-               if LogItemAction.Checked then
-                                               LogItemAction.Checked := False;
-               if NewItemAction.Checked then
-                                               NewItemaction.Checked := False;
+               SetListViewType( gvtUser, text, false );
        end;
+end;
+
+procedure TGikoForm.SelectComboBoxChange(Sender: TObject);
+begin
+
+       SetSelectWord( SelectComboBox.Text );
 
-       if Length( SelectComboBox.Text ) = 0 then
-               SetListViewType( gvtAll )
-       else
-               SetListViewType( gvtUser, SelectComboBox.Text, false);
 end;
 
 procedure TGikoForm.SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
        Shift: TShiftState);
+var
+  IMC: HIMC;
+  Len: integer;
+  Str: string;
+  tmp: string;
 begin
 
        if Key = VK_Return then
        begin
                ModifySelectList;
+       end else if Key = 229 then begin
+               if GikoSys.Setting.UseUndecided then begin
+                       IMC := ImmGetContext(SelectComboBox.Handle); //\83R\83\93\83e\83L\83X\83g\8eæ\93¾
+                       Len := ImmGetCompositionString(IMC, GCS_COMPSTR, nil, 0); //\82Ü\82¸\92·\82³\82ð\8eæ\93¾
+                       SetLength(Str, Len + 1); //Buffer\82Ì\83\81\83\82\83\8a\82ð\90Ý\92è
+                       ImmGetCompositionString(IMC, GCS_COMPSTR, PChar(Str), Len + 1); //\82Ü\82¸\92·\82³\82ð\8eæ\93¾
+                       ImmReleaseContext(SelectComboBox.Handle, IMC);  //\83R\83\93\83e\83L\83X\83g\89ð\95ú
+                       SetLength(Str, Len);
+                       if SelectComboBox.SelLength > 0 then begin //\91I\91ð\92\86\82Ì\95\8e\9a\97ñ\82ª\82 \82é\82©
+                               tmp := Copy(SelectComboBox.Text, 1, SelectComboBox.SelStart);
+                               Str := tmp + Str + Copy(SelectComboBox.Text, SelectComboBox.SelStart + SelectComboBox.SelLength + 1, Length(SelectComboBox.Text));
+                       end else
+                               Str := SelectComboBox.Text + Str;
+
+                       if (Length(Str) > 0) then begin
+                               SetSelectWord(Str);
+                       end;
+               end;
        end else if Length( SelectComboBox.Text ) = 0 then
        begin
-               AllItemAction.Checked := True;
-               LogItemAction.Checked := False;
-               NewItemAction.Checked := False;
+               {* SelectComboBox.Text\82ª\8bó\82Å\82à\81A\93ü\97Í\93r\92\86\82ÅEsc\82µ\82½\82Æ\82©
+                * \8bó\82Ì\82Æ\82«\82ÉDel\83L\81[\82ð\89\9f\82µ\82½\82Æ\82©\82È\82Ì\82Å\81A\83X\83\8c\82Ì\8di\8d\9e\82Ý\82ð\88Û\8e\9d\82·\82é\81B
+                * \81i\82±\82±\82Å\82Í\89½\82à\82µ\82È\82¢\81j
+                *}
        end else begin
-               // \83`\83\89\82Â\82­\82Æ\8c\99\82¾\82©\82ç\81A\88ê\89\9e\89\9f\82µ\82Ä\82 \82é\82Æ\82«\82¾\82¯\8f\88\97\9d\82·\82é
-               if AllItemAction.Checked then
-                       AllItemAction.Checked := False;
-               if LogItemAction.Checked then
-                       LogItemAction.Checked := False;
-               if NewItemAction.Checked then
-                       NewItemaction.Checked := False;
+        // \83X\83\8c\88ê\97\97\82Ì\94Í\88Í\8ew\92è\82ð\89ð\8f\9c
+               ClearThreadRengeAction;
        end;
 
 end;
+//! \83X\83\8c\83b\83h\88ê\97\97\82Ì\95\\8e¦\94Í\88Í\90Ý\92è\83`\83F\83b\83N\83N\83\8a\83A
+procedure TGikoForm.ClearThreadRengeAction;
+begin
+       // \83`\83\89\82Â\82­\82Æ\8c\99\82¾\82©\82ç\81A\88ê\89\9e\89\9f\82µ\82Ä\82 \82é\82Æ\82«\82¾\82¯\8f\88\97\9d\82·\82é
+       if GikoDM.AllItemAction.Checked then
+               GikoDM.AllItemAction.Checked := False;
+       if GikoDM.LogItemAction.Checked then
+               GikoDM.LogItemAction.Checked := False;
+       if GikoDM.NewItemAction.Checked then
+               GikoDM.NewItemaction.Checked := False;
+       if GikoDM.LiveItemAction.Checked then
+               GikoDM.LiveItemAction.Checked := False;
+       if GikoDM.ArchiveItemAction.Checked then
+               GikoDM.ArchiveItemAction.Checked := False;
+
+end;
 
 procedure TGikoForm.SelectComboBoxExit(Sender: TObject);
 begin
@@ -9017,8 +5655,8 @@ begin
 
        if Length( SelectComboBox.Text ) = 0 then
        begin
-               SelectComboBox.Text := SELECTCOMBOBOX_NAME;
-               SelectComboBox.Color := SELECTCOMBOBOX_COLOR;
+               SelectComboBox.Text := GikoDataModule.SELECTCOMBOBOX_NAME;
+               SelectComboBox.Color := GikoDataModule.SELECTCOMBOBOX_COLOR;
        end;
 
 end;
@@ -9031,7 +5669,7 @@ var
 begin
 
        try
-               if SelectComboBox.Parent = nil then
+               if not SelectComboBoxPanel.Visible then
                        exit;
 
                if Length( SelectComboBox.Text ) > 0 then
@@ -9053,198 +5691,18 @@ begin
 end;
 
 
-//NG\83\8f\81[\83h\83t\83@\83C\83\8b\82ð\8dÄ\93Ç\82Ý\8d\9e\82Ý\82·\82é
-procedure TGikoForm.SelectResActionExecute(Sender: TObject);
-var
-       Dlg: TListSelectDialog;
-       ThreadItem : TThreadItem;
-       FilterList : TStringList;
-       i, idx : Integer;
-begin
-       Dlg := TListSelectDialog.Create(Self);
-       try
-               Dlg.SelectComboBox.Items.Assign(GikoSys.Setting.SelectTextList);
-               Dlg.SelectComboBox.Text := FSelectResWord;
-               Dlg.ShowModal;
-               if Dlg.ModalResult = mrOK then begin
-                       SelectResAction.Checked := True;
-                       if Length( Dlg.SelectComboBox.Text ) = 0 then begin
-                               // \8bó\93ü\97Í\82Å OK \82Í\8di\82è\8d\9e\82Ý\89ð\8f\9c\82Æ\93¯\88Ó\8b`
-                               ResRangeAction.Execute;
-                       end else begin
-                               GikoSys.ResRange := Ord( grrSelect );
-
-                               // \8dÅ\8cã\82É\90Ý\92è\82µ\82½\82à\82Ì\82ð\8ao\82¦\82Ä\82¨\82­
-                               FSelectResWord := Dlg.SelectComboBox.Text;
-
-                               // \8c\9f\8dõ\97\9a\97ð\82Ì\8dX\90V
-                               idx := GikoSys.Setting.SelectTextList.IndexOf(Dlg.SelectComboBox.Text);
-                               if idx <> -1 then
-                                       GikoSys.Setting.SelectTextList.Delete(idx);
-                               GikoSys.Setting.SelectTextList.Insert(0, Dlg.SelectComboBox.Text);
-                               while Dlg.SelectComboBox.Items.Count > 100 do begin
-                                       Dlg.SelectComboBox.Items.Delete(Dlg.SelectComboBox.Items.Count - 1);
-                               end;
-
-                               try
-                                       if SelectComboBox.Parent <> nil then
-                                               SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
-                               except
-                               end;
-
-                               // \83t\83B\83\8b\83^\82Ì\90Ý\92è
-                               FilterList := TStringList.Create;
-                               try
-                                       GikoSys.FSelectResFilter.Reverse := True;
-                                       FilterList.Delimiter := ' '; //\8bæ\90Ø\82è\8eq\82ð\94¼\8ap\83X\83y\81[\83X\82É\90Ý\92è
-                                       FilterList.DelimitedText := Dlg.SelectComboBox.Text;
-
-                                       GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
-                               finally
-                                       FilterList.Destroy;
-                               end;
-
-                               // \83X\83\8c\83b\83h\82Ì\8dÄ\95`\89æ
-                               for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                    TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-                               end;
-                               ThreadItem := GetActiveContent;
-                               if ThreadItem <> nil then
-                                       InsertBrowserTab( ThreadItem, True );
-                       end;
-               end else begin
-                       // \83L\83\83\83\93\83Z\83\8b
-                       if GikoSys.ResRange <> Ord( grrSelect ) then
-                               ResRangeAction.Execute;
-               end;
-       finally
-               Dlg.Release;
-       end;
-
-end;
-
-procedure TGikoForm.SelectResActionUpdate(Sender: TObject);
-begin
-       SelectResAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
-end;
-
-// \91S\82Ä\82Ì\83\8c\83X\82ð\95\\8e¦
-procedure TGikoForm.AllResActionExecute(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       FilterList : TStringList;
-       i: Integer;
-begin
-       if(FActiveContent <> nil) and (FActiveContent.FBrowser <> nil )
-               and (FActiveContent.FBrowser.Busy) then Exit;
-
-       FResRangeMenuSelect                             := Ord( grrAll );
-       AllResAction.Checked                    := True;
-
-       if GikoSys.ResRange <> Ord( grrAll ) then begin
-               GikoSys.ResRange := Ord( grrAll );
-
-               // \83t\83B\83\8b\83^\95\8e\9a\97ñ\82ð\8bó\82É\82·\82é
-               FilterList := TStringList.Create;
-               try
-                       GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
-                       GikoSys.FSelectResFilter.Reverse := False;
-               finally
-                       FilterList.Destroy;
-               end;
-
-               FSelectResWord := '';
-
-               // \83X\83\8c\83b\83h\82ð\8dÄ\95`\89æ
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-               end;
-               ThreadItem := GetActiveContent;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
-       end;
-end;
-
-procedure TGikoForm.AllResActionUpdate(Sender: TObject);
-begin
-       AllResAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
-end;
-
-procedure TGikoForm.ReloadClick(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       i: Integer;
-begin
-       if GikoSys.FAbon.ReLoadFromNGwordFile =false then begin
-               MsgBox(Handle, 'NG\83\8f\81[\83h\83t\83@\83C\83\8b\82Ì\8dÄ\93Ç\82Ý\8d\9e\82Ý\82É\8e¸\94s\82µ\82Ü\82µ\82½', '\83G\83\89\81[', MB_OK or MB_ICONEXCLAMATION);
-       end else begin
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-                       
-               ThreadItem := GetActiveContent;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
-       end;
-
-end;
-
-procedure TGikoForm.GoBackClick(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       s: string;
-       i: Integer;
-begin
-       if GikoSys.FAbon.GoForward =false then begin
-               MsgBox(Handle, '\88ê\82Â\91O\82ÌNG\83\8f\81[\83h\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý\82É\8e¸\94s\82µ\82Ü\82µ\82½', '\83G\83\89\81[', MB_OK or MB_ICONEXCLAMATION);
-       end else begin
-               s := GikoSys.FAbon.NGwordname;
-               StatusBar.Panels.Items[2].Text := s;
-               StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
-               StatusBarResize(Sender);
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-
-               ThreadItem := GetActiveContent;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
-       end;
-
-end;
-
-procedure TGikoForm.GoFowardClick(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       s: string;
-       i: Integer;
-begin
-       if GikoSys.FAbon.GoBack =false then begin
-               MsgBox(Handle, '\88ê\82Â\8cã\82ë\82ÌNG\83\8f\81[\83h\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý\82É\8e¸\94s\82µ\82Ü\82µ\82½', '\83G\83\89\81[', MB_OK or MB_ICONEXCLAMATION);
-       end else begin
-               s := GikoSys.FAbon.NGwordname;
-               StatusBar.Panels.Items[2].Text := s;
-               StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
-               StatusBarResize(Sender);
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-
-               ThreadItem := GetActiveContent;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
-       end;
-
-end;
-
 procedure TGikoForm.SelectComboBoxSplitterMouseMove(Sender: TObject;
        Shift: TShiftState; X, Y: Integer);
 var
        pos                             : TPoint;
        w                                       : Integer;
 begin
-       If (SelectComboBox.Parent <> nil) and (IsDraggingSelectComboBox) Then begin
+       If (SelectComboBoxPanel.Visible) and (IsDraggingSelectComboBox) Then begin
                pos.X := X;
                pos.Y := Y;
                pos := SelectComboBoxSplitter.ClientToScreen( pos );
-               w := SelectComboBox.Width + (pos.X - DraggingSelectComboBoxPosition.X);
+               //w := SelectComboBox.Width + (pos.X - DraggingSelectComboBoxPosition.X);
+               w := SelectComboBoxPanel.Width + (pos.X - DraggingSelectComboBoxPosition.X);
 
                If w <= 50 Then Begin
                        // \8e\9f\82Ì\88Ú\93®\82Ì\8aî\8f\80\82ª\81u\89ß\82¬\82Ä\82µ\82Ü\82Á\82½\88Ê\92u\81v\82Å\82Í\82È\82­
@@ -9256,8 +5714,10 @@ begin
                End;
 
                // \83`\83\89\82Â\82«\8cy\8c¸\82Ì\88×
-               If SelectComboBox.Width <> w Then Begin
-                       SelectComboBox.Width := w;
+               //If SelectComboBox.Width <> w Then Begin
+               If SelectComboBoxPanel.Width <> w Then Begin
+                       SelectComboBoxPanel.Width := w;
+                       SelectComboBox.Width := SelectComboBoxPanel.Width - SelectComboBoxSplitter.Width;
                        GikoSys.Setting.SelectComboBoxWidth := w;
                        DraggingSelectComboBoxPosition := pos;
 
@@ -9265,222 +5725,44 @@ begin
                        ResetBandInfo( ListCoolBar, ListToolBar );
                End;
        End;
-end;
-
-procedure TGikoForm.SelectComboBoxSplitterMouseDown(Sender: TObject;
-       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-var
-       pos : TPoint;
-begin
-       IsDraggingSelectComboBox := True;
-       pos.X := X;
-       pos.Y := Y;
-       DraggingSelectComboBoxPosition := SelectComboBoxSplitter.ClientToScreen( pos );
-end;
-
-procedure TGikoForm.SelectComboBoxSplitterMouseUp(Sender: TObject;
-       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-begin
-       IsDraggingSelectComboBox := False;
-end;
-
-procedure TGikoForm.StatusBarResize(Sender: TObject);
-begin
-       StatusBar.Panels[1].Width := StatusBar.Width -
-                                                                                                                        StatusBar.Panels[0].Width -
-                                                                                                                        StatusBar.Panels[2].Width;
-end;
-//\8cÂ\95Ê\82 \82Ú\81[\82ñ\81u\92Ê\8fí\81v
-procedure TGikoForm.IndividualAbon1Click(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       i: Integer;
-begin
-       GikoSys.FAbon.AddIndividualAbon(KokoPopupMenu.Tag,1);
-       ThreadItem := GetActiveContent;
-       for i := BrowserTab.Tabs.Count - 1 downto 0 do
-               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-
-       if ThreadItem <> nil then
-               InsertBrowserTab( ThreadItem, True );
-end;
-//\8cÂ\95Ê\82 \82Ú\81[\82ñ\81u\93§\96¾\81v
-procedure TGikoForm.IndividualAbon2Click(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       i: Integer;
-begin
-       GikoSys.FAbon.AddIndividualAbon(KokoPopupMenu.Tag,0);
-       ThreadItem := GetActiveContent;
-       for i := BrowserTab.Tabs.Count - 1 downto 0 do
-               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-       if ThreadItem <> nil then
-               InsertBrowserTab( ThreadItem, True );
-end;
-//\8cÂ\95Ê\82 \82Ú\81[\82ñ\89ð\8f\9c\81i\81j
-procedure TGikoForm.AntiIndividualAbonClick(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       msg : String;
-       i: Integer;
-begin
-       if GikoSys.FAbon.GetAbonResCount <> 0 then begin
-               GikoSys.FAbon.DeleteIndividualAbon(KokoPopupMenu.Tag);
-               ThreadItem := GetActiveContent;
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
-       end else begin
-               msg := '\82±\82Ì\83X\83\8c\83b\83h\82Å\82Í\8cÂ\95Ê\82 \82Ú\81`\82ñ\82ð\8ds\82Á\82Ä\82Ü\82¹\82ñ';
-               MsgBox(Handle, msg, '\83\81\83b\83Z\81[\83W', MB_OK);
-       end;
-end;
-//\8cÂ\95Ê\82 \82Ú\81[\82ñ\89ð\8f\9c
-procedure TGikoForm.N42Click(Sender: TObject);
-var
-       IndividualForm :TIndividualAbonForm;
-       ThreadItem : TThreadItem;
-       i : Integer;
-       msg : String;
-begin
-       IndividualForm := TIndividualAbonForm.Create(Self);
-       try
-               if GikoSys.FAbon.GetAbonResCount <> 0 then begin
-                       for i :=0 to GikoSys.FAbon.GetAbonResCount-1 do begin
-                       IndividualForm.ComboBox1.Items.Add(GikoSys.FAbon.GetAbonResString(i));
-                       end;
-                       if IndividualForm.ShowModal = mrOK then begin
-                               GikoSys.FAbon.DeleteIndividualAbon(IndividualForm.ResNumber);
-               end;
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-               ThreadItem := GetActiveContent;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
-               end else begin
-                       msg := '\82±\82Ì\83X\83\8c\83b\83h\82Å\82Í\8cÂ\95Ê\82 \82Ú\81`\82ñ\82ð\8ds\82Á\82Ä\82Ü\82¹\82ñ';
-                       MsgBox(Handle, msg, '\83\81\83b\83Z\81[\83W', MB_OK);
-               end;
-       finally
-               IndividualForm.Free;
-       end;
-end;
-
-procedure TGikoForm.SelectComboBoxEnter(Sender: TObject);
-begin
-
-       if (Length( SelectComboBox.Text ) = 0) or
-               (SelectComboBox.Text = SELECTCOMBOBOX_NAME) then
-       begin
-               SelectComboBox.Text := '';
-               SelectComboBox.Color := clWindow;
-       end;
-
-end;
-
-procedure TGikoForm.N51Click(Sender: TObject);
-begin
-       N42Click(Sender);
-end;
-//\94Â\96¼\8c\9f\8dõ
-procedure TGikoForm.TreeSelectSearchBoardNameExecute(Sender: TObject);
-var
-       s : String;
-       msg : String;
-       CurItem : TTreeNode;
-       next : boolean;
-begin
-       if InputQuery('\94Â\96¼\8c\9f\8dõ','\94Â\96¼\82Ì\93ü\97Í',s) then begin
-               next := true;
-               while next do begin
-                       if TreeView.Selected = nil then
-                               CurItem := TreeView.Items.GetFirstNode
-                       else begin
-                               CurItem := TreeView.Selected.GetNext;
-                               if CurItem = nil then
-                                       CurItem := TreeView.Items.GetFirstNode;
-                       end;
-                       while CurItem <> nil do begin
-                               if (CurItem.ImageIndex <> 2) and (VaguePos(s,CurItem.Text) <> 0) then begin
-                                       break;
-                               end;
-                               CurItem := CurItem.GetNext;
-                       end;
-                       try
-                               if CurItem = nil then begin
-                                       msg := '\90æ\93ª\82É\96ß\82è\82Ü\82·\82©\81H';
-                                       if MsgBox(Handle, msg, '', MB_YESNO or MB_ICONEXCLAMATION) = mrYes      then begin
-                                               CurItem := TreeView.Items.GetFirstNode;
-                                       end else begin
-                                               Exit;
-                                       end;
-                                       TreeView.Select(CurItem);
-                                       TreeView.SetFocus;
-                               end else begin
-                                       TreeView.Select(CurItem);
-                                       TreeView.SetFocus;
-                                       msg := '\8e\9f\82É\8ds\82«\82Ü\82·\82©\81H';
-                                       if MsgBox(Handle, msg, '', MB_YESNO or MB_ICONEXCLAMATION) = mrYes      then begin
-                                               next := true;
-                                       end else begin
-                                               next := false;
-                                       end;
-                               end;
 
-                       except
-                               Exit;
-                       end;
-               end;
-       end;
 end;
 
-procedure TGikoForm.CabinetFavoriteActionExecute(Sender: TObject);
+procedure TGikoForm.SelectComboBoxSplitterMouseDown(Sender: TObject;
+       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 var
-       i, b : Integer;
-       item : TMenuItem;
+       pos : TPoint;
 begin
+       IsDraggingSelectComboBox := True;
+       pos.X := X;
+       pos.Y := Y;
+       DraggingSelectComboBoxPosition := SelectComboBoxSplitter.ClientToScreen( pos );
 
-       if CabinetPanel.Visible then begin
-               if FTreeType = gttFavorite then begin
-                       CabinetVisible( False );
-                       CabinetFavoriteAction.Checked := False;
-               end else begin
-                       CabinetFavoriteAction.Checked := True;
-               end;
-       end else begin
-               CabinetVisible( True );
-               CabinetFavoriteAction.Checked := True;
-       end;
-
-       // BBS...BBS, History, Favorite
-       GikoSys.Setting.CabinetIndex := CabinetSelectPopupMenu.Items.Count - 1;
-
-       b := CabinetSelectPopupMenu.Items.Count - 1;
-       for i := 0 to b do begin
-               item := CabinetSelectPopupMenu.Items[ i ];
-               if item is TBBSMenuItem then begin
-                       item.Checked := False;
-                       // CabinetMenu \82Í CabinetSelectPopupMenu \82Æ\93¯\82\82Æ\8c\88\82ß\82¤\82¿\82µ\82¿\82á\82¤
-                       CabinetMenu.Items[ i ].Checked := False;
-               end;
-       end;
+end;
 
-       // \83L\83\83\83r\83l\83b\83g\83c\81[\83\8b\83o\81[\8by\82Ñ\83L\83\83\83r\83l\83b\83g\82Ì\95\\8e¦\90Ø\91Ö
-       HistoryToolBar.Hide;
-       FavoriteToolBar.Show;
-       TreeView.Visible := False;
-       FavoriteTreeView.Visible := True;
+procedure TGikoForm.SelectComboBoxSplitterMouseUp(Sender: TObject;
+       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+       IsDraggingSelectComboBox := False;
 
-       CabinetSelectToolButton.Caption := '\82¨\8bC\82É\93ü\82è';
-       FTreeType := gttFavorite;
+end;
 
-       // \83\81\83j\83\85\81[\8by\82Ñ\83{\83^\83\93\82Ì\83`\83F\83b\83N\82ð\90Ý\92è
-       CabinetBBSAction.Checked := False;
-       CabinetHistoryAction.Checked := False;
+procedure TGikoForm.StatusBarResize(Sender: TObject);
+begin
+       StatusBar.Panels[1].Width := StatusBar.Width -
+                                       StatusBar.Panels[0].Width -
+                                       StatusBar.Panels[THREADSIZE_PANEL].Width -
+                                       StatusBar.Panels[NGWORDNAME_PANEL].Width;
+end;
+procedure TGikoForm.SelectComboBoxEnter(Sender: TObject);
+begin
 
-       // \82¨\8bC\82É\93ü\82è\82Ì\83c\83\8a\81[\82ð\93W\8aJ
-       FavoriteTreeView.Items.GetFirstNode.Expanded := True;
+       if (Length( SelectComboBox.Text ) = 0) or
+               (SelectComboBox.Text = GikoDataModule.SELECTCOMBOBOX_NAME) then
+       begin
+               SelectComboBox.Text := '';
+               SelectComboBox.Color := clWindow;
+       end;
 
 end;
 
@@ -9539,7 +5821,7 @@ begin
                Node.ImageIndex := 16;
                Node.SelectedIndex := 16;
        end else if Source is TBrowserRecord then begin
-               ThreadItem := TBrowserRecord( Source ).FThread;
+               ThreadItem := TBrowserRecord( Source ).Thread;
                FavoThreadItem                          := TFavoriteThreadItem.CreateWithItem( ThreadItem );
                Node := FavoriteDM.TreeView.Items.AddChildObject(FavNode, ThreadItem.Title, FavoThreadItem);
                Node.ImageIndex := 16;
@@ -9573,33 +5855,20 @@ begin
                        SenderNode := FDropSpaceNode;
 
        if Source = FavoriteTreeView then begin
-
                SourceNode := FavoriteTreeView.Selected;
                FavoriteMoveTo( SenderNode, SourceNode );
-
        end else if Source is TLinkToolButton then begin
-
                LinkToolButton := TLinkToolButton( Source );
-               //ShowMessage(LinkToolButton.Text);
                SourceNode := TreeNodeDataFind( FavoriteTreeView.Items.GetFirstNode, LinkToolButton.Data );
                FavoriteMoveTo( SenderNode, SourceNode );
-
        end else if Source = BrowserTab then begin
-
                idx := BrowserTab.TabIndex;
                FavoriteAddTo( SenderNode, BrowserTab.Tabs.Objects[idx] );
        end else if Source = ListView then begin
-
                FavoriteAddTo( SenderNode, ListView.Selected.Data );
-
        end else if Source = TreeView then begin
-
                FavoriteAddTo( SenderNode, TreeView.Selected.Data );
-
        end;
-
-       SetLinkBar;
-
 end;
 
 procedure TGikoForm.FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
@@ -9613,16 +5882,26 @@ begin
                FavoriteDragDrop( SenderNode, Source );
        end;
 
+       //\8bó\94\92\8d\80\96Ú\82ª\82¢\82½\82ç\8dí\8f\9c\82·\82é
        if FDropSpaceNode <> nil then begin
-               FDropSpaceNode.Free;
-               FDropSpaceNode := nil;
+               try
+                       FDropSpaceNode.Delete;
+               finally
+                       FDropSpaceNode := nil;
+               end;
        end;
+       //\8dX\90V\82µ\82½\82±\82Æ\82ð\8b³\82¦\82é
+       FavoriteDM.Modified := true;
+
+       SetLinkBar;
 
 end;
 
 procedure TGikoForm.FavoriteTreeViewEdited(Sender: TObject;
        Node: TTreeNode; var S: String);
 begin
+       //\8dX\90V\82µ\82½\82±\82Æ\82ð\8b³\82¦\82é
+       FavoriteDM.Modified := true;
 
        FavoriteTreeView.ReadOnly := True;
        SetLinkBar;
@@ -9637,12 +5916,12 @@ begin
                VK_F2:
                        begin
                                FClickNode := FavoriteTreeView.Selected;
-                               FavoriteTreeViewRenameActionExecute( Sender );
+                               GikoDM.FavoriteTreeViewRenameActionExecute( Sender );
                        end;
                VK_DELETE:
                        begin
                                FClickNode := FavoriteTreeView.Selected;
-                               FavoriteTreeViewDeleteActionExecute( Sender );
+                               GikoDM.FavoriteTreeViewDeleteActionExecute( Sender );
                        end;
                VK_RETURN:
                        begin
@@ -9650,7 +5929,18 @@ begin
                        FavoriteTreeView.Selected.Expanded := not FavoriteTreeView.Selected.Expanded;
                        end;
                VK_SPACE:
-                       FavoriteTreeViewDblClick( Sender );
+                       begin
+                       FClickNode := FavoriteTreeView.Selected;
+                       GikoDM.FavoriteTreeViewReloadActionExecute( Sender );
+                       end;
+               end;
+       end else begin
+               //\95Ò\8fW\92\86\82ÉESC\82ð\89\9f\82µ\82½\82ç\81A\95Ò\8fW\82ð\8fI\97¹\82µ\82Ä\81A\8c³\82Ì\95\8e\9a\97ñ\82É\96ß\82·
+               if Key = VK_ESCAPE then begin
+                       if (TTreeView(Sender).Selected <> nil) then begin
+                               TTreeView(Sender).Selected.Text := FOrigenCaption;
+                       end;
+                       TTreeView(Sender).Selected.Focused := False;
                end;
        end;
 
@@ -9689,388 +5979,99 @@ begin
                FavoriteTreeDeletePopupMenu.Visible := False;
                FavoriteTreeRenamePopupMenu.Visible := False;
                FavoriteTreeNewFolderPopupMenu.Visible := False;
-               //FavoriteTreeBrowseBoardPopupMenu.Visible := False;
-               //FavoriteTreeBrowseThreadPopupMenu.Visible := False;
                FavoriteTreeURLCopyPopupMenu.Visible := False;
                FavoriteTreeNameCopyPopupMenu.Visible := False;
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := False;
        end else if FClickNode.IsFirstNode then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := True;
                FavoriteTreeDeletePopupMenu.Visible := False;
                FavoriteTreeRenamePopupMenu.Visible := False;
                FavoriteTreeNewFolderPopupMenu.Visible := True;
-               //FavoriteTreeBrowseBoardPopupMenu.Visible := False;
-               //FavoriteTreeBrowseThreadPopupMenu.Visible := False;
                FavoriteTreeURLCopyPopupMenu.Visible := False;
-               FavoriteTreeNameCopyPopupMenu.Visible := True;
+               FavoriteTreeNameCopyPopupMenu.Visible := False;
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else if FClickNode.Text = Favorite.FAVORITE_LINK_NAME then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := True;
                FavoriteTreeDeletePopupMenu.Visible := True;
                FavoriteTreeRenamePopupMenu.Visible := False;
                FavoriteTreeNewFolderPopupMenu.Visible := True;
-               //FavoriteTreeBrowseBoardPopupMenu.Visible := False;
-               //FavoriteTreeBrowseThreadPopupMenu.Visible := False;
                FavoriteTreeURLCopyPopupMenu.Visible := False;
-               FavoriteTreeNameCopyPopupMenu.Visible := True;
+               FavoriteTreeNameCopyPopupMenu.Visible := False;
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else if TObject(FClickNode.Data) is TFavoriteFolder then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := True;
                FavoriteTreeDeletePopupMenu.Visible := True;
                FavoriteTreeRenamePopupMenu.Visible := True;
                FavoriteTreeNewFolderPopupMenu.Visible := True;
-               //FavoriteTreeBrowseBoardPopupMenu.Visible := False;
-               //FavoriteTreeBrowseThreadPopupMenu.Visible := False;
                FavoriteTreeURLCopyPopupMenu.Visible := False;
                FavoriteTreeNameCopyPopupMenu.Visible := True;
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else if TObject(FClickNode.Data) is TFavoriteThreadItem then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := False;
                FavoriteTreeDeletePopupMenu.Visible := True;
                FavoriteTreeRenamePopupMenu.Visible := True;
                FavoriteTreeNewFolderPopupMenu.Visible := True;
-               //FavoriteTreeBrowseBoardPopupMenu.Visible := True;
-               //FavoriteTreeBrowseThreadPopupMenu.Visible := True;
                FavoriteTreeURLCopyPopupMenu.Visible := True;
                FavoriteTreeNameCopyPopupMenu.Visible := True;
                FavoriteTreeNameURLCopyPopupMenu.Visible := True;
                FavoriteTreeReloadPopupMenu.Visible := True;
                FavoriteTreeLogDeletePopupMenu.Visible := True;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else if TObject(FClickNode.Data) is TFavoriteBoardItem then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := False;
                FavoriteTreeDeletePopupMenu.Visible := True;
                FavoriteTreeRenamePopupMenu.Visible := True;
                FavoriteTreeNewFolderPopupMenu.Visible := True;
-               //FavoriteTreeBrowseBoardPopupMenu.Visible := True;
-               //FavoriteTreeBrowseThreadPopupMenu.Visible := False;
                FavoriteTreeURLCopyPopupMenu.Visible := True;
                FavoriteTreeNameCopyPopupMenu.Visible := True;
                FavoriteTreeNameURLCopyPopupMenu.Visible := True;
                FavoriteTreeReloadPopupMenu.Visible := True;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := False;
                FavoriteTreeDeletePopupMenu.Visible := False;
                FavoriteTreeRenamePopupMenu.Visible := False;
                FavoriteTreeNewFolderPopupMenu.Visible := False;
-               //FavoriteTreeBrowseBoardPopupMenu.Visible := False;
-               //FavoriteTreeBrowseThreadPopupMenu.Visible := False;
                FavoriteTreeURLCopyPopupMenu.Visible := False;
                FavoriteTreeNameCopyPopupMenu.Visible := False;
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := False;
        end;
 
 end;
 
-procedure TGikoForm.FavoriteTreeViewDeleteActionExecute(Sender: TObject);
-const
-       DEL_LINK_MSG = '\81g\83\8a\83\93\83N\81h\82Í\83\8a\83\93\83N\83o\81[\97p\83t\83H\83\8b\83_\82Å\82·\81B\8dí\8f\9c\82µ\82Ä\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_MSG = '\81g^0\81h\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_TITLE = '\8dí\8f\9c\8am\94F';
-begin
-
-       if FClickNode = nil then
-               Exit;
-       if FClickNode.IsFirstNode then
-               Exit;
-       if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then begin
-               if FClickNode.Text = Favorite.FAVORITE_LINK_NAME then begin
-                       if MsgBox(Handle, DEL_LINK_MSG, DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
-                               Exit;
-               end else begin
-                       if MsgBox(Handle, StringReplace( DEL_MSG, '^0', FClickNode.Text, [rfReplaceAll] ) , DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
-                               Exit;
-               end;
-       end;
-
-       //FDeleteList.Add(FClickNode.Data);
-       //SetDeleteItemList(FClickNode);
-
-       FClickNode.Delete;
-
-       SetLinkBar;
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewRenameActionExecute(Sender: TObject);
-var
-       node : TTreeNode;
-begin
-
-       if FClickNode = nil then
-               Exit;
-       if FClickNode.IsFirstNode then
-               Exit;
-       if FClickNode.Text = Favorite.FAVORITE_LINK_NAME then
-               Exit;
-       FavoriteTreeView.ReadOnly := False;
-       if (FTreeType = gttFavorite) and (CabinetPanel.Visible) then begin
-               node := FClickNode.Parent;
-               while node <> nil do begin
-                       node.Expanded   := True;
-                       node                                    := node.Parent;
-               end;
-               FClickNode.EditText;
-       end else begin
-               FClickNode.Text := InputBox( '\96¼\91O\82Ì\95Ï\8dX', '\82¨\8bC\82É\93ü\82è\82Ì\90V\82µ\82¢\96¼\91O\82ð\93ü\97Í\82µ\82Ä\82­\82¾\82³\82¢', FClickNode.Text );
-       end;
-
-       SetLinkBar;
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewNewFolderActionExecute(
-       Sender: TObject);
-var
-       NewFavFolder: TFavoriteFolder;
-       Node: TTreeNode;
-begin
-
-       if FClickNode = nil then
-               Exit;
-
-       try
-               if not (TObject(FClickNode.Data) is TFavoriteFolder) then begin
-                       FavoriteTreeView.Selected := FClickNode.Parent;
-                       FClickNode := FClickNode.Parent;
-               end;
-
-               NewFavFolder := TFavoriteFolder.Create;
-               Node := FavoriteTreeView.Items.AddChildObject(FClickNode, '\90V\82µ\82¢\83t\83H\83\8b\83_', NewFavFolder);
-               Node.ImageIndex := 14;
-               Node.SelectedIndex := 14;
-       //                      FClickNode.Selected.Expanded := True;
-               FavoriteTreeView.Selected := Node;
-               FClickNode := Node;
-               FavoriteTreeViewRenameAction.Execute;
-       finally
-       end;
-
-end;
-
-procedure TGikoForm.ToolButton19Click(Sender: TObject);
-begin
-
-       FavoriteArrangeActionExecute( nil );
-       
-end;
-
 procedure TGikoForm.FavoriteBrowseFolder( node: TTreeNode );
 var
-       i: Integer;
-begin
-
-       if not (TObject(node.Data) is TFavoriteFolder) then
-               exit;
-
-       for i := 0 to node.Count - 1 do
-       begin
-               if TObject(node.Item[i].Data) is TFavoriteFolder then
-                       FavoriteBrowseFolder( node.Item[i] )
-               else if TObject(node.Item[i].Data) is TFavoriteThreadItem then
-                       FavoriteClick( node.Item[i], False );
-       end;
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewBrowseFolderActionExecute(
-       Sender: TObject);
-begin
-
-       FavoriteBrowseFolder( FClickNode );
-       //BrowserTab.OnChange(nil);
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewDblClick(Sender: TObject);
-begin
-
-       FClickNode := FavoriteTreeView.Selected;
-       FavoriteTreeViewReloadActionExecute( Sender );
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewLogDeleteActionExecute(
-       Sender: TObject);
-const
-       DEL_MSG = '\81g^0\81h\82Ì\83\8d\83O\82ð\8dí\8f\9c\82µ\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H';
-       DEL_TITLE = '\8dí\8f\9c\8am\94F';
-var
-       ThreadItem: TThreadItem;
-       FavThread: TFavoriteThreadItem;
-begin
-
-       if FClickNode = nil then Exit;
-       if not (TObject(FClickNode.Data) is TFavoriteThreadItem) then Exit;
-
-       FavThread := TFavoriteThreadItem( FClickNode.Data );
-       ThreadItem := FavThread.Item;
-
-       try
-               if GikoSys.Setting.DeleteMsg then begin
-                       if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then
-                               if MsgBox(Handle, StringReplace( DEL_MSG, '^0', FClickNode.Text, [rfReplaceAll] ) , DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then
-                                       Exit;
-               end;
-
-               DeleteHistory(ThreadItem);
-               DeleteTab(ThreadItem);
-               ThreadItem.DeleteLogFile;
-
-               ListView.Refresh;
-       finally
-       end;
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewReloadActionExecute(Sender: TObject);
-var
-       ThreadItem: TThreadItem;
-       FavThread: TFavoriteThreadItem;
-       Board: TBoard;
-       FavBoard: TFavoriteBoardItem;
-       shiftDown: Boolean;
-begin
-
-       if FClickNode = nil then Exit;
-
-       shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
-
-       if TObject( FClickNode.Data ) is TFavoriteThreadItem then begin
-               FavThread := TFavoriteThreadItem( FClickNode.Data );
-               ThreadItem := FavThread.Item;
-               if ThreadItem <> nil then
-                       DownloadContent(ThreadItem, shiftDown);
-       end else if TObject( FClickNode.Data ) is TFavoriteBoardItem then begin
-               FavBoard := TFavoriteBoardItem( FClickNode.Data );
-               Board := FavBoard.Item;
-               DownloadList(Board, shiftDown);
-       end;
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewURLCopyActionExecute(Sender: TObject);
-var
-       FavThread       : TFavoriteThreadItem;
-       FavBoard        : TFavoriteBoardItem;
-       s                                       : string;
-begin
-
-       if FClickNode = nil then Exit;
-
-       if (TObject(FClickNode.Data) is TFavoriteThreadItem) then begin
-
-               FavThread := TFavoriteThreadItem( FClickNode.Data );
-               s := FavThread.URL + #13#10;
-               if s <> '' then
-                       Clipboard.AsText := s;
-
-       end else if (TObject(FClickNode.Data) is TFavoriteBoardItem) then begin
-
-               FavBoard := TFavoriteBoardItem( FClickNode.Data );
-               s := FavBoard.URL + #13#10;
-               if s <> '' then
-                       Clipboard.AsText := s;
-
-       end;
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewNameCopyActionExecute(Sender: TObject);
-var
-       ThreadItem: TThreadItem;
-       FavThread: TFavoriteThreadItem;
-       Board: TBoard;
-       FavBoard: TFavoriteBoardItem;
-       s: string;
-begin
-
-       if FClickNode = nil then Exit;
-
-       if (TObject(FClickNode.Data) is TFavoriteThreadItem) then begin
-
-               FavThread := TFavoriteThreadItem( FClickNode.Data );
-               ThreadItem := FavThread.Item;
-
-               try
-                       s := ThreadItem.Title + #13#10;
-                       if s <> '' then
-                               Clipboard.AsText := s;
-               finally
-               end;
-
-       end else if (TObject(FClickNode.Data) is TFavoriteBoardItem) then begin
-
-               FavBoard := TFavoriteBoardItem( FClickNode.Data );
-               Board := FavBoard.Item;
-               if Board <> nil then
-                       if not Board.IsThreadDatRead then
-                               GikoSys.ReadSubjectFile(Board);
-
-               try
-                       s := Board.Title + #13#10;
-                       if s <> '' then
-                               Clipboard.AsText := s;
-               finally
-               end;
-
-       end;
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewNameURLCopyActionExecute(
-       Sender: TObject);
-var
-       ThreadItem: TThreadItem;
-       FavThread: TFavoriteThreadItem;
-       Board: TBoard;
-       FavBoard: TFavoriteBoardItem;
-       s: string;
-begin
-
-       if FClickNode = nil then Exit;
-
-       if (TObject(FClickNode.Data) is TFavoriteThreadItem) then begin
-
-               FavThread := TFavoriteThreadItem( FClickNode.Data );
-               ThreadItem := FavThread.Item;
-
-               try
-                       s := ThreadItem.Title + #13#10 + ThreadItem.URL + #13#10;
-                       if s <> '' then
-                               Clipboard.AsText := s;
-               finally
-               end;
-
-       end else if (TObject(FClickNode.Data) is TFavoriteBoardItem) then begin
-
-               FavBoard := TFavoriteBoardItem( FClickNode.Data );
-               Board := FavBoard.Item;
-               if Board <> nil then
-                       if not Board.IsThreadDatRead then
-                               GikoSys.ReadSubjectFile(Board);
+       i: Integer;
+begin
 
-               try
-                       s := Board.Title + #13#10 + Board.URL + #13#10;
-                       if s <> '' then
-                               Clipboard.AsText := s;
-               finally
-               end;
+       if not (TObject(node.Data) is TFavoriteFolder) then
+               exit;
 
+       for i := 0 to node.Count - 1 do
+       begin
+               if TObject(node.Item[i].Data) is TFavoriteFolder then
+                       FavoriteBrowseFolder( node.Item[i] )
+               else if TObject(node.Item[i].Data) is TFavoriteThreadItem then
+                       FavoriteClick( node.Item[i], False );
        end;
 
 end;
-
 function TGikoForm.TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode;
 var
        Found: TTreeNode;
@@ -10108,32 +6109,28 @@ begin
                        Break;
                end;
        end;
-
+       SenderNode.Selected := False;
+       
        FavoriteDragDrop( SenderNode, Source );
 
+       SetLinkBar;
 end;
 
 procedure TGikoForm.BrowserTabMouseUp(Sender: TObject;
        Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 begin
-       if FDragWFirst <> true then begin
+       if FDragWFirst = true then
                FDragWFirst := false;
-{
-       end else if (abs( X - FMouseDownPos.X ) < Mouse.DragThreshold)
-       and (abs( Y - FMouseDownPos.Y ) < Mouse.DragThreshold) then begin
-(*}
-       end else begin
-//*)
-               if GikoSys.Setting.ListOrientation = gloHorizontal then begin
-                       if GikoSys.Setting.ListWidthState = glsMin then begin
-                               BrowserMaxAndFocusAction.Execute;
-                       end;
-               end else begin
-                       if GikoSys.Setting.ListHeightState = glsMin then begin
-                               BrowserMaxAndFocusAction.Execute;
-                       end;
-               end;
-       end;
+
+    if GikoSys.Setting.ListOrientation = gloHorizontal then begin
+        if GikoSys.Setting.ListWidthState = glsMin then begin
+            GikoDM.BrowserMaxAndFocusAction.Execute;
+        end;
+    end else begin
+        if GikoSys.Setting.ListHeightState = glsMin then begin
+            GikoDM.BrowserMaxAndFocusAction.Execute;
+        end;
+    end;
 end;
 
 procedure TGikoForm.LinkToolBarDragOver(Sender, Source: TObject; X,
@@ -10144,66 +6141,23 @@ begin
 
 end;
 
-procedure TGikoForm.ResRangeActionExecute(Sender: TObject);
-begin
-       case FResRangeMenuSelect of
-       Ord( grrAll ):  AllResAction.Execute;
-       Ord( grrKoko ): OnlyKokoResAction.Execute;
-       Ord( grrNew ):  OnlyNewResAction.Execute;
-       100:                                            OnlyAHundredResAction.Execute;
-       end;
-end;
-
 procedure TGikoForm.FavoriteTreeViewEndDrag(Sender, Target: TObject; X,
        Y: Integer);
 begin
 
        if FDropSpaceNode <> nil then begin
-               FDropSpaceNode.Free;
-               FDropSpaceNode := nil;
+               try
+                       FDropSpaceNode.Delete;
+               finally
+                       FDropSpaceNode := nil;
+               end;
+               //\8dX\90V\82µ\82½\82±\82Æ\82ð\8b³\82¦\82é
+               FavoriteDM.Modified := true;
                SetLinkBar;
        end;
 
 end;
 
-procedure TGikoForm.ListCoolBarContextPopup(Sender: TObject;
-       MousePos: TPoint; var Handled: Boolean);
-begin
-
-       FToolBarSettingSender := tssList;
-       MousePos := ListCoolBar.ClientToScreen( MousePos );
-       MainCoolBarPopupMenu.Popup( MousePos.X, MousePos.Y );
-
-end;
-
-procedure TGikoForm.MainCoolBarContextPopup(Sender: TObject;
-       MousePos: TPoint; var Handled: Boolean);
-begin
-
-       FToolBarSettingSender := tssMain;
-       MousePos := MainCoolBar.ClientToScreen( MousePos );
-       MainCoolBarPopupMenu.Popup( MousePos.X, MousePos.Y );
-
-end;
-
-procedure TGikoForm.BrowserCoolBarContextPopup(Sender: TObject;
-       MousePos: TPoint; var Handled: Boolean);
-begin
-
-       FToolBarSettingSender := tssBrowser;
-       MousePos := BrowserCoolBar.ClientToScreen( MousePos );
-       MainCoolBarPopupMenu.Popup( MousePos.X, MousePos.Y );
-
-end;
-procedure TGikoForm.ExportFavoriteFileAccept(Sender: TObject);
-begin
-
-       if FavoriteDM.SaveFavoriteFile( ExportFavoriteFile.Dialog.FileName ) Then begin
-               ShowMessage('\83t\83@\83C\83\8b\82ð\8fo\97Í\82µ\82Ü\82µ\82½');
-       end else begin
-               ShowMessage('\83t\83@\83C\83\8b\82Ì\8fo\97Í\82É\8e¸\94s\82µ\82Ü\82µ\82½');
-       end;
-end;
 procedure TGikoForm.SetListViewBackGroundColor(value: TColor);
 begin
        if FListViewBackGroundColor <> value then begin
@@ -10211,53 +6165,6 @@ begin
                ListView.Color := FListViewBackGroundColor;
        end;
 end;
-procedure TGikoForm.ExportFavoriteFileBeforeExecute(Sender: TObject);
-begin
-       ExportFavoriteFile.Dialog.FileName := FavoriteDM.GetFavoriteFilePath;
-end;
-
-procedure TGikoForm.CabinetBBSActionExecute(Sender: TObject);
-begin
-
-       if CabinetPanel.Visible then begin
-               if FTreeType = gtt2ch then begin
-                       CabinetVisible( False );
-
-                       CabinetBBSAction.Checked := False;
-               end else begin
-                       CabinetBBSAction.Checked := True;
-               end;
-       end else begin
-               CabinetVisible( True );
-               CabinetBBSAction.Checked := True;
-       end;
-
-       if FActiveBBS = nil then
-               ShowBBSTree( BBSs[ 0 ] )
-       else
-               ShowBBSTree( FActiveBBS );
-
-end;
-
-procedure TGikoForm.FavoriteTreeViewBrowseThreadActionExecute(
-       Sender: TObject);
-var
-       threadItem      : TThreadItem;
-begin
-
-       if FClickNode = nil then Exit;
-
-       if (TObject(FClickNode.Data) is TFavoriteThreadItem) then begin
-
-               threadItem := TFavoriteThreadItem( FClickNode.Data ).Item;
-               if threadItem = nil then
-                       Exit;
-               GikoSys.OpenBrowser( threadItem.URL, gbtAuto );
-
-       end;
-
-end;
-
 procedure TGikoForm.FavoriteTreeBrowseBoardPopupMenuClick(Sender: TObject);
 var
        threadItem      : TThreadItem;
@@ -10284,20 +6191,6 @@ begin
 
 end;
 
-procedure TGikoForm.UpBoardActionExecute(Sender: TObject);
-begin
-
-       SelectTreeNode( GetActiveContent.ParentBoard, True );
-
-end;
-
-procedure TGikoForm.UpBoardActionUpdate(Sender: TObject);
-begin
-
-       UpBoardAction.Enabled := GetActiveContent <> nil;
-
-end;
-
 procedure TGikoForm.BrowserTabContextPopup(Sender: TObject;
        MousePos: TPoint; var Handled: Boolean);
 var
@@ -10308,13 +6201,8 @@ begin
                BrowserTab.TabIndex := idx;
                        BrowserTab.OnChange(nil);
                end;
-
 end;
 
-procedure TGikoForm.KoreCopyExecute(Sender: TObject);
-begin
-       KonoresCopy(KokoPopupMenu.Tag, true);
-end;
 procedure TGikoForm.KonoresCopy(Number: Integer; ReplaceTag : Boolean);
 var
        ThreadItem: TThreadItem;
@@ -10326,12 +6214,14 @@ var
        boardPlugIn : TBoardPlugIn;
 begin
        if Number = 0 then Exit;
-       ThreadItem := GetActiveContent;
+       ThreadItem := GetActiveContent(True);
 
        if ThreadItem <> nil then begin
-               if ThreadItem.IsBoardPlugInAvailable then begin
+               //if ThreadItem.IsBoardPlugInAvailable then begin
+        if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin
                        //===== \83v\83\89\83O\83C\83\93\82É\82æ\82é\95\\8e¦
-                       boardPlugIn             := ThreadItem.BoardPlugIn;
+                       //boardPlugIn           := ThreadItem.BoardPlugIn;
+            boardPlugIn                := ThreadItem.ParentBoard.BoardPlugIn;
 
                        // \83t\83H\83\93\83g\82â\83T\83C\83Y\82Ì\90Ý\92è
                        // \95\8e\9a\83R\81[\83h\82Í\83v\83\89\83O\83C\83\93\82É\94C\82¹\82é
@@ -10342,239 +6232,188 @@ begin
       tmp := GikoSys.ReadThreadFile(FileName, Number);
                end;
                if tmp <> '' then begin
-                       Res := GikoSys.DivideStrLine(tmp);
+                       THTMLCreate.DivideStrLine(tmp, @Res);
 
                        Header := IntToStr(Number) + ' \81F' + Res.FName + ' \81F' + Res.FDateTime + #13#10;
                        if ReplaceTag then begin
                                Header := CustomStringReplace(Header, '</b>', '',true);
                                Header := CustomStringReplace(Header, '<b>', '',true);
+                               Header := CustomStringReplace(Header, '<br>', '',true);
+                               Header := DeleteFontTag(Header);
                        end;
-                       if ThreadItem.IsBoardPlugInAvailable then begin
+                       //if ThreadItem.IsBoardPlugInAvailable then begin
+            if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin
                                Body := CustomStringReplace(Res.FBody, '<br>', #13#10,true);
                                Body := CustomStringReplace(Body, '<br>', #13#10,true);
                        end else begin
                                Body := CustomStringReplace(Res.FBody, ' <br> ', #13#10,true);
                                Body := CustomStringReplace(Body, ' <br>', #13#10,true);
-                               Body := CustomStringReplace(Body, '<br> ', #13#10,true);
-                               Body := CustomStringReplace(Body, '<br>', #13#10,true);
-
-                       end;
-                       Body := CustomStringReplace(Body, '</a>', '',true);
-
-                       Body := GikoSys.DeleteLink(Body);
-                       if ReplaceTag then begin
-                               Body := CustomStringReplace(Body, '&lt;', '<');
-                               Body := CustomStringReplace(Body, '&gt;', '>');
-                               Body := CustomStringReplace(Body, '&quot;', '"');
-                               Body := CustomStringReplace(Body, '&amp;', '&');
-                               //Body := CustomStringReplace(Body, '&nbsp;', ' ');
-                       end;
-
-                       Header := Header + Body;
-
-                       Clipboard.SetTextBuf( PChar(Header) );
-               end;
-       end;
-end;
-
-
-procedure TGikoForm.BrowserTabPopupMenuPopup(Sender: TObject);
-begin
-       AddRoundNameMenu(dummy1);
-end;
-
-procedure TGikoForm.FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
-begin
-       FavoriteDM.URLReplace(oldURLs, newURLs);
-end;
-
-procedure TGikoForm.RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);
-begin
-       RoundList.URLReplace(oldURLs, newURLs);
-end;
-
-procedure TGikoForm.TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
-var
-       i: Integer;
-                               j: Integer;
-                               tempString: string;
-                               tmpURL: string;
-                               oldHost: string;
-                               oldBoardName: string;
-                               newHost: string;
-                               newBoardName: string;
-                               TabList: TStringList;
-begin
-               TabList := TStringList.Create;
-               if oldURLs.Count <> newURLs.Count then
-                       Exit;
-               //\82±\82±\82©\82ç\81ABoard\82ÌURL\82Ì\95Ï\8dX
-               for j :=0 to oldURLs.Count - 1 do begin
-               for i :=0 to TabList.Count - 1 do begin
-                       if TabList.Text = oldURLs[j] then
-                                                       TabList.Text := newURLs[j];
-                       end;
-               end;
-               //\82±\82±\82Ü\82Å\81ABoard\82ÌURL\82Ì\95Ï\8dX
-
-               //\82±\82±\82©\82ç\81AThread\82ÌURL\82Ì\95Ï\8dX
-               //\96Ê\93|\82¾\82¯\82Çthread\82Í\82»\82ê\82¼\82êURL\82ð\83`\83\83\83b\83N\82µ\82È\82ª\82ç\82â\82Á\82Ä\82©\82È\82«\82á\82¢\82¯\82È\82¢\81B
-               for i := 0 to oldURLs.Count - 1 do begin
-                               tmpURL                  := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1);
-                               oldHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
-                               oldBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
-                               tmpURL                  := Copy(newURLs[i], 1, Length(newURLs[i]) -1);
-                               newHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
-                               newBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
-
-                               for j := 0 to TabList.Count - 1 do begin
-                                               tempString := TabList.Text;
-                                               if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
-                                                       tempString := StringReplace(tempString, oldHost, newHost,[]);
-                                                               TabList.Text := tempString;
-                                               end;
-                               end;
-end;
-               //\82±\82±\82Ü\82Å\81AThread\82ÌURL\82Ì\95Ï\8dX
-
-end;
-
-/// \8dÅ\8f¬\89»\82³\82ê\82é
-procedure TGikoForm.OnMinimize;
-begin
-       if FActiveContent <> nil then begin
-               FIsMinimize := mtMinimizing;
-               FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
-       end;
-end;
-
-/// \8dÅ\8f¬\89»\82³\82ê\82½ (OnResized \82©\82ç\8cÄ\82Î\82ê\82é)
-procedure TGikoForm.OnMinimized;
-begin
-       FIsMinimize := mtMinimized;
-end;
-
-procedure TGikoForm.CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
-var
-       coolSet                         : TCoolSet;
-       toolbar                         : TToolBar;
-       band                                    : TCoolBand;
-       affectedBand    : TCoolBand;
-       i                                                       : Integer;
-begin
-       if (FOldFormWidth = Width) and not IsIconic( Handle ) and (FIsIgnoreResize = rtNone) then begin
-               FIsIgnoreResize := rtResizing;
-               PostMessage( Handle, USER_RESIZED, 0, 0 );
-               if not (Sender is TToolBar) or (CoolBar = nil) then
-                       Exit;
-               toolbar := TToolBar( Sender );
-               band := nil;
-               // \95Ï\8dX\82³\82ê\82½\83N\81[\83\8b\83o\81[\82Ì\92l\82ð\95Û\91
-               if CoolBar = MainCoolBar then begin
-                       for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
-                               CoolSet.FCoolID := CoolBar.Bands[i].ID;
-                               CoolSet.FCoolWidth := CoolBar.Bands[i].Width;
-                               CoolSet.FCoolBreak := CoolBar.Bands[i].Break;
-                               GikoSys.Setting.MainCoolSet[i] := CoolSet;
-                       end;
-               end else if CoolBar = ListCoolBar then begin
-                       for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
-                               CoolSet.FCoolID := CoolBar.Bands[i].ID;
-                               CoolSet.FCoolWidth := CoolBar.Bands[i].Width;
-                               CoolSet.FCoolBreak := CoolBar.Bands[i].Break;
-                               GikoSys.Setting.ListCoolSet[i] := CoolSet;
-                       end;
-               end else if CoolBar = BrowserCoolBar then begin
-                       for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
-                               CoolSet.FCoolID := CoolBar.Bands[i].ID;
-                               CoolSet.FCoolWidth := CoolBar.Bands[i].Width;
-                               CoolSet.FCoolBreak := CoolBar.Bands[i].Break;
-                               GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
-                       end;
-               end;
-               // \95\9d\82Ì\95Ï\8dX\82³\82ê\82½\83o\83\93\83h\82ð\8c©\82Â\82¯\82é
-               affectedBand := nil;
-               for i := CoolBar.Bands.Count - 1 downto 0 do begin
-                       if CoolBar.Bands[ i ].Control.Handle = toolbar.Handle then begin
-                               band    := CoolBar.Bands[ i ];
-                               if band.Break or (i = 0) then begin
-                                       if i + 1 < CoolBar.Bands.Count then
-                                               if not CoolBar.Bands[ i + 1 ].Break then
-                                                       affectedBand := CoolBar.Bands[ i + 1 ];
-                               end else begin
-                                       if i > 0 then
-                                               affectedBand := CoolBar.Bands[ i - 1 ];
-                               end;
-                               Break;
-                       end;
-               end;
-               // \83h\83\89\83b\83O\92\86\82Í band.Width \82ª\8dX\90V\82³\82ê\82È\82¢\82Ì\82Å\81A\93à\91¤\82Ì\83T\83C\83Y\82©\82ç\82Ð\82Ë\82è\8fo\82·
-               if CoolBar = MainCoolBar then begin
-                       coolSet := GikoSys.Setting.MainCoolSet[ band.ID ];
-                       coolSet.FCoolWidth := toolbar.Width + 25;
-                       GikoSys.Setting.MainCoolSet[ band.ID ] := coolSet;
-                       if affectedBand <> nil then begin
-                               coolSet := GikoSys.Setting.MainCoolSet[ affectedBand.ID ];
-                               coolSet.FCoolWidth := affectedBand.Control.Width + 25;
-                               GikoSys.Setting.MainCoolSet[ affectedBand.ID ] := coolSet;
-                       end;
-               end else if CoolBar = ListCoolBar then begin
-                       coolSet := GikoSys.Setting.ListCoolSet[ band.ID ];
-                       coolSet.FCoolWidth := toolbar.Width + 25;
-                       GikoSys.Setting.ListCoolSet[ band.ID ] := coolSet;
-                       if affectedBand <> nil then begin
-                               coolSet := GikoSys.Setting.ListCoolSet[ affectedBand.ID ];
-                               coolSet.FCoolWidth := affectedBand.Control.Width + 25;
-                               GikoSys.Setting.ListCoolSet[ affectedBand.ID ] := coolSet;
-                       end;
-               end else if CoolBar = BrowserCoolBar then begin
-                       coolSet := GikoSYs.Setting.BrowserCoolSet[ band.ID ];
-                       coolSet.FCoolWidth := toolbar.Width + 25;
-                       GikoSys.Setting.BrowserCoolSet[ band.ID ] := coolSet;
-                       if affectedBand <> nil then begin
-                               coolSet := GikoSys.Setting.BrowserCoolSet[ affectedBand.ID ];
-                               coolSet.FCoolWidth := affectedBand.Control.Width + 25;
-                               GikoSys.Setting.BrowserCoolSet[ affectedBand.ID ] := coolSet;
+                               Body := CustomStringReplace(Body, '<br> ', #13#10,true);
+                               Body := CustomStringReplace(Body, '<br>', #13#10,true);
+
+                       end;
+                       Body := CustomStringReplace(Body, '</a>', '',true);
+
+                       Body := HTMLCreater.DeleteLink(Body);
+                       if ReplaceTag then begin
+                               Body := CustomStringReplace(Body, '&lt;', '<');
+                               Body := CustomStringReplace(Body, '&gt;', '>');
+                               Body := CustomStringReplace(Body, '&quot;', '"');
+                               Body := CustomStringReplace(Body, '&amp;', '&');
+                               //Body := CustomStringReplace(Body, '&nbsp;', ' ');
                        end;
+
+                       Header := Header + Body;
+
+                       Clipboard.SetTextBuf( PChar(Header) );
                end;
        end;
 end;
 
-procedure TGikoForm.MenuToolBarResize(Sender: TObject);
+
+procedure TGikoForm.BrowserTabPopupMenuPopup(Sender: TObject);
 begin
-       CoolBarResized( Sender, MainCoolBar );
+       AddRoundNameMenu(dummy1);
+    AddMenuSameBoardThread;
 end;
-
-procedure TGikoForm.StdToolBarResize(Sender: TObject);
+//! \83A\83N\83e\83B\83u\82È\83^\83u\82Æ\93¯\82\94Â\82Ì\8aJ\82¢\82Ä\82¢\82é\83X\83\8c\83b\83h\82ð\83\81\83j\83\85\81[\83A\83C\83e\83\80\82É\92Ç\89Á
+procedure TGikoForm.AddMenuSameBoardThread;
+var
+       i: Integer;
+       Item: TMenuItem;
 begin
-       CoolBarResized( Sender, MainCoolBar );
+    SameBoardThreadItem.Clear;
+    for i := 0 to BrowserTab.Tabs.Count - 1 do begin
+        // \93¯\82\94Â\82©\82Ç\82¤\82©
+        if (FActiveContent.Thread.ParentBoard =
+            TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ParentBoard) then begin
+            // \8e©\95ª\82Í\8aO\82·
+            if FActiveContent.Thread <>
+                TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin
+                Item := TMenuItem.Create(Self);
+                Item.Caption := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.Title;
+                Item.OnClick := SameBoardThreadSubItemOnClick;
+                SameBoardThreadItem.Add(Item);
+            end;
+        end;
+    end;
+    // \89½\82à\96³\82¢\82È\82ç\8eg\97p\82Å\82«\82È\82¢\82æ\82¤\82É\82·\82é
+    SameBoardThreadItem.Enabled := SameBoardThreadItem.Count > 0;
 end;
-
-procedure TGikoForm.LinkToolBarResize(Sender: TObject);
+//!  \83A\83N\83e\83B\83u\82È\83^\83u\82Æ\93¯\82\94Â\82Ì\8aJ\82¢\82Ä\82¢\82é\83X\83\8c\83b\83h\83N\83\8a\83b\83N\83C\83x\83\93\83g
+procedure TGikoForm.SameBoardThreadSubItemOnClick(Sender: TObject);
+var
+       i, j: Integer;
+       MenuItem: TMenuItem;
 begin
-       CoolBarResized( Sender, MainCoolBar );
+       if Sender is TMenuItem then begin
+        try
+            j := 0;
+            MenuItem := TMenuItem(Sender);
+            for i := 0 to BrowserTab.Tabs.Count - 1 do begin
+                // \93¯\82\94Â\82©\82Ç\82¤\82©
+                if (FActiveContent.Thread.ParentBoard =
+                    TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ParentBoard) then begin
+                    if FActiveContent.Thread <>
+                        TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin
+                        if (SameBoardThreadItem.Items[j] = MenuItem) then begin
+                            MoveToURL( TBrowserRecord(BrowserTab.Tabs.Objects[i])
+                                .Thread.URL);
+                            Exit;
+                        end;
+                        Inc(j);
+                    end;
+                end;
+            end;
+        except
+        end;
+       end;
+end;
+procedure TGikoForm.FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
+begin
+       FavoriteDM.URLReplace(oldURLs, newURLs);
 end;
 
-procedure TGikoForm.ListNameToolBarResize(Sender: TObject);
+procedure TGikoForm.RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);
 begin
-       CoolBarResized( Sender, ListCoolBar );
+       RoundList.URLReplace(oldURLs, newURLs);
 end;
 
-procedure TGikoForm.ListToolBarResize(Sender: TObject);
+procedure TGikoForm.TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
+const
+       Filename = 'tab.sav';
+       bFilename = '~tab.sav';
+var
+       i, j: Integer;
+       tempString: string;
+       tmpURL: string;
+       oldHost: string;
+       oldBoardName: string;
+       newHost: string;
+       newBoardName: string;
+       TabList: TStringList;
 begin
-       CoolBarResized( Sender, ListCoolBar );
+
+       if oldURLs.Count <> newURLs.Count then begin
+               Exit;
+       end;
+       if FileExists(GikoSys.GetAppDir + 'tab.sav') then begin
+               TabList := TStringList.Create;
+               try
+                       TabList.LoadFromFile(GikoSys.GetAppDir + Filename);
+
+                       //\82±\82±\82©\82ç\81AThread\82ÌURL\82Ì\95Ï\8dX
+                       //\96Ê\93|\82¾\82¯\82Çthread\82Í\82»\82ê\82¼\82êURL\82ð\83`\83\83\83b\83N\82µ\82È\82ª\82ç\82â\82Á\82Ä\82©\82È\82«\82á\82¢\82¯\82È\82¢\81B
+                       for i := 0 to oldURLs.Count - 1 do begin
+                                       tmpURL                  := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1);
+                                       oldHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
+                                       oldBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
+                                       tmpURL                  := Copy(newURLs[i], 1, Length(newURLs[i]) -1);
+                                       newHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
+                                       newBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
+
+                                       for j := 0 to TabList.Count - 1 do begin
+                                                       tempString := TabList[j];
+                                                       if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
+                                                               tempString := StringReplace(tempString, oldHost, newHost,[]);
+                                                               TabList[j] := tempString;
+                                                       end;
+                                       end;
+                       end;
+                       //\82±\82±\82Ü\82Å\81AThread\82ÌURL\82Ì\95Ï\8dX
+
+                       if FileExists( GikoSys.GetAppDir + Filename) then begin
+                               if FileExists( GikoSys.GetAppDir + bFilename) then
+                                       DeleteFile(GikoSys.GetAppDir + bFilename);
+
+                               //\83o\83b\83N\83A\83b\83v\82ð\8dì\82é\81B
+                               RenameFile(GikoSys.GetAppDir + Filename, GikoSys.GetAppDir + bFilename);
+                       end;
+
+                       TabList.SaveToFile(GikoSys.GetAppDir + Filename);
+               finally
+                       TabList.Free;
+               end;
+       end;
+
 end;
 
-procedure TGikoForm.BrowserNameToolBarResize(Sender: TObject);
+/// \8dÅ\8f¬\89»\82³\82ê\82é
+procedure TGikoForm.OnMinimize;
 begin
-       CoolBarResized( Sender, BrowserCoolBar );
+       if FActiveContent <> nil then begin
+               FIsMinimize := mtMinimizing;
+               FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
+       end;
 end;
 
-procedure TGikoForm.BrowserToolBarResize(Sender: TObject);
+/// \8dÅ\8f¬\89»\82³\82ê\82½ (OnResized \82©\82ç\8cÄ\82Î\82ê\82é)
+procedure TGikoForm.OnMinimized;
 begin
-       CoolBarResized( Sender, BrowserCoolBar );
+       FIsMinimize := mtMinimized;
 end;
 
+
 procedure TGikoForm.BrowserTabResize(Sender: TObject);
 begin
        CoolBarResized( Sender, BrowserCoolBar );
@@ -10616,6 +6455,9 @@ begin
                                        FavoriteClick( Node );
                Exit;
        end;
+    //\8c»\8dÝ\95\\8e¦\82µ\82Ä\82¢\82é\82Ì\82Æ\93¯\82\82È\82ç\8dÄ\95`\89æ\82µ\82È\82¢
+       if ActiveList = Node.Data then
+               Exit;
 
        ActiveListColumnSave;
 
@@ -10627,25 +6469,26 @@ begin
                if not TBoard(Node.Data).IsThreadDatRead then begin
                        Screen.Cursor := crHourGlass;
                        try
-        if not TBoard(Node.Data).IsThreadDatRead then
+               if not TBoard(Node.Data).IsThreadDatRead then
                                        GikoSys.ReadSubjectFile(Node.Data);
                        finally
                                Screen.Cursor := crDefault;
                        end;
                end;
+               Sort.SetSortDate(Now());
                SetActiveList(Node.data);
        end;
 
        if TObject( Node.Data ) is TBoard then begin // not TCategory
                if GikoSys.Setting.ListOrientation = gloHorizontal then begin
                        if GikoSys.Setting.ListWidthState = glsMax then begin
-                               BrowserMinAction.Execute;
+                               GikoDM.BrowserMinAction.Execute;
                                if GikoForm.Visible then
                                        ListView.SetFocus;
                        end;
                end else begin
                        if GikoSys.Setting.ListHeightState = glsMax then begin
-                               BrowserMinAction.Execute;
+                               GikoDM.BrowserMinAction.Execute;
                                if GikoForm.Visible then
                                        ListView.SetFocus;
                        end;
@@ -10677,12 +6520,9 @@ begin
        end;
 
 end;
-
-procedure TGikoForm.TreeViewClick(Sender: TObject);
-begin
-       TreeClick( TreeView.Selected );
-end;
-
+// *************************************************************************
+//! \83c\83\8a\81[\83r\83\85\81[\82ÌKeyDown\83C\83x\83\93\83g
+// *************************************************************************
 procedure TGikoForm.TreeViewKeyDown(Sender: TObject; var Key: Word;
        Shift: TShiftState);
 begin
@@ -10692,1078 +6532,1158 @@ begin
                TreeDoubleClick( TreeView.Selected );
        end else if Key = VK_RETURN then begin
                TreeClick( TreeView.Selected );
-        TreeView.Selected.Expanded := not TreeView.Selected.Expanded;
+        // \97\9a\97ð\82Ì\8fê\8d\87\81A\8fÁ\82³\82ê\82Ä\82¢\82é\82Ì\82Å\83`\83F\83b\83N\82·\82é
+        if (TreeView.Selected <> nil) then begin
+               TreeView.Selected.Expanded := not TreeView.Selected.Expanded;
+        end;
        end;
 end;
-
-// \83u\83\89\83E\83U\82Ì\83L\81[\83_\83E\83\93\83C\83x\83\93\83g    //\82È\82ñ\82©\8eg\82í\82È\82­\82Ä\82à\93®\82¢\82Ä\82é\8bC\82ª\82·\82é\81@by\82à\82\82ã
-// \83C\83x\83\93\83g\82ð\8eæ\82è\88µ\82Á\82½\8fê\8d\87\82Í True \82ð\95Ô\82·
-function TGikoForm.BrowserKeydown(var Msg: TMsg; Key: Word; State:TShiftState) : Boolean;
+//! \82¨\8bC\82É\93ü\82è\82ÌMouseDown\83C\83x\83\93\83g
+procedure TGikoForm.FavoriteTreeViewMouseDown(Sender: TObject;
+       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 var
-       iOIPAO          : IOleInPlaceActiveObject;
-       Dispatch        : IDispatch;
+       favItem                         : TTreeNode;
+       favThreadItem   : TFavoriteThreadItem;
+       rect: TRect;
 begin
-       Result := False;
-       if Key = VK_BACK then begin
-               UpBoardAction.Execute;
-               Result := True;
-       {end else if Key in [VK_ESCAPE..VK_HELP] then begin
-               // \8f\\8e\9a\81APage Up\81APage Down \93\99\82Í Browser \82ª\8f\9f\8eè\82É\8eó\82¯\8eæ\82é\82Ì\82Å\83C\83x\83\93\83g\82ð\83J\83b\83g
-               Result := True;
-       }
-       end else if(Key in [VK_SPACE..VK_HELP]) and
-               not(ssCtrl in State) and not(ssAlt in State) and not (ssShift in State) then begin
-               Result := True;
-       end else begin
-               // \82»\82ê\88È\8aO\82Ì\83C\83x\83\93\83g\82Í Browser \82É\97¬\82·
-               if(FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
-                       Dispatch := FActiveContent.Browser.Application;
-                       if Dispatch <> nil then begin
-                               Dispatch.QueryInterface( IOleInPlaceActiveObject, iOIPAO );
-                               if iOIPAO <> nil then
-                                       iOIPAO.TranslateAccelerator( Msg );
+       case Button of
+       mbLeft:
+               begin
+                       if not (ssAlt in Shift) and (FavoriteTreeView.Selected <> nil) and 
+                               (FavoriteTreeView.Selected = FavoriteTreeView.GetNodeAt(X, Y)) then begin
+                               //\83}\83E\83X\82ªnode\82Ì\8fã\82É\82¢\82é\82©
+                               rect := FavoriteTreeView.Selected.DisplayRect(true);
+                               // \83A\83C\83R\83\93\95ª\8d\82É\82¸\82ç\82·
+                               if ((rect.Left - FavoriteTreeView.Indent <= X) and (rect.Right >= X)) and
+                                       ((rect.Bottom >= Y) and (rect.Top <= Y)) then begin
+                                       if ssDouble in Shift then begin
+                                               FClickNode := FavoriteTreeView.Selected;
+                                               GikoDM.FavoriteTreeViewReloadActionExecute(Sender);
+                                               FClickNode := nil;
+                                       end else begin
+                                               FavoriteClick(
+                                                       TObject(FavoriteTreeView.Selected));
+                                       end;
+                               end;
+                       end;
+               end;
+       mbMiddle:
+               begin
+                       favItem := FavoriteTreeView.GetNodeAt( X, Y );
+                       if favItem = nil then Exit;
+
+                       if TObject( favItem.Data ) is TFavoriteThreadItem then begin
+                               favThreadItem := TFavoriteThreadItem( favItem.Data );
+                               if favThreadItem.Item <> nil then
+                                       InsertBrowserTab( favThreadItem.Item, False );
                        end;
                end;
-               // \83M\83R\83i\83r\82Å\8eg\82¤\83V\83\87\81[\83g\83J\83b\83g\82Í\8eó\82¯\8eæ\82è\82½\82¢\82Ì\82Å\83C\83x\83\93\83g\82Í\83J\83b\83g\82µ\82È\82¢
-               //Result := False;
        end;
 
 end;
 
-// \83M\83R\83i\83r\82Ì\83\81\83b\83Z\81[\83W\83\8b\81[\83v\82ð\89¡\8eæ\82è\82µ\82Ü\82·
-procedure TGikoForm.HandleAppMessage(var Msg: TMsg; var Handled: Boolean);
-//var
-//     key                             : Word;
+procedure TGikoForm.MessagePanelResize(Sender: TObject);
 begin
-       case Msg.message of
-       {WM_KEYDOWN:
-               if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
-                       if IsDialogMessage( FActiveContent.Browser.Handle, Msg ) then begin
-                               key := Msg.wParam;
-                               Handled := BrowserKeyDown( Msg, key, KeyDataToShiftState( Msg.lParam ) );
-                       end;
-               end;}
 
-       WM_XBUTTONDOWN:
-               case Msg.wParam shr 16 of
-                       XBUTTON1:
-                       begin
-                                       if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
-                                               if IsDialogMessage( FActiveContent.Browser.Handle, Msg ) then begin
-                                                       UpBoardAction.Execute;
-                                                       Handled := True;
-                                               end;
-                                       end;
-                                       if not Handled then begin
-                                               if IsDialogMessage( ListView.Handle, Msg ) then begin
-                                                       UpFolderAction.Execute;
-                                                       Handled := True;
-                                               end;
-                                       end;
-                       end;
-                       XBUTTON2:
+       if FIsIgnoreResize <> rtNone then
+               Exit;
+
+       if GikoSys.Setting.ListOrientation = gloVertical then begin
+               if GikoSys.Setting.ListHeightState = glsMin then begin
+                       // \8dÅ\8f¬\95\\8e¦\82É\82·\82é
+                       ViewPanel.Height := ThreadMainPanel.Height - BrowserCoolBar.Height - 7;
                end;
        end;
+
 end;
 
-procedure TGikoForm.FavoriteTreeViewMouseDown(Sender: TObject;
-       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+procedure TGikoForm.OnResized;
 var
-       favItem                         : TTreeNode;
-       favThreadItem   : TFavoriteThreadItem;
+       doc                                             : Variant;
 begin
 
-       case Button of
-       mbLeft:
+       FOldFormWidth := Width;
+       FIsIgnoreResize := rtNone;
+
+       case FIsMinimize of
+       mtMinimizing:
                begin
-                       FMouseDownPos.X := X;
-                       FMouseDownPos.Y := Y;
+                       // \8dÅ\8f¬\89»\92\86\82Å\82 \82é
+                       PostMessage( Handle, USER_MINIMIZED, 0, 0 );
                end;
-       mbMiddle:
+
+       mtMinimized:
                begin
-                       favItem := FavoriteTreeView.GetNodeAt( X, Y );
-                       if favItem = nil then Exit;
+                       // \8dÅ\8f¬\89»\82Í\8aù\82É\8a®\97¹\82µ\82Ä\82¢\82é (\82Â\82Ü\82è\83^\83X\83N\83o\81[\82©\82ç\83E\83B\83\93\83h\83E\82ð\95\9c\8c³\92\86)
+                       if FActiveContent <> nil then begin
+                               doc := Idispatch( olevariant(FActiveContent.Browser.ControlInterface).Document) as IHTMLDocument2;
+                               doc.Body.ScrollTop := FActiveContent.Thread.ScrollTop;
+                       end;
+                       FIsMinimize := mtNone;
+               end;
+       end;
 
-                       if TObject( favItem.Data ) is TFavoriteThreadItem then begin
-                               favThreadItem := TFavoriteThreadItem( favItem.Data );
-                               if favThreadItem.Item <> nil then
-                                       InsertBrowserTab( favThreadItem.Item, False );
+end;
+// *************************************************************************
+//! \82¨\8bC\82É\93ü\82è\83c\83\8a\81[\82Ì\83}\83E\83X\83A\83b\83v\83C\83x\83\93\83g
+// *************************************************************************
+function TGikoForm.WebBrowserClick(Sender: TObject): WordBool;
+const
+    LIMIT = 20;
+var
+       p : TPoint;
+       e: IHTMLElement;
+       AID: string;
+       stlist : TStringList;
+       i, count: Integer;
+       body : String;
+    limited : Integer;
+    FOleInPlaceActiveObject: IOleInPlaceActiveObject;
+begin
+  result := true;
+  try
+       if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then
+        FOleInPlaceActiveObject := FActiveContent.Browser.ControlInterface as IOleInPlaceActiveObject;
+        FOleInPlaceActiveObject.OnFrameWindowActivate(True);
+               try
+                       GetCursorPos(p);
+                       p.x := p.x - FActiveContent.Browser.ClientOrigin.x;
+                       p.y := p.y - FActiveContent.Browser.ClientOrigin.y;
+                       e := IHTMLDocument2(FActiveContent.Browser.Document).elementFromPoint(p.x, p.y);
+                       if (Assigned(e)) then begin
+                               if (e.className = 'date') or (e.id = 'date') then begin
+                                       AID := e.innerText;
+                                       if AnsiPos('id', AnsiLowerCase(AID)) > 0 then begin
+                                               AID := Copy(AID, AnsiPos('id', AnsiLowerCase(AID)) - 1, 11);
+                       if AnsiPos(' be:', AnsiLowerCase(AID)) > 0 then begin
+                               AID := Copy(AID, 1, AnsiPos(' BE:', AnsiLowerCase(AID)) - 1)
+                        end;
+                                       end else begin
+                                               stlist := TStringList.Create;
+                                               try
+                                                       stList.DelimitedText := AID;
+                                                       AID := '';
+                                                       for i := 0 to stList.Count - 1 do
+                                                               if Length(WideString(stList[i])) = 8 then begin
+                                                                       if GikoSys.NotDateorTimeString(stList[i]) then begin
+                                                                               AID := stList[i];
+                                                                               break;
+                                                                       end;
+                                                               end;
+                                               finally
+                                                       stList.Free;
+                                               end;
+                                       end;
+                    count := GikoSys.GetSameIDResCount(AID, FActiveContent.Thread);
+                    limited := LIMIT;
+                    if count > LIMIT then begin
+                        if (GikoUtil.MsgBox(Handle,
+                                IntToStr(LIMIT) + '\8cÂ\88È\8fã\82 \82è\82Ü\82·\82ª\81A\82·\82×\82Ä\95\\8e¦\82µ\82Ü\82·\82©\81H',
+                                'ID\83|\83b\83v\83A\83b\83v\8cx\8d\90',
+                                                               MB_YESNO or MB_ICONQUESTION) = ID_YES) then begin
+                            limited := -1;
+                        end
+                    end;
+                                       body := GikoSys.GetSameIDResAnchor(AID, FActiveContent.Thread, limited);
+                                       FActiveContent.IDAnchorPopup(body);
+                               end;
+                       end;
+               except
+               end;
+  except
+  end;
+end;
+
+//\83X\83\8c\83b\83h\88ê\97\97\82ð\8dÅ\91å\89»\82µ\82Ä\83t\83H\81[\83J\83X\82ð\93\96\82Ä\82é
+procedure TGikoForm.SelectTimerTimer(Sender: TObject);
+begin
+       SelectTimer.Interval := 0;
+       if not (ListView.Selected = nil) then
+               if( FActiveContent = nil) or
+                               (GetActiveContent <> TThreadItem(ListView.Selected.Data) ) then begin
+                       ListClick;
+               end;
+end;
+
+/// ListView \82Ì\83J\83\89\83\80\95\9d\82¨\82æ\82Ñ\88Ê\92u\82Ì\95Û\91
+procedure TGikoForm.ActiveListColumnSave;
+var
+       ActivListObj    : TObject;
+       i, id, idx              : Integer;
+       BBSOrder                        : TGikoBBSColumnList;
+       CategoryOrder   : TGikoCategoryColumnList;
+       BoardOrder              : TGikoBoardColumnList;
+begin
+
+       ActivListObj := ActiveList;
+       if ActivListObj is TBBS then begin
+               //===== \83J\83e\83S\83\8a\83\8a\83X\83g =====
+               BBSOrder := TGikoBBSColumnList.Create;
+               try
+                       for i := 0 to ListView.Columns.Count - 1 do begin
+                               // \8f\87\8f\98\82Ì\8eæ\93¾
+                               idx := ListView.Column[ i ].Tag;
+                               id := Ord( GikoSys.Setting.BBSColumnOrder[ idx ] );
+                               BBSOrder.Add( TGikoBBSColumnID( id ) );
+                               // \95\9d\82Ì\95Û\91
+                               GikoSys.Setting.BBSColumnWidth[ id ] := ListView.Column[ i ].Width;
+                       end;
+                       for i := 0 to ListView.Columns.Count - 1 do
+                               // \8f\87\8f\98\82Ì\95Û\91
+                               GikoSys.Setting.BBSColumnOrder[ i ] := BBSOrder[ i ];
+               finally
+                       BBSOrder.Free;
+               end;
+       end else if ActivListObj is TCategory then begin
+               //===== \94Â\83\8a\83X\83g =====
+               CategoryOrder := TGikoCategoryColumnList.Create;
+               try
+                       for i := 0 to ListView.Columns.Count - 1 do begin
+                               // \8f\87\8f\98\82Ì\8eæ\93¾
+                               idx := ListView.Column[ i ].Tag;
+                               id := Ord( GikoSys.Setting.CategoryColumnOrder[ idx ] );
+                               CategoryOrder.Add( TGikoCategoryColumnID( id ) );
+                               // \95\9d\82Ì\95Û\91
+                               GikoSys.Setting.CategoryColumnWidth[ id ] := ListView.Column[ i ].Width;
+                       end;
+                       for i := 0 to ListView.Columns.Count - 1 do
+                               // \8f\87\8f\98\82Ì\95Û\91
+                               GikoSys.Setting.CategoryColumnOrder[ i ] := CategoryOrder[ i ];
+               finally
+                       CategoryOrder.Free;
+               end;
+       end else if ActivListObj is TBoard then begin
+               //===== \83X\83\8c\83\8a\83X\83g =====
+               BoardOrder := TGikoBoardColumnList.Create;
+               try
+                       for i := 0 to ListView.Columns.Count - 1 do begin
+                               // \8f\87\8f\98\82Ì\8eæ\93¾
+                               idx := ListView.Column[ i ].Tag;
+                               id := Ord( GikoSys.Setting.BoardColumnOrder[ idx ] );
+                               BoardOrder.Add( TGikoBoardColumnID( id ) );
+                               // \95\9d\82Ì\95Û\91
+                               GikoSys.Setting.BoardColumnWidth[ id ] := ListView.Column[ i ].Width;
                        end;
+                       for i := 0 to ListView.Columns.Count - 1 do
+                               // \8f\87\8f\98\82Ì\95Û\91
+                               GikoSys.Setting.BoardColumnOrder[ i ] := BoardOrder[ i ];
+               finally
+                       BoardOrder.Free;
                end;
        end;
 
 end;
 
-procedure TGikoForm.MessagePanelResize(Sender: TObject);
+procedure TGikoForm.ListViewColumnRightClick(Sender: TObject;
+       Column: TListColumn; Point: TPoint);
+var
+       i, j    : Integer;
+       item    : TMenuItem;
 begin
 
-       if FIsIgnoreResize <> rtNone then
-               Exit;
-
-       if GikoSys.Setting.ListOrientation = gloVertical then begin
-               if GikoSys.Setting.ListHeightState = glsMin then begin
-                       // \8dÅ\8f¬\95\\8e¦\82É\82·\82é
-                       ViewPanel.Height := ThreadMainPanel.Height - BrowserCoolBar.Height - 7;
-               end;
-       end;
+       // \83|\83b\83v\83A\83b\83v\83\81\83j\83\85\81[\82ð\83N\83\8a\83A
+       for i := ListColumnPopupMenu.Items.Count - 1 downto 0 do
+               ListColumnPopupMenu.Items.Items[ i ].Free;
 
-end;
+       // \83\81\83j\83\85\81[\82Ì\8dì\90¬ (\83\81\83C\83\93\83J\83\89\83\80\82Í\95K\90{\82È\82Ì\82Å\83\81\83j\83\85\81[\82É\8aÜ\82ß\82È\82¢)
+       if TObject( FActiveList ) is TBBS then begin
 
-procedure TGikoForm.OnResized;
-var
-       doc                                             : Variant;
-begin
+               //===== \83J\83e\83S\83\8a\83\8a\83X\83g =====
+               for i := 1 to Length( GikoBBSColumnCaption ) - 1 do begin
+                       item := TMenuItem.Create( ListColumnPopupMenu );
+                       item.Caption := GikoBBSColumnCaption[ i ];
+                       item.Tag := i;
+                       item.OnClick := ListColumnPopupMenuOnClick;
+                       for j := GikoSys.Setting.BBSColumnOrder.Count - 1 downto 0 do begin
+                               if GikoSys.Setting.BBSColumnOrder[ j ] = TGikoBBSColumnID( i ) then begin
+                                       item.Checked := True;
+                                       Break;
+                               end;
+                       end;
+                       ListColumnPopupMenu.Items.Add( item );
+               end;
 
-       FOldFormWidth := Width;
-       FIsIgnoreResize := rtNone;
+       end else if TObject( FActiveList ) is TCategory then begin
 
-       case FIsMinimize of
-       mtMinimizing:
-               begin
-                       // \8dÅ\8f¬\89»\92\86\82Å\82 \82é
-                       PostMessage( Handle, USER_MINIMIZED, 0, 0 );
+               //===== \94Â\83\8a\83X\83g =====
+               for i := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
+                       item := TMenuItem.Create( ListColumnPopupMenu );
+                       item.Caption := GikoCategoryColumnCaption[ i ];
+                       item.Tag := i;
+                       item.OnClick := ListColumnPopupMenuOnClick;
+                       for j := GikoSys.Setting.CategoryColumnOrder.Count - 1 downto 0 do begin
+                               if GikoSys.Setting.CategoryColumnOrder[ j ] = TGikoCategoryColumnID( i ) then begin
+                                       item.Checked := True;
+                                       Break;
+                               end;
+                       end;
+                       ListColumnPopupMenu.Items.Add( item );
                end;
 
-       mtMinimized:
-               begin
-                       // \8dÅ\8f¬\89»\82Í\8aù\82É\8a®\97¹\82µ\82Ä\82¢\82é (\82Â\82Ü\82è\83^\83X\83N\83o\81[\82©\82ç\83E\83B\83\93\83h\83E\82ð\95\9c\8c³\92\86)
-                       if FActiveContent <> nil then begin
-                               doc := Idispatch( olevariant(FActiveContent.Browser.ControlInterface).Document) as IHTMLDocument2;
-                               doc.Body.ScrollTop := FActiveContent.Thread.ScrollTop;
+       end else if TObject( FActiveList ) is TBoard then begin
+
+               //===== \83X\83\8c\83\8a\83X\83g =====
+               for i := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
+                       item := TMenuItem.Create( ListColumnPopupMenu );
+                       item.Caption := GikoBoardColumnCaption[ i ];
+                       item.Tag := i;
+                       item.OnClick := ListColumnPopupMenuOnClick;
+                       for j := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 0 do begin
+                               if GikoSys.Setting.BoardColumnOrder[ j ] = TGikoBoardColumnID( i ) then begin
+                                       item.Checked := True;
+                                       Break;
+                               end;
                        end;
-                       FIsMinimize := mtNone;
+                       ListColumnPopupMenu.Items.Add( item );
                end;
+
        end;
 
+       // \83\81\83j\83\85\81[\82Ì\95\\8e¦
+       Point := ListView.ClientToScreen( Point );
+       if ListColumnPopupMenu.Items.Count > 0 then
+               ListColumnPopupMenu.Popup( Point.X, Point.Y );
+
 end;
 
-procedure TGikoForm.TreeSelectNameCopyExecute(Sender: TObject);
+/// ListColumnPopupMenu \83A\83C\83e\83\80\82Ì\83N\83\8a\83b\83N\83C\83x\83\93\83g
+procedure      TGikoForm.ListColumnPopupMenuOnClick( Sender : TObject );
 var
-       s: string;
+       i                                       : Integer;
+       orderList       : TList;
+       item                    : TMenuItem;
 begin
-       TreeView.Selected := FClickNode;
-       s := FClickNode.Text;
-       Clipboard.AsText := s;
-end;
 
-procedure TGikoForm.FavoriteTreeViewMouseUp(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-begin
+       if not (Sender is TMenuItem) then
+               Exit;
 
-       if (abs( X - FMouseDownPos.X ) < Mouse.DragThreshold) and
-                (abs( Y - FMouseDownPos.Y ) < Mouse.DragThreshold) then begin
-               FavoriteClick( TObject( FavoriteTreeView.Selected ) );
-       end;
+       ActiveListColumnSave;
+       item := TMenuItem( Sender );
 
-end;
+       if TObject( FActiveList ) is TBBS then
+               orderList := GikoSys.Setting.BBSColumnOrder
+       else if TObject( FActiveList ) is TCategory then
+               orderList := GikoSys.Setting.CategoryColumnOrder
+       else if TObject( FActiveList ) is TBoard then
+               orderList := GikoSys.Setting.BoardColumnOrder
+       else
+               Exit;
 
-destructor     TBrowserRecord.Destroy;
-var
-       doc :OleVariant;
-begin
-       if Self.FEvent <> nil then
-               Self.FEvent.Free;
-       if Self.FBrowser <> nil then begin
-               if Self.Thread <> nil then begin
-                       //\83^\83u\82Ì\95\9c\8c³\82Å\95\9c\8c³\82³\82ê\82½\83X\83\8c\82Í\81A\95`\89æ\82³\82ê\82Ä\82¢\82È\82¢\82Æ\82«\82ª\82 \82é\82Ì\82Å
-                       //\82»\82Ì\82Æ\82«\82Ì\83X\83N\83\8d\81[\83\8b\97Ê\82ð\95Û\91\82µ\82Ä\82µ\82Ü\82¤\82Æ\83g\83b\83v\82É\96ß\82Á\82Ä\82µ\82Ü\82¤\81B
-                       if Self.FBrowser.OleObject.Document.documentElement.innerText <> '' then begin
-                               doc := Idispatch( olevariant(Self.FBrowser.ControlInterface).Document) as IHTMLDocument2;
-                               Self.Thread.ScrollTop := doc.Body.ScrollTop;
+       if item.Checked then begin
+               // \83J\83\89\83\80\82Ì\8dí\8f\9c
+               for i := orderList.Count - 1 downto 0 do begin
+                       if Integer( orderList[ i ] ) = item.Tag then begin
+                               orderList.Delete( i );
+                               Break;
                        end;
                end;
-               //TOleControl(Self.FBrowser).Visible := false;
-               ShowWindow(Self.FBrowser.Handle, SW_HIDE);
+       end else begin
+               // \83J\83\89\83\80\82Ì\92Ç\89Á
+               orderList.Add( Pointer( item.Tag ) );
        end;
 
-end;
+       SetActiveList( FActiveList );
 
-procedure TGikoForm.ResRangeActionUpdate(Sender: TObject);
-begin
-       ResRangeAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
 end;
 
-function TGikoForm.WebBrowserClick(Sender: TObject): WordBool;
+procedure TGikoForm.OnGestureStart(Sender: TObject);
 begin
-  result := true;
-  try
-       if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then
-               FActiveContent.FBrowser.SetFocus;
-  except
-  end;
+//
 end;
 
-procedure TGikoForm.SetFocusForBrowserActionExecute(Sender: TObject);
+procedure TGikoForm.OnGestureMove(Sender: TObject);
+var
+       s: string;
+       Action: TAction;
+       ActStr: string;
+       P : TPoint;
 begin
-       FActiveContent.FBrowser.SetFocus;
+       //\83}\83E\83X\88Ê\92u\82Ì\8eæ\93¾
+       GetCursorPos(P);
+       //\83R\83\93\83|\81[\83l\83\93\83g\96¼\8eæ\93¾
+       s := MouseGesture.GetGestureStr;
+       ActStr := '';
+       Action := GikoSys.Setting.Gestures.GetGestureAction(s);
+       if Action <> nil then
+               ActStr := '\81i' + Action.Caption + '\81j';
+       s := '\83W\83F\83X\83`\83\83\81[: ' + s + ActStr;
+       StatusBar.Panels[1].Text := s;
 end;
 
-procedure TGikoForm.SetFocusForBrowserActionUpdate(Sender: TObject);
+procedure TGikoForm.OnGestureEnd(Sender: TObject);
+var
+       s: string;
+       Action: TAction;
 begin
-       if( FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
-               (FActiveContent.Browser <> BrowserNullTab.Browser) then
-               SetFocusForBrowserAction.Enabled := true
-       else
-               SetFocusForBrowserAction.Enabled := false;
+       s := MouseGesture.GetGestureStr;
+    MouseGesture.Clear;
+       Action := GikoSys.Setting.Gestures.GetGestureAction(s);
+       if Action <> nil then
+               Action.Execute;
+       StatusBar.Panels[1].Text := '';
 end;
 
-procedure TGikoForm.SetFocusForThreadListActionExecute(Sender: TObject);
+procedure TGikoForm.ListViewCustomDrawItem(Sender: TCustomListView;
+  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
 var
-       rct: TRect;
+       ThreadItem: TThreadItem;
 begin
-       if FActiveContent <> nil then
-               WebBrowserClick(FActiveContent.Browser); //\88ê\89ñBrowser\82É\93\96\82Ä\82È\82¢\82Æ\93®\82©\82È\82¢\82Æ\82«\82ª\82 \82é
-       ListView.SetFocus;
-       if( ListView.Items.Count > 0 ) and (ListView.ItemFocused = nil) then
-               ListView.Items.Item[0].Selected := true //\91I\91ð\83A\83C\83e\83\80\82ª\96³\82¢\82Æ\82«\82Í\90æ\93ª\82Ì\82ð\91I\91ð\82·\82é
-       else if ListView.Items.Count > 0 then begin
-               ListView.Scroll(-ListView.ClientWidth, -ListView.ClientHeight);
-               rct := ListView.ItemFocused.DisplayRect(drBounds);
-               ListView.Scroll(0, 2 * rct.Top - rct.Bottom);
-               if ListView.ViewStyle <> vsReport then begin
-                       ListView.Scroll(rct.Left, 0);
+       DefaultDraw := true;
+       if TObject(Item.Data) is TThreadItem then begin
+               ThreadItem := TThreadItem(Item.Data);
+               if ( FUseOddResOddColor ) and ( ThreadItem.Count <> 0 ) and ( ThreadItem.AllResCount <> ThreadItem.Count) then begin
+                       ListView.Canvas.Brush.Color := FOddColor;
+                       //\91I\91ð\82³\82ê\82Ä\82¢\82é\82¯\82Ç\81A\83t\83H\81[\83J\83X\82ª\82È\82¢\82Æ\81A\83O\83\8c\83C\82É\82È\82é\82Ì\82Å\81A\91¾\8e\9a\82É\95Ï\8dX
+                       if (GikoSys.Setting.UnFocusedBold) and
+                        (Item.Selected) and (not ListView.Focused) then begin
+                               ListView.Canvas.Font.Style := [fsBold];
+                       end;
+               end else begin
+                       ListView.Canvas.Brush.Color := FListViewBackGroundColor;
                end;
-       end;
-end;
 
-procedure TGikoForm.SetFocusForCabinetActionExecute(Sender: TObject);
-begin
-       if FActiveContent <> nil then
-               WebBrowserClick(FActiveContent.Browser); //\88ê\89ñBrowser\82É\93\96\82Ä\82È\82¢\82Æ\93®\82©\82È\82¢\82Æ\82«\82ª\82 \82é
-       if TreeView.Visible then begin
-               TreeView.SetFocus;
-               if(TreeView.Items.Count > 0) and ( TreeView.Selected = nil ) then
-                       TreeView.Items.Item[0].Selected := true;
-       end else if FavoriteTreeView.Visible then begin
-               FavoriteTreeView.SetFocus;
-               if(FavoriteTreeView.Items.Count > 0) and (FavoriteTreeView.Selected = nil) then
-                       FavoriteTreeView.Items.Item[0].Selected := true;
+               if ThreadItem.UnRead then
+                       ListView.Canvas.Font.Style := [fsBold];
        end;
-end;
-procedure TGikoForm.SetFocusForCabinetActionUpdate(Sender: TObject);
-begin
-       SetFocusForCabinetAction.Enabled := CabinetPanel.Visible;
-end;
 
-//\83u\83\89\83E\83U\82ð\8dÅ\91å\89»\82µ\82Ä\83t\83H\81[\83J\83X\82ð\93\96\82Ä\82é\81B
-procedure TGikoForm.BrowserMaxAndFocusActionExecute(Sender: TObject);
-begin
-       BrowserMaxAction.Execute;
-       SetFocusForBrowserAction.Execute;
-end;
-
-procedure TGikoForm.BrowserMaxAndFocusActionUpdate(Sender: TObject);
-begin
-       if( FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
-               (FActiveContent.Browser <> BrowserNullTab.Browser) then
-               BrowserMaxAndFocusAction.Enabled := true
-       else
-               BrowserMaxAndFocusAction.Enabled := false;
-end;
-//\83X\83\8c\83b\83h\88ê\97\97\82ð\8dÅ\91å\89»\82µ\82Ä\83t\83H\81[\83J\83X\82ð\93\96\82Ä\82é
-procedure TGikoForm.ThreadlistMaxAndFocusActionExecute(Sender: TObject);
-begin
-       BrowserMinAction.Execute;
-       SetFocusForThreadListAction.Execute;
 end;
 
-procedure TGikoForm.ListViewExit(Sender: TObject);
+procedure TGikoForm.FormActivate(Sender: TObject);
 begin
-       ListView.Repaint;
+       if GikoSys.Setting.GestureEnabled then begin
+               GikoSys.Setting.Gestures.ClearGesture;
+               GikoSys.Setting.Gestures.LoadGesture(
+                       GikoSys.Setting.GetGestureFileName, GikoDM.GikoFormActionList );
+               MouseGesture.UnHook;
+               MouseGesture.OnGestureStart := OnGestureStart;
+               MouseGesture.OnGestureMove := OnGestureMove;
+               MouseGesture.OnGestureEnd := OnGestureEnd;
+               MouseGesture.SetHook(Handle);
+       end else begin
+               //MouseGesture.UnHook;
+               MouseGesture.OnGestureStart := nil;
+               MouseGesture.OnGestureMove := nil;
+               MouseGesture.OnGestureEnd := nil;
+       end;
 end;
 
-
-procedure TGikoForm.ListViewSelectItem(Sender: TObject; Item: TListItem;
-  Selected: Boolean);
+procedure TGikoForm.BrowserPanelResize(Sender: TObject);
 begin
+       if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
+               MoveWindow(FActiveContent.Browser.Handle, 0, 0, BrowserPanel.ClientWidth, BrowserPanel.ClientHeight, false);
+       end;
 
-       if not (GikoSys.Setting.BrowserTabVisible) and (Item <> nil) then
-                       if (TObject( Item.Data ) is TThreadItem) then begin
-                               SelectTimer.Interval := GikoSys.Setting.SelectInterval;
-                       end else
-                               SelectTimer.Interval := 0
-       else
-               SelectTimer.Interval := 0;
-
-end;
-
-procedure TGikoForm.SelectTimerTimer(Sender: TObject);
-begin
-       if not (ListView.Selected = nil) then
-               if( FActiveContent = nil) or
-                               (GetActiveContent <> TThreadItem(ListView.Selected.Data) ) then begin
-                       SelectTimer.Interval := 0;
-                       ListClick;
-               end;
 end;
-
-procedure TGikoForm.SelectItemSaveForDatExecute(Sender: TObject);
+procedure TGikoForm.CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
 var
-       List: TList;
-       i: Integer;
+       coolSet                         : TCoolSet;
+       toolbar                         : TToolBar;
+       band                                    : TCoolBand;
+       affectedBand    : TCoolBand;
+       i                                                       : Integer;
 begin
-       List := TList.Create;
-       try
-               Screen.Cursor := crHourGlass;
-               SelectListItem(List);
-               if ((GikoSys.Setting.ListOrientation = gloVertical) and
-                       (GikoSys.Setting.ListHeightState = glsMax)) or
-                       ((GikoSys.Setting.ListOrientation = gloHorizontal) and
-                       (GikoSys.Setting.ListWidthState = glsMax)) then
-                       ShowMessage('\83X\83\8c\83b\83h\88ê\97\97\82ð\95\\8e¦\82µ\82Ä\82­\82¾\82³\82¢')
-               else if(List.Count = 0) then
-                       ShowMessage('\83X\83\8c\83b\83h\82ð\91I\91ð\82µ\82Ä\82­\82¾\82³\82¢')
-               else begin
-                       FileSaveAs1.Dialog.Title := '\91I\91ð\83X\83\8c\83b\83h\82ðdat\82Ì\82Ü\82Ü\95Û\91¶';
-                       FileSaveAs1.Dialog.Filter := 'DAT\83t\83@\83C\83\8b(*.dat)|*.dat';
-                       for i := 0 to List.Count - 1 do begin
-                               if (TObject(List[i]) is TThreadItem) and (TThreadItem(List[i]).IsLogFile) then begin
-                                       FileSaveAs1.Dialog.FileName := TThreadItem(List[i]).FileName;
-                                       if FileSaveAs1.Execute then begin
-                                               //\82È\82º\82©\83L\83\83\83\93\83Z\83\8b\82Å\82à\82±\82Á\82¿\82É\93ü\82Á\82Ä\82­\82é
-                                               if ExtractFilePath(FileSaveAs1.Dialog.FileName) <> '' then begin
-                                                       CopyFile(PChar(TThreadItem(List[i]).FilePath),
-                                                               PChar(FileSaveAs1.Dialog.FileName), true);
-                                               end;
-                                       end;
-                               end;
+       if (FOldFormWidth = Width) and not IsIconic( Handle ) and (FIsIgnoreResize = rtNone) then begin
+               FIsIgnoreResize := rtResizing;
+               PostMessage( Handle, USER_RESIZED, 0, 0 );
+               band := nil;
+               // \95Ï\8dX\82³\82ê\82½\83N\81[\83\8b\83o\81[\82Ì\92l\82ð\95Û\91
+               if CoolBar = MainCoolBar then begin
+                       for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
+                               CoolSet.FCoolID := CoolBar.Bands[i].ID;
+                               CoolSet.FCoolWidth := CoolBar.Bands[i].Width;
+                               CoolSet.FCoolBreak := CoolBar.Bands[i].Break;
+                               GikoSys.Setting.MainCoolSet[i] := CoolSet;
+                       end;
+               end else if CoolBar = ListCoolBar then begin
+                       for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
+                               CoolSet.FCoolID := CoolBar.Bands[i].ID;
+                               CoolSet.FCoolWidth := CoolBar.Bands[i].Width;
+                               CoolSet.FCoolBreak := CoolBar.Bands[i].Break;
+                               GikoSys.Setting.ListCoolSet[i] := CoolSet;
+                       end;
+               end else if CoolBar = BrowserCoolBar then begin
+                       for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
+                               CoolSet.FCoolID := CoolBar.Bands[i].ID;
+                               CoolSet.FCoolWidth := CoolBar.Bands[i].Width;
+                               CoolSet.FCoolBreak := CoolBar.Bands[i].Break;
+                               GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
                        end;
                end;
-       finally
-               Screen.Cursor := crDefault;
-               List.Free;
-       end;
-
-end;
-
-procedure TGikoForm.SelectItemSaveForHTMLExecute(Sender: TObject);
-var
-       List: TList;
-       i: Integer;
-       html: TStringList;
-       title: string;
-begin
-       List := TList.Create;
-       try
-               Screen.Cursor := crHourGlass;
-               SelectListItem(List);
-               if ((GikoSys.Setting.ListOrientation = gloVertical) and
-                       (GikoSys.Setting.ListHeightState = glsMax)) or
-                       ((GikoSys.Setting.ListOrientation = gloHorizontal) and
-                       (GikoSys.Setting.ListWidthState = glsMax))      then
-                       ShowMessage('\83X\83\8c\83b\83h\88ê\97\97\82ð\95\\8e¦\82µ\82Ä\82­\82¾\82³\82¢')
-               else if(List.Count = 0) then
-                       ShowMessage('\83X\83\8c\83b\83h\82ð\91I\91ð\82µ\82Ä\82­\82¾\82³\82¢')
-               else begin
-                       FileSaveAs1.Dialog.Title := '\91I\91ð\83X\83\8c\83b\83h\82ðHTML\89»\82µ\82Ä\95Û\91¶';
-                       FileSaveAs1.Dialog.Filter := 'HTML\83t\83@\83C\83\8b(*.html)|*.html';
-                       for i := 0 to List.Count - 1 do begin
-                               if (TObject(List[i]) is TThreadItem) and (TThreadItem(List[i]).IsLogFile) then begin
-                                       FileSaveAs1.Dialog.FileName := TThreadItem(List[i]).Title + '.html';
-                                       if FileSaveAs1.Execute then begin
-                                               //\82È\82º\82©\83L\83\83\83\93\83Z\83\8b\82Å\82à\82±\82Á\82¿\82É\93ü\82Á\82Ä\82­\82é
-                                               if ExtractFilePath(FileSaveAs1.Dialog.FileName) <> '' then begin
-                                                       html := TStringList.Create;
-                                                       title := TThreadItem(List[i]).Title;
-                                                       try
-                                                               GikoSys.CreateHTML3(html, TThreadItem(List[i]), title);
-                                                               html.SaveToFile(FileSaveAs1.Dialog.FileName);
-                                                               SkinorCSSFilesCopy(ExtractFilePath(FileSaveAs1.Dialog.FileName));
-                                                       finally
-                                                               html.Free;
-                                                       end;
-                                               end;
-                                       end;
+               if not (Sender is TToolBar) or (CoolBar = nil) then
+                       Exit;
+               toolbar := TToolBar( Sender );
+               // \95\9d\82Ì\95Ï\8dX\82³\82ê\82½\83o\83\93\83h\82ð\8c©\82Â\82¯\82é
+               affectedBand := nil;
+               for i := CoolBar.Bands.Count - 1 downto 0 do begin
+                       if CoolBar.Bands[ i ].Control.Handle = toolbar.Handle then begin
+                               band    := CoolBar.Bands[ i ];
+                               if band.Break or (i = 0) then begin
+                                       if i + 1 < CoolBar.Bands.Count then
+                                               if not CoolBar.Bands[ i + 1 ].Break then
+                                                       affectedBand := CoolBar.Bands[ i + 1 ];
+                               end else begin
+                                       if i > 0 then
+                                               affectedBand := CoolBar.Bands[ i - 1 ];
                                end;
+                               Break;
                        end;
                end;
-       finally
-               Screen.Cursor := crDefault;
-               List.Free;
-       end;
-end;
-procedure TGikoForm.SkinorCSSFilesCopy(path: string);
-var
-       tmp, tmpD, tmpF: string;
-       current: string;
-       dirs: TStringList;
-       files: TStringList;
-       i, j: Integer;
-begin
-       if GikoSys.Setting.UseSkin then begin
-               current := ExtractFilePath(GikoSys.GetSkinDir);
-               tmp := GikoSys.Setting.CSSFileName;
-       end else if GikoSys.Setting.UseCSS then begin
-               current := ExtractFilePath(GikoSys.GetStyleSheetDir);
-               tmp := ExtractFilePath(GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName);
-       end;
-       dirs := TStringList.Create;
-       try
-               dirs.Add(tmp);
-               if tmp <> current then begin
-                       GikoSys.GetDirectoryList(current, '*.*', dirs, true);
-                       for i := 0 to dirs.Count - 1 do begin
-                               files := TStringList.Create;
-                               try
-                                       gikoSys.GetFileList(dirs[i], '*.*', files, true);
-                                       tmpD := CustomStringReplace(dirs[i], GikoSys.GetConfigDir, path);
-                                       if (AnsiPos(dirs[i], tmp) <> 0) and not (DirectoryExists(tmpD)) then
-                                               ForceDirectories(tmpD);
-
-                                       if(dirs[i] = tmp) and (dirs[i] <> current) then begin
-                                               for j := 0 to files.Count - 1 do begin
-                                                       tmpF := CustomStringReplace(files[j], GikoSys.GetConfigDir, path);
-                                                       if not FileExists(tmpF) then begin
-                                                               CopyFile(PChar(files[j]), PChar(tmpF),True);
-                                                       end;
-                                               end;
-                                       end;
-                               finally
-                                       files.Free;
-                               end;
+               // \83h\83\89\83b\83O\92\86\82Í band.Width \82ª\8dX\90V\82³\82ê\82È\82¢\82Ì\82Å\81A\93à\91¤\82Ì\83T\83C\83Y\82©\82ç\82Ð\82Ë\82è\8fo\82·
+               if CoolBar = MainCoolBar then begin
+                       coolSet := GikoSys.Setting.MainCoolSet[ band.ID ];
+                       coolSet.FCoolWidth := toolbar.Width + 25;
+                       GikoSys.Setting.MainCoolSet[ band.ID ] := coolSet;
+                       if affectedBand <> nil then begin
+                               coolSet := GikoSys.Setting.MainCoolSet[ affectedBand.ID ];
+                               coolSet.FCoolWidth := affectedBand.Control.Width + 25;
+                               GikoSys.Setting.MainCoolSet[ affectedBand.ID ] := coolSet;
                        end;
-               end else begin
-                       tmpD := CustomStringReplace(dirs[0], GikoSys.GetConfigDir, path);
-                       if not DirectoryExists(tmpD) then
-                               ForceDirectories(tmpD);
-                       tmpF := CustomStringReplace(GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName
-                                       , GikoSys.GetConfigDir, path);
-                       if not FileExists(tmpF) then begin
-                               CopyFile(PChar(GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName)
-                                       , PChar(tmpF), True);
+               end else if CoolBar = ListCoolBar then begin
+                       coolSet := GikoSys.Setting.ListCoolSet[ band.ID ];
+                       coolSet.FCoolWidth := toolbar.Width + 25;
+                       GikoSys.Setting.ListCoolSet[ band.ID ] := coolSet;
+                       if affectedBand <> nil then begin
+                               coolSet := GikoSys.Setting.ListCoolSet[ affectedBand.ID ];
+                               coolSet.FCoolWidth := affectedBand.Control.Width + 25;
+                               GikoSys.Setting.ListCoolSet[ affectedBand.ID ] := coolSet;
+                       end;
+               end else if CoolBar = BrowserCoolBar then begin
+                       coolSet := GikoSys.Setting.BrowserCoolSet[ band.ID ];
+                       coolSet.FCoolWidth := toolbar.Width + 25;
+                       GikoSys.Setting.BrowserCoolSet[ band.ID ] := coolSet;
+                       if affectedBand <> nil then begin
+                               coolSet := GikoSys.Setting.BrowserCoolSet[ affectedBand.ID ];
+                               coolSet.FCoolWidth := affectedBand.Control.Width + 25;
+                               GikoSys.Setting.BrowserCoolSet[ affectedBand.ID ] := coolSet;
                        end;
                end;
-       finally
-               dirs.Free;
        end;
+end;
 
 
+procedure TGikoForm.MenuToolBarResize(Sender: TObject);
+begin
+       CoolBarResized( Sender, MainCoolBar );
 end;
-procedure TGikoForm.KidokuActionExecute(Sender: TObject);
-var
-       List: TList;
-       i: Integer;
+
+procedure TGikoForm.ListToolBarResize(Sender: TObject);
 begin
-       List := TList.Create;
-       try
-               SelectListItem(List);
-               for i := 0 to List.Count - 1 do begin
-                       if TObject(List[i]) is TThreadItem then begin
-                               TThreadItem(List[i]).UnRead := false;
-                               TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1;
-                       end;
-               end;
-               if TreeView.Visible then
-                       TreeView.Refresh;
-       finally
-               List.Free;
-       end;
+       CoolBarResized( Sender, ListCoolBar );
 end;
 
-procedure TGikoForm.MidokuActionExecute(Sender: TObject);
-var
-       List: TList;
-       i: Integer;
+procedure TGikoForm.BrowserToolBarResize(Sender: TObject);
 begin
-       List := TList.Create;
-       try
-               SelectListItem(List);
-               for i := 0 to List.Count - 1 do begin
-                       if TObject(List[i]) is TThreadItem then begin
-                               TThreadItem(List[i]).UnRead := true;
-                               TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1;
-                       end;
-               end;
-               if TreeView.Visible then
-                       TreeView.Refresh;
-       finally
-               List.Free;
-       end;
+       CoolBarResized( Sender, BrowserCoolBar );
 end;
 
-procedure TGikoForm.BrowserPanelCanResize(Sender: TObject; var NewWidth,
-  NewHeight: Integer; var Resize: Boolean);
+//\82±\82Ì\83\8c\83X\82 \82Ú\81`\82ñ
+procedure TGikoForm.IndividualAbon(Atag, Atype : Integer);
 var
-       i: Integer;
+       ThreadItem      : TThreadItem;
+       ReadList                : TStringList;
+       wordCount               : TWordCount;
 begin
-       for i := BROWSER_COUNT - 1 downto 0 do begin
-               SetWindowPos(TWebBrowser(FBrowsers[i]).Handle, HWND_NOTOPMOST, 0, 0, NewWidth, NewHeight, SWP_NOMOVE + SWP_NOZORDER);
+       ThreadItem      := GetActiveContent(True);
+       ReadList                := TStringList.Create;
+       wordCount               := TWordCount.Create;
+       try
+               ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
+{$IFDEF SPAM_FILTER_ENABLED}
+               // \83X\83p\83\80\82É\90Ý\92è
+               ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
+               GikoSys.SpamCountWord( ReadList[ ATag - 1 ], wordCount );
+               GikoSys.SpamForget( wordCount, False ); // \83n\83\80\82ð\89ð\8f\9c
+               GikoSys.SpamLearn( wordCount, True );           // \83X\83p\83\80\82É\90Ý\92è
+{$ENDIF}
+               // \82 \82Ú\81[\82ñ\82É\90Ý\92è
+               GikoSys.FAbon.AddIndividualAbon(Atag, Atype, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG'));
+       finally
+               wordCount.Free;
+               ReadList.Free;
        end;
+       FActiveContent.Repaint := true;
+       if ThreadItem <> nil then
+               InsertBrowserTab( ThreadItem, True );
 end;
 
-procedure TGikoForm.LogFolderOpenActionExecute(Sender: TObject);
+//\93¯\88êID\82Ì\82 \82Ú\81`\82ñ
+procedure TGikoForm.IndividualAbonID(Atype : Integer);
 var
-       List: TList;
+       ThreadItem : TThreadItem;
+       i, No : Integer;
+       body : TStringList;
+       ReadList                : TStringList;
+       wordCount               : TWordCount;
 begin
-       if ((GikoSys.Setting.ListOrientation = gloVertical) and
-               (GikoSys.Setting.ListHeightState = glsMax)) or
-               ((GikoSys.Setting.ListOrientation = gloHorizontal) and
-               (GikoSys.Setting.ListWidthState = glsMax))      then begin
-               if(GetActiveContent <> nil) then begin
-                       GikoSys.CreateProcess('explorer.exe', '/e,"' + ExtractFilePath(GetActiveContent.FilePath) + '"');
-               end;
-       end else if GetActiveList is TCategory then begin
-               List := TList.Create;
+       No := KokoPopupMenu.Tag;
+       if No = 0 then Exit;
+       ThreadItem := GetActiveContent(True);
+       if ThreadItem = nil then Exit;
+       body := TStringList.Create;
+       try
+               GikoSys.GetSameIDRes(No, ThreadItem, body);
+
+               ReadList                := TStringList.Create;
+               wordCount               := TWordCount.Create;
                try
-                       SelectListItem(List);
-                       GikoSys.CreateProcess('explorer.exe', '/e,"' + ExtractFilePath(TBoard(List[0]).FilePath) + '"');
+                       ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
+{$IFDEF SPAM_FILTER_ENABLED}
+                       // \83X\83p\83\80\82É\90Ý\92è
+                       ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
+{$ENDIF}
+                       for i := 0 to body.Count - 1 do begin
+{$IFDEF SPAM_FILTER_ENABLED}
+                               GikoSys.SpamCountWord( ReadList[ i ], wordCount );
+                               GikoSys.SpamForget( wordCount, False ); // \83n\83\80\82ð\89ð\8f\9c
+                               GikoSys.SpamLearn( wordCount, True );           // \83X\83p\83\80\82É\90Ý\92è
+{$ENDIF}
+                               // \82 \82Ú\81[\82ñ\82É\90Ý\92è
+                               GikoSys.FAbon.AddIndividualAbon(StrToInt(body[i]), Atype, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG'));
+                       end;
                finally
-                       List.Free;
+                       wordCount.Free;
+                       ReadList.Free;
                end;
-       end else if GetActiveList is TBoard then begin
-               GikoSys.CreateProcess('explorer.exe', '/e,"' + ExtractFilePath(TBoard(GetActiveList).FilePath) + '"');
+               FActiveContent.Repaint := true;
+               if ThreadItem <> nil then
+                       InsertBrowserTab( ThreadItem, True );
+       finally
+               body.Free;
        end;
 
 end;
 
-procedure TGikoForm.LogFolderOpenActionUpdate(Sender: TObject);
+procedure TGikoForm.KokoPopupMenuPopup(Sender: TObject);
+var
+       firstElement: IHTMLElement;
+       document: IHTMLDocument2;
 begin
-       if (GetActiveList is TCategory) and (ListView.SelCount > 0) then
-               LogFolderOpenAction.Enabled := True
-       else if GetActiveList is TBoard then
-               LogFolderOpenAction.Enabled := True
-       else
-               LogFolderOpenAction.Enabled := False;
+       document := FActiveContent.Browser.Document as IHTMLDocument2;
+       if Assigned(document) then
+               firstElement := document.all.item('idSearch', 0) as IHTMLElement;
+               if Assigned(firstElement) then
+                       if firstElement.style.visibility <> 'hidden' then
+                               firstElement.style.visibility := 'hidden';
 end;
 
-function TGikoForm.GetTabURLs(AStringList: TStringList) : Boolean;
+procedure TGikoForm.RepaintAllTabsBrowser();
 var
-  rec : TBrowserRecord;
-  i, bound : Integer;
+       i : Integer;
+       ThreadItem: TThreadItem;
 begin
-  bound := BrowserTab.Tabs.Count -1;
-       if bound = -1 then begin
-               Result := False;
-               Exit; //for\82É\94ò\82Î\82È\82¢\82Å\91\80\8dì\82ð\94²\82¯\82é
-  end;
+       for i := BrowserTab.Tabs.Count - 1 downto 0 do
+               TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
+
+       ThreadItem := GetActiveContent;
+       if ThreadItem <> nil then
+               InsertBrowserTab( ThreadItem, True );
 
-  for i := 0 to bound do begin
-       rec := TBrowserRecord( BrowserTab.Tabs.Objects[ i ] );
-       if( rec <> nil) and (rec.Thread <> nil) then
-               AStringList.Add( rec.Thread.URL );
-  end;
-  Result := True;
 end;
 
-procedure TGikoForm.TabsSaveActionExecute(Sender: TObject);
+//ListView\82Ì\91I\91ð\8fó\91Ô\82ð\89ð\8f\9c\82·\82é
+procedure TGikoForm.ListViewKeyUp(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
 begin
-       if not SaveTabURLs then begin
-               ShowMessage('\95Û\91\82·\82é\83^\83u\82ª\82 \82è\82Ü\82¹\82ñ');
+       //\83u\83\89\83E\83U\83^\83u\96³\82µ\82Å\81A\83L\81[\88Ú\93®\82Å\93Ç\82Ý\94ò\82Î\82µ\82ð\89Â\94\\82É\82·\82é\82½\82ß\82Ì
+       //\96³\8cø\8e\9e\8aÔ\82ÌTimer\82Ì\8f\88\97\9d
+       //\82Æ\82è\82 \82¦\82¸\81A\83^\83C\83}\81[\82ð\92â\8e~\82·\82é\81B
+       SelectTimer.Interval := 0;
+       if not (GikoSys.Setting.BrowserTabVisible) then begin
+               if (GetActiveList is TBoard) then begin
+                       //Shift Alt Ctrl\82ª\98b\82³\82ê\82½\82Æ\82«\82Í\81A\95û\8cü\83L\81[\82ð\97£\82µ\82Ä\82¢\82Ä\82à\96³\8e\8b
+                       if not ((ssShift in Shift) or (ssAlt in Shift) or (ssCtrl in Shift))  and
+                               (( Key = VK_LEFT) or (Key = VK_RIGHT) or
+                                               (Key = VK_UP) or (Key = VK_DOWN)) then
+                                       SelectTimer.Interval := GikoSys.Setting.SelectInterval;
+               end;
        end;
 end;
-
-function TGikoForm.SaveTabURLs : Boolean;
-var
-       SaveStringList: TStringList;
+// *************************************************************************
+//! \82¨\8bC\82É\93ü\82è\82Ì\95Ò\8fW\8aJ\8en\83C\83x\83\93\83g
+// *************************************************************************
+procedure TGikoForm.FavoriteTreeViewEditing(Sender: TObject;
+  Node: TTreeNode; var AllowEdit: Boolean);
 begin
-       SaveStringList := TStringList.Create;
-       try
-               Result := GetTabURLs(SaveStringList);
-               SaveStringList.SaveToFile(ExtractFilePath(Application.ExeName) + 'tab.sav');
-       finally
-               SaveStringList.Free
-       end;
+       //\95Ò\8fW\91O\82Ì\95\8e\9a\97ñ\82ð\88ê\8e\9e\95Û\91\82·\82é
+       FOrigenCaption := Node.Text;
 end;
-
-procedure TGikoForm.TabsOpenActionExecute(Sender: TObject);
+// *************************************************************************
+//! Application\82ÌMainForm\82ð\8eæ\93¾\82·\82é
+// *************************************************************************
+function TGikoForm.GetMainForm(): TComponent;
 begin
-       if not LoadTabURLs then begin
-               ShowMessage('\95\\8e¦\82·\82é\83^\83u\82ª\82 \82è\82Ü\82¹\82ñ\81B');
-       end;
+       Result := Application.MainForm;
 end;
-{
- procedure TGikoForm.FileTabSaveClick(Sender: TObject);
-var
-       SaveStringList: TStringList;
+// *************************************************************************
+//! \8c»\8dÝ\82Ì\83J\81[\83\\83\8b\82ð\8eæ\93¾\82·\82é
+// *************************************************************************
+function TGikoForm.GetScreenCursor(): TCursor;
 begin
-                SaveTabList := TStringList.Create;
-                SaveTabList := GetTabURLs;
-                if TabSaveDialog.Execute then begin
-                                SaveTabList.SaveToFile(TabSaveDialog.FileName);
-                end;
+       Result := Screen.Cursor;
 end;
-}
-
-function TGikoForm.LoadTabURLs : Boolean;
-var
-       i, bound    : Integer;
-       item        : TThreadItem;
-       URLs                            : TStringList;
-       GikoTab                 : TGikoTabAppend;
-       fileName                : string;
+// *************************************************************************
+//! \83J\81[\83\\83\8b\82ð\90Ý\92è\82·\82é
+// *************************************************************************
+procedure TGikoForm.SetScreenCursor(Cursor : TCursor);
 begin
-       fileName := ExtractFilePath(Application.ExeName) + 'tab.sav';
-       URLs := TStringList.Create();
-       GikoTab := GikoSys.Setting.BrowserTabAppend;
-       try
-               try
-                       if FileExists(fileName) then
-                               URLs.LoadFromFile(fileName);
-               except
-                       on EFOpenError do
-                               ShowMessage('\83^\83u\83t\83@\83C\83\8b\82ª\8aJ\82¯\82Ü\82¹\82ñ');
-               end;
-               bound    := URLs.Count - 1;
-               if bound = -1 then begin
-                       Result := False;
-                       Exit;
-               end;
-
-
-               GikoSys.Setting.BrowserTabAppend := gtpLast;//TGikoTabAppend(1);
-               for i := 0 to URLs.Count - 1 do begin
-                       item := BBSsFindThreadFromURL( URLs[ i ] );
-                       if item <> nil then
-                               InsertBrowserTab( item, false );
-               end;
-       finally
-               GikoSys.Setting.BrowserTabAppend := GikoTab;
-               URLs.Free;
-       end;
-       Result := True;
+       if (Screen.Cursor <> Cursor) then
+               Screen.Cursor := Cursor;
 end;
-
-procedure TGikoForm.TabsSaveToFileActionExecute(Sender: TObject);
-var
-       SaveTabList: TStringList;
-       Result: Boolean;
+// *************************************************************************
+//! \83L\83\83\83r\83l\83b\83g\82ð\95Â\82\82é\81~\83{\83^\83\93\82Ì\83N\83\8a\83b\83N\83C\83x\83\93\83g
+// *************************************************************************
+procedure TGikoForm.CabinetCloseSpeedButtonClick(Sender: TObject);
 begin
-       SaveTabList := TStringList.Create;
-       try
-               Result := GetTabURLs(SaveTabList);
-//             if TabSaveDialog.Execute then begin
-//                     SaveTabList.SaveToFile(TabSaveDialog.FileName);
-//             end;
-       finally
-               SaveTabList.Free;
+       //Action\82Å\90Ý\92è\82·\82é\82Æ\83L\83\83\83v\83V\83\87\83\93\82ª\8fÁ\82¹\82È\82¢\82Ì\82Å\81AOnClick\83C\83x\83\93\83g\82Å\82Ì
+       //\8cÄ\82Ñ\8fo\82µ\82É\82µ\82½\81@by \82à\82\82ã
+       if GikoDM.CabinetVisibleAction.Enabled then begin
+               GikoDM.CabinetVisibleAction.Execute;
        end;
 end;
-
-procedure TGikoForm.TabsOpenFromFileActionExecute(Sender: TObject);
-var
-       i    : Integer;
-       item        : TThreadItem;
-       URLs : TStringList;
-       GikoTab: TGikoTabAppend;
+// *************************************************************************
+//! \82¨\8bC\82É\93ü\82è\83L\83\83\83r\83l\83b\83g\82Ì\90®\97\9d\83{\83^\83\93\82Ì\83N\83\8a\83b\83N\83C\83x\83\93\83g
+// *************************************************************************
+procedure TGikoForm.FavoriteArrangeToolButtonClick(Sender: TObject);
 begin
-       URLs := TStringList.Create();
-       GikoTab := GikoSys.Setting.BrowserTabAppend;
-       try
-               try
-//                     if TabOpenDialog.Execute then begin
-//                             URLs.LoadFromFile(TabOpenDialog.FileName);
-//                     end;
-               except
-                       on EFOpenError do ShowMessage('\83^\83u\83t\83@\83C\83\8b\82ª\8aJ\82¯\82Ü\82¹\82ñ');
-               end;
-
-               GikoSys.Setting.BrowserTabAppend := gtpLast;//TGikoTabAppend(1);
-               for i := 0 to URLs.Count - 1 do begin
-                       item := BBSsFindThreadFromURL( URLs[ i ] );
-                       if item <> nil then
-                               InsertBrowserTab( item, false );
-               end;
-       finally
-               GikoSys.Setting.BrowserTabAppend := GikoTab;
-               URLs.Free;
+       if GikoDM.FavoriteArrangeAction.Enabled then begin
+               GikoDM.FavoriteArrangeAction.Execute;
        end;
 end;
-
-procedure TGikoForm.OnlyAHundredResActionExecute(Sender: TObject);
+// *************************************************************************
+//! \83M\83R\83i\83r\82Ì\83\81\83b\83Z\81[\83W\83n\83\93\83h\83\8a\83\93\83O   (\92\8d\88Ó\81j\8f\88\97\9d\97Ê\82É\92\8d\88Ó\81I
+// *************************************************************************
+procedure TGikoForm.GikoApplicationEventsMessage(var Msg: tagMSG;
+  var Handled: Boolean);
 var
-       ThreadItem : TThreadItem;
-       FilterList : TStringList;
-       i: Integer;
+       wmMsg: TWMKey;
 begin
-       if (FActiveContent <> nil) and (FActiveContent.FBrowser <> nil)
-               and (FActiveContent.FBrowser.Busy) then Exit;
-
-       FResRangeMenuSelect                                             := 100;
-       OnlyAHundredResAction.Checked   := True;
-
-       if GikoSys.ResRange <> 100 then begin
-               GikoSys.ResRange                                        := 100;
-
-               // \83t\83B\83\8b\83^\95\8e\9a\97ñ\82ð\8bó\82É\82·\82é
-               FilterList := TStringList.Create;
-               try
-                       GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
-                       GikoSys.FSelectResFilter.Reverse := False;
-               finally
-                       FilterList.Destroy;
-               end;
-
-               FSelectResWord := '';
-
-               // \83X\83\8c\83b\83h\82ð\8dÄ\95`\89æ
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
+       //GikoForm\82ª\83A\83N\83e\83B\83u\82È\82Æ\82«\82¾\82¯\8eó\82¯\8eæ\82é \91¼\82Ì\83t\83H\81[\83\80\82Ì\82ð\89¡\8eæ\82è\82µ\82È\82¢\82½\82ß
+       if Self.Active then begin
+               case Msg.message of
+                       //\83L\81[\93ü\97Í\82·\82×\82Ä
+                       WM_KEYFIRST..WM_KEYLAST :
+                       begin
+                               //\83L\81[\83A\83b\83v\82Í\96³\8e\8b\82·\82é\81@KeyDown\82Æ\8d\87\82í\82¹\82Ä\82Q\89ñ\8cÄ\82Î\82ê\82é\82©\82ç
+                               if (Msg.message <> WM_KEYUP)
+                    and (Msg.message <> WM_CHAR)
+                    and (Msg.message <> WM_SYSKEYUP) then begin
+                                       wmMsg.Msg := Msg.message;
+                                       wmMsg.CharCode := Word(Msg.wParam);
+                                       wmMsg.KeyData := Msg.lParam;
+                                       //\83t\83H\81[\83\80\82Ì\83V\83\87\81[\83g\83J\83b\83g\82Ì\8f\88\97\9d\82É\93]\91\97
+                                       Self.OnShortCut(wmMsg, Handled);
+                               end;
+                       end;
                end;
-               ThreadItem := GetActiveContent;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
        end;
 end;
-
-procedure TGikoForm.OnlyKokoResActionExecute(Sender: TObject);
-var
-       ThreadItem : TThreadItem;
-       FilterList : TStringList;
-       i: Integer;
+// *************************************************************************
+//! \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ª\83A\83N\83e\83B\83u\82Å\82È\82­\82È\82Á\82½\82Æ\82«\82Ì\83C\83x\83\93\83g
+// *************************************************************************
+procedure TGikoForm.GikoApplicationEventsDeactivate(Sender: TObject);
 begin
-       if (FActiveContent <> nil) and (FActiveContent.FBrowser <> nil)
-               and (FActiveContent.FBrowser.Busy) then Exit;
-
-       FResRangeMenuSelect                             := Ord( grrKoko );
-       OnlyKokoResAction.Checked       := True;
-
-       if GikoSys.ResRange <> Ord( grrKoko ) then begin
-               GikoSys.ResRange                                        := Ord( grrKoko );
-
-               // \83t\83B\83\8b\83^\95\8e\9a\97ñ\82ð\8bó\82É\82·\82é
-               FilterList := TStringList.Create;
-               try
-                       GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
-                       GikoSys.FSelectResFilter.Reverse := False;
-               finally
-                       FilterList.Destroy;
-               end;
-
-               FSelectResWord := '';
-
-               // \83X\83\8c\83b\83h\82ð\8dÄ\95`\89æ
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-               end;
-               ThreadItem := GetActiveContent;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
+       Application.ProcessMessages;
+       if not Application.Terminated then begin
+               if PreviewTimer.Enabled then
+               PreviewTimer.Enabled := False;
+               //\83t\83H\81[\83J\83X\82ª\91¼\82Ì\83A\83v\83\8a\82É\95Ï\82í\82Á\82½\82Æ\82«\82É\83|\83b\83v\83A\83b\83v\8fÁ\8b\8e
+        if (FResPopupBrowser <> nil) then
+            FResPopupBrowser.Clear;
+
+               //\83v\83\8c\83r\83\85\81[\82ð\89B\82·
+               if FPreviewBrowser <> nil then
+                       ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
        end;
-end;
 
-procedure TGikoForm.OnlyNewResActionExecute(Sender: TObject);
+end;
+// *************************************************************************
+//! \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ª\8f\88\97\9d\82³\82ê\82È\82¢\97á\8aO\82ð\8fE\82Á\82½\82Æ\82«\82Ì\83C\83x\83\93\83g
+// *************************************************************************
+procedure TGikoForm.GikoApplicationEventsException(Sender: TObject;
+  E: Exception);
 var
-       ThreadItem : TThreadItem;
-       FilterList : TStringList;
-       i: Integer;
+       s : String;
 begin
-       if (FActiveContent <> nil) and (FActiveContent.FBrowser <> nil)
-               and (FActiveContent.FBrowser.Busy) then Exit;
-
-       FResRangeMenuSelect                             := Ord( grrNew );
-       OnlyNewResAction.Checked        := True;
-
-       if GikoSys.ResRange <> Ord( grrNew ) then begin
-               GikoSys.ResRange                                        := Ord( grrNew );
-
-               // \83t\83B\83\8b\83^\95\8e\9a\97ñ\82ð\8bó\82É\82·\82é
-               FilterList := TStringList.Create;
-               try
-                       GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
-                       GikoSys.FSelectResFilter.Reverse := False;
-               finally
-                       FilterList.Destroy;
-               end;
-
-               FSelectResWord := '';
-
-               // \83X\83\8c\83b\83h\82ð\8dÄ\95`\89æ
-               for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
-                       TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
-               end;
-               ThreadItem := GetActiveContent;
-               if ThreadItem <> nil then
-                       InsertBrowserTab( ThreadItem, True );
+       if (Sender <> nil) then begin
+               s := ' [' + Sender.ClassName + ']' + #13#10;
+       end else begin
+               s := ' [ Sender is nil ] ' + #13#10;
        end;
+       s := s + E.Message;
+       MsgBox(Handle, s, '\8f\88\97\9d\82³\82ê\82È\82©\82Á\82½\97á\8aO', MB_OK or MB_ICONSTOP);
 end;
-
-procedure TGikoForm.BrowsBoradHeadActionExecute(Sender: TObject);
+// *************************************************************************
+//! \83_\83E\83\93\83\8d\81[\83h\83R\83\93\83g\83\8d\81[\83\8b\83X\83\8c\83b\83h\82Ì\90\90¬
+// *************************************************************************
+procedure TGikoForm.CreateControlThread();
+begin
+       //\83_\83E\83\93\83\8d\81[\83h\83I\83u\83W\83F\83N\83g
+       FControlThread := TThreadControl.Create(True);
+       FControlThread.MaxThreadCount := 1;
+       FControlThread.Resume;
+       FControlThread.OnDownloadEnd := DownloadEnd;
+       FControlThread.OnDownloadMsg := DownloadMsg;
+       FControlThread.OnWork := Work;
+       FControlThread.OnWorkBegin := WorkBegin;
+       FControlThread.OnWorkEnd := WorkEnd;
+end;
+// *************************************************************************
+//! \83u\83\89\83E\83U\82Ì\90\90¬
+// *************************************************************************
+procedure TGikoForm.CreateBrowsers(count: Integer);
 var
-       RefURL, URL : string;
-       List : TList;
+       i: Integer;
+       newBrowser: TWebBrowser;
 begin
-       RefURL := '';
-       if GetActiveList is TCategory then begin
-               List := TList.Create;
-               try
-                       SelectListItem(List);
-                       RefURL := TBoard(List[0]).URL;
-               finally
-                       List.Free;
-               end;
-       end else if GetActiveList is TBoard then begin
-               RefURL := TBoard(GetActiveList).URL
+       BrowserNullTab := TBrowserRecord.Create;
+       BrowserNullTab.Browser := Browser;
+       BrowserNullTab.Browser.Navigate(BLANK_HTML);
+
+       FBrowsers := TList.Create;
+       for i := 0 to count -1 do begin
+               FBrowsers.Add(TWebBrowser.Create(BrowserPanel));
+               newBrowser := FBrowsers[FBrowsers.Count - 1];
+               TOleControl(newBrowser).Parent := BrowserPanel;
+               TOleControl(newBrowser).Align := alNone;
+               TOleControl(newBrowser).Left    := 0;
+               TOleControl(newBrowser).Top     := 0;
+               newBrowser.RegisterAsDropTarget := False;
+               newBrowser.OnDocumentComplete   := BrowserDocumentComplete;
+               newBrowser.OnBeforeNavigate2    := BrowserBeforeNavigate2;
+               newBrowser.OnEnter                              := BrowserEnter;
+               newBrowser.OnNewWindow2                 := BrowserNewWindow2;
+               newBrowser.OnStatusTextChange   := BrowserStatusTextChange;
+               newBrowser.Navigate(BLANK_HTML);
+               ShowWindow(newBrowser.Handle, SW_HIDE);
        end;
-       if RefURL <> '' then begin
-               if RefURL[Length(RefURL)] <> '/' then
-                       URL     := RefURL + '/' + 'head.txt'
-               else
-                       URL     := RefURL + 'head.txt';
+       BrowserNullTab.Browser.BringToFront;
+       ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
 
-               MoveToURL(URL);
-       end else begin
-               ShowMessage('\94Â\82ð\93Á\92è\82Å\82«\82Ü\82¹\82ñ\82Å\82µ\82½\81B');
+       //\8bN\93®\8e\9e\82É\83^\83u\8e©\93®\95\9c\8c³\82ð\93ü\82ê\82Ä\82¢\82é\82Æ\81A\8bó\83y\81[\83W\97p\82ÌBrowser\82Ì
+       //\95`\89æ\82ª\8fI\82í\82Á\82Ä\82¢\82È\82­\82Ä\81A\83N\83\8a\83b\83N\83C\83x\83\93\83g\82Ì\90Ý\92è\93\99\82É\93Ë\93ü\82·\82é\82Ì\82Å
+       //\82±\82±\82Å\8fI\82í\82ç\82¹\82Ä\82¨\82­
+       while (Browser.ReadyState <> READYSTATE_COMPLETE) and
+               (Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
+               Application.ProcessMessages;
        end;
-
-end;
-
-procedure TGikoForm.BrowsBoradHeadActionUpdate(Sender: TObject);
-begin
-       if (GetActiveList is TCategory) and (ListView.SelCount > 0) then
-               BrowsBoradHeadAction.Enabled := True
-       else if GetActiveList is TBoard then
-               BrowsBoradHeadAction.Enabled := True
-       else
-               BrowsBoradHeadAction.Enabled := False;
-
-end;
-//NG\83\8f\81[\83h\83t\83@\83C\83\8b\82ð\95Ò\8fW\82·\82é\82½\82ß\82É\8aJ\82­
-procedure TGikoForm.EditNGActionExecute(Sender: TObject);
-begin
-       GikoSys.FAbon.EditNGwords;
-end;
-
-procedure TGikoForm.ThreadRangeActionUpdate(Sender: TObject);
-begin
-       ThreadRangeAction.Enabled := (GetActiveList is TBoard);
 end;
-
-procedure TGikoForm.ThreadRangeActionExecute(Sender: TObject);
+// *************************************************************************
+//! \83c\81[\83\8b\83o\81[\82É\83X\83\8c\8di\8d\9e\82Ý\83R\83\93\83{\83{\83b\83N\83X\82ð\90Ý\92è\82·\82é
+// *************************************************************************
+procedure TGikoForm.SetSelectComboBox();
+const
+       DUMMYCOMPNAME = 'SelectComboBoxDummy';
+var
+       i: Integer;
+       ToolButton: TToolButton;
 begin
-       case GikoSys.Setting.ThreadRange of
-       gtrAll: AllItemAction.Execute;
-       gtrLog: LogItemAction.Execute;
-       gtrNew: NewItemAction.Execute;
-       end;
-end;
+       //ListToolBar\82É\82¢\82é\82©\82à\82µ\82ê\82È\82¢\8di\8d\9e\82ÝComboBox\82ð\94z\92u
+       SelectComboBoxPanel.Visible := False;
+       try
+               for i := ListToolBar.ControlCount - 1 downto 0 do
+               begin
+                       if ListToolBar.Controls[ i ].Action = GikoDM.SelectItemAction then
+                       begin
+                               SelectComboBoxPanel.Left := ListToolBar.Controls[ i ].Left;
+                               SelectComboBoxPanel.Width := GikoSys.Setting.SelectComboBoxWidth;
+                               SelectComboBoxPanel.Parent := ListToolBar;
+                               SelectComboBoxPanel.Visible := True;
+
+                               SelectComboBox.Left := 0;
+                               SelectComboBox.Top  := 0;
+                               SelectComboBox.Height := SelectComboBoxPanel.ClientHeight;
+                               SelectComboBox.Width := SelectComboBoxPanel.Width -
+                                                                               SelectComboBoxSplitter.Width;
+
+                               //\88ê\82Â\8c©\82¦\82È\82¢\83{\83^\83\93\82ð\93Ë\82Á\8d\9e\82Þ
+                               ToolButton := TToolButton(ListToolBar.FindComponent(DUMMYCOMPNAME));
+                               if ToolButton = nil then begin
+                                       ToolButton := TToolButton.Create(ListToolBar);
+                                       ToolButton.Name := DUMMYCOMPNAME;
+                               end;
+                               ToolButton.Style := tbsSeparator;
+                               ToolButton.Width := 0;
+                               ToolButton.Left  := ListToolBar.Controls[ i ].Left;
+                               ListToolBar.InsertControl(ToolButton);
+                               ToolButton.Visible := False;
 
-procedure TGikoForm.TabAutoSaveActionExecute(Sender: TObject);
-begin
-       SaveTabURLs;
-end;
+                               // \83X\83\8c\83b\83h\8di\8d\9e\82Ì\97×\82É\83Z\83p\83\8c\81[\83^\82ª\82 \82é\8fê\8d\87\82Í\89B\82·
+                               if (i + 1) < ListToolBar.ControlCount then
+                                       if ListToolBar.Controls[ i + 1 ] is TToolButton then
+                                               if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
+                                                       ListToolBar.Controls[ i + 1 ].Visible := False;
 
-procedure TGikoForm.TabAutoLoadActionExecute(Sender: TObject);
-begin
-       LoadTabURLs;
-end;
 
-/// ListView \82Ì\83J\83\89\83\80\95\9d\82¨\82æ\82Ñ\88Ê\92u\82Ì\95Û\91
-procedure TGikoForm.ActiveListColumnSave;
-var
-       ActivListObj    : TObject;
-       i, id, idx              : Integer;
-       BBSOrder                        : TGikoBBSColumnList;
-       CategoryOrder   : TGikoCategoryColumnList;
-       BoardOrder              : TGikoBoardColumnList;
-begin
+                               // \83X\83\8c\83b\83h\8di\8d\9e\83{\83^\83\93\82ð\89B\82·
+                               ListToolBar.Controls[ i ].Visible := False;
 
-       ActivListObj := ActiveList;
-       if ActivListObj is TBBS then begin
-               //===== \83J\83e\83S\83\8a\83\8a\83X\83g =====
-               BBSOrder := TGikoBBSColumnList.Create;
-               try
-                       for i := 0 to ListView.Columns.Count - 1 do begin
-                               // \8f\87\8f\98\82Ì\8eæ\93¾
-                               idx := ListView.Column[ i ].Tag;
-                               id := Ord( GikoSys.Setting.BBSColumnOrder[ idx ] );
-                               BBSOrder.Add( TGikoBBSColumnID( id ) );
-                               // \95\9d\82Ì\95Û\91
-                               GikoSys.Setting.BBSColumnWidth[ id ] := ListView.Column[ i ].Width;
-                       end;
-                       for i := 0 to ListView.Columns.Count - 1 do
-                               // \8f\87\8f\98\82Ì\95Û\91
-                               GikoSys.Setting.BBSColumnOrder[ i ] := BBSOrder[ i ];
-               finally
-                       BBSOrder.Free;
-               end;
-       end else if ActivListObj is TCategory then begin
-               //===== \94Â\83\8a\83X\83g =====
-               CategoryOrder := TGikoCategoryColumnList.Create;
-               try
-                       for i := 0 to ListView.Columns.Count - 1 do begin
-                               // \8f\87\8f\98\82Ì\8eæ\93¾
-                               idx := ListView.Column[ i ].Tag;
-                               id := Ord( GikoSys.Setting.CategoryColumnOrder[ idx ] );
-                               CategoryOrder.Add( TGikoCategoryColumnID( id ) );
-                               // \95\9d\82Ì\95Û\91
-                               GikoSys.Setting.CategoryColumnWidth[ id ] := ListView.Column[ i ].Width;
-                       end;
-                       for i := 0 to ListView.Columns.Count - 1 do
-                               // \8f\87\8f\98\82Ì\95Û\91
-                               GikoSys.Setting.CategoryColumnOrder[ i ] := CategoryOrder[ i ];
-               finally
-                       CategoryOrder.Free;
-               end;
-       end else if ActivListObj is TBoard then begin
-               //===== \83X\83\8c\83\8a\83X\83g =====
-               BoardOrder := TGikoBoardColumnList.Create;
-               try
-                       for i := 0 to ListView.Columns.Count - 1 do begin
-                               // \8f\87\8f\98\82Ì\8eæ\93¾
-                               idx := ListView.Column[ i ].Tag;
-                               id := Ord( GikoSys.Setting.BoardColumnOrder[ idx ] );
-                               BoardOrder.Add( TGikoBoardColumnID( id ) );
-                               // \95\9d\82Ì\95Û\91
-                               GikoSys.Setting.BoardColumnWidth[ id ] := ListView.Column[ i ].Width;
+                               break;
                        end;
-                       for i := 0 to ListView.Columns.Count - 1 do
-                               // \8f\87\8f\98\82Ì\95Û\91
-                               GikoSys.Setting.BoardColumnOrder[ i ] := BoardOrder[ i ];
-               finally
-                       BoardOrder.Free;
                end;
+       except
        end;
-       
 end;
-
-procedure TGikoForm.ListViewColumnRightClick(Sender: TObject;
-       Column: TListColumn; Point: TPoint);
+//! \83L\83\83\83r\83l\83b\83g\82Ì\83}\83E\83X\83_\83E\83\93\83C\83x\83\93\83g
+procedure TGikoForm.TreeViewMouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 var
-       i, j    : Integer;
-       item    : TMenuItem;
+       rect : TRect;
 begin
-
-       // \83|\83b\83v\83A\83b\83v\83\81\83j\83\85\81[\82ð\83N\83\8a\83A
-       for i := ListColumnPopupMenu.Items.Count - 1 downto 0 do
-               ListColumnPopupMenu.Items.Items[ i ].Free;
-
-       // \83\81\83j\83\85\81[\82Ì\8dì\90¬ (\83\81\83C\83\93\83J\83\89\83\80\82Í\95K\90{\82È\82Ì\82Å\83\81\83j\83\85\81[\82É\8aÜ\82ß\82È\82¢)
-       if TObject( FActiveList ) is TBBS then begin
-
-               //===== \83J\83e\83S\83\8a\83\8a\83X\83g =====
-               for i := 1 to Length( GikoBBSColumnCaption ) - 1 do begin
-                       item := TMenuItem.Create( ListColumnPopupMenu );
-                       item.Caption := GikoBBSColumnCaption[ i ];
-                       item.Tag := i;
-                       item.OnClick := ListColumnPopupMenuOnClick;
-                       for j := GikoSys.Setting.BBSColumnOrder.Count - 1 downto 0 do begin
-                               if GikoSys.Setting.BBSColumnOrder[ j ] = TGikoBBSColumnID( i ) then begin
-                                       item.Checked := True;
-                                       Break;
-                               end;
-                       end;
-                       ListColumnPopupMenu.Items.Add( item );
-               end;
-
-       end else if TObject( FActiveList ) is TCategory then begin
-
-               //===== \94Â\83\8a\83X\83g =====
-               for i := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
-                       item := TMenuItem.Create( ListColumnPopupMenu );
-                       item.Caption := GikoCategoryColumnCaption[ i ];
-                       item.Tag := i;
-                       item.OnClick := ListColumnPopupMenuOnClick;
-                       for j := GikoSys.Setting.CategoryColumnOrder.Count - 1 downto 0 do begin
-                               if GikoSys.Setting.CategoryColumnOrder[ j ] = TGikoCategoryColumnID( i ) then begin
-                                       item.Checked := True;
-                                       Break;
+       case Button of
+       mbLeft:
+               begin
+                       if (TreeView.Selected <> nil) and
+                               (TreeView.Selected = TreeView.GetNodeAt(X, Y)) then begin
+                               //\83}\83E\83X\82ªnode\82Ì\8fã\82É\82¢\82é\82©
+                               rect := TreeView.Selected.DisplayRect(true);
+                               // \83A\83C\83R\83\93\95ª\82¾\82¯\8d\82É\82¸\82ç\82·
+                               if ((rect.Left - TreeView.Indent <= X) and (rect.Right >= X)) and
+                                       ((rect.Bottom >= Y) and (rect.Top <= Y)) then begin
+                                       // \83N\83\8a\83b\83N\82Æ\83_\83u\83\8b\83N\83\8a\83b\83N\82ð\83R\83R\82Å\94»\92è
+                                       if ssDouble in Shift then begin
+                                               TreeDoubleClick( TreeView.Selected );
+                                       end else begin
+                                               TreeClick(TreeView.Selected);
+                                       end;
                                end;
                        end;
-                       ListColumnPopupMenu.Items.Add( item );
                end;
+       end;
+end;
+//! ActionList\82ÌGroupIndex\82Ì\95Û\91
+procedure TGikoForm.GetGroupIndex(ActionList: TActionList);
+var
+       i: Integer;
+begin
+       if ActionList <> nil then begin
+               SetLength(FActionListGroupIndexes, ActionList.ActionCount);
 
-       end else if TObject( FActiveList ) is TBoard then begin
-
-               //===== \83X\83\8c\83\8a\83X\83g =====
-               for i := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
-                       item := TMenuItem.Create( ListColumnPopupMenu );
-                       item.Caption := GikoBoardColumnCaption[ i ];
-                       item.Tag := i;
-                       item.OnClick := ListColumnPopupMenuOnClick;
-                       for j := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 0 do begin
-                               if GikoSys.Setting.BoardColumnOrder[ j ] = TGikoBoardColumnID( i ) then begin
-                                       item.Checked := True;
-                                       Break;
-                               end;
+               for i := 0 to ActionList.ActionCount - 1 do begin
+                       try
+                               FActionListGroupIndexes[i] :=
+                                       TCustomAction(ActionList.Actions[i]).GroupIndex;
+                               TCustomAction(ActionList.Actions[i]).GroupIndex
+                                       := 0;
+                       except
+                               ;//Cast\82Å\82«\82È\82¢\82Æ\82«\91Î\8dô
                        end;
-                       ListColumnPopupMenu.Items.Add( item );
                end;
 
        end;
-
-       // \83\81\83j\83\85\81[\82Ì\95\\8e¦
-       Point := ListView.ClientToScreen( Point );
-       if ListColumnPopupMenu.Items.Count > 0 then
-               ListColumnPopupMenu.Popup( Point.X, Point.Y );
-
 end;
-
-/// ListColumnPopupMenu \83A\83C\83e\83\80\82Ì\83N\83\8a\83b\83N\83C\83x\83\93\83g
-procedure      TGikoForm.ListColumnPopupMenuOnClick( Sender : TObject );
+//! ActionList\82ÌGroupIndex\82Ì\90Ý\92è
+procedure TGikoForm.SetGroupIndex(ActionList: TActionList);
 var
-       i                                       : Integer;
-       orderList       : TList;
-       item                    : TMenuItem;
+       i: Integer;
 begin
-
-       if not (Sender is TMenuItem) then
-               Exit;
-
-       ActiveListColumnSave;
-       item := TMenuItem( Sender );
-
-       if TObject( FActiveList ) is TBBS then
-               orderList := GikoSys.Setting.BBSColumnOrder
-       else if TObject( FActiveList ) is TCategory then
-               orderList := GikoSys.Setting.CategoryColumnOrder
-       else if TObject( FActiveList ) is TBoard then
-               orderList := GikoSys.Setting.BoardColumnOrder
-       else
-               Exit;
-
-       if item.Checked then begin
-               // \83J\83\89\83\80\82Ì\8dí\8f\9c
-               for i := orderList.Count - 1 downto 0 do begin
-                       if Integer( orderList[ i ] ) = item.Tag then begin
-                               orderList.Delete( i );
-                               Break;
+       if ActionList <> nil then begin
+               if Length( FActionListGroupIndexes ) = ActionList.ActionCount then begin
+                       for i := 0 to ActionList.ActionCount - 1 do begin
+                               try
+                                       TCustomAction(ActionList.Actions[i]).GroupIndex
+                                               := FActionListGroupIndexes[i];
+                               except
+                                       ;//Cast\82Å\82«\82È\82¢\82Æ\82«\91Î\8dô
+                               end;
                        end;
                end;
-       end else begin
-               // \83J\83\89\83\80\82Ì\92Ç\89Á
-               orderList.Add( Pointer( item.Tag ) );
        end;
-
-       SetActiveList( FActiveList );
-
 end;
-//\8ew\92è\82µ\82½\94Ô\8d\86\82Ì\83\8c\83X\82Éjump\82·\82éAction
-procedure TGikoForm.JumpToNumOfResActionExecute(Sender: TObject);
-var
-       str: string;
-       res: integer;
+//! \82±\82Ì\83\8c\83X\82ÌURL\8eæ\93¾
+procedure TGikoForm.GetResURLMenuClick(Sender: TObject);
 begin
-       str := '1';
-       if( InputQuery('\8ew\92è\82µ\82½\94Ô\8d\86\82Ì\83\8c\83X\82É\94ò\82Ô', '\94Ô\8d\86\82ð\93ü\97Í\82µ\82Ä\82­\82¾\82³\82¢', str) ) then begin
-               str := ZenToHan(str);
-               res := StrToIntDef(str, -1);
-               if (res > 0) and (res <= GetActiveContent.Count) then begin
-                       BrowserMovement(IntToStr(res), FActiveContent);
-                       SetFocusForBrowserAction.Execute;
-               end else if res > GetActiveContent.Count then begin
-                       BrowserMovement(IntToStr(GetActiveContent.Count), FActiveContent);
-                       SetFocusForBrowserAction.Execute;
-               end;
+;
+end;
+//! ListView\81i\83X\83\8c\83b\83h\88ê\97\97\81j\82ð\8dX\90V\82·\82é
+procedure TGikoForm.RefreshListView(Thread: TThreadItem);
+begin
+       //Thread\82Ì\94Â\82Æ\95\\8e¦\82µ\82Ä\82¢\82é\94Â\82ª\93¯\82\82È\82ç\95`\89æ\82ð\8dX\90V\82·\82é
+       if (FActiveList is TBoard) and (TBoard(ActiveList) = Thread.ParentBoard) then begin
+               ListView.Refresh;
        end;
 end;
 
-procedure TGikoForm.JumpToNumOfResActionUpdate(Sender: TObject);
-begin
-       JumpToNumOfResAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
+procedure TGikoForm.MainCoolBarContextPopup(Sender: TObject;
+  MousePos: TPoint; var Handled: Boolean);
+var
+    pos : TPoint;
+    coolBar: TGikoCoolBar;
+begin
+    Handled := False;
+    if (Sender <> nil) and (Sender is TGikoCoolBar) then begin
+        coolBar := TGikoCoolBar(Sender);
+        if (coolBar = MainCoolBar) then begin
+            FToolBarSettingSender := tssMain;
+        end else if (coolBar = ListCoolBar) then begin
+            FToolBarSettingSender := tssList;
+        end else if (coolBar = BrowserCoolBar) then begin
+            FToolBarSettingSender := tssBrowser;
+        end else begin
+            FToolBarSettingSender := tssNone;
+        end;
+        pos := coolBar.ClientToScreen( MousePos );
+        MainCoolBarPopupMenu.Popup( pos.X, pos.Y );
+        Handled := True;
+    end;
 end;
 
-procedure TGikoForm.FavoriteTreeViewCollapseActionExecute(Sender: TObject);
+procedure TGikoForm.TaskTrayIconMessage(var Msg: TMsg);
+begin
+    //  \8d\83N\83\8a\83b\83N\82È\82ç\95\9c\8c³\82·\82é
+    if  (Msg.wParam = WM_LBUTTONUP) then  begin
+        UnStoredTaskTray;
+    end;
+end;
+//! \83^\83X\83N\83g\83\8c\83C\82É\83A\83C\83R\83\93\93o\98^\81\95\83t\83H\81[\83\80\89B\82µ
+procedure TGikoForm.StoredTaskTray;
+begin
+    try
+        if (FIconData.uID = 0) then begin
+            FIconData.cbSize  :=  SizeOf(TNotifyIconData);
+            FIconData.uID     :=  Self.Handle;
+            FIconData.Wnd     :=  Handle;
+            FIconData.uFlags  :=  NIF_MESSAGE or NIF_ICON or NIF_TIP;
+            FIconData.uCallbackMessage  :=  USER_TASKTRAY;
+            FIconData.hIcon   :=  Application.Icon.Handle;  {\83A\83C\83R\83\93\8ew\92è}
+            FIconData.szTip   :=  '\83M\83R\83i\83r';      {\83q\83\93\83g\95\8e\9a\97ñ}
+            Shell_NotifyIcon(NIM_ADD, @FIconData);
+            ShowEditors(SW_HIDE);
+            ShowWindow(Self.Handle, SW_HIDE);
+        end;
+    except
+    end;
+end;
+//! \83^\83X\83N\83g\83\8c\83C\82Ì\83A\83C\83R\83\93\8dí\8f\9c\81\95\83t\83H\81[\83\80\95\\8e¦
+procedure TGikoForm.UnStoredTaskTray;
+begin
+    try
+        try
+            Shell_NotifyIcon(NIM_DELETE, @FIconData);
+            SetForegroundWindow(Application.Handle);
+        except
+        end;
+    finally
+        FIconData.uID := 0;
+        // Action\82©\82ç\8ai\94[\82µ\82½\82Æ\82«\82ÍTag\82Ì\92l\82Í0\88È\8aO
+        if (GikoDM.StoredTaskTrayAction.Tag = 0) then begin
+            ShowWindow(Self.Handle, SW_RESTORE);
+        end else begin
+            ShowWindow(Self.Handle, SW_SHOW);
+        end;
+        ShowEditors(SW_SHOW);
+        GikoDM.StoredTaskTrayAction.Tag := 0;
+    end;
+end;
+{
+\brief \83\8c\83X\83G\83f\83B\83^\82Ì\95\\8e¦\94ñ\95\\8e¦
+\param nCmdShow Windows.ShowWindow\82É\91\97\82é\83p\83\89\83\81\81[\83^\82Æ\93¯\82
+}
+procedure TGikoForm.ShowEditors(nCmdShow: Integer);
 var
-       node    : TTreeNode;
+    i : Integer;
 begin
+    // \83\8c\83X\83G\83f\83B\83^\82ð\92T\82·
+    for i := 0 to Screen.CustomFormCount - 1 do begin
+        if TObject(Screen.CustomForms[i]) is TEditorForm then
+            ShowWindow(Screen.CustomForms[i].Handle, nCmdShow);
 
-       node := FavoriteTreeView.Items.GetFirstNode;
-       while node <> nil do begin
-               if node.HasChildren then
-                       node.Expanded := False;
-               node := node.GetNext;
-       end;
+    end;
+end;
+//! \83|\83b\83v\83A\83b\83v\83u\83\89\83E\83U\8dì\90¬
+procedure TGikoForm.CreateResPopupBrowser;
+begin
+    if (FResPopupBrowser = nil) then begin
+        FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
+    end;
+end;
+//! \8aO\82©\82ç\82ÌD&D\8f\88\97\9d
+procedure TGikoForm.WMDropFiles(var Msg: TWMDropFiles);
+var
+    FileName: Array[0..MAX_PATH] of Char;
+    Cnt, K: Integer;
+    Board: TBoard;
+    LogFolder: String;
+    datList: TStringList;
+begin
+    // \95\\8e¦\82µ\82Ä\82¢\82é\82Ì\94Â\82Ì\82Æ\82«\88È\8aO\82Í\8b\91\94Û
+    if GetActiveList is TBoard then begin
+        Board := TBoard(GetActiveList);
+        if MsgBox(Handle, Board.Title
+            + ' \94Â\82É\93ü\82ê\82Ä\82¢\82¢\82Å\82·\82©\81H', '\83M\83R\83i\83r', MB_YESNO or MB_ICONQUESTION) = IDYES      then begin
+            // \94Â\82Ì\8e\9e\82Í\81A\83\8d\83O\83t\83H\83\8b\83_\82É\83R\83s\81[\82µ\82Ä\82Í\82®\82ê\83\8d\83O\91Î\89\9e\82Æ\93¯\82\8f\88\97\9d\81H
+            datList := TStringList.Create;
+            try
+                Cnt := DragQueryFile(Msg.Drop, $FFFFFFFF, FileName, SizeOf(FileName));
+                for K := 0 to Cnt - 1 do begin
+                    DragQueryFile(Msg.Drop, K, FileName, SizeOf(FileName));
+                    {FileName\82Édrop\82³\82ê\82½\83t\83@\83C\83\8b\96¼\82ª\93ü\82Á\82Ä\82¢\82é\82Ì\82Å\81A\82±\82±\82Å\89½\82ç\82©\82Ì\8f\88\97\9d\82ð\82·\82é\81B\82½\82Æ\82¦\82Î\8e\9f\82Ì\8ds}
+                    // \83t\83@\83C\83\8b\82Ì\83`\83F\83b\83N
+                    if (isValidFile(FileName)) then begin
+                        LogFolder := ExtractFilePath(Board.FilePath);
+                        if (FileExists( LogFolder + ExtractFileName(FileName))) then begin
+                            GikoUtil.MsgBox(Handle, LogFolder + '\82É' + ExtractFileName(FileName) + '\82ª\8aù\82É\91\8dÝ\82µ\82Ü\82·\81B', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
+                        end else begin
+                            if (not DirectoryExists(LogFolder)) then begin
+                                if (not GikoSys.ForceDirectoriesEx(LogFolder) ) then begin
+                                    GikoUtil.MsgBox(Handle, LogFolder + '\82Ì\90\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
+                                end;
+                            end;
+                            if (not Windows.CopyFile(FileName,  PChar(LogFolder + ExtractFileName(FileName)), true)) then begin
+                                GikoUtil.MsgBox(Handle, FileName + '\82Ì\83R\83s\81[\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
+                            end else begin
+                                datList.Add(ExtractFileName(FileName));
+                            end;
+                        end;
+                    end;
+                end;
+                DragFinish(Msg.Drop);
+                if (datList.Count > 0) then begin
+                    GikoSys.AddOutofIndexDat(Board, datList, False);
+                    ShowMessage(IntToStr(datList.Count) + '\8cÂ\82Ìdat\83t\83@\83C\83\8b\82ª\83R\83s\81[\82³\82ê\82Ü\82µ\82½\81B' );
+                       if GikoForm.TreeView.Visible then
+                               GikoForm.TreeView.Refresh;
+                           if GikoForm.ListView.Visible then
+                               GikoForm.ListView.Refresh;
+                end else begin
+                    ShowMessage('\88ê\82Â\82à\83R\83s\81[\82³\82ê\82Ü\82¹\82ñ\82Å\82µ\82½\81B' );
+                end;
+            finally
+                datList.Free;
+            end;
 
+        end;
+    end else begin
+        ShowMessage('\94Â\82ð\95\\8e¦\82µ\82Ä\82­\82¾\82³\82¢\81B');
+    end;
+end;
+//! \83t\83@\83C\83\8b\83`\83F\83b\83N
+function TGikoForm.isValidFile(FileName: String) : boolean;
+var
+    tmp: String;
+       unixtime: Int64;
+    dt: TDateTime;
+begin
+    Result := True;
+    // \91\8dÝ\82·\82é\82©\81A\8ag\92£\8eqdat\81A\83t\83@\83C\83\8b\96¼
+    if ( not FileExists(FileName) ) then begin
+        Result := False;
+        GikoUtil.MsgBox(Handle, FileName + '\82Í\91\8dÝ\82µ\82Ü\82¹\82ñ\81B', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
+    end else if (ExtractFileExt(ExtractFileName(FileName)) <> '.dat' ) then begin
+        Result := False;
+        GikoUtil.MsgBox(Handle, ExtractFileName(FileName) + '\82Ì\8ag\92£\8eq\82ª".dat"\82Å\82 \82è\82Ü\82¹\82ñ\81B', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
+    end else begin
+        // \83\8d\83O\83t\83@\83C\83\8b\82Ì\8ag\92£\8eq\82ð\82Í\82¸\82µ\82½\82à\82Ì\82ª\83X\83\8c\8dì\90¬\93ú\8e\9e
+        try
+            dt := GikoSys.GetCreateDateFromName(FileName);
+            if ((UnixToDateTime(ZERO_DATE) + OffsetFromUTC) = dt) then begin
+                Result := False;
+                GikoUtil.MsgBox(Handle, ExtractFileName(FileName) + '\82Ì\83t\83@\83C\83\8b\96¼\82ª\95s\90³\82Å\82·\81B', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
+            end;
+        except
+            Result := False;
+            GikoUtil.MsgBox(Handle, ExtractFileName(FileName) + '\82Ì\83t\83@\83C\83\8b\96¼\82ª\95s\90³\82Å\82·\81B', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
+        end;
+    end;
 end;
 
 initialization