VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "exdisp.tlb"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#1.1#0"; "comct232.ocx"
Begin VB.Form frmMain 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Viral Toolbar Builder"
   ClientHeight    =   5955
   ClientLeft      =   150
   ClientTop       =   555
   ClientWidth     =   11910
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   204
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   5955
   ScaleWidth      =   11910
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdHelp 
      Caption         =   "Video Help"
      Height          =   700
      Left            =   10800
      MaskColor       =   &H00FF00FF&
      Picture         =   "frmMain.frx":1982
      Style           =   1  'Graphical
      TabIndex        =   111
      ToolTipText     =   "Help on current step"
      Top             =   1800
      UseMaskColor    =   -1  'True
      Visible         =   0   'False
      Width           =   870
   End
   Begin VB.PictureBox picDefaultLogo2 
      AutoSize        =   -1  'True
      Height          =   300
      Left            =   2040
      Picture         =   "frmMain.frx":2084
      ScaleHeight     =   240
      ScaleWidth      =   660
      TabIndex        =   50
      Top             =   240
      Visible         =   0   'False
      Width           =   720
   End
   Begin VB.Frame fraPreview 
      Caption         =   "Toolbar Preview"
      Height          =   855
      Left            =   60
      TabIndex        =   0
      Top             =   0
      Width           =   11800
      Begin VB.PictureBox pbxLogo 
         BorderStyle     =   0  'None
         Height          =   255
         Left            =   1440
         ScaleHeight     =   255
         ScaleWidth      =   495
         TabIndex        =   155
         Top             =   600
         Visible         =   0   'False
         Width           =   495
      End
      Begin VB.PictureBox picTemp 
         Height          =   255
         Left            =   6360
         ScaleHeight     =   195
         ScaleWidth      =   435
         TabIndex        =   143
         Top             =   240
         Visible         =   0   'False
         Width           =   495
      End
      Begin MSComctlLib.ImageList ilsAdsHot 
         Left            =   6000
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
      Begin MSComctlLib.ImageList ilsAds 
         Left            =   5400
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
      Begin MSComctlLib.ImageList ilsToolbarHot 
         Left            =   9840
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
      Begin MSComctlLib.ImageList ilsTlbButtonsHot 
         Index           =   0
         Left            =   11280
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
      Begin MSComctlLib.ImageList ilsTlbButtons 
         Index           =   0
         Left            =   10800
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
      Begin VB.PictureBox picCleaner 
         AutoSize        =   -1  'True
         Height          =   240
         Left            =   4560
         Picture         =   "frmMain.frx":2786
         ScaleHeight     =   180
         ScaleWidth      =   225
         TabIndex        =   49
         Top             =   240
         Visible         =   0   'False
         Width           =   285
      End
      Begin MSComctlLib.ImageList ilsTools 
         Left            =   6960
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
      Begin MSComctlLib.ImageList ilsToolbar 
         Left            =   9360
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         ImageWidth      =   48
         ImageHeight     =   21
         MaskColor       =   8421376
         _Version        =   393216
         BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
            NumListImages   =   1
            BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmMain.frx":2868
               Key             =   ""
            EndProperty
         EndProperty
      End
      Begin VB.PictureBox picDefaultLogo 
         AutoSize        =   -1  'True
         Height          =   300
         Left            =   1200
         Picture         =   "frmMain.frx":30AA
         ScaleHeight     =   240
         ScaleWidth      =   660
         TabIndex        =   44
         Top             =   240
         Visible         =   0   'False
         Width           =   720
      End
      Begin VB.PictureBox picDefaultButton 
         Height          =   255
         Left            =   4920
         Picture         =   "frmMain.frx":37AC
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   42
         Top             =   240
         Visible         =   0   'False
         Width           =   255
      End
      Begin MSComctlLib.Toolbar tlbMain 
         Height          =   330
         Left            =   135
         TabIndex        =   1
         Top             =   240
         Width           =   11550
         _ExtentX        =   20373
         _ExtentY        =   582
         ButtonWidth     =   1773
         ButtonHeight    =   582
         AllowCustomize  =   0   'False
         Wrappable       =   0   'False
         Style           =   1
         _Version        =   393216
         Begin VB.Frame fraAds 
            BorderStyle     =   0  'None
            Caption         =   "Frame1"
            Height          =   375
            Left            =   240
            TabIndex        =   138
            Top             =   0
            Visible         =   0   'False
            Width           =   1095
            Begin MSComctlLib.Toolbar tlbAds 
               Height          =   330
               Left            =   240
               TabIndex        =   139
               Top             =   0
               Width           =   735
               _ExtentX        =   1296
               _ExtentY        =   582
               ButtonWidth     =   609
               ButtonHeight    =   582
               AllowCustomize  =   0   'False
               Wrappable       =   0   'False
               Style           =   1
               _Version        =   393216
            End
            Begin SHDocVwCtl.WebBrowser wbrAds 
               Height          =   255
               Left            =   240
               TabIndex        =   217
               Top             =   120
               Width           =   255
               ExtentX         =   450
               ExtentY         =   450
               ViewMode        =   0
               Offline         =   0
               Silent          =   0
               RegisterAsBrowser=   0
               RegisterAsDropTarget=   1
               AutoArrange     =   0   'False
               NoClientEdge    =   0   'False
               AlignLeft       =   0   'False
               NoWebView       =   0   'False
               HideFileNames   =   0   'False
               SingleClick     =   0   'False
               SingleSelection =   0   'False
               NoFolders       =   0   'False
               Transparent     =   0   'False
               ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
               Location        =   "http:///"
            End
         End
         Begin VB.Frame fraTellAFriend 
            BorderStyle     =   0  'None
            Caption         =   "Frame1"
            Height          =   375
            Left            =   0
            TabIndex        =   168
            Top             =   0
            Width           =   975
            Begin MSComctlLib.Toolbar tlbTellAFriend 
               Height          =   330
               Left            =   0
               TabIndex        =   169
               Top             =   120
               Width           =   735
               _ExtentX        =   1296
               _ExtentY        =   582
               ButtonWidth     =   609
               ButtonHeight    =   582
               AllowCustomize  =   0   'False
               Wrappable       =   0   'False
               Style           =   1
               _Version        =   393216
            End
         End
         Begin SHDocVwCtl.WebBrowser WebBrowser 
            Height          =   1575
            Index           =   0
            Left            =   7080
            TabIndex        =   148
            Top             =   0
            Visible         =   0   'False
            Width           =   1575
            ExtentX         =   2778
            ExtentY         =   2778
            ViewMode        =   0
            Offline         =   0
            Silent          =   0
            RegisterAsBrowser=   0
            RegisterAsDropTarget=   1
            AutoArrange     =   0   'False
            NoClientEdge    =   0   'False
            AlignLeft       =   0   'False
            NoWebView       =   0   'False
            HideFileNames   =   0   'False
            SingleClick     =   0   'False
            SingleSelection =   0   'False
            NoFolders       =   0   'False
            Transparent     =   0   'False
            ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
            Location        =   "http:///"
         End
         Begin VB.Frame fraButtons 
            BorderStyle     =   0  'None
            Height          =   375
            Index           =   0
            Left            =   6720
            TabIndex        =   147
            Top             =   0
            Visible         =   0   'False
            Width           =   1000
         End
         Begin VB.PictureBox picLogoDummy 
            Height          =   255
            Left            =   5400
            Picture         =   "frmMain.frx":3C2E
            ScaleHeight     =   195
            ScaleWidth      =   315
            TabIndex        =   142
            Top             =   0
            Visible         =   0   'False
            Width           =   375
         End
         Begin VB.Frame fraLogo 
            BorderStyle     =   0  'None
            Caption         =   "fraLogo"
            Height          =   255
            Left            =   5640
            TabIndex        =   141
            Top             =   0
            Width           =   615
         End
         Begin MSComctlLib.Toolbar tlbButtons 
            Height          =   330
            Index           =   0
            Left            =   10440
            TabIndex        =   53
            Top             =   0
            Visible         =   0   'False
            Width           =   735
            _ExtentX        =   1296
            _ExtentY        =   582
            ButtonWidth     =   1138
            ButtonHeight    =   582
            AllowCustomize  =   0   'False
            Wrappable       =   0   'False
            Style           =   1
            TextAlignment   =   1
            _Version        =   393216
         End
         Begin VB.Frame fraCombo 
            BorderStyle     =   0  'None
            Caption         =   "Frame1"
            Height          =   375
            Left            =   50
            TabIndex        =   52
            Top             =   0
            Width           =   615
            Begin VB.ComboBox cmbSearch 
               Height          =   315
               Left            =   0
               TabIndex        =   2
               Top             =   0
               Width           =   975
            End
         End
         Begin VB.PictureBox picDefaultSearch2 
            Height          =   255
            Left            =   3000
            Picture         =   "frmMain.frx":4200
            ScaleHeight     =   195
            ScaleWidth      =   195
            TabIndex        =   51
            Top             =   0
            Visible         =   0   'False
            Width           =   255
         End
         Begin VB.PictureBox picTranslate 
            AutoSize        =   -1  'True
            Height          =   240
            Left            =   4080
            Picture         =   "frmMain.frx":4742
            ScaleHeight     =   180
            ScaleWidth      =   225
            TabIndex        =   48
            Top             =   0
            Visible         =   0   'False
            Width           =   285
         End
         Begin MSComctlLib.Toolbar tlbTools 
            Height          =   330
            Left            =   4200
            TabIndex        =   47
            Top             =   360
            Width           =   3135
            _ExtentX        =   5530
            _ExtentY        =   582
            ButtonWidth     =   609
            ButtonHeight    =   582
            AllowCustomize  =   0   'False
            Wrappable       =   0   'False
            Style           =   1
            _Version        =   393216
         End
         Begin VB.PictureBox picSound 
            Height          =   255
            Left            =   3360
            Picture         =   "frmMain.frx":4824
            ScaleHeight     =   195
            ScaleWidth      =   195
            TabIndex        =   46
            Top             =   0
            Visible         =   0   'False
            Width           =   255
         End
         Begin VB.PictureBox picPopup 
            AutoSize        =   -1  'True
            Height          =   240
            Left            =   3720
            Picture         =   "frmMain.frx":4D36
            ScaleHeight     =   180
            ScaleWidth      =   225
            TabIndex        =   45
            Top             =   0
            Visible         =   0   'False
            Width           =   285
         End
         Begin VB.PictureBox picDefaultSearch 
            Height          =   255
            Left            =   2640
            Picture         =   "frmMain.frx":5238
            ScaleHeight     =   195
            ScaleWidth      =   195
            TabIndex        =   43
            Top             =   0
            Visible         =   0   'False
            Width           =   255
         End
      End
      Begin MSComctlLib.ImageList ilsToolsHot 
         Left            =   7560
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
      Begin MSComctlLib.ImageList ilsTellAFriendHot 
         Left            =   4800
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
      Begin MSComctlLib.ImageList ilsTellAFriend 
         Left            =   4200
         Top             =   240
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   8421376
         MaskColor       =   8421376
         _Version        =   393216
      End
   End
   Begin VB.Frame fraProperties 
      Caption         =   "Toolbar Properties"
      Height          =   4980
      Left            =   50
      TabIndex        =   3
      Top             =   900
      Width           =   11800
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step1"
         Height          =   3495
         Index           =   0
         Left            =   240
         TabIndex        =   54
         Top             =   840
         Width           =   11415
         Begin VB.TextBox txtAffiliateId 
            Height          =   315
            Left            =   1080
            TabIndex        =   6
            Top             =   2520
            Width           =   4335
         End
         Begin VB.TextBox txtToolbarName 
            Height          =   315
            Left            =   0
            TabIndex        =   5
            Top             =   600
            Width           =   5535
         End
         Begin VB.Label Label21 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   123
            Top             =   1080
            Width           =   840
         End
         Begin VB.Label Label13 
            Caption         =   $"frmMain.frx":577A
            Height          =   675
            Left            =   0
            TabIndex        =   122
            Top             =   1320
            Width           =   5415
         End
         Begin VB.Label Label23 
            Caption         =   $"frmMain.frx":5841
            Height          =   495
            Left            =   0
            TabIndex        =   121
            Top             =   2040
            Width           =   5415
         End
         Begin VB.Label Label24 
            Caption         =   "Affiliate ID:"
            Height          =   255
            Left            =   0
            TabIndex        =   120
            Top             =   2565
            Width           =   855
         End
         Begin VB.Label Label20 
            AutoSize        =   -1  'True
            Caption         =   "This name will appear in the Toolbar's installation program."
            Height          =   195
            Left            =   0
            TabIndex        =   56
            Top             =   360
            Width           =   4185
         End
         Begin VB.Label Label19 
            AutoSize        =   -1  'True
            Caption         =   "What do you want to call your toolbar?"
            Height          =   195
            Left            =   0
            TabIndex        =   55
            Top             =   120
            Width           =   2805
         End
      End
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step 10"
         Height          =   3495
         Index           =   8
         Left            =   240
         TabIndex        =   96
         Top             =   840
         Width           =   11300
         Begin VB.PictureBox Picture9 
            BorderStyle     =   0  'None
            Height          =   2535
            Left            =   1440
            ScaleHeight     =   2535
            ScaleWidth      =   9015
            TabIndex        =   110
            Top             =   480
            Width           =   9015
            Begin VB.CommandButton cmdSaveForBranding 
               Caption         =   "Save Toolbar Template For Branding"
               Height          =   495
               Left            =   120
               TabIndex        =   162
               Top             =   1920
               Width           =   3975
            End
            Begin VB.CommandButton cmdMakeSetup 
               Caption         =   "Save Toolbar Setup File To My Computer"
               Height          =   495
               Left            =   120
               TabIndex        =   35
               Top             =   360
               Width           =   3975
            End
            Begin VB.CommandButton cmdMakeAndUploadSetup 
               Caption         =   "Make Toolbar Setup.exe and Upload To My Server"
               Height          =   495
               Left            =   4320
               TabIndex        =   36
               Top             =   360
               Width           =   3975
            End
            Begin VB.CommandButton cmdSaveConfig 
               Caption         =   "Save Toolbar Update File To My Computer"
               Height          =   495
               Left            =   120
               TabIndex        =   37
               Top             =   1200
               Width           =   3975
            End
            Begin VB.CommandButton cmdSaveAndUploadConfig 
               Caption         =   "Upload Toolbar Update File To My Server"
               Height          =   495
               Left            =   4320
               TabIndex        =   38
               Top             =   1200
               Width           =   3975
            End
         End
         Begin MSComDlg.CommonDialog dlgSaveConfig 
            Left            =   600
            Top             =   2880
            _ExtentX        =   847
            _ExtentY        =   847
            _Version        =   393216
            CancelError     =   -1  'True
            DefaultExt      =   "cfg"
            DialogTitle     =   "Save Toolbar Update File"
            FileName        =   "toolbar"
            Filter          =   "Web-update files|*.cfg"
            InitDir         =   "c:\"
         End
         Begin MSComDlg.CommonDialog dlgSaveToolbar 
            Left            =   0
            Top             =   2880
            _ExtentX        =   847
            _ExtentY        =   847
            _Version        =   393216
            CancelError     =   -1  'True
            DefaultExt      =   "exe"
            DialogTitle     =   "Save Toolbar Setup File"
            FileName        =   "setup"
            Filter          =   "Executable Files|*.exe"
            InitDir         =   "c:\"
         End
         Begin MSComDlg.CommonDialog dlgSaveTemplate 
            Left            =   1200
            Top             =   2880
            _ExtentX        =   847
            _ExtentY        =   847
            _Version        =   393216
            CancelError     =   -1  'True
            DefaultExt      =   "dat"
            DialogTitle     =   "Save Toolbar Update File"
            FileName        =   "toolbar"
            Filter          =   "Toolbar Template For Branding|*.dat"
            InitDir         =   "c:\"
         End
         Begin VB.Label Label9 
            Caption         =   "Now, it's time to save your toolbar's  setup and configuration files."
            Height          =   255
            Left            =   2880
            TabIndex        =   97
            Top             =   240
            Width           =   5535
         End
      End
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step 3"
         Height          =   3495
         Index           =   1
         Left            =   240
         TabIndex        =   57
         Top             =   840
         Width           =   11415
         Begin VB.PictureBox Picture15 
            BorderStyle     =   0  'None
            Height          =   1815
            Left            =   6120
            ScaleHeight     =   1815
            ScaleWidth      =   5205
            TabIndex        =   156
            Top             =   1560
            Width           =   5200
            Begin VB.Frame fraLogoMenu 
               Caption         =   "Logo Menu (Available only in Platinum version!)"
               Height          =   1815
               Left            =   0
               TabIndex        =   157
               Top             =   0
               Width           =   5175
               Begin VB.TextBox txtLogoMenu 
                  Height          =   1455
                  Left            =   120
                  MultiLine       =   -1  'True
                  ScrollBars      =   3  'Both
                  TabIndex        =   158
                  Top             =   240
                  Width           =   4935
               End
            End
         End
         Begin VB.PictureBox Picture13 
            BorderStyle     =   0  'None
            Height          =   255
            Left            =   3000
            ScaleHeight     =   255
            ScaleWidth      =   1935
            TabIndex        =   149
            Top             =   120
            Width           =   1935
            Begin VB.OptionButton optPict 
               Caption         =   "Picture"
               Height          =   255
               Left            =   0
               TabIndex        =   151
               Top             =   0
               Width           =   790
            End
            Begin VB.OptionButton optText 
               Caption         =   "Text"
               Height          =   255
               Left            =   840
               TabIndex        =   150
               Top             =   0
               Width           =   735
            End
         End
         Begin VB.PictureBox Picture12 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   4920
            ScaleHeight     =   495
            ScaleWidth      =   975
            TabIndex        =   145
            Top             =   3000
            Width           =   975
            Begin VB.CommandButton cmdLogoFont 
               Caption         =   "Font"
               Height          =   315
               Left            =   0
               TabIndex        =   11
               Top             =   0
               Width           =   855
            End
         End
         Begin MSComDlg.CommonDialog cdgLogoFont 
            Left            =   9840
            Top             =   240
            _ExtentX        =   847
            _ExtentY        =   847
            _Version        =   393216
            CancelError     =   -1  'True
         End
         Begin VB.TextBox txtLogoCaption 
            Height          =   315
            Left            =   1920
            TabIndex        =   10
            Top             =   3000
            Width           =   2895
         End
         Begin VB.PictureBox Picture3 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   4920
            ScaleHeight     =   495
            ScaleWidth      =   975
            TabIndex        =   103
            Top             =   2340
            Width           =   975
            Begin VB.CommandButton cmdBrowseForHotLogo 
               Appearance      =   0  'Flat
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   12
               Top             =   0
               Width           =   840
            End
         End
         Begin VB.PictureBox Picture2 
            BorderStyle     =   0  'None
            Height          =   375
            Left            =   4920
            ScaleHeight     =   375
            ScaleWidth      =   975
            TabIndex        =   102
            Top             =   960
            Width           =   975
            Begin VB.CommandButton cmdBrowseForLogo 
               Appearance      =   0  'Flat
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   8
               Top             =   0
               Width           =   840
            End
         End
         Begin VB.TextBox txtLogoFileNameHot 
            Height          =   315
            Left            =   1920
            TabIndex        =   9
            Top             =   2340
            Width           =   2895
         End
         Begin VB.TextBox txtLink 
            Height          =   315
            Left            =   7200
            TabIndex        =   13
            Top             =   1200
            Width           =   4095
         End
         Begin VB.TextBox txtLogoFileName 
            Height          =   315
            Left            =   1920
            TabIndex        =   7
            Top             =   960
            Width           =   2895
         End
         Begin VB.Label Label38 
            AutoSize        =   -1  'True
            Caption         =   "Select the type of logo you want to use:"
            Height          =   195
            Left            =   0
            TabIndex        =   144
            Top             =   120
            Width           =   2910
         End
         Begin VB.Label Label56 
            Caption         =   "Text For Logo:"
            Height          =   255
            Left            =   0
            TabIndex        =   146
            Top             =   3000
            Width           =   1215
         End
         Begin VB.Label Label72 
            AutoSize        =   -1  'True
            Caption         =   "(Bitmap Image. Max. Size 20x40. Background Color 0,128,128)"
            Height          =   195
            Left            =   0
            TabIndex        =   140
            Top             =   2040
            Width           =   4545
         End
         Begin VB.Label Label69 
            AutoSize        =   -1  'True
            Caption         =   "(Bitmap Image. Max. Size 20x40. Background Color 0,128,128)"
            Height          =   195
            Left            =   0
            TabIndex        =   133
            Top             =   720
            Width           =   4545
         End
         Begin VB.Label Label16 
            AutoSize        =   -1  'True
            Caption         =   "Logo Mouse-over Image:"
            Height          =   195
            Left            =   0
            TabIndex        =   65
            Top             =   2400
            Width           =   1800
         End
         Begin VB.Label Label28 
            Caption         =   $"frmMain.frx":58A2
            Height          =   480
            Left            =   0
            TabIndex        =   64
            Top             =   1575
            Width           =   5775
         End
         Begin VB.Label Label27 
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   0
            TabIndex        =   63
            Top             =   1335
            Width           =   855
         End
         Begin VB.Label Label11 
            AutoSize        =   -1  'True
            Caption         =   "Logo Link:"
            Height          =   195
            Left            =   6120
            TabIndex        =   62
            Top             =   1240
            Width           =   720
         End
         Begin VB.Label Label26 
            AutoSize        =   -1  'True
            Caption         =   $"frmMain.frx":593B
            Height          =   390
            Left            =   6120
            TabIndex        =   61
            Top             =   720
            Width           =   4230
         End
         Begin VB.Label Label25 
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   6120
            TabIndex        =   60
            Top             =   480
            Width           =   855
         End
         Begin VB.Label Label2 
            Caption         =   "Logo Image:"
            Height          =   255
            Left            =   0
            TabIndex        =   59
            Top             =   960
            Width           =   1215
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            Caption         =   "Enter the location of your logo image file from your hard drive."
            Height          =   195
            Left            =   0
            TabIndex        =   58
            Top             =   480
            Width           =   4500
         End
      End
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step 4"
         Height          =   3375
         Index           =   2
         Left            =   240
         TabIndex        =   66
         Top             =   840
         Width           =   11295
         Begin VB.PictureBox Picture14 
            BorderStyle     =   0  'None
            Height          =   330
            Left            =   9960
            ScaleHeight     =   330
            ScaleWidth      =   1335
            TabIndex        =   153
            Top             =   2115
            Width           =   1335
            Begin VB.CommandButton cmdSearchMenu 
               Caption         =   "Search Menu"
               Height          =   315
               Left            =   0
               TabIndex        =   154
               Top             =   0
               Width           =   1080
            End
         End
         Begin VB.PictureBox Picture5 
            BorderStyle     =   0  'None
            Height          =   375
            Left            =   5640
            ScaleHeight     =   375
            ScaleWidth      =   1335
            TabIndex        =   104
            Top             =   2980
            Width           =   1335
            Begin VB.CommandButton cmdBrowseForHotSearchIcon 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   19
               Top             =   0
               Width           =   1200
            End
         End
         Begin VB.PictureBox Picture4 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   5640
            ScaleHeight     =   495
            ScaleWidth      =   1455
            TabIndex        =   20
            Top             =   2160
            Width           =   1455
            Begin VB.CommandButton cmdBrowseForSearchIcon 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   17
               Top             =   0
               Width           =   1200
            End
         End
         Begin VB.TextBox txtSearchHotIconFileName 
            Height          =   315
            Left            =   2040
            TabIndex        =   18
            Top             =   2980
            Width           =   3495
         End
         Begin VB.TextBox txtSearchIconFileName 
            Height          =   315
            Left            =   2040
            TabIndex        =   16
            Top             =   2160
            Width           =   3495
         End
         Begin VB.TextBox txtSearchURL 
            Height          =   315
            Left            =   2040
            TabIndex        =   15
            Top             =   1395
            Width           =   4815
         End
         Begin VB.TextBox txtSearchCaption 
            Height          =   285
            Left            =   2040
            TabIndex        =   14
            Top             =   360
            Width           =   4815
         End
         Begin VB.Label Label74 
            Caption         =   "To set up Search Menu, click button:"
            Height          =   255
            Left            =   7200
            TabIndex        =   161
            Top             =   2160
            Width           =   2895
         End
         Begin VB.Label Label73 
            Caption         =   "You can set up a drop down menu with additonal search url's."
            Height          =   495
            Left            =   7200
            TabIndex        =   160
            Top             =   1680
            Width           =   3975
         End
         Begin VB.Label Label71 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   7200
            TabIndex        =   159
            Top             =   1440
            Width           =   840
         End
         Begin VB.Label Label17 
            AutoSize        =   -1  'True
            Caption         =   "Search Mouse-over Image:"
            Height          =   195
            Left            =   0
            TabIndex        =   76
            Top             =   3030
            Width           =   1950
         End
         Begin VB.Label Label34 
            AutoSize        =   -1  'True
            Caption         =   "Enter the location of your Search icon mouse-over image file."
            Height          =   195
            Left            =   0
            TabIndex        =   75
            Top             =   2760
            Width           =   4395
         End
         Begin VB.Label Label33 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   74
            Top             =   2520
            Width           =   840
         End
         Begin VB.Label Label4 
            Caption         =   "Search Image:"
            Height          =   255
            Left            =   0
            TabIndex        =   73
            Top             =   2160
            Width           =   1815
         End
         Begin VB.Label Label32 
            AutoSize        =   -1  'True
            Caption         =   "Enter the location of your Search icon image file."
            Height          =   195
            Left            =   0
            TabIndex        =   72
            Top             =   1920
            Width           =   3495
         End
         Begin VB.Label Label31 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   71
            Top             =   1680
            Width           =   840
         End
         Begin VB.Label Label3 
            Caption         =   "Search URL:"
            Height          =   255
            Left            =   0
            TabIndex        =   70
            Top             =   1425
            Width           =   975
         End
         Begin VB.Label Label30 
            Caption         =   $"frmMain.frx":59A8
            Height          =   615
            Left            =   0
            TabIndex        =   69
            Top             =   720
            Width           =   6615
         End
         Begin VB.Label Label18 
            AutoSize        =   -1  'True
            Caption         =   "Search button caption:"
            Height          =   195
            Left            =   0
            TabIndex        =   68
            Top             =   390
            Width           =   1650
         End
         Begin VB.Label Label29 
            Caption         =   "This is the words you want to see on your search button. An example is provided below. "
            Height          =   255
            Left            =   0
            TabIndex        =   67
            Top             =   120
            Width           =   10695
         End
      End
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step 5"
         Height          =   3375
         Index           =   3
         Left            =   240
         TabIndex        =   77
         Top             =   840
         Width           =   7575
         Begin VB.TextBox txtUpdateInterval 
            Enabled         =   0   'False
            Height          =   315
            Left            =   1920
            TabIndex        =   22
            Text            =   "10"
            Top             =   2760
            Width           =   720
         End
         Begin VB.TextBox txtUpdateURL 
            Height          =   315
            Left            =   1920
            TabIndex        =   21
            Top             =   2400
            Width           =   4095
         End
         Begin ComCtl2.UpDown UpDown1 
            Height          =   315
            Left            =   2640
            TabIndex        =   23
            Top             =   2760
            Width           =   240
            _ExtentX        =   450
            _ExtentY        =   556
            _Version        =   327681
            Value           =   10
            AutoBuddy       =   -1  'True
            BuddyControl    =   "txtUpdateInterval"
            BuddyDispid     =   196697
            OrigLeft        =   9960
            OrigTop         =   1920
            OrigRight       =   10200
            OrigBottom      =   2175
            Increment       =   10
            Max             =   65000
            Min             =   10
            SyncBuddy       =   -1  'True
            BuddyProperty   =   0
            Enabled         =   -1  'True
         End
         Begin VB.Label Label39 
            AutoSize        =   -1  'True
            Caption         =   "minutes."
            Height          =   195
            Left            =   3000
            TabIndex        =   82
            Top             =   2805
            Width           =   615
         End
         Begin VB.Label Label14 
            AutoSize        =   -1  'True
            Caption         =   "Check for updates every"
            Height          =   195
            Left            =   0
            TabIndex        =   81
            Top             =   2805
            Width           =   1785
         End
         Begin VB.Label Label12 
            AutoSize        =   -1  'True
            Caption         =   "Update File URL:"
            Height          =   195
            Left            =   0
            TabIndex        =   80
            Top             =   2445
            Width           =   1200
         End
         Begin VB.Label Label36 
            Caption         =   $"frmMain.frx":5A84
            Height          =   2055
            Left            =   0
            TabIndex        =   79
            Top             =   360
            Width           =   10695
         End
         Begin VB.Label Label35 
            AutoSize        =   -1  'True
            Caption         =   "(recommended)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   78
            Top             =   120
            Width           =   1380
         End
      End
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step 6"
         Height          =   3495
         Index           =   4
         Left            =   240
         TabIndex        =   92
         Top             =   840
         Width           =   11385
         Begin VB.TextBox txtButtonsCount 
            Alignment       =   1  'Right Justify
            Enabled         =   0   'False
            Height          =   315
            Left            =   1440
            TabIndex        =   24
            Text            =   "0"
            Top             =   360
            Width           =   615
         End
         Begin ComCtl2.UpDown udButtonsCount 
            Height          =   315
            Left            =   2056
            TabIndex        =   25
            Top             =   360
            Width           =   240
            _ExtentX        =   450
            _ExtentY        =   556
            _Version        =   327681
            AutoBuddy       =   -1  'True
            BuddyControl    =   "txtButtonsCount"
            BuddyDispid     =   196704
            OrigLeft        =   2280
            OrigTop         =   360
            OrigRight       =   2520
            OrigBottom      =   855
            SyncBuddy       =   -1  'True
            BuddyProperty   =   0
            Enabled         =   -1  'True
         End
         Begin VB.Label Label37 
            Caption         =   $"frmMain.frx":5CCE
            Height          =   975
            Left            =   0
            TabIndex        =   152
            Top             =   1080
            Width           =   4335
         End
         Begin VB.Label Label5 
            Caption         =   "Toolbar will have "
            Height          =   495
            Left            =   0
            TabIndex        =   95
            Top             =   405
            Width           =   1335
         End
         Begin VB.Label Label40 
            Caption         =   "Enter the number of buttons your toolbar will have in addition to the search button."
            Height          =   255
            Left            =   0
            TabIndex        =   94
            Top             =   120
            Width           =   7935
         End
         Begin VB.Label Label41 
            AutoSize        =   -1  'True
            Caption         =   "buttons."
            Height          =   195
            Left            =   2400
            TabIndex        =   93
            Top             =   405
            Width           =   615
         End
      End
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step 9"
         Height          =   3375
         Index           =   7
         Left            =   240
         TabIndex        =   114
         Top             =   840
         Width           =   11300
         Begin VB.PictureBox Picture24 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   2880
            ScaleHeight     =   495
            ScaleWidth      =   1335
            TabIndex        =   163
            Top             =   2950
            Width           =   1335
            Begin VB.CommandButton cmdTellAfriend 
               Caption         =   "Tell A Friend"
               Height          =   375
               Left            =   0
               TabIndex        =   164
               Top             =   0
               Width           =   1215
            End
         End
         Begin VB.PictureBox Picture11 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   9360
            ScaleHeight     =   495
            ScaleWidth      =   1455
            TabIndex        =   136
            Top             =   840
            Width           =   1455
            Begin VB.CommandButton cmdURLResponse 
               Caption         =   "URL Response"
               Height          =   375
               Left            =   0
               TabIndex        =   137
               Top             =   0
               Width           =   1215
            End
         End
         Begin VB.PictureBox Picture10 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   9360
            ScaleHeight     =   495
            ScaleWidth      =   1695
            TabIndex        =   134
            Top             =   2400
            Width           =   1695
            Begin VB.CommandButton cmdAddButtons 
               Caption         =   "Ad Buttons"
               Height          =   375
               Left            =   0
               TabIndex        =   135
               Top             =   0
               Width           =   1215
            End
         End
         Begin VB.TextBox txtErrorPage 
            Height          =   315
            Left            =   2160
            TabIndex        =   119
            Top             =   4095
            Width           =   5055
         End
         Begin VB.TextBox txtAbarSearch 
            Height          =   315
            Left            =   1320
            TabIndex        =   118
            Top             =   1560
            Width           =   5055
         End
         Begin VB.Label Label86 
            Caption         =   "You can set up ""Tell A Friend"" Button"
            Height          =   405
            Left            =   0
            TabIndex        =   167
            Top             =   2640
            Width           =   4575
         End
         Begin VB.Label Label85 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   166
            Top             =   2400
            Width           =   840
         End
         Begin VB.Label Label84 
            Caption         =   "To set up Tell A Friend, click button:"
            Height          =   375
            Left            =   0
            TabIndex        =   165
            Top             =   3040
            Width           =   2655
         End
         Begin VB.Label Label68 
            Caption         =   "To set up Ad Buttons, click button:"
            Height          =   375
            Left            =   6600
            TabIndex        =   132
            Top             =   2475
            Width           =   2655
         End
         Begin VB.Label Label67 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   6600
            TabIndex        =   131
            Top             =   1680
            Width           =   840
         End
         Begin VB.Label Label66 
            Caption         =   "You can set up four ad buttons to be included in your toolbar. The ads can be rotated by clicks or time."
            Height          =   405
            Left            =   6600
            TabIndex        =   130
            Top             =   1920
            Width           =   4575
         End
         Begin VB.Label Label65 
            Caption         =   "To set up URL Response, click button:"
            Height          =   375
            Left            =   6600
            TabIndex        =   129
            Top             =   900
            Width           =   3015
         End
         Begin VB.Label Label64 
            Caption         =   $"frmMain.frx":5D50
            Height          =   405
            Left            =   6600
            TabIndex        =   128
            Top             =   360
            Width           =   4095
         End
         Begin VB.Label Label63 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   6600
            TabIndex        =   127
            Top             =   120
            Width           =   840
         End
         Begin VB.Label Label62 
            Caption         =   $"frmMain.frx":5DAE
            Height          =   600
            Left            =   840
            TabIndex        =   126
            Top             =   3495
            Width           =   6495
         End
         Begin VB.Label Label61 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   840
            TabIndex        =   125
            Top             =   3360
            Width           =   840
         End
         Begin VB.Label Label60 
            Caption         =   "Error Page URL:"
            Height          =   255
            Left            =   840
            TabIndex        =   124
            Top             =   4155
            Width           =   1215
         End
         Begin VB.Label Label59 
            Caption         =   "Enter the URL:"
            Height          =   255
            Left            =   0
            TabIndex        =   117
            Top             =   1635
            Width           =   1215
         End
         Begin VB.Label Label58 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   116
            Top             =   120
            Width           =   840
         End
         Begin VB.Label Label57 
            Caption         =   $"frmMain.frx":5E68
            Height          =   1200
            Left            =   0
            TabIndex        =   115
            Top             =   360
            Width           =   6495
         End
      End
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step 9"
         Height          =   3495
         Index           =   6
         Left            =   240
         TabIndex        =   170
         Top             =   840
         Width           =   11415
         Begin VB.TextBox txtPopupSoundCaption 
            Height          =   315
            Left            =   2520
            TabIndex        =   215
            Top             =   1920
            Width           =   2175
         End
         Begin VB.CheckBox chkPopupBlocker 
            Alignment       =   1  'Right Justify
            Caption         =   "Check if you want a Popup Blocker in this Toolbar:"
            Height          =   350
            Left            =   0
            TabIndex        =   200
            Top             =   360
            Width           =   4695
         End
         Begin VB.CheckBox chkCleaner 
            Alignment       =   1  'Right Justify
            Caption         =   "Check if you want a Cookie Cleaner Button  in this Toolbar:"
            Height          =   350
            Left            =   5760
            TabIndex        =   199
            Top             =   360
            Width           =   4695
         End
         Begin VB.CheckBox chkTranslate 
            Alignment       =   1  'Right Justify
            Caption         =   "Check if you want a Translation Button in this toolbar:"
            Height          =   350
            Left            =   5760
            TabIndex        =   198
            Top             =   2040
            Width           =   4695
         End
         Begin VB.PictureBox Picture16 
            BorderStyle     =   0  'None
            Height          =   375
            Left            =   4800
            ScaleHeight     =   375
            ScaleWidth      =   735
            TabIndex        =   196
            Top             =   1440
            Width           =   735
            Begin VB.CommandButton cmdPopupBlockerIconOverBrowse 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   197
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.PictureBox Picture17 
            BorderStyle     =   0  'None
            Height          =   350
            Left            =   4800
            ScaleHeight     =   345
            ScaleWidth      =   735
            TabIndex        =   194
            Top             =   1080
            Width           =   735
            Begin VB.CommandButton cmbPopupBlockerIconBrowse 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   195
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.TextBox txtPopupBlockerIconOver 
            Height          =   315
            Left            =   2520
            TabIndex        =   193
            Top             =   1440
            Width           =   2175
         End
         Begin VB.TextBox txtPopupBlockerIcon 
            Height          =   315
            Left            =   2520
            TabIndex        =   192
            Top             =   1080
            Width           =   2175
         End
         Begin VB.TextBox txtCookieCleanerIcon 
            Height          =   315
            Left            =   8280
            TabIndex        =   191
            Top             =   1080
            Width           =   2175
         End
         Begin VB.TextBox txtCookieCleanerIconOver 
            Height          =   315
            Left            =   8280
            TabIndex        =   190
            Top             =   1440
            Width           =   2175
         End
         Begin VB.PictureBox Picture18 
            BorderStyle     =   0  'None
            Height          =   350
            Left            =   10560
            ScaleHeight     =   345
            ScaleWidth      =   735
            TabIndex        =   188
            Top             =   1080
            Width           =   735
            Begin VB.CommandButton cmdCookieCleanerIconBrowse 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   189
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.PictureBox Picture19 
            BorderStyle     =   0  'None
            Height          =   375
            Left            =   10560
            ScaleHeight     =   375
            ScaleWidth      =   735
            TabIndex        =   186
            Top             =   1440
            Width           =   735
            Begin VB.CommandButton cmdCookieCleanerIconOverBrowse 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   187
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.PictureBox Picture20 
            BorderStyle     =   0  'None
            Height          =   375
            Left            =   10560
            ScaleHeight     =   375
            ScaleWidth      =   735
            TabIndex        =   184
            Top             =   3120
            Width           =   735
            Begin VB.CommandButton cmdTranslationIconOverBrowse 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   185
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.PictureBox Picture21 
            BorderStyle     =   0  'None
            Height          =   350
            Left            =   10560
            ScaleHeight     =   345
            ScaleWidth      =   735
            TabIndex        =   182
            Top             =   2760
            Width           =   735
            Begin VB.CommandButton cmdTranslationIconBrowse 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   183
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.TextBox txtTranslationIconOver 
            Height          =   315
            Left            =   8280
            TabIndex        =   181
            Top             =   3120
            Width           =   2175
         End
         Begin VB.TextBox txtTranslationIcon 
            Height          =   315
            Left            =   8280
            TabIndex        =   180
            Top             =   2760
            Width           =   2175
         End
         Begin VB.TextBox txtPopupSoundIcon 
            Height          =   315
            Left            =   2520
            TabIndex        =   179
            Top             =   2280
            Width           =   2175
         End
         Begin VB.TextBox txtPopupSoundIconOver 
            Height          =   315
            Left            =   2520
            TabIndex        =   178
            Top             =   2640
            Width           =   2175
         End
         Begin VB.PictureBox Picture22 
            BorderStyle     =   0  'None
            Height          =   350
            Left            =   4800
            ScaleHeight     =   345
            ScaleWidth      =   735
            TabIndex        =   176
            Top             =   2280
            Width           =   735
            Begin VB.CommandButton cmdPopupSoundIconBrowse 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   177
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.PictureBox Picture23 
            BorderStyle     =   0  'None
            Height          =   375
            Left            =   4800
            ScaleHeight     =   375
            ScaleWidth      =   735
            TabIndex        =   174
            Top             =   2640
            Width           =   735
            Begin VB.CommandButton cmdPopupSoundIconOverBrowse 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   175
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.TextBox txtPopupBlockerCaption 
            Height          =   315
            Left            =   2520
            TabIndex        =   173
            Top             =   720
            Width           =   2175
         End
         Begin VB.TextBox txtCookieCleanerCaption 
            Height          =   315
            Left            =   8280
            TabIndex        =   172
            Top             =   720
            Width           =   2175
         End
         Begin VB.TextBox txtTranslationCaption 
            Height          =   315
            Left            =   8280
            TabIndex        =   171
            Top             =   2400
            Width           =   2175
         End
         Begin MSComDlg.CommonDialog dlgOpenIcon 
            Left            =   2880
            Top             =   2880
            _ExtentX        =   847
            _ExtentY        =   847
            _Version        =   393216
            CancelError     =   -1  'True
            DefaultExt      =   "bmp"
            DialogTitle     =   "Use Bitmap Image. Max. Size 20x40. Background Color 0,128,128"
            Filter          =   "Picture Files|*.bmp"
         End
         Begin VB.Label Label87 
            Caption         =   "Popup Sound Caption:"
            Height          =   255
            Left            =   0
            TabIndex        =   216
            Top             =   1920
            Width           =   1695
         End
         Begin VB.Label Label22 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   214
            Top             =   120
            Width           =   840
         End
         Begin VB.Label Label49 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   5760
            TabIndex        =   213
            Top             =   120
            Width           =   840
         End
         Begin VB.Label Label51 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   5760
            TabIndex        =   212
            Top             =   1800
            Width           =   840
         End
         Begin VB.Label Label79 
            Caption         =   "Popup Blocker Icon:"
            Height          =   255
            Left            =   0
            TabIndex        =   211
            Top             =   1080
            Width           =   1695
         End
         Begin VB.Label Label77 
            Caption         =   "Popup Blocker MouseOver Icon:"
            Height          =   255
            Left            =   0
            TabIndex        =   210
            Top             =   1440
            Width           =   2415
         End
         Begin VB.Label Label78 
            Caption         =   "Cookie Cleaner Icon:"
            Height          =   255
            Left            =   5760
            TabIndex        =   209
            Top             =   1080
            Width           =   1695
         End
         Begin VB.Label Label80 
            Caption         =   "Cookie Cleaner MouseOver Icon:"
            Height          =   255
            Left            =   5760
            TabIndex        =   208
            Top             =   1440
            Width           =   2415
         End
         Begin VB.Label Label75 
            Caption         =   "Translation MouseOver Icon:"
            Height          =   255
            Left            =   5760
            TabIndex        =   207
            Top             =   3120
            Width           =   2415
         End
         Begin VB.Label Label76 
            Caption         =   "Translation Icon:"
            Height          =   255
            Left            =   5760
            TabIndex        =   206
            Top             =   2760
            Width           =   1695
         End
         Begin VB.Label Label81 
            Caption         =   "Popup Sound MouseOver Icon:"
            Height          =   255
            Left            =   0
            TabIndex        =   205
            Top             =   2640
            Width           =   2415
         End
         Begin VB.Label Label82 
            Caption         =   "Popup Sound Icon:"
            Height          =   255
            Left            =   0
            TabIndex        =   204
            Top             =   2280
            Width           =   1695
         End
         Begin VB.Label Label48 
            Caption         =   "Popup Blocker Caption:"
            Height          =   255
            Left            =   0
            TabIndex        =   203
            Top             =   720
            Width           =   1695
         End
         Begin VB.Label Label50 
            Caption         =   "Cookie Cleaner Caption:"
            Height          =   255
            Left            =   5760
            TabIndex        =   202
            Top             =   720
            Width           =   2055
         End
         Begin VB.Label Label52 
            Caption         =   "Translation Caption:"
            Height          =   255
            Left            =   5760
            TabIndex        =   201
            Top             =   2400
            Width           =   1695
         End
      End
      Begin VB.Frame fraTabs 
         BorderStyle     =   0  'None
         Caption         =   "Step 7"
         Height          =   3495
         Index           =   5
         Left            =   240
         TabIndex        =   83
         Top             =   840
         Width           =   11370
         Begin VB.PictureBox Picture8 
            BorderStyle     =   0  'None
            Height          =   3495
            Left            =   6000
            ScaleHeight     =   3495
            ScaleWidth      =   5385
            TabIndex        =   107
            Top             =   0
            Width           =   5385
            Begin VB.Frame fraPopupMenu 
               Caption         =   "Drop down menu"
               Height          =   3450
               Left            =   0
               TabIndex        =   108
               Top             =   0
               Width           =   5355
               Begin VB.TextBox txtPopupMenu 
                  Height          =   1635
                  Left            =   120
                  MultiLine       =   -1  'True
                  ScrollBars      =   3  'Both
                  TabIndex        =   34
                  Top             =   1680
                  Width           =   5130
               End
               Begin VB.Label Label47 
                  Caption         =   $"frmMain.frx":5FA1
                  Height          =   1575
                  Left            =   120
                  TabIndex        =   109
                  Top             =   240
                  Width           =   5160
               End
            End
         End
         Begin VB.PictureBox Picture7 
            BorderStyle     =   0  'None
            Height          =   375
            Left            =   5160
            ScaleHeight     =   375
            ScaleWidth      =   735
            TabIndex        =   106
            Top             =   3149
            Width           =   735
            Begin VB.CommandButton cmdBrowseButtonIconHot 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   33
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.PictureBox Picture6 
            BorderStyle     =   0  'None
            Height          =   375
            Left            =   5160
            ScaleHeight     =   375
            ScaleWidth      =   735
            TabIndex        =   105
            Top             =   2160
            Width           =   735
            Begin VB.CommandButton cmdBrowseButtonIcon 
               Caption         =   "Browse"
               Height          =   315
               Left            =   0
               TabIndex        =   31
               Top             =   0
               Width           =   680
            End
         End
         Begin VB.TextBox txtButtonHotImageFile 
            Height          =   315
            Left            =   2160
            TabIndex        =   32
            Top             =   3180
            Width           =   2895
         End
         Begin VB.TextBox txtButtonImageFile 
            Height          =   315
            Left            =   2160
            TabIndex        =   30
            Top             =   2160
            Width           =   2895
         End
         Begin VB.TextBox txtBtnTooltip 
            Height          =   315
            Left            =   2160
            TabIndex        =   29
            Top             =   1350
            Width           =   2895
         End
         Begin VB.TextBox txtBtnCaption 
            Height          =   315
            Left            =   2160
            TabIndex        =   28
            Top             =   510
            Width           =   2895
         End
         Begin VB.TextBox txtCurrentButton 
            Alignment       =   1  'Right Justify
            Enabled         =   0   'False
            Height          =   315
            Left            =   5040
            TabIndex        =   26
            Text            =   "1"
            Top             =   120
            Width           =   495
         End
         Begin ComCtl2.UpDown udCurrentButton 
            Height          =   315
            Left            =   5535
            TabIndex        =   27
            Top             =   120
            Width           =   240
            _ExtentX        =   450
            _ExtentY        =   556
            _Version        =   327681
            Value           =   1
            AutoBuddy       =   -1  'True
            BuddyControl    =   "txtCurrentButton"
            BuddyDispid     =   196790
            OrigLeft        =   2280
            OrigTop         =   360
            OrigRight       =   2520
            OrigBottom      =   855
            Min             =   1
            SyncBuddy       =   -1  'True
            BuddyProperty   =   0
            Enabled         =   -1  'True
         End
         Begin MSComDlg.CommonDialog dlgButtonImageBrowse 
            Left            =   5520
            Top             =   1320
            _ExtentX        =   847
            _ExtentY        =   847
            _Version        =   393216
            DialogTitle     =   "Use Bitmap Image. Max. Size 20x40. Background Color 0,128,128"
            Filter          =   "Picture Files|*.bmp"
         End
         Begin VB.Label Label43 
            Caption         =   $"frmMain.frx":60C0
            Height          =   400
            Left            =   0
            TabIndex        =   99
            Top             =   2720
            Width           =   5775
         End
         Begin VB.Label Label53 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   100
            Top             =   2520
            Width           =   840
         End
         Begin VB.Label Label42 
            Caption         =   "Enter the location of this button's icon you want to use."
            Height          =   255
            Left            =   0
            TabIndex        =   98
            Top             =   1950
            Width           =   4935
         End
         Begin VB.Label Label15 
            Caption         =   "Button icon Mouse-over:"
            Height          =   255
            Left            =   0
            TabIndex        =   91
            Top             =   3180
            Width           =   1815
         End
         Begin VB.Label Label10 
            Caption         =   "Button icon:"
            Height          =   255
            Left            =   0
            TabIndex        =   90
            Top             =   2200
            Width           =   1695
         End
         Begin VB.Label Label46 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   89
            Top             =   1750
            Width           =   840
         End
         Begin VB.Label Label8 
            AutoSize        =   -1  'True
            Caption         =   "Button mouse-over tip:"
            Height          =   195
            Left            =   0
            TabIndex        =   88
            Top             =   1380
            Width           =   1665
         End
         Begin VB.Label Label45 
            AutoSize        =   -1  'True
            Caption         =   "(optional)"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   204
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   0
            TabIndex        =   87
            Top             =   930
            Width           =   840
         End
         Begin VB.Label Label44 
            Caption         =   "Enter a short phrase that will show when user's mouse goes over this button."
            Height          =   435
            Left            =   0
            TabIndex        =   86
            Top             =   1120
            Width           =   5625
         End
         Begin VB.Label Label7 
            Caption         =   "What should this button say?"
            Height          =   255
            Left            =   0
            TabIndex        =   85
            Top             =   550
            Width           =   2295
         End
         Begin VB.Label Label6 
            Caption         =   "Click the number to the right to choose the button you want to edit."
            Height          =   255
            Left            =   0
            TabIndex        =   84
            Top             =   165
            Width           =   5055
         End
      End
      Begin VB.PictureBox Picture1 
         BorderStyle     =   0  'None
         Height          =   375
         Left            =   7800
         ScaleHeight     =   375
         ScaleWidth      =   3975
         TabIndex        =   101
         Top             =   4480
         Width           =   3975
         Begin VB.CommandButton cmdApply 
            Caption         =   "Apply"
            Height          =   375
            Left            =   2640
            TabIndex        =   41
            Top             =   0
            Width           =   1245
         End
         Begin VB.CommandButton cmdBack 
            Caption         =   "Back"
            Height          =   375
            Left            =   0
            TabIndex        =   39
            Top             =   0
            Width           =   1215
         End
         Begin VB.CommandButton cmdNext 
            Caption         =   "Next"
            Height          =   375
            Left            =   1320
            TabIndex        =   40
            Top             =   0
            Width           =   1215
         End
      End
      Begin MSComDlg.CommonDialog dlgLogoBrowse 
         Left            =   3960
         Top             =   4440
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
         CancelError     =   -1  'True
         DefaultExt      =   "bmp"
         DialogTitle     =   "Use Bitmap Image. Max. Size 20x40. Background Color 0,128,128"
         Filter          =   "Picture Files|*.bmp"
      End
      Begin MSComDlg.CommonDialog dlgSave 
         Left            =   3360
         Top             =   4440
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
         CancelError     =   -1  'True
         DefaultExt      =   "tbs"
         DialogTitle     =   "Save Toolbar Project"
         FileName        =   "untitled"
         Filter          =   "Toolbar Software Files|*.tbs"
      End
      Begin MSComDlg.CommonDialog dlgLoad 
         Left            =   2760
         Top             =   4440
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
         CancelError     =   -1  'True
         DefaultExt      =   "tbs"
         DialogTitle     =   "Open Toolbar Project"
         Filter          =   "Toolbar Software Files|*.tbs"
      End
      Begin MSComDlg.CommonDialog dlgSearchIconBrowse 
         Left            =   4560
         Top             =   4440
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
         CancelError     =   -1  'True
         DefaultExt      =   "bmp"
         DialogTitle     =   "Use Bitmap Image. Max. Size 20x40. Background Color 0,128,128"
         Filter          =   "Picture Files|*.bmp"
      End
      Begin MSComctlLib.TabStrip TabStrip1 
         Height          =   4125
         Left            =   75
         TabIndex        =   4
         Top             =   255
         Width           =   11655
         _ExtentX        =   20558
         _ExtentY        =   7276
         MultiRow        =   -1  'True
         TabFixedWidth   =   2274
         HotTracking     =   -1  'True
         TabMinWidth     =   1058
         _Version        =   393216
         BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
            NumTabs         =   9
            BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 1 - Toolbar Name"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 2 - Add Logo"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 3 - Search Button"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 4 - Auto Update"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab5 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 5 - Add/Remove Buttons"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab6 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 6 - Edit Buttons"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab7 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 7 - Optional Buttons"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab8 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 8 - Platinum Features"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab9 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "Step 9 - Generate Toolbar"
               ImageVarType    =   2
            EndProperty
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.Label Label55 
         Caption         =   "http://www.viraltoolbarbuilder.com/updatefile.cfg"
         Height          =   375
         Left            =   240
         TabIndex        =   113
         Top             =   1440
         Width           =   5535
      End
      Begin VB.Label Label54 
         Caption         =   "http://www.viraltoolbarbuilder.com/updatefile.cfg"
         Height          =   255
         Left            =   240
         TabIndex        =   112
         Top             =   1560
         Width           =   7575
      End
   End
   Begin VB.Menu mnuFile 
      Caption         =   "&File"
      Begin VB.Menu mnuFileNew 
         Caption         =   "&New"
      End
      Begin VB.Menu mnuFileLoad 
         Caption         =   "&Open.."
      End
      Begin VB.Menu mnuFileSave 
         Caption         =   "&Save"
      End
      Begin VB.Menu mnuFileSaveAs 
         Caption         =   "Save As..."
      End
      Begin VB.Menu mnuFileSeparator1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileExit 
         Caption         =   "E&xit..."
      End
   End
   Begin VB.Menu mnuOptions 
      Caption         =   "&Options"
      Begin VB.Menu mnuFTPOptions 
         Caption         =   "&FTP Options..."
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "&Help"
      Begin VB.Menu mnuVideoHelp 
         Caption         =   "--- Video Help ---"
         Enabled         =   0   'False
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 1"
         Index           =   0
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 2"
         Index           =   1
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 3"
         Index           =   2
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Search Menu"
         Index           =   3
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 4"
         Index           =   4
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 5"
         Index           =   5
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 6"
         Index           =   6
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Sub Menus"
         Index           =   7
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Audio Buttons"
         Index           =   8
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 7"
         Index           =   9
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 8"
         Index           =   10
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "URL Response"
         Index           =   11
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Ad Button"
         Index           =   12
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Tell A Friend Button"
         Index           =   13
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Step 9"
         Index           =   14
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "Installing Toolbar"
         Index           =   15
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpStep 
         Caption         =   "FTP Options"
         Index           =   16
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpSep 
         Caption         =   "-"
         Visible         =   0   'False
      End
      Begin VB.Menu mnuHelpAbout 
         Caption         =   "&About program..."
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim b As Boolean

Dim fraPreviewWidthDiff As Long
Dim tlbPreviewWidthDiff As Long

Dim iSelectedTab As Long

Dim lastButtonNum As Long
Dim bFirstShowPopupMenuWindow As Boolean

Private Type BUTTON_INFO
    strCaption As String
    strTooltip As String
    strImageFile As String
    strImageFileHot As String
    strPopupMenu As String
End Type

Private buttons(1 To 10) As BUTTON_INFO
Private buttonsCount As Long

Private dHeight As Long

Private m_bFirstActivate As Boolean

Private m_strProjectPath As String
Private m_strProjectName As String
Private m_bNewWindowVisible As Boolean

Private fileHist As New CFileHistory

Private m_strWindowCaption As String

Private WithEvents m_objFtpClient As CFtpClient
Attribute m_objFtpClient.VB_VarHelpID = -1
Private m_lngFileSize As Long
Private m_strLocalFileName As String
Private m_strRemoteFileName As String
Private m_bUploadingSetup As Boolean

Private g_bNewFile As Boolean

Private m_LogoLinks(1 To 100) As String
Private m_LogoLinksCount As Long

Private WithEvents m_AdButtonDocument As HTMLDocument
Attribute m_AdButtonDocument.VB_VarHelpID = -1

Public Sub SetMode()
    Select Case g_iMode
        Case 0:
            Me.Caption = Me.Caption & " - Unlicensed mode"
        
        Case 1:
            Me.Caption = Me.Caption & " - Demo mode"
            cmdMakeAndUploadSetup.Enabled = False
            cmdMakeSetup.Enabled = False
            cmdSaveConfig.Enabled = False
            cmdSaveAndUploadConfig.Enabled = False
            cmdSaveForBranding.Enabled = False
            txtLogoMenu.Enabled = True
            cmdSearchMenu.Enabled = True
    End Select

    m_strWindowCaption = Me.Caption
End Sub

Private Sub SetModeLimitations()
' Limit fields for needed mode

    Dim i As Long
    
    Select Case g_iMode
        
        Case 1:
            txtToolbarName.Text = "Demo of Viral Toolbar Builder"
            txtLink.Text = "http://www.google.com"
            txtSearchURL.Text = "http://www.google.com/search?q=[SEARCH]"
            txtUpdateURL.Text = ""
            
            txtLogoMenu.Text = ""
            fraLogoMenu.Caption = "Logo Menu"
    
            For i = 0 To 3
                frmSearchMenu.txtCaption(i).Text = ""
                frmSearchMenu.txtURL(i).Text = ""
            Next i
    End Select
End Sub

Private Function LoadPictureFromPath(ByVal strFileName As String) As Picture
    If InStr(strFileName, ":") > 0 Then
        Set LoadPictureFromPath = LoadPicture(strFileName)
    Else
        Set LoadPictureFromPath = LoadPicture(m_strProjectPath & strFileName)
    End If
End Function

' Get from all controls current toolbar state and build property bag
Private Function GetToolbarOptionsFromControls(toolbarOptions As PropertyBag) As Boolean
    'On Error GoTo error_handler
    On Error Resume Next
    
    Dim i As Long, iPos As Long
    Dim buttonName As String
    Dim strPopupMenu As String
    Dim strLine As String
    Dim PMICount As Long
    
    ' Save current button state
    udCurrentButton_Change
        
    ' Save buttons count
    buttonsCount = Val(txtButtonsCount.Text)
    
    ' Toolbar properties
    toolbarOptions.WriteProperty "Name", txtToolbarName.Text
    toolbarOptions.WriteProperty "LogoLink", txtLink.Text
    toolbarOptions.WriteProperty "UpdateLink", txtUpdateURL.Text
    toolbarOptions.WriteProperty "UpdateInterval", Val(txtUpdateInterval.Text)
    
    toolbarOptions.WriteProperty "ProviderUsername", g_strProviderName
    toolbarOptions.WriteProperty "ProviderPassword", g_strProviderPassword
    toolbarOptions.WriteProperty "ProviderUnique", g_strProvideUnique
    
        
    toolbarOptions.WriteProperty "AffiliateID", txtAffiliateId.Text
    
    ' Popup blocker
    toolbarOptions.WriteProperty "PopupBlocker", chkPopupBlocker.Value
    
    ' Translater
    toolbarOptions.WriteProperty "Translate", chkTranslate.Value
    toolbarOptions.WriteProperty "TranslateURL", "http://babelfish.altavista.com/babelfish/tr?tt=url&url=[URL]&lp=[LANG]"
         
    ' Cleaner
    toolbarOptions.WriteProperty "Cleaner", chkCleaner.Value

    ' Logo button
    toolbarOptions.WriteProperty "LogoPictFileName", txtLogoFileName.Text
    If Len(txtLogoFileName.Text) Then
        toolbarOptions.WriteProperty "LogoPict", LoadPictureFromPath(toolbarOptions.ReadProperty("LogoPictFileName"))
    Else
        toolbarOptions.WriteProperty "LogoPict", picDefaultLogo
    End If

    toolbarOptions.WriteProperty "LogoPictFileNameHot", txtLogoFileNameHot.Text
    If Len(txtLogoFileNameHot.Text) Then
        toolbarOptions.WriteProperty "LogoPictHot", LoadPictureFromPath(toolbarOptions.ReadProperty("LogoPictFileNameHot"))
    Else
        toolbarOptions.WriteProperty "LogoPictHot", picDefaultLogo2
    End If

    toolbarOptions.WriteProperty "LogoCaption", txtLogoCaption.Text
    toolbarOptions.WriteProperty "LogoFontName", cdgLogoFont.FontName
    toolbarOptions.WriteProperty "LogoFontSize", cdgLogoFont.FontSize
    toolbarOptions.WriteProperty "LogoFontBold", cdgLogoFont.FontBold
    toolbarOptions.WriteProperty "LogoFontItalic", cdgLogoFont.FontItalic
    toolbarOptions.WriteProperty "LogoFontUnderline", cdgLogoFont.FontUnderline
    toolbarOptions.WriteProperty "LogoFontStrikethru", cdgLogoFont.FontStrikethru
    toolbarOptions.WriteProperty "LogoFontColor", cdgLogoFont.Color
    
    toolbarOptions.WriteProperty "LogoUsePict", optPict.Value

    ' Search
    toolbarOptions.WriteProperty "SearchWidth", 1500
    toolbarOptions.WriteProperty "SearchURL", Replace(txtSearchURL.Text, "[SEARCH]", "[SEARCHTEXT]")
    toolbarOptions.WriteProperty "SearchCaption", txtSearchCaption.Text
    
    toolbarOptions.WriteProperty "SearchPictFileName", txtSearchIconFileName.Text
    If Len(txtSearchIconFileName.Text) > 0 Then
        toolbarOptions.WriteProperty "SearchPict", LoadPictureFromPath(toolbarOptions.ReadProperty("SearchPictFileName"))
    Else
        toolbarOptions.WriteProperty "SearchPict", picDefaultSearch.Picture
    End If
    
    toolbarOptions.WriteProperty "SearchPictFileNameHot", txtSearchHotIconFileName.Text
    If Len(txtSearchHotIconFileName.Text) > 0 Then
        toolbarOptions.WriteProperty "SearchPictHot", LoadPictureFromPath(toolbarOptions.ReadProperty("SearchPictFileNameHot"))
    Else
        toolbarOptions.WriteProperty "SearchPictHot", picDefaultSearch2.Picture
    End If
    
    toolbarOptions.WriteProperty "AddressBarSearch", txtAbarSearch.Text
   
    ' Fill buttons
    toolbarOptions.WriteProperty "ButtonsCount", buttonsCount
    For i = 1 To 10
        buttonName = "Button" & i
        toolbarOptions.WriteProperty buttonName & "TooltipText", buttons(i).strTooltip
        toolbarOptions.WriteProperty buttonName & "Description", buttons(i).strTooltip
        
        toolbarOptions.WriteProperty buttonName & "PictFileName", buttons(i).strImageFile
        toolbarOptions.WriteProperty buttonName & "PictFileNameHot", buttons(i).strImageFileHot
        
        If Len(buttons(i).strImageFile) > 0 Then
            toolbarOptions.WriteProperty buttonName & "Pict", LoadPictureFromPath(toolbarOptions.ReadProperty(buttonName & "PictFileName"))
            toolbarOptions.WriteProperty buttonName & "Caption", buttons(i).strCaption
        Else
            toolbarOptions.WriteProperty buttonName & "Pict", picDefaultButton.Picture
            toolbarOptions.WriteProperty buttonName & "Caption", buttons(i).strCaption & " "
        End If
        
        If Len(buttons(i).strImageFileHot) > 0 Then
            toolbarOptions.WriteProperty buttonName & "PictHot", LoadPictureFromPath(toolbarOptions.ReadProperty(buttonName & "PictFileNameHot"))
        Else
            toolbarOptions.WriteProperty buttonName & "PictHot", picDefaultButton.Picture
        End If
        
        ' Build button menu
        PMICount = 0
        strPopupMenu = Replace(buttons(i).strPopupMenu, "[SEARCH]", "[SEARCHTEXT]")
        
        If Len(strPopupMenu) And right(strPopupMenu, 2) <> vbCrLf Then
            strPopupMenu = strPopupMenu & vbCrLf
        End If
        
        Dim bIsWebButton As Boolean
        
        If InStr(1, UCase(strPopupMenu), "<OBJECT", vbTextCompare) > 0 Then
            bIsWebButton = True
                    
            ' Add web code
            toolbarOptions.WriteProperty buttonName & "WebCode", strPopupMenu
                    
        Else
            bIsWebButton = False

            Do While Len(strPopupMenu) > 0
                iPos = InStr(1, strPopupMenu, vbCrLf, vbTextCompare)
                If iPos > 0 Then
                    strLine = left(strPopupMenu, iPos - 1)
                    strPopupMenu = Mid(strPopupMenu, iPos + 2)
                    
                    ' Add current menu to array
                    iPos = InStr(1, strLine, "#", vbTextCompare)
                    If (iPos > 0) Then
                        PMICount = PMICount + 1
                        toolbarOptions.WriteProperty buttonName & "PMI" & PMICount & "Caption", left(strLine, iPos - 1)
                        toolbarOptions.WriteProperty buttonName & "PMI" & PMICount & "Link", Mid(strLine, iPos + 1)
                    End If
                End If
            Loop
            
            toolbarOptions.WriteProperty buttonName & "PMICount", PMICount
            
        End If
                
        toolbarOptions.WriteProperty buttonName & "IsWebButton", bIsWebButton
    Next i
    
    
    ' Step 7
    toolbarOptions.WriteProperty "PopupBlockerCaption", txtPopupBlockerCaption.Text
    toolbarOptions.WriteProperty "PopupSoundCaption", txtPopupSoundCaption.Text
    toolbarOptions.WriteProperty "PopupBlockerIcon", txtPopupBlockerIcon.Text
    toolbarOptions.WriteProperty "PopupBlockerIconOver", txtPopupBlockerIconOver.Text
    toolbarOptions.WriteProperty "PopupSoundIcon", txtPopupSoundIcon.Text
    toolbarOptions.WriteProperty "PopupSoundIconOver", txtPopupSoundIconOver.Text
    
    ' Only if have popup blocker, add images
    If chkPopupBlocker.Value Then
        If Len(txtPopupBlockerIcon.Text) > 0 Then
            toolbarOptions.WriteProperty "PopupBlockerIconPicture", LoadPictureFromPath(txtPopupBlockerIcon.Text)
        Else
            toolbarOptions.WriteProperty "PopupBlockerIconPicture", picPopup.Picture
        End If
        
        
        If Len(txtPopupBlockerIconOver.Text) > 0 Then
            toolbarOptions.WriteProperty "PopupBlockerIconOverPicture", LoadPictureFromPath(txtPopupBlockerIconOver.Text)
        Else
            toolbarOptions.WriteProperty "PopupBlockerIconOverPicture", picPopup.Picture
        End If
    
        If Len(txtPopupSoundIcon.Text) > 0 Then
            toolbarOptions.WriteProperty "PopupSoundIconPicture", LoadPictureFromPath(txtPopupSoundIcon.Text)
        Else
            toolbarOptions.WriteProperty "PopupSoundIconPicture", picSound.Picture
        End If
            
        If Len(txtPopupSoundIconOver.Text) > 0 Then
            toolbarOptions.WriteProperty "PopupSoundIconOverPicture", LoadPictureFromPath(txtPopupSoundIconOver.Text)
        Else
            toolbarOptions.WriteProperty "PopupSoundIconOverPicture", picSound.Picture
        End If
    End If
    
    toolbarOptions.WriteProperty "CookieCleanerCaption", txtCookieCleanerCaption.Text
    toolbarOptions.WriteProperty "CookieCleanerIcon", txtCookieCleanerIcon.Text
    toolbarOptions.WriteProperty "CookieCleanerIconOver", txtCookieCleanerIconOver.Text
    If chkCleaner.Value Then
        If Len(txtCookieCleanerIcon.Text) > 0 Then
            toolbarOptions.WriteProperty "CookieCleanerIconPicture", LoadPictureFromPath(txtCookieCleanerIcon.Text)
        Else
            toolbarOptions.WriteProperty "CookieCleanerIconPicture", picCleaner.Picture
        End If
    
        If Len(txtCookieCleanerIconOver.Text) > 0 Then
            toolbarOptions.WriteProperty "CookieCleanerIconOverPicture", LoadPictureFromPath(txtCookieCleanerIconOver.Text)
        Else
            toolbarOptions.WriteProperty "CookieCleanerIconOverPicture", picCleaner.Picture
        End If
    End If
    
    toolbarOptions.WriteProperty "TranslationCaption", txtTranslationCaption.Text
    toolbarOptions.WriteProperty "TranslationIcon", txtTranslationIcon.Text
    toolbarOptions.WriteProperty "TranslationIconOver", txtTranslationIconOver.Text
    If chkTranslate.Value Then
        If Len(txtTranslationIcon.Text) > 0 Then
            toolbarOptions.WriteProperty "TranslationIconPicture", LoadPictureFromPath(txtTranslationIcon.Text)
        Else
            toolbarOptions.WriteProperty "TranslationIconPicture", picTranslate.Picture
        End If
        
        If Len(txtTranslationIconOver.Text) > 0 Then
            toolbarOptions.WriteProperty "TranslationIconOverPicture", LoadPictureFromPath(txtTranslationIconOver.Text)
        Else
            toolbarOptions.WriteProperty "TranslationIconOverPicture", picTranslate.Picture
        End If
    End If

    ' Fill URL response values
    Dim iCount As Long
    iCount = 0
    For i = 0 To 2
        If Len(frmURLResponce.txtURLwatch(i).Text) > 0 And Len(frmURLResponce.txtURLshow(i).Text) > 0 Then
            iCount = iCount + 1
            toolbarOptions.WriteProperty "WatchURL" & iCount, frmURLResponce.txtURLwatch(i).Text
            toolbarOptions.WriteProperty "WatchURL" & iCount & "target", frmURLResponce.txtURLshow(i).Text
            toolbarOptions.WriteProperty "WatchURL" & iCount & "title", ""
            
            If IsNumeric(frmURLResponce.txtURLwidth(i).Text) Then
                toolbarOptions.WriteProperty "WatchURL" & iCount & "width", frmURLResponce.txtURLwidth(i).Text
            Else
                frmURLResponce.txtURLwidth(i).Text = 400
                toolbarOptions.WriteProperty "WatchURL" & iCount & "width", 400
            End If
            
            If IsNumeric(frmURLResponce.txtURLheight(i).Text) Then
                toolbarOptions.WriteProperty "WatchURL" & iCount & "height", frmURLResponce.txtURLheight(i).Text
            Else
                frmURLResponce.txtURLheight(i).Text = 200
                toolbarOptions.WriteProperty "WatchURL" & iCount & "height", 200
            End If
        End If
    Next i
    toolbarOptions.WriteProperty "WatchURLCount", iCount
    
    ' Fill add buttons
    iCount = 0
    For i = 0 To 3
        If (Len(frmAdButton.txtAdImage(i).Text) > 0 Or Len(frmAdButton.txtAdCaption(i).Text) > 0) And Len(frmAdButton.txtAdURL(i).Text) > 0 Then
            iCount = iCount + 1
            
            toolbarOptions.WriteProperty "Ad" & iCount & "URL", frmAdButton.txtAdURL(i).Text
            toolbarOptions.WriteProperty "Ad" & iCount & "ImageFileName", frmAdButton.txtAdImage(i).Text
            
            If Len(frmAdButton.txtAdImage(i).Text) > 0 Then
                toolbarOptions.WriteProperty "Ad" & iCount & "ImagePict", LoadPictureFromPath(frmAdButton.txtAdImage(i).Text)
                toolbarOptions.WriteProperty "Ad" & iCount & "Caption", frmAdButton.txtAdCaption(i).Text
            Else
                toolbarOptions.WriteProperty "Ad" & iCount & "ImagePict", frmMain.picDefaultButton.Picture
                toolbarOptions.WriteProperty "Ad" & iCount & "Caption", frmAdButton.txtAdCaption(i).Text & " "
            End If
            
            toolbarOptions.WriteProperty "Ad" & iCount & "ImageOverFileName", frmAdButton.txtAdImageOver(i).Text
            
            If Len(frmAdButton.txtAdImageOver(i).Text) > 0 Then
                toolbarOptions.WriteProperty "Ad" & iCount & "ImageOverPict", LoadPictureFromPath(frmAdButton.txtAdImageOver(i).Text)
            Else
                toolbarOptions.WriteProperty "Ad" & iCount & "ImageOverPict", toolbarOptions.ReadProperty("Ad" & iCount & "ImagePict")
            End If
        End If
    Next i
    
    toolbarOptions.WriteProperty "Ads", iCount
    toolbarOptions.WriteProperty "AdsRotationByTime", frmAdButton.optTime.Value
    If IsNumeric(frmAdButton.txtRotateTime) Then
        toolbarOptions.WriteProperty "AdsRotateTime", frmAdButton.txtRotateTime.Text
    Else
        toolbarOptions.WriteProperty "AdsRotateTime", 1
        frmAdButton.txtRotateTime = 1
    End If
    
    toolbarOptions.WriteProperty "AdStatic", frmAdButton.optStatic.Value
    
    toolbarOptions.WriteProperty "AdsWebButtonCode", frmAdButton.txtWebButtonCode.Text
    toolbarOptions.WriteProperty "AdsWebButtonWidth", frmAdButton.txtWebButtonWidth.Text
    toolbarOptions.WriteProperty "AdWebURL", frmAdButton.txtWebButtonURL.Text
        
    ' Fill Tell A Friend
    toolbarOptions.WriteProperty "TellAFriendCaption", frmTellAFriend.txtCaption.Text
    toolbarOptions.WriteProperty "TellAFriendImage", frmTellAFriend.txtImage.Text
    If Len(frmTellAFriend.txtImage.Text) > 0 Then
        toolbarOptions.WriteProperty "TellAFriendImagePict", LoadPictureFromPath(frmTellAFriend.txtImage.Text)
    Else
        toolbarOptions.WriteProperty "TellAFriendImagePict", picDefaultButton
    End If
        
    toolbarOptions.WriteProperty "TellAFriendImageOver", frmTellAFriend.txtImageOver.Text
    If Len(frmTellAFriend.txtImage.Text) > 0 Then
        toolbarOptions.WriteProperty "TellAFriendImageOverPict", LoadPictureFromPath(frmTellAFriend.txtImageOver.Text)
    Else
        toolbarOptions.WriteProperty "TellAFriendImageOverPict", picDefaultButton
    End If
    
    toolbarOptions.WriteProperty "TellAFriendURL", frmTellAFriend.txtURLshow.Text
    toolbarOptions.WriteProperty "TellAFriendWidth", frmTellAFriend.txtWidth.Text
    toolbarOptions.WriteProperty "TellAFriendHeight", frmTellAFriend.txtHeight.Text
    toolbarOptions.WriteProperty "TellAFriendWindowTitle", ""
    
    
    ' Fill Search Button Menu
    iCount = 0
    For i = 0 To 3
        If Len(frmSearchMenu.txtCaption(i).Text) > 0 And Len(frmSearchMenu.txtURL(i).Text) > 0 Then
            iCount = iCount + 1
            
            toolbarOptions.WriteProperty "SearchButtonMenu" & iCount & "Caption", frmSearchMenu.txtCaption(i).Text
            toolbarOptions.WriteProperty "SearchButtonMenu" & iCount & "URL", frmSearchMenu.txtURL(i).Text
        End If
    Next i
    toolbarOptions.WriteProperty "SearchButtonMenuCount", iCount

    ' Put logo button menu
    PMICount = 0
    strPopupMenu = Replace(txtLogoMenu, "[SEARCH]", "[SEARCHTEXT]")
    If Len(strPopupMenu) And right(strPopupMenu, 2) <> vbCrLf Then
        strPopupMenu = strPopupMenu & vbCrLf
    End If

    Do While Len(strPopupMenu) > 0
        iPos = InStr(1, strPopupMenu, vbCrLf, vbTextCompare)
        If iPos > 0 Then
            strLine = left(strPopupMenu, iPos - 1)
            strPopupMenu = Mid(strPopupMenu, iPos + 2)
                    
            ' Add current menu to array
            iPos = InStr(1, strLine, "#", vbTextCompare)
            If (iPos > 0) Then
                PMICount = PMICount + 1
                toolbarOptions.WriteProperty "LogoMenuItem" & PMICount & "Caption", left(strLine, iPos - 1)
                toolbarOptions.WriteProperty "LogoMenuItem" & PMICount & "Link", Mid(strLine, iPos + 1)
                m_LogoLinks(PMICount) = Mid(strLine, iPos + 1)
            End If
        End If
    Loop
    toolbarOptions.WriteProperty "LogoMenuItems", PMICount
    toolbarOptions.WriteProperty "LogoMenuText", txtLogoMenu.Text
    m_LogoLinksCount = PMICount

    GetToolbarOptionsFromControls = True
    Exit Function
    
ERROR_HANDLER:
    MsgBox Err.Description, vbExclamation
    GetToolbarOptionsFromControls = False
End Function

Private Sub cmbPopupBlockerIconBrowse_Click()
    On Error GoTo ErrHandler
    dlgOpenIcon.CancelError = True
    dlgOpenIcon.FileName = App.Path & "\Icons\noname"
    dlgOpenIcon.ShowOpen
    txtPopupBlockerIcon.Text = dlgOpenIcon.FileName
    If txtPopupBlockerIcon.Text = App.Path & "\Icons\noname.bmp" Then
        txtPopupBlockerIcon.Text = ""
    End If
    cmdApply_Click
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdAddButtons_Click()
    frmAdButton.Show vbModal, Me
    cmdApply_Click
End Sub

Private Sub cmdApply_Click()
    Dim toolbarOptions As New PropertyBag
      
    ' Update toolbar
    If GetToolbarOptionsFromControls(toolbarOptions) Then
        BuildToolbarFromOptions toolbarOptions
    End If
    Set toolbarOptions = Nothing
    
    ' Set position of frames
    fraPreview.Height = tlbMain.Height + 400
    tlbMain.top = 240
    fraProperties.top = fraPreview.Height + 80
    frmMain.Height = fraPreview.Height + fraProperties.Height + dHeight
        
        
End Sub


Private Sub cmdBack_Click()
    TabStrip1.SetFocus
    SendKeys "^{LEFT}"
End Sub

Private Sub cmdBrowseButtonIcon_Click()
    On Error GoTo ErrHandler
    dlgButtonImageBrowse.CancelError = True
    dlgButtonImageBrowse.FileName = App.Path & "\Icons\noname"
    dlgButtonImageBrowse.ShowOpen
    txtButtonImageFile = dlgButtonImageBrowse.FileName
    If txtButtonImageFile = App.Path & "\Icons\noname.bmp" Then
        txtButtonImageFile = ""
    End If
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdBrowseButtonIconHot_Click()
    On Error GoTo ErrHandler
    dlgButtonImageBrowse.CancelError = True
    dlgButtonImageBrowse.FileName = App.Path & "\Icons\noname"
    dlgButtonImageBrowse.ShowOpen
    txtButtonHotImageFile = dlgButtonImageBrowse.FileName
    If txtButtonHotImageFile = App.Path & "\Icons\noname.bmp" Then
        txtButtonHotImageFile = ""
    End If
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdBrowseForHotLogo_Click()
    On Error GoTo ErrHandler
    dlgLogoBrowse.CancelError = True
    dlgLogoBrowse.FileName = App.Path & "\Icons\noname"
    dlgLogoBrowse.ShowOpen
    txtLogoFileNameHot = dlgLogoBrowse.FileName
    If txtLogoFileNameHot = App.Path & "\Icons\noname.bmp" Then
        txtLogoFileNameHot = ""
    End If
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdBrowseForHotSearchIcon_Click()
    On Error GoTo ErrHandler
    dlgSearchIconBrowse.CancelError = True
    dlgSearchIconBrowse.FileName = App.Path & "\Icons\noname"
    dlgSearchIconBrowse.ShowOpen
    txtSearchHotIconFileName = dlgSearchIconBrowse.FileName
    If txtSearchHotIconFileName = App.Path & "\Icons\noname.bmp" Then
        txtSearchHotIconFileName = ""
    End If
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If

End Sub

Private Sub cmdBrowseForLogo_Click()
    On Error GoTo ErrHandler
    dlgLogoBrowse.CancelError = True
    dlgLogoBrowse.FileName = App.Path & "\Icons\noname"
    dlgLogoBrowse.ShowOpen
    txtLogoFileName = dlgLogoBrowse.FileName
    If txtLogoFileName = App.Path & "\Icons\noname.bmp" Then
        txtLogoFileName = ""
    End If
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdBrowseForSearchIcon_Click()
    On Error GoTo ErrHandler
    dlgSearchIconBrowse.CancelError = True
    dlgSearchIconBrowse.FileName = App.Path & "\Icons\noname"
    dlgSearchIconBrowse.ShowOpen
    txtSearchIconFileName = dlgSearchIconBrowse.FileName
    If txtSearchIconFileName = App.Path & "\Icons\noname.bmp" Then
        txtSearchIconFileName = ""
    End If
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdCookieCleanerIconBrowse_Click()
    On Error GoTo ErrHandler
    dlgOpenIcon.CancelError = True
    dlgOpenIcon.FileName = App.Path & "\Icons\noname"
    dlgOpenIcon.ShowOpen
    txtCookieCleanerIcon.Text = dlgOpenIcon.FileName
    If txtCookieCleanerIcon.Text = App.Path & "\Icons\noname.bmp" Then
        txtCookieCleanerIcon.Text = ""
    End If
    cmdApply_Click
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdCookieCleanerIconOverBrowse_Click()
    On Error GoTo ErrHandler
    dlgOpenIcon.CancelError = True
    dlgOpenIcon.FileName = App.Path & "\Icons\noname"
    dlgOpenIcon.ShowOpen
    txtCookieCleanerIconOver.Text = dlgOpenIcon.FileName
    If txtCookieCleanerIconOver.Text = App.Path & "\Icons\noname.bmp" Then
        txtCookieCleanerIconOver.Text = ""
    End If
    cmdApply_Click
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdHelp_Click()
    
    Select Case TabStrip1.SelectedItem.index
        Case 1: ShowHelp 0
        Case 2: ShowHelp 1
        Case 3: ShowHelp 2
        Case 4: ShowHelp 4
        Case 5: ShowHelp 5
        Case 6: ShowHelp 6
        Case 7: ShowHelp 9
        Case 8: ShowHelp 10
        Case 9: ShowHelp 11
    End Select
End Sub


Private Sub cmdLogoFont_Click()
    On Error GoTo ERROR_HANDLER
    cdgLogoFont.flags = cdlCFEffects + cdlCFScreenFonts
    cdgLogoFont.ShowFont
       
    cmdApply_Click
    
ERROR_HANDLER:
End Sub

Private Sub cmdNext_Click()
    TabStrip1.SetFocus
    SendKeys "^{RIGHT}"
End Sub

Private Sub cmdPopupBlockerIconOverBrowse_Click()
    On Error GoTo ErrHandler
    dlgOpenIcon.CancelError = True
    dlgOpenIcon.FileName = App.Path & "\Icons\noname"
    dlgOpenIcon.ShowOpen
    txtPopupBlockerIconOver.Text = dlgOpenIcon.FileName
    If txtPopupBlockerIconOver.Text = App.Path & "\Icons\noname.bmp" Then
        txtPopupBlockerIconOver.Text = ""
    End If
    cmdApply_Click
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdPopupSoundIconBrowse_Click()
    On Error GoTo ErrHandler
    dlgOpenIcon.CancelError = True
    dlgOpenIcon.FileName = App.Path & "\Icons\noname"
    dlgOpenIcon.ShowOpen
    txtPopupSoundIcon.Text = dlgOpenIcon.FileName
    If txtPopupSoundIcon.Text = App.Path & "\Icons\noname.bmp" Then
        txtPopupSoundIcon.Text = ""
    End If
    cmdApply_Click
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdPopupSoundIconOverBrowse_Click()
    On Error GoTo ErrHandler
    dlgOpenIcon.CancelError = True
    dlgOpenIcon.FileName = App.Path & "\Icons\noname"
    dlgOpenIcon.ShowOpen
    txtPopupSoundIconOver.Text = dlgOpenIcon.FileName
    If txtPopupSoundIconOver.Text = App.Path & "\Icons\noname.bmp" Then
        txtPopupSoundIconOver.Text = ""
    End If
    cmdApply_Click
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdSearchMenu_Click()
    frmSearchMenu.Show vbModal, Me
    cmdApply_Click
End Sub

Private Sub cmdTellAfriend_Click()
    frmTellAFriend.Show vbModal, Me
    cmdApply_Click
End Sub

Private Sub cmdTranslationIconBrowse_Click()
    On Error GoTo ErrHandler
    dlgOpenIcon.CancelError = True
    dlgOpenIcon.FileName = App.Path & "\Icons\noname"
    dlgOpenIcon.ShowOpen
    txtTranslationIcon.Text = dlgOpenIcon.FileName
    If txtTranslationIcon.Text = App.Path & "\Icons\noname.bmp" Then
        txtTranslationIcon.Text = ""
    End If
    cmdApply_Click
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdTranslationIconOverBrowse_Click()
    On Error GoTo ErrHandler
    dlgOpenIcon.CancelError = True
    dlgOpenIcon.FileName = App.Path & "\Icons\noname"
    dlgOpenIcon.ShowOpen
    txtTranslationIconOver.Text = dlgOpenIcon.FileName
    If txtTranslationIconOver.Text = App.Path & "\Icons\noname.bmp" Then
        txtTranslationIconOver.Text = ""
    End If
    cmdApply_Click
    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub cmdURLResponse_Click()
    frmURLResponce.Show vbModal, Me
    cmdApply_Click
End Sub

Private Sub Command2_Click()

End Sub

Private Sub Form_Activate()

    If m_bFirstActivate Then
        m_bFirstActivate = False
        
        If Len(g_strCmdLineFileName) > 0 Then
            LoadProject g_strCmdLineFileName
            m_bNewWindowVisible = False
            
            If Not fileHist.OnList(g_strCmdLineFileName) Then
                fileHist.AddNewItem g_strCmdLineFileName
            Else
                fileHist.MoveItemToTop g_strCmdLineFileName
            End If
        Else
            ' Show startup dialog
            Load frmNew
            frmNew.Show vbModal, Me
            If frmNew.bExit Then
                Unload frmMain
                Unload frmNew
                m_bNewWindowVisible = False
                Exit Sub
            End If
        
            If frmNew.bOpenExisting Then
                LoadProject frmNew.strFileName
            End If
        
            Unload frmNew
            m_bNewWindowVisible = False
            
            ' Activate window
            SetForegroundWindow hwnd
            SetActiveWindow hwnd
            
        End If
        TabStrip1_Click
    End If

End Sub

Private Sub Form_Load()
    
    Dim fra As Frame
    Dim initToolbarOpt As New PropertyBag
        
    SetMode
        
    ' Save different in height of main form and frames
    dHeight = frmMain.Height - fraPreview.Height - fraProperties.Height
    
    iButtonsCount = 0
    
    ' Hide all frames except first
    For Each fra In fraTabs
        fra.Visible = False
    Next fra
    fraTabs(0).Visible = True
    
    ' Save preview and form width differences
    fraPreviewWidthDiff = Width - fraPreview.Width
    tlbPreviewWidthDiff = Width - tlbMain.Width
    
    cmdBack.Enabled = False
    bFirstShowPopupMenuWindow = True
    
    ' Load toolbar options
    mnuFileNew_Click
    GetToolbarOptionsFromControls initToolbarOpt
    
    ' Construct toolbar
    BuildToolbarFromOptions initToolbarOpt
    cmdApply_Click
    
    lastButtonNum = 1
    iSelectedTab = 1
    
    Set initToolbarOpt = Nothing
    
    m_bFirstActivate = True
    m_strProjectName = "Untitled"
    m_bNewWindowVisible = True
               
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    
    Dim iRes As Long
    
    If Not m_bNewWindowVisible Then
        iRes = MsgBox("Save toolbar project?", vbQuestion + vbYesNoCancel)
        
        If iRes = vbCancel Then
            Cancel = True
            Exit Sub
        End If
        
        Cancel = False
        
        If iRes = vbYes Then
            mnuFileSave_Click
        End If
    End If
End Sub

Private Sub fraTabs1_DragDrop(index As Integer, Source As Control, x As Single, y As Single)

End Sub

Private Sub Form_Resize()
    cmdHelp.left = fraProperties.left + TabStrip1.clientLeft + TabStrip1.clientWidth - cmdHelp.Width - 50
    cmdHelp.top = fraProperties.top + TabStrip1.clientTop + 50
End Sub

Private Sub Form_Unload(Cancel As Integer)
    On Error Resume Next
    
    g_bExiting = True
    
    Unload frmHelp
    Unload frmURLResponce
    Unload frmAdButton
    Unload frmFTPOptions
    Unload frmResult
    Unload frmSearchMenu
    Unload frmUpdateInfo
    Unload frmTellAFriend
        
    Set m_objFtpClient = Nothing
    CloseHandle g_hMutex
End Sub


Private Sub lblUpdateLink_Click()
    On Error Resume Next
    
    Dim strURL As String
    
    If g_iMode = 1 Then
        strURL = UNLOCK_URL
    Else
        strURL = UPDATE_LINK
    
        strURL = Replace(strURL, "[USERNAME]", g_strProviderName)
        strURL = Replace(strURL, "[PASSWORD]", g_strProviderPassword)
        strURL = Replace(strURL, "[MODE]", g_iMode)
    End If
    
    ShellExecute hwnd, "open", strURL, "", "", 1
End Sub

Private Function m_AdButtonDocument_oncontextmenu() As Boolean
    m_AdButtonDocument_oncontextmenu = False
End Function

Private Sub m_objFtpClient_OnConnect(ByVal AsyncResultStatus As AsyncResultStatusConstants)
    
    On Error GoTo ERROR_HANDLER
    
    If AsyncResultStatus = arStatusOk Then
        m_objFtpClient.UploadFile m_strLocalFileName, m_strRemoteFileName, 0
        Exit Sub
    End If
    
ERROR_HANDLER:
    frmWait.pgbProgress.Visible = False
    frmWait.Hide
    frmMain.Enabled = True
    MsgBox "Toolbar Generator is unable to connect to your FTP server using the settings you entered. ", vbExclamation
    Set m_objFtpClient = Nothing
    frmFTPOptions.Show vbModal, Me
End Sub

Private Sub m_objFtpClient_OnDataTransferProgress(ByVal lngBytesTransferred As Long)
    
    On Error Resume Next
    
    If Not m_objFtpClient.FtpSessionState = ftpRetrievingDirectoryInfo Then
        frmWait.pgbProgress.Value = lngBytesTransferred / (m_lngFileSize / 100)
    End If
End Sub

Private Sub m_objFtpClient_OnUploadFile(ByVal AsyncResultStatus As AsyncResultStatusConstants)
    
    On Error GoTo ERROR_HANDLER
        
    frmMain.Enabled = True
    frmWait.Hide
    frmWait.pgbProgress.Visible = False
            
    If AsyncResultStatus = arStatusOk Then
        If m_bUploadingSetup Then
            MsgBox "Your toolbar setup program uploaded to your ftp server!", vbInformation
        Else
            MsgBox "Your toolbar update file uploaded to your ftp server!", vbInformation
        End If
    Else
        MsgBox "Viral Toolbar Builder is unable to connect to your FTP server using the settings you entered. ", vbExclamation
        frmFTPOptions.Show vbModal, Me
    End If
        
ERROR_HANDLER:
    Set m_objFtpClient = Nothing
End Sub

Private Sub mnuFileExit_Click()
    Unload Me
End Sub

Private Sub mnuFileNew_Click()
    
    Dim i As Long
    
    g_bNewFile = True
    
    bFirstShowPopupMenuWindow = True
    
    ' Clear all components
    txtToolbarName.Text = "My Toolbar"
    chkPopupBlocker.Value = 0
    
    txtAbarSearch.Text = "http://www.google.com/search?&q=[ABARSEARCH]"
            
    txtLogoFileName.Text = ""
    txtLogoFileNameHot.Text = ""
    txtSearchURL.Text = "http://www.google.com/search?q=[SEARCH]"
    txtSearchCaption.Text = "Search"
    txtSearchIconFileName = ""
    txtSearchHotIconFileName = ""
    txtLink = "http://www.viraltoolbarbuilder.com"
    txtUpdateURL = ""
    txtUpdateInterval = "10"
    txtAffiliateId = ""
    
    optText.Value = True
    txtLogoCaption.Text = "Logo"
    cdgLogoFont.FontName = ""
    cdgLogoFont.FontSize = 10
    cdgLogoFont.FontBold = False
    cdgLogoFont.FontItalic = False
    cdgLogoFont.FontUnderline = False
    cdgLogoFont.FontStrikethru = False
    cdgLogoFont.Color = 0
    
    txtButtonsCount.Text = "0"
    txtCurrentButton.Text = "1"
    txtBtnCaption.Text = ""
    txtBtnTooltip.Text = ""
    txtButtonImageFile.Text = ""
    txtButtonHotImageFile.Text = ""
    txtPopupMenu.Text = "Alexa#http://www.alexa.com/data/details?url=[URL]" & vbCrLf & "WayBack#http://web.archive.org/web/*/[URL]" & vbCrLf & "Link Popularity#http://linkpopularity.com/linkpop.cgi?url=[URL]"
    
    chkCleaner.Value = 0
    chkTranslate.Value = 0
    
    txtLogoMenu.Text = "Google#http://www.google.com" & vbCrLf & "#[SEPARATOR]" & vbCrLf & "viraltoolbarbuilder.com#http://www.viraltoolbarbuilder.com" & vbCrLf

    ' Step 7
    txtPopupBlockerCaption.Text = ""
    txtPopupBlockerIcon.Text = ""
    txtPopupBlockerIconOver.Text = ""
    
    txtPopupSoundCaption.Text = ""
    txtPopupSoundIcon.Text = ""
    txtPopupSoundIconOver.Text = ""

    txtCookieCleanerCaption.Text = ""
    txtCookieCleanerIcon.Text = ""
    txtCookieCleanerIconOver.Text = ""
    
    txtTranslationCaption.Text = ""
    txtTranslationIcon.Text = ""
    txtTranslationIconOver.Text = ""

    ' Setup URL responce
    For i = 0 To 2
        frmURLResponce.txtURLwatch(i).Text = ""
        frmURLResponce.txtURLshow(i).Text = ""
        frmURLResponce.txtURLwidth(i).Text = "400"
        frmURLResponce.txtURLheight(i).Text = "200"
    Next i
    
    ' ûóå SearchButtonMenu
    For i = 0 To 3
        frmSearchMenu.txtCaption(i) = ""
        frmSearchMenu.txtURL(i) = ""
    Next i
    
    ' Set AdButtons
    For i = 0 To frmAdButton.txtAdCaption.Count - 1
        frmAdButton.txtAdCaption(i).Text = ""
        frmAdButton.txtAdURL(i).Text = ""
        frmAdButton.txtAdImage(i).Text = ""
        frmAdButton.txtAdImageOver(i).Text = ""
    Next i
    
    frmAdButton.optTime.Value = True
    
    optPict_Click
    
    frmAdButton.txtRotateTime.Text = 10
    frmAdButton.optStatic.Value = True
    frmAdButton.txtWebButtonCode = ""
    frmAdButton.txtWebButtonWidth = "100"
    frmAdButton.txtWebButtonURL.Text = ""
    
    ' Set Tell A Friend buttons
    frmTellAFriend.txtCaption.Text = ""
    frmTellAFriend.txtImage.Text = ""
    frmTellAFriend.txtImageOver.Text = ""
    frmTellAFriend.txtURLshow.Text = "http://www.viraltoolbarbuilder.com/tellafriend.php?[URL]"
    frmTellAFriend.txtWidth.Text = "400"
    frmTellAFriend.txtHeight.Text = "450"

    ' Clear buttons
    For i = 1 To 10
        buttons(i).strCaption = ""
        buttons(i).strTooltip = ""
        buttons(i).strPopupMenu = ""
        buttons(i).strImageFile = ""
        buttons(i).strImageFileHot = ""
    Next i
    
    m_strProjectName = "Untitled"
    
    ' If demo mode, fill all demo-fields
    SetModeLimitations
    
    cmdApply_Click
    
End Sub

Private Sub mnuFileLoad_Click()
    On Error GoTo ErrHandler
    
    ' Get file name
    dlgLoad.CancelError = True
    dlgLoad.ShowOpen
    LoadProject dlgLoad.FileName
    Exit Sub
    
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub LoadProject(ByVal strProjectName As String)
    
    Dim pb As New PropertyBag
    Dim varTemp As Variant
    Dim byteArr() As Byte
    Dim strButtonName As String
    Dim iPos As Long
    Dim i As Long
    Dim j As Long
    
    g_bNewFile = False
    
    iPos = InStrRev(strProjectName, "\")
    m_strProjectPath = left(strProjectName, iPos)
    
    m_strProjectName = Mid(strProjectName, iPos + 1)
    
    ' Load from file
    Open strProjectName For Binary As #1
    Get #1, , varTemp
    Close #1
    
    byteArr = varTemp
    pb.Contents = byteArr
    
    ' Support old version
    On Error Resume Next
    
    ' Update controls
    txtToolbarName.Text = pb.ReadProperty("Name")
    
    chkPopupBlocker.Value = 0
    
    chkPopupBlocker.Value = pb.ReadProperty("PopupBlocker")
    chkTranslate.Value = pb.ReadProperty("Translate")
    chkCleaner.Value = pb.ReadProperty("Cleaner")
    
    txtLogoFileName.Text = pb.ReadProperty("LogoPictFileName")
    txtLogoFileNameHot.Text = pb.ReadProperty("LogoPictFileNameHot")
    txtSearchURL.Text = pb.ReadProperty("SearchURL")
    txtSearchCaption.Text = pb.ReadProperty("SearchCaption")
    txtSearchIconFileName = pb.ReadProperty("SearchPictFileName")
    txtSearchHotIconFileName = pb.ReadProperty("SearchPictFileNameHot")
    txtAbarSearch.Text = pb.ReadProperty("AddressBarSearch")
    
    txtLink = pb.ReadProperty("LogoLink")
    txtUpdateURL = pb.ReadProperty("UpdateLink")
    txtUpdateInterval = pb.ReadProperty("UpdateInterval")
    txtAffiliateId = pb.ReadProperty("AffiliateID")
    
    txtLogoCaption.Text = pb.ReadProperty("LogoCaption")
    cdgLogoFont.FontName = pb.ReadProperty("LogoFontName")
    cdgLogoFont.FontSize = pb.ReadProperty("LogoFontSize")
    cdgLogoFont.FontBold = pb.ReadProperty("LogoFontBold")
    cdgLogoFont.FontItalic = pb.ReadProperty("LogoFontItalic")
    cdgLogoFont.FontUnderline = pb.ReadProperty("LogoFontUnderline")
    cdgLogoFont.FontStrikethru = pb.ReadProperty("LogoFontStrikethru")
    cdgLogoFont.Color = pb.ReadProperty("LogoFontColor")

    txtLogoMenu.Text = pb.ReadProperty("LogoMenuText")
    

    optPict.Value = pb.ReadProperty("LogoUsePict")

    ' Load URL Responce list
    For i = 0 To 2
        frmURLResponce.txtURLwatch(i).Text = pb.ReadProperty("WatchURL" & i + 1)
        frmURLResponce.txtURLshow(i).Text = pb.ReadProperty("WatchURL" & i + 1 & "target")
        frmURLResponce.txtURLwidth(i).Text = pb.ReadProperty("WatchURL" & i + 1 & "width")
        frmURLResponce.txtURLheight(i).Text = pb.ReadProperty("WatchURL" & i + 1 & "height")
    Next i
    
    ' Load ad buttons
    For i = 0 To frmAdButton.txtAdCaption.Count - 1
        frmAdButton.txtAdCaption(i).Text = pb.ReadProperty("Ad" & i + 1 & "Caption")
        frmAdButton.txtAdURL(i).Text = pb.ReadProperty("Ad" & i + 1 & "URL")
        frmAdButton.txtAdImage(i).Text = pb.ReadProperty("Ad" & i + 1 & "ImageFileName")
        frmAdButton.txtAdImageOver(i).Text = pb.ReadProperty("Ad" & i + 1 & "ImageOverFileName")
    Next i
    
    If pb.ReadProperty("AdStatic") Then
        frmAdButton.optStatic.Value = True
    Else
        frmAdButton.optWebButton.Value = True
    End If
    
    frmAdButton.txtWebButtonURL.Text = pb.ReadProperty("AdWebURL")

    ' Load SearchButtonMenu
    For i = 0 To pb.ReadProperty("SearchButtonMenuCount") - 1
        frmSearchMenu.txtCaption(i) = pb.ReadProperty("SearchButtonMenu" & i + 1 & "Caption")
        frmSearchMenu.txtURL(i) = pb.ReadProperty("SearchButtonMenu" & i + 1 & "URL")
    Next i

    ' Load Tell A Friend
    frmTellAFriend.txtCaption.Text = pb.ReadProperty("TellAFriendCaption")
    frmTellAFriend.txtImage.Text = pb.ReadProperty("TellAFriendImage")
    frmTellAFriend.txtImageOver.Text = pb.ReadProperty("TellAFriendImageOver")
    frmTellAFriend.txtURLshow.Text = pb.ReadProperty("TellAFriendURL")
    frmTellAFriend.txtWidth.Text = pb.ReadProperty("TellAFriendWidth")
    frmTellAFriend.txtHeight.Text = pb.ReadProperty("TellAFriendHeight")

    frmAdButton.optTime.Value = pb.ReadProperty("AdsRotationByTime")
    If Not frmAdButton.optTime.Value Then
        frmAdButton.optClicks.Value = True
    End If
    frmAdButton.txtRotateTime.Text = pb.ReadProperty("AdsRotateTime")
    
    frmAdButton.txtWebButtonCode = pb.ReadProperty("AdsWebButtonCode")
    frmAdButton.txtWebButtonWidth = pb.ReadProperty("AdsWebButtonWidth")
    
    If pb.ReadProperty("AdStatic") Then
        frmAdButton.optStatic.Value = True
    Else
        frmAdButton.optWebButton.Value = True
    End If
        
    ' Load buttons list
    txtButtonsCount.Text = pb.ReadProperty("ButtonsCount")
    txtCurrentButton.Text = "1"
    
    ' Update buttons
    For i = 1 To 10
        strButtonName = "Button" & i
        buttons(i).strCaption = pb.ReadProperty(strButtonName & "Caption")
        buttons(i).strTooltip = pb.ReadProperty(strButtonName & "TooltipText")
        buttons(i).strImageFile = pb.ReadProperty(strButtonName & "PictFileName")
        buttons(i).strImageFileHot = pb.ReadProperty(strButtonName & "PictFileNameHot")
                
        buttons(i).strPopupMenu = ""
        If pb.ReadProperty(strButtonName & "IsWebButton") Then
            buttons(i).strPopupMenu = pb.ReadProperty(strButtonName & "WebCode")
        Else
            For j = 1 To pb.ReadProperty(strButtonName & "PMICount")
                buttons(i).strPopupMenu = buttons(i).strPopupMenu & pb.ReadProperty(strButtonName & "PMI" & j & "Caption") & "#" & pb.ReadProperty(strButtonName & "PMI" & j & "Link") & vbCrLf
            Next j
        End If
    Next i
    
    ' Step 7
    txtPopupBlockerCaption.Text = pb.ReadProperty("PopupBlockerCaption")
    txtPopupBlockerIcon.Text = pb.ReadProperty("PopupBlockerIcon")
    txtPopupBlockerIconOver.Text = pb.ReadProperty("PopupBlockerIconOver")
    
    txtPopupSoundCaption.Text = pb.ReadProperty("PopupSoundCaption")
    txtPopupSoundIcon.Text = pb.ReadProperty("PopupSoundIcon")
    txtPopupSoundIconOver.Text = pb.ReadProperty("PopupSoundIconOver")

    txtCookieCleanerCaption.Text = pb.ReadProperty("CookieCleanerCaption")
    txtCookieCleanerIcon.Text = pb.ReadProperty("CookieCleanerIcon")
    txtCookieCleanerIconOver.Text = pb.ReadProperty("CookieCleanerIconOver")
    
    txtTranslationCaption.Text = pb.ReadProperty("TranslationCaption")
    txtTranslationIcon.Text = pb.ReadProperty("TranslationIcon")
    txtTranslationIconOver.Text = pb.ReadProperty("TranslationIconOver")
    
    txtBtnCaption.Text = Trim(buttons(1).strCaption)
    txtBtnTooltip.Text = Trim(buttons(1).strTooltip)
    txtButtonImageFile.Text = Trim(buttons(1).strImageFile)
    txtButtonHotImageFile.Text = Trim(buttons(1).strImageFileHot)
    txtPopupMenu.Text = buttons(1).strPopupMenu
          
    ' If in DEMO-Mode, fill demo-fields
    SetModeLimitations
    
    cmdApply_Click
    
    Set pb = Nothing
    Exit Sub
    
ErrHandler:
    MsgBox Err.Description, vbExclamation
End Sub



Private Sub mnuFileSave_Click()
    
    If g_bNewFile Then
        mnuFileSaveAs_Click
        g_bNewFile = False
    Else
        SaveProject m_strProjectPath & m_strProjectName
    End If
End Sub


Private Sub mnuFileSaveAs_Click()
    On Error GoTo ErrHandler
        
    ' Get file name
    dlgSave.CancelError = True
    dlgSave.FileName = m_strProjectPath & m_strProjectName
    dlgSave.flags = cdlOFNOverwritePrompt
    dlgSave.ShowSave
        
    SaveProject dlgSave.FileName
    
    If Not fileHist.OnList(dlgSave.FileName) Then
        fileHist.AddNewItem dlgSave.FileName
    Else
        fileHist.MoveItemToTop dlgSave.FileName
    End If
    
    Exit Sub
    
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub SaveProject(ByVal strProjectName As String)
    
    On Error GoTo ErrHandler
    Dim pb As New PropertyBag
    Dim varTemp As Variant
    Dim i As Long
    
   
    ' Save to file
    GetToolbarOptionsFromControls pb
    varTemp = pb.Contents
    
    Open strProjectName For Binary As #1
    Put #1, , varTemp
    Close #1
    
    Set pb = Nothing
    
    i = InStrRev(strProjectName, "\")
    If i > 0 Then
        m_strProjectName = Mid(strProjectName, i + 1)
        m_strProjectPath = left(strProjectName, i)
    Else
        m_strProjectPath = ""
        m_strProjectName = strProjectName
    End If
    Exit Sub
    
ErrHandler:
    MsgBox Err.Description, vbExclamation
End Sub


Private Sub mnuFTPOptions_Click()
    frmFTPOptions.Show vbModal, Me
End Sub

Private Sub mnuHelpAbout_Click()
    Load frmAbout
    frmAbout.Show vbModal, Me
    Unload frmAbout
End Sub

Private Sub mnuHelpStep_Click(index As Integer)
    ShowHelp index
End Sub

Private Sub optPict_Click()
    optText_Click
End Sub

Private Sub optText_Click()
' Enable / disable controls
    txtLogoFileName.Enabled = optPict.Value
    cmdBrowseForLogo.Enabled = optPict.Value
    txtLogoFileNameHot.Enabled = optPict.Value
    cmdBrowseForHotLogo.Enabled = optPict.Value
    
    txtLogoCaption.Enabled = optText.Value
    cmdLogoFont.Enabled = optText.Value
End Sub

Private Sub TabStrip1_Click()
        
    Dim bBool As Boolean
        
    If iSelectedTab = TabStrip1.SelectedItem.index Then
        Me.Caption = m_strWindowCaption & " - Step " & iSelectedTab & " of 9"
        Exit Sub
    End If
    
    fraTabs(iSelectedTab - 1).Visible = False
    fraTabs(TabStrip1.SelectedItem.index - 1).Visible = True
    iSelectedTab = TabStrip1.SelectedItem.index
     
    udCurrentButton.Min = 1
    udCurrentButton.Max = CLng(txtButtonsCount.Text)
    If CLng(txtButtonsCount.Text) = 0 Then
        bBool = False
    Else
        bBool = True
        txtCurrentButton.Text = "1"
    End If
    
    udCurrentButton.Enabled = bBool
    txtBtnCaption.Enabled = bBool
    txtBtnTooltip.Enabled = bBool
    txtButtonHotImageFile.Enabled = bBool
    txtButtonImageFile.Enabled = bBool
    txtPopupMenu.Enabled = bBool
    cmdBrowseButtonIcon.Enabled = bBool
    cmdBrowseButtonIconHot.Enabled = bBool
    
    ' Set enable-disable of next / previous buttons
    If iSelectedTab = 1 Then
        cmdBack.Enabled = False
        cmdNext.Enabled = True
    ElseIf iSelectedTab = TabStrip1.Tabs.Count Then
        cmdBack.Enabled = True
        cmdNext.Enabled = False
    Else
        cmdBack.Enabled = True
        cmdNext.Enabled = True
    End If
    
    Me.Caption = m_strWindowCaption & " - Step " & iSelectedTab & " of 9"
    
    ' Check and add http:// to all needed fields
    If txtLink.Text <> "" And InStr(txtLink.Text, "http://") = 0 Then txtLink.Text = "http://" & txtLink.Text
    If txtSearchURL.Text <> "" And InStr(txtSearchURL.Text, "http://") = 0 Then txtSearchURL.Text = "http://" & txtSearchURL.Text
    If txtUpdateURL.Text <> "" And InStr(txtUpdateURL.Text, "http://") = 0 Then txtUpdateURL.Text = "http://" & txtUpdateURL.Text
    If txtAbarSearch.Text <> "" And g_iMode = 4 And InStr(txtAbarSearch.Text, "http://") = 0 Then txtAbarSearch.Text = "http://" & txtAbarSearch.Text
    
        
    ' Aply changes
    cmdApply_Click
    
End Sub

Private Sub tlbButtons_ButtonClick(index As Integer, ByVal Button As MSComctlLib.Button)
    
    If index = 1 Then
        MsgBox "This is search buton." & vbCrLf & vbCrLf & "After click on this button you will be moved to """ & txtSearchURL & """.", vbInformation
        Exit Sub
    End If
    
    ' Check for amount of menus
    If tlbButtons(index).buttons(1).ButtonMenus.Count = 0 Then
        MsgBox "Please, setup menu for this button!", vbExclamation
        Exit Sub
    End If
    
    ' If more than one link than show menu...
    If tlbButtons(index).buttons(1).ButtonMenus.Count > 1 Then
    
        Dim rc As RECTAPI
        Dim result As Long, i As Long
        Dim strCaption As String
        
        Dim mnu(1 To 100) As Long
        Dim iCurMenu As Long, iLastMenu As Long
        
        Dim st(1 To 100) As Long
        Dim ist As Long
        
        Dim t As Long
        
        GetWindowRect tlbButtons(index).hwnd, rc
        
        'Create popup menu
        iCurMenu = 1
        iLastMenu = 1
        ist = 0
        mnu(1) = CreatePopupMenu
        For i = 0 To tlbButtons(index).buttons(1).ButtonMenus.Count - 1
            strCaption = tlbButtons(index).buttons(1).ButtonMenus(i + 1).Text
            
            ' Check if this is begin of new popup menu
            If tlbButtons(index).buttons(1).ButtonMenus(i + 1).Tag = ">" Then
                
                ist = ist + 1
                st(ist) = iLastMenu
                
                iCurMenu = iCurMenu + 1
                mnu(iCurMenu) = CreatePopupMenu
                iLastMenu = iCurMenu
            ElseIf tlbButtons(index).buttons(1).ButtonMenus(i + 1).Tag = "<" Then
                
                t = iLastMenu
                
                iLastMenu = st(ist)
                ist = ist - 1
                
                AppendMenu mnu(iLastMenu), MF_POPUP, mnu(t), strCaption
            ElseIf tlbButtons(index).buttons(1).ButtonMenus(i + 1).Tag = "[SEPARATOR]" Then
                AppendMenu mnu(iLastMenu), MF_SEPARATOR, i + 1, ""
            Else
                AppendMenu mnu(iLastMenu), MF_STRING, i + 1, strCaption
            End If
        Next i
        
        result = TrackPopupMenu(mnu(1), &H102, rc.left, rc.bottom, 0, hwnd, 0) - 1
        
        For i = 1 To iCurMenu
            DestroyMenu mnu(i)
        Next i
    Else    ' ... else go to link directly
        
        MsgBox "This button have only one link in popup menu and will work as instant action button." & vbCrLf & " After click on this button you will be moved to """ & _
        tlbButtons(index).buttons(1).ButtonMenus(1).Tag & """.", vbInformation
    End If
End Sub

Private Sub tlbLogo_ButtonClick(ByVal Button As MSComctlLib.Button)
    MsgBox "After click on the logo button you will be moved to """ & txtLink & """.", vbInformation
End Sub

Private Sub tlbButtons_ButtonMenuClick(index As Integer, ByVal ButtonMenu As MSComctlLib.ButtonMenu)
    MsgBox "This is search menu." & vbCrLf & vbCrLf & "After click on this search menu item you will be moved to """ & frmSearchMenu.txtURL(ButtonMenu.index - 1) & """.", vbInformation
End Sub

Private Sub tlbButtons_MouseUp(index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
    
    
    Dim rc As RECTAPI
    Dim mnu As Long, result As Long, i As Long
    Dim strCaption As String
    
    If Button = vbRightButton Then
        
        ' Show Popup menu
        GetWindowRect tlbButtons(index).hwnd, rc
        
        'Create popup menu
        mnu = CreatePopupMenu
        AppendMenu mnu, MF_STRING, 1, "Delete this button"
            
        result = TrackPopupMenu(mnu, &H102, rc.left, rc.bottom, 0, hwnd, 0) - 1
        DestroyMenu mnu
        
        Select Case result
        
            Case 0:
                If MsgBox("Your are about to permanently delete this button." & vbCrLf & "Are you sure you want to do this?", vbQuestion + vbYesNo) = vbYes Then
                
                    ' Delete current button
                    For i = index - 1 To buttonsCount - 1
                        buttons(i).strCaption = buttons(i + 1).strCaption
                        buttons(i).strImageFile = buttons(i + 1).strImageFile
                        buttons(i).strImageFileHot = buttons(i + 1).strImageFileHot
                        buttons(i).strPopupMenu = buttons(i + 1).strPopupMenu
                        buttons(i).strTooltip = buttons(i + 1).strTooltip
                    Next i
                    
                    buttons(buttonsCount).strCaption = ""
                    buttons(buttonsCount).strImageFile = ""
                    buttons(buttonsCount).strImageFileHot = ""
                    buttons(buttonsCount).strPopupMenu = ""
                    buttons(buttonsCount).strTooltip = ""
                    
                    txtBtnCaption.Text = buttons(txtCurrentButton.Text).strCaption
                    txtBtnTooltip.Text = buttons(txtCurrentButton.Text).strTooltip
                    txtButtonImageFile.Text = buttons(txtCurrentButton.Text).strImageFile
                    txtButtonHotImageFile.Text = buttons(txtCurrentButton.Text).strImageFileHot
                    txtPopupMenu.Text = buttons(txtCurrentButton.Text).strPopupMenu
                    
                    buttonsCount = buttonsCount - 1
                    txtButtonsCount.Text = buttonsCount
                    
                    If CLng(txtCurrentButton.Text) > buttonsCount Then
                        txtCurrentButton.Text = buttonsCount
                    End If
                    
                    udCurrentButton.Max = buttonsCount
                    
                    cmdApply_Click
                End If
        End Select
    End If
End Sub

Private Sub tlbMain_ButtonClick(ByVal Button As MSComctlLib.Button)
    MsgBox "This is logo button." & vbCrLf & vbCrLf & "After selecting this menu item you will be moved to """ & txtLink & """.", vbInformation
End Sub

Private Sub tlbMain_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
    If ButtonMenu.Key = "ClearHistory" Then
        MsgBox "After selecting this menu item toolbar will clear search history.", vbInformation
    Else
        MsgBox "After selecting this menu item you will be moved to """ & m_LogoLinks(ButtonMenu.index) & """.", vbInformation
    End If
End Sub

Private Sub udCurrentButton_Change()
      
    ' Save last button info
    If lastButtonNum <> 0 Then
        buttons(lastButtonNum).strCaption = Trim(txtBtnCaption.Text)
        buttons(lastButtonNum).strTooltip = Trim(txtBtnTooltip.Text)
        buttons(lastButtonNum).strImageFile = Trim(txtButtonImageFile.Text)
        buttons(lastButtonNum).strImageFileHot = Trim(txtButtonHotImageFile.Text)
        buttons(lastButtonNum).strPopupMenu = txtPopupMenu.Text
    End If
    
    ' Set new
    If lastButtonNum <> Val(txtCurrentButton.Text) Then
        lastButtonNum = Val(txtCurrentButton.Text)
        txtBtnCaption.Text = Trim(buttons(lastButtonNum).strCaption)
        txtBtnTooltip.Text = Trim(buttons(lastButtonNum).strTooltip)
        txtButtonImageFile.Text = Trim(buttons(lastButtonNum).strImageFile)
        txtButtonHotImageFile.Text = Trim(buttons(lastButtonNum).strImageFileHot)
        
        If bFirstShowPopupMenuWindow Then
            bFirstShowPopupMenuWindow = False
        Else
            txtPopupMenu.Text = buttons(lastButtonNum).strPopupMenu
        End If
    End If
    
End Sub

Private Sub cmdMakeAndUploadSetup_Click()
    On Error GoTo ErrHandler
    
    Dim strFileName As String
    
    strFileName = App.Path & "\setup.exe"
    MakeAndUpoloadSetup strFileName, True

    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub


Private Sub cmdMakeSetup_Click()
    On Error GoTo ErrHandler
    
    Dim strFileName As String
    dlgSaveToolbar.flags = cdlOFNOverwritePrompt
    dlgSaveToolbar.ShowSave
    strFileName = dlgSaveToolbar.FileName
    MakeAndUpoloadSetup strFileName, False

    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Public Function UniqueValue() As String
Dim id As GUID
Dim sTemp$
Dim nLen%, hr&



hr = CoCreateGuid(id)
If (hr = 0) Then
    sTemp = StrConv(String(38, Chr(0)), vbUnicode)
    nLen = StringFromGUID2(id, sTemp, Len(sTemp))
    sTemp = StrConv(sTemp, vbFromUnicode)
    If (nLen > 0) Then
        If (left(sTemp, 1) = "{") Then sTemp = right(sTemp, Len(sTemp) - 1)
        If (right(sTemp, 1) = "}") Then sTemp = left(sTemp, Len(sTemp) - 1)
'        nLen = InStr(sTemp, "-")
 '       Do While (nLen <> 0)
  '          sTemp = left(sTemp, nLen - 1) & right(sTemp, Len(sTemp) - nLen)
   '         nLen = InStr(sTemp, "-")
    '    Loop
    Else
        sTemp = ""
    End If
End If
UniqueValue = sTemp

End Function

Private Function ExecWaitProcess(strCmdLine As String, strDir As String) As Long

Dim nRet As Long
Dim nExitCode As Long
Dim sinfo As STARTUPINFO
Dim pinfo As PROCESS_INFORMATION

sinfo.cb = Len(sinfo)
sinfo.lpReserved = vbNullString
sinfo.lpDesktop = vbNullString
sinfo.lpTitle = vbNullString
sinfo.wShowWindow = 0
sinfo.dwFlags = 1

nRet = CreateProcessBynum(vbNullString, strCmdLine, 0, 0, True, NORMAL_PRIORITY_CLASS, ByVal 0&, strDir, sinfo, pinfo)
nExitCode = -1

If nRet > 0 Then
    Do
        GetExitCodeProcess pinfo.hProcess, nExitCode
        If nExitCode <> &H103 Then
            Exit Do
        End If
    Loop While True
End If

ExecWaitProcess = nExitCode

End Function

Private Function BuildToolbarDLL() As String

Dim strPathVB6 As String
Dim strPathProj As String
Dim strCmdLine As String
Dim GUID As String
Dim nRet As String

strPathVB6 = "C:\Program Files\Microsoft Visual Studio\VB98\"
strPathProj = App.Path + "\Toolbar\IEToolbar.vbp"

On Error Resume Next
Kill App.Path & "\IEToolbarTemplate.dll"

strCmdLine = strPathVB6 + "vb6.exe" + " /outdir " + Chr(34) + App.Path + Chr(34) + " /make " + Chr(34) + strPathProj + Chr(34)
nRet = ExecWaitProcess(strCmdLine, strPathVB6)

strCmdLine = "RegSvr32.exe /s " + App.Path + "\IEToolbarTemplate.dll"
nRet = ExecWaitProcess(strCmdLine, App.Path)

Dim hKey As Long
RegOpenKeyEx HKEY_CLASSES_ROOT, "IEToolbar.clsIEToolbar", 0, KEY_ALL_ACCESS, hKey
GUID = GetRegistryValue(hKey, "Clsid", "")

strCmdLine = "RegSvr32.exe /u /s " + App.Path + "\IEToolbarTemplate.dll"
nRet = ExecWaitProcess(strCmdLine, App.Path)

GUID = Mid(GUID, 2, Len(GUID) - 2)

BuildToolbarDLL = GUID

End Function

Private Sub MakeAndUpoloadSetup(ByVal strFileName As String, ByVal bUpload As Boolean)

    On Error GoTo ERROR_HANDLER
    Dim BeginPos As Long
    Dim varTemp As Variant
    Dim pb As New PropertyBag
    Dim a As String
    Dim temp As String
    Dim i As Long
    Dim strExeName As String
    Dim strToolbarName As String
    Dim strDllName As String
    
    Dim GUID As String

    ' If demo mode, fill all demo-fields
    SetModeLimitations
    
    '0. Build Toolbar dll
    GUID = BuildToolbarDLL()
    strDllName = txtToolbarName.Text & ".dll"

    ' 1. Create copy of template dll
    FileCopy App.Path & "\IEToolbarTemplate.dll", App.Path & "\" & strDllName
    
    ' 2. Save data to dll.
    Open App.Path & "\" & strDllName For Binary As #1
    BeginPos = LOF(1)
    GetToolbarOptionsFromControls pb
    pb.WriteProperty "SearchWidth", 1500
    varTemp = pb.Contents
    Seek #1, LOF(1)
    Put #1, , varTemp
    Put #1, , BeginPos
    Close #1
    Set varTemp = Nothing
   
    '3. Delete old setup
    On Error Resume Next
    Kill App.Path & "\setup.exe"
    Kill App.Path & "\IEToolbar.iss"
    Kill strFileName
    On Error GoTo 0
    
    ' 4. Make .iss file
    temp = pb.ReadProperty("Name")
    If temp = "" Then temp = "IE Toolbar Generated In Viral Toolbar Builder"
    Open App.Path & "\IEToolbarTemplateNEW.iss" For Binary As #1
    a = StrConv(InputB(LOF(1), 1), vbUnicode)
    Close #1
    
    ' Replace templates in setup file
    strToolbarName = temp
    a = Replace(a, "%%%DLLNAME%%%", strDllName)
    a = Replace(a, "%%%DEFAULT_DIR%%%", "{pf}\Toolbars\%%%TOOLBAR_NAME%%%") '{sys}")
    a = Replace(a, "%%%TOOLBAR_NAME%%%", temp)
    a = Replace(a, "%%%SEARCHTEXT%%%", "[ABARSEARCH]")
    Dim GUID1, GUID2, GUID3 As String
    GUID1 = UniqueValue()
    GUID2 = UniqueValue()
    GUID3 = UniqueValue()
    
    a = Replace(a, "%%%DEFAULT_GUID%%%", "{" & GUID & "}")
    a = Replace(a, "%%%DEFAULT_GUID_2%%%", "{" & GUID & "}")
    a = Replace(a, "%%%DEFAULT_GUID_3%%%", "{" & GUID & "}")
    
    If g_iMode = 1 Then
        a = Replace(a, "%%%SEARCHURL%%%", ABARSEARCHURL)
    ElseIf g_iMode = 2 Or g_iMode = 3 Then
        a = Replace(a, "%%%SEARCHURL%%%", "")
    ElseIf g_iMode = 4 Then
        a = Replace(a, "%%%SEARCHURL%%%", pb.ReadProperty("AddressBarSearch"))
    End If

    ' Replace toolbar setup name
    i = InStrRev(strFileName, "\")
    If i > 0 Then
        temp = Mid(strFileName, i + 1)
        i = InStr(temp, ".")
        If i > 0 Then
            temp = left(temp, i - 1)
        End If
        strExeName = temp
    End If
    
    a = Replace(a, "%%%EXENAME%%%", temp)

    Open App.Path & "\IEToolbar.iss" For Binary As #1
    Put #1, , a
    Close #1
    
    Set pb = Nothing
    
    ' 5. Call Inno Setup compiler.
    Dim res As Long
    Dim sinfo As STARTUPINFO
    Dim pinfo As PROCESS_INFORMATION
    Dim strCmdLine As String
    sinfo.cb = Len(sinfo)
    sinfo.lpReserved = vbNullString
    sinfo.lpDesktop = vbNullString
    sinfo.lpTitle = vbNullString
    sinfo.wShowWindow = 0               ' 0 = SW_HIDE
    sinfo.dwFlags = 1                   '1 = STARTF_USESHOWWINDOW
    
    Load frmWait
    frmWait.lblStatus = "Please, wait, while Toolbar setup program will be generated..."
    frmWait.Show vbModeless, Me
    strCmdLine = """" & App.Path & "\InnoSetup\ISCC.exe"" """ & App.Path & "\IEToolbar.iss"""
    res = CreateProcessBynum(vbNullString, strCmdLine, 0, 0, True, NORMAL_PRIORITY_CLASS, ByVal 0&, vbNullString, sinfo, pinfo)
    If res Then
        Do
            res = WaitForSingleObject(pinfo.hProcess, 0)
            If res = WAIT_OBJECT_0 Then
                Exit Do
            End If
            DoEvents
        Loop While True
        CloseHandle pinfo.hThread
        CloseHandle pinfo.hProcess
        frmWait.Hide
        If bUpload Then
            m_bUploadingSetup = True
            UploadFileToFTP frmFTPOptions.strFTPHost, frmFTPOptions.strFTPUsername, frmFTPOptions.strFTPPassword, frmFTPOptions.strFTPDirectory, frmFTPOptions.txtFTPDirectory & "setup.exe", App.Path & "\setup.exe"
        Else
            CopyFiles App.Path & "\" & strExeName & ".exe", strFileName
            'frmResult.lblFileName = strFileName
            frmResult.lblLink.Tag = strFileName
            frmResult.lblToolbarName = """" & strToolbarName & """"
            frmResult.lblNNN = Replace(frmResult.lblNNN, "%%%TOOLBARNAME%%%", strToolbarName)
            MessageBeep MB_ICONASTERISK
            frmResult.Show vbModal, Me
        End If
    Else
        frmWait.Hide
        MsgBox "Can't start Inno Setup Complier!", vbExclamation
    End If
    
    Exit Sub
ERROR_HANDLER:
    MsgBox Err.Description, vbExclamation
End Sub


Private Sub cmdSaveAndUploadConfig_Click()
    
    On Error GoTo ErrHandler
    
    Dim pb As New PropertyBag
    
    Dim strFileName As String
    
    GetToolbarOptionsFromControls pb
    
    If Len(pb.ReadProperty("UpdateLink")) = 0 Then
        MsgBox "Before Viral Toolbar Builder can upload your update file. You must first properly complete step 4.", vbExclamation
        Set pb = Nothing
        Exit Sub
    End If
    Set pb = Nothing
    
    SaveAndUploadConfig App.Path & "\toolbar.cfg", True

    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub


Private Sub cmdSaveConfig_Click()
    On Error GoTo ErrHandler
    
    ' Get Update File Name
    Dim i As Long
    Dim strFileName As String
    strFileName = txtUpdateURL
    
    i = InStrRev(strFileName, "/")
    If i > 0 Then
        strFileName = Mid(strFileName, i + 1)
        dlgSaveConfig.FileName = strFileName
    End If
    dlgSaveConfig.flags = cdlOFNOverwritePrompt
    dlgSaveConfig.ShowSave
    strFileName = dlgSaveConfig.FileName
    SaveAndUploadConfig strFileName, False

    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If
End Sub

Private Sub SaveAndUploadConfig(ByVal strFileName As String, ByVal bUploadToFTP As Boolean)
    
    On Error GoTo ERROR_HANDLER
    Dim BeginPos As Long
    Dim varTemp As Variant
    Dim pb As New PropertyBag
    Dim a As String
    Dim strRemoteFileName As String
    Dim i As Long
       

    ' 1. Save data to config file
    Open strFileName For Binary As #1
    GetToolbarOptionsFromControls pb
    pb.WriteProperty "SearchWidth", 1500
    varTemp = pb.Contents
    Put #1, , varTemp
    Close #1
    Set varTemp = Nothing
    
    strRemoteFileName = pb.ReadProperty("UpdateLink")
    
    If strRemoteFileName = "" Then
        strRemoteFileName = "toolbar.cfg"
    Else
        i = InStrRev(strRemoteFileName, "/")
        If i > 0 Then
            strRemoteFileName = Mid(strRemoteFileName, i + 1)
        End If
    End If
    
    If bUploadToFTP Then
        m_bUploadingSetup = False
        UploadFileToFTP frmFTPOptions.strFTPHost, frmFTPOptions.strFTPUsername, frmFTPOptions.strFTPPassword, frmFTPOptions.strFTPDirectory, frmFTPOptions.txtFTPDirectory & strRemoteFileName, App.Path & "\toolbar.cfg"
    Else
        MsgBox "Your toolbar configuration file saved as """ & strFileName & vbCrLf & vbCrLf & _
        "If you will be using your own FTP program to upload this " & vbCrLf & "file, make sure you use BINARY transfer mode otherwise" & vbCrLf & "the update file will not work.", vbInformation
    End If
    Exit Sub
ERROR_HANDLER:
    MsgBox Err.Description, vbExclamation
End Sub

Public Sub ShowHelp(index As Integer)
    Dim strURL As String
    
    If index = 0 Then
        strURL = Replace(HELP_URL, "[STEP]", 1)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 1"
    
    ElseIf index = 1 Then
        strURL = Replace(HELP_URL, "[STEP]", 2)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 2"
    
    ElseIf index = 2 Then
        strURL = Replace(HELP_URL, "[STEP]", 3)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 3"
        
    ElseIf index = 3 Then
        strURL = HELPSEARCHMENU_URL
        frmHelp.Caption = "Viral Toolbar Builder - Help on Search Menu"
        
    ElseIf index = 4 Then
        strURL = Replace(HELP_URL, "[STEP]", 4)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 4"
        
    ElseIf index = 5 Then
        strURL = Replace(HELP_URL, "[STEP]", 5)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 5"
    
    ElseIf index = 6 Then
        strURL = Replace(HELP_URL, "[STEP]", 6)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 6"
        
    ElseIf index = 7 Then
        strURL = HELPSUBMENUS_URL
        frmHelp.Caption = "Viral Toolbar Builder - Help on Sub Menus"
                
    ElseIf index = 8 Then
        strURL = HELPAB_URL
        frmHelp.Caption = "Viral Toolbar Builder - Help on Audio Buttons"
        
    ElseIf index = 9 Then
        strURL = Replace(HELP_URL, "[STEP]", 7)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 7"
        
    ElseIf index = 10 Then
        strURL = Replace(HELP_URL, "[STEP]", 8)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 8"
        
    ElseIf index = 11 Then
        strURL = HELPUR_URL
        frmHelp.Caption = "Viral Toolbar Builder - Help on URL Response"
        
    ElseIf index = 12 Then
        strURL = HELPAD_URL
        frmHelp.Caption = "Viral Toolbar Builder - Help on Ad Button"
        
    ElseIf index = 13 Then
        strURL = HELPTF_URL
        frmHelp.Caption = "Viral Toolbar Builder - Help on Tell A Friend Button"
    
    ElseIf index = 14 Then
        strURL = Replace(HELP_URL, "[STEP]", 9)
        frmHelp.Caption = "Viral Toolbar Builder - Help on Step 9"
    
    ElseIf index = 15 Then
        strURL = HELPINST_URL
        frmHelp.Caption = "Viral Toolbar Builder - Help on Installing Toolbar"
        
    ElseIf index = 16 Then
        strURL = HELPFTP_URL
        frmHelp.Caption = "Viral Toolbar Builder - Help on FTP Options"
    End If
    
    frmHelp.brwWebBrowser.Navigate strURL
    frmHelp.Show vbModal, Me
    Unload frmHelp
End Sub


Public Sub UploadFileToFTP(strFTPHost As String, strUsername As String, strPassword As String, strDirectory As String, strFileNameRemote As String, strFileNameLocal As String)

    ' Create ftp client object
    Set m_objFtpClient = New CFtpClient

    
    On Error GoTo ERROR_HANDLER
    ' Connect to server
    
    If strFTPHost = "" Then GoTo ERROR_HANDLER
    
    m_objFtpClient.FtpServer = strFTPHost
    m_objFtpClient.RemotePort = 21
    m_objFtpClient.UserName = strUsername
    m_objFtpClient.Password = strPassword
    
    m_objFtpClient.PassiveMode = True
    
    m_strLocalFileName = strFileNameLocal
    m_strRemoteFileName = strFileNameRemote
    
    m_lngFileSize = FileLen(strFileNameLocal)
    
    frmWait.lblStatus = "Toolbar Generator is uploading the file to your FTP server."
    frmWait.pgbProgress.Value = 0
    frmWait.pgbProgress.Visible = True
    frmMain.Enabled = False
    frmWait.Show vbModeless, Me
    
    m_objFtpClient.Connect
    
    Exit Sub

ERROR_HANDLER:
    frmWait.pgbProgress.Visible = False
    frmWait.Hide
    frmMain.Enabled = True
    MsgBox "Viral Toolbar Builder is unable to connect to your FTP server using the settings you entered. ", vbExclamation
    Set m_objFtpClient = Nothing
    frmFTPOptions.Show vbModal, Me
End Sub

Private Sub wbrAds_DocumentComplete(ByVal pDisp As Object, url As Variant)
    On Error Resume Next
    wbrAds.Document.Write g_strAdWebButtonCode
    Set m_AdButtonDocument = wbrAds.Document
End Sub

Private Sub WebBrowser_DownloadComplete(index As Integer)
    If strWebBrowserUrls(index) <> "" Then
        'WebBrowser(index).Document.write (strWebBrowserUrls(index))
        strWebBrowserUrls(index) = ""
    End If
End Sub


Private Sub cmdSaveForBranding_Click()
    On Error GoTo ErrHandler
    
    ' Get Update File Name
    Dim strFileName As String
    Dim varTemp As Variant
    Dim pb As New PropertyBag
    Dim strPath As String
    Dim i As Long
        
    ' Ask user about filename
    strFileName = "template"
    dlgSaveTemplate.flags = cdlOFNOverwritePrompt
    dlgSaveTemplate.DefaultExt = "dat"
    dlgSaveTemplate.ShowSave
    strFileName = dlgSaveTemplate.FileName

    ' Save config data to file
    Open strFileName For Binary As #1
    GetToolbarOptionsFromControls pb
    pb.WriteProperty "SearchWidth", 1500
    varTemp = pb.Contents
    Put #1, , varTemp
    Close #1
    Set varTemp = Nothing
    
    ' Copy toolbarbrander setup to the same folder
    i = InStrRev(strFileName, "\")
    strPath = left$(strFileName, i)
    
    CopyFiles App.Path & "\tbsetup.exe", strPath & "toolbarbrander.exe"

    Exit Sub
ErrHandler:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Description, vbExclamation
    End If

End Sub


