VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0"; "mscomctl.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frm_techinfo 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "frm_techinfo"
   ClientHeight    =   9900
   ClientLeft      =   4035
   ClientTop       =   1110
   ClientWidth     =   11745
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   9900
   ScaleWidth      =   11745
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox txt_ObjectID 
      Height          =   360
      Left            =   9855
      TabIndex        =   87
      Top             =   105
      Width           =   1770
   End
   Begin VB.Frame fra_CADObject 
      Caption         =   "#CAD Object"
      Height          =   5670
      Left            =   30
      TabIndex        =   86
      Tag             =   "fra_CADObject"
      Top             =   600
      Width           =   11655
      Begin VB.CheckBox chk_InternetFlag 
         Caption         =   "#Internet flag"
         Height          =   252
         Left            =   1485
         TabIndex        =   108
         Tag             =   "chk_InternetFlag"
         Top             =   4935
         Width           =   1545
      End
      Begin VB.TextBox txt_Version 
         Height          =   360
         Left            =   1455
         MaxLength       =   10
         TabIndex        =   106
         Top             =   3720
         Width           =   1275
      End
      Begin VB.Frame fra_CADObjectLanguage 
         Height          =   2760
         Left            =   75
         TabIndex        =   91
         Tag             =   "fra_CADObjectLanguage"
         Top             =   600
         Width           =   11445
         Begin VB.TextBox txt_VersionDesc 
            Height          =   360
            Left            =   2400
            MaxLength       =   100
            TabIndex        =   104
            Tag             =   "txt_VersionDesc"
            Top             =   2295
            Width           =   8910
         End
         Begin VB.TextBox txt_InternetURL2 
            Height          =   360
            Left            =   2400
            MaxLength       =   100
            TabIndex        =   102
            Tag             =   "txt_InternetURL2"
            Top             =   1950
            Width           =   8910
         End
         Begin VB.TextBox txt_InternetURL1 
            Height          =   360
            Left            =   2400
            MaxLength       =   100
            TabIndex        =   100
            Tag             =   "txt_InternetURL1"
            Top             =   1215
            Width           =   8910
         End
         Begin VB.TextBox txt_InternetDesc2 
            Height          =   360
            Left            =   2400
            MaxLength       =   100
            TabIndex        =   98
            Tag             =   "txt_InternetDesc2"
            Top             =   1575
            Width           =   8910
         End
         Begin VB.TextBox txt_InternetDesc1 
            Height          =   360
            Left            =   2400
            MaxLength       =   100
            TabIndex        =   96
            Tag             =   "txt_InternetDesc1"
            Top             =   855
            Width           =   8910
         End
         Begin VB.TextBox txt_ObjectDescription 
            Height          =   360
            Left            =   2400
            MaxLength       =   100
            TabIndex        =   94
            Tag             =   "txt_ObjectDesc"
            Top             =   495
            Width           =   8910
         End
         Begin Project1.ArmCombobox cbo_TextLanguage 
            Height          =   345
            Left            =   2400
            TabIndex        =   93
            Tag             =   "cbo_TextLanguage"
            Top             =   150
            Width           =   3645
            _ExtentX        =   6429
            _ExtentY        =   609
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Version description"
            Height          =   255
            Index           =   8
            Left            =   105
            TabIndex        =   105
            Tag             =   "lbl_VersionDesc"
            Top             =   2415
            Width           =   1965
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Internet URL2"
            Height          =   255
            Index           =   7
            Left            =   105
            TabIndex        =   103
            Tag             =   "lbl_InternetURL2"
            Top             =   2055
            Width           =   1965
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Internet URL1"
            Height          =   255
            Index           =   6
            Left            =   105
            TabIndex        =   101
            Tag             =   "lbl_InternetURL1"
            Top             =   1320
            Width           =   1965
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Internet description 2"
            Height          =   255
            Index           =   5
            Left            =   105
            TabIndex        =   99
            Tag             =   "lbl_InternetDesc2"
            Top             =   1695
            Width           =   1965
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Internet description 1"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   4
            Left            =   105
            TabIndex        =   97
            Tag             =   "lbl_InternetDesc1"
            Top             =   960
            Width           =   1965
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Object description"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   3
            Left            =   105
            TabIndex        =   95
            Tag             =   "lbl_ObjectDesc"
            Top             =   600
            Width           =   1965
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Text language"
            Height          =   300
            Index           =   2
            Left            =   105
            TabIndex        =   92
            Tag             =   "lbl_TextLanguage"
            Top             =   195
            Width           =   1965
         End
      End
      Begin Project1.ArmCombobox cbo_ObjectLangauge 
         Height          =   345
         Left            =   2400
         TabIndex        =   90
         Tag             =   "cbo_ObjectLangauge"
         Top             =   210
         Width           =   2610
         _ExtentX        =   4604
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_Extension 
         Height          =   345
         Left            =   9990
         TabIndex        =   110
         Tag             =   "cbo_Extension"
         Top             =   210
         Width           =   1500
         _ExtentX        =   2646
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_Author 
         Height          =   345
         Left            =   1455
         TabIndex        =   112
         Tag             =   "cbo_ObjectLangauge"
         Top             =   4095
         Width           =   2505
         _ExtentX        =   4419
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_Owner 
         Height          =   345
         Left            =   1455
         TabIndex        =   114
         Tag             =   "cbo_ObjectLangauge"
         Top             =   4470
         Width           =   2505
         _ExtentX        =   4419
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_CADType 
         Height          =   345
         Left            =   6495
         TabIndex        =   115
         Tag             =   "cbo_CADType"
         Top             =   210
         Width           =   1800
         _ExtentX        =   3175
         _ExtentY        =   609
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#CAD Type"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Index           =   13
         Left            =   5055
         TabIndex        =   116
         Tag             =   "lbl_CADType"
         Top             =   270
         Width           =   1455
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Owner"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Index           =   12
         Left            =   120
         TabIndex        =   113
         Tag             =   "lbl_Owner"
         Top             =   4485
         Width           =   1290
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Author"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Index           =   11
         Left            =   90
         TabIndex        =   111
         Tag             =   "lbl_Author"
         Top             =   4110
         Width           =   1545
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Extension"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Index           =   10
         Left            =   8340
         TabIndex        =   109
         Tag             =   "lbl_Extension"
         Top             =   225
         Width           =   1650
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Version"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   9
         Left            =   120
         TabIndex        =   107
         Tag             =   "lbl_Version"
         Top             =   3765
         Width           =   1065
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Object language"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Index           =   1
         Left            =   195
         TabIndex        =   89
         Tag             =   "lbl_ObjectLangauge"
         Top             =   270
         Width           =   2220
      End
   End
   Begin VB.Frame fra_Other 
      Caption         =   "#Other"
      Height          =   5670
      Left            =   45
      TabIndex        =   21
      Tag             =   "fra_Other"
      Top             =   585
      Width           =   11655
      Begin VB.Frame frm_Language 
         ClipControls    =   0   'False
         ForeColor       =   &H00FFFFFF&
         Height          =   1572
         Left            =   2295
         TabIndex        =   24
         Top             =   630
         Visible         =   0   'False
         Width           =   915
         Begin MSComctlLib.ListView lvw_Language 
            Height          =   1395
            Left            =   60
            TabIndex        =   25
            Top             =   120
            Width           =   795
            _ExtentX        =   1402
            _ExtentY        =   2461
            View            =   3
            LabelWrap       =   -1  'True
            HideSelection   =   -1  'True
            HideColumnHeaders=   -1  'True
            _Version        =   393217
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            BorderStyle     =   1
            Appearance      =   0
            NumItems        =   1
            BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
               Object.Width           =   882
            EndProperty
         End
      End
      Begin VB.Frame frm_TitleLanguage 
         ClipControls    =   0   'False
         ForeColor       =   &H00FFFFFF&
         Height          =   1572
         Left            =   2295
         TabIndex        =   22
         Top             =   3990
         Visible         =   0   'False
         Width           =   915
         Begin MSComctlLib.ListView lvw_TitleLanguage 
            Height          =   1395
            Left            =   60
            TabIndex        =   23
            Top             =   120
            Width           =   795
            _ExtentX        =   1402
            _ExtentY        =   2461
            View            =   3
            LabelWrap       =   -1  'True
            HideSelection   =   -1  'True
            HideColumnHeaders=   -1  'True
            _Version        =   393217
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            BorderStyle     =   1
            Appearance      =   0
            NumItems        =   1
            BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
               Object.Width           =   882
            EndProperty
         End
      End
      Begin VB.ComboBox cbo_Interest 
         Height          =   315
         Left            =   7035
         Style           =   2  'Dropdown List
         TabIndex        =   72
         Top             =   5010
         Width           =   2172
      End
      Begin VB.ComboBox cbo_Country 
         Height          =   315
         Left            =   7035
         Style           =   2  'Dropdown List
         TabIndex        =   71
         Top             =   4530
         Width           =   2172
      End
      Begin VB.TextBox txt_IntTitle 
         Height          =   288
         Left            =   2295
         MaxLength       =   30
         TabIndex        =   70
         Top             =   4530
         Width           =   2412
      End
      Begin VB.ComboBox cbo_Def 
         Height          =   315
         Left            =   2295
         Style           =   2  'Dropdown List
         TabIndex        =   69
         Top             =   2130
         Visible         =   0   'False
         Width           =   2172
      End
      Begin VB.ComboBox cbo_Ext 
         Height          =   315
         Left            =   2295
         Style           =   2  'Dropdown List
         TabIndex        =   68
         Top             =   690
         Width           =   2172
      End
      Begin VB.ComboBox cbo_Qons 
         Height          =   315
         Left            =   2295
         Style           =   2  'Dropdown List
         TabIndex        =   67
         Top             =   2610
         Visible         =   0   'False
         Width           =   2172
      End
      Begin VB.ComboBox cbo_ExtCode 
         Height          =   315
         Left            =   3735
         Style           =   2  'Dropdown List
         TabIndex        =   66
         Top             =   690
         Visible         =   0   'False
         Width           =   492
      End
      Begin VB.ComboBox cbo_DefCode 
         Height          =   315
         Left            =   3735
         Style           =   2  'Dropdown List
         TabIndex        =   65
         Top             =   2130
         Visible         =   0   'False
         Width           =   492
      End
      Begin VB.ComboBox cbo_QonsCode 
         Height          =   315
         Left            =   3735
         Style           =   2  'Dropdown List
         TabIndex        =   64
         Top             =   2610
         Visible         =   0   'False
         Width           =   492
      End
      Begin VB.TextBox txt_Title 
         Height          =   285
         Left            =   2295
         MaxLength       =   80
         TabIndex        =   63
         Top             =   4050
         Width           =   6855
      End
      Begin VB.TextBox txt_Width 
         Height          =   285
         Left            =   2295
         MaxLength       =   10
         TabIndex        =   62
         Top             =   1650
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.TextBox txt_Height 
         Height          =   285
         Left            =   2295
         MaxLength       =   10
         TabIndex        =   61
         Top             =   1170
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.CheckBox chk_Int 
         Caption         =   "Check1"
         Height          =   252
         Left            =   2295
         TabIndex        =   60
         Top             =   5010
         Width           =   252
      End
      Begin VB.PictureBox pic_Language 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00C0C0C0&
         BorderStyle     =   0  'None
         DragIcon        =   "TECHINFO.frx":0000
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   2295
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   59
         Top             =   210
         Width           =   384
      End
      Begin VB.PictureBox pic_TitleLanguage 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00C0C0C0&
         BorderStyle     =   0  'None
         DragIcon        =   "TECHINFO.frx":030A
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   2295
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   58
         Top             =   3570
         Width           =   384
      End
      Begin VB.ComboBox cbo_CountryCode 
         Height          =   315
         Left            =   8475
         Style           =   2  'Dropdown List
         TabIndex        =   57
         Top             =   4530
         Visible         =   0   'False
         Width           =   492
      End
      Begin VB.ComboBox cbo_InterestCode 
         Height          =   315
         Left            =   8475
         Style           =   2  'Dropdown List
         TabIndex        =   56
         Top             =   5010
         Visible         =   0   'False
         Width           =   492
      End
      Begin VB.Frame fra_Visible 
         Height          =   3675
         Left            =   6900
         TabIndex        =   26
         Top             =   165
         Width           =   4575
         Begin VB.Frame fra_Visible1 
            BorderStyle     =   0  'None
            Height          =   300
            Left            =   240
            TabIndex        =   51
            Top             =   720
            Width           =   4200
            Begin VB.OptionButton Opt_1y 
               Caption         =   "Yes"
               Height          =   195
               Left            =   1680
               TabIndex        =   53
               Top             =   0
               Width           =   855
            End
            Begin VB.OptionButton Opt_1n 
               Caption         =   "No"
               Height          =   195
               Left            =   2880
               TabIndex        =   52
               Top             =   0
               Width           =   855
            End
            Begin VB.Label Lbl_vis1 
               BackStyle       =   0  'Transparent
               Height          =   255
               Left            =   0
               TabIndex        =   54
               Top             =   0
               Width           =   1335
            End
         End
         Begin VB.Frame fra_Visible3 
            BorderStyle     =   0  'None
            Height          =   300
            Left            =   240
            TabIndex        =   47
            Top             =   1500
            Width           =   4200
            Begin VB.OptionButton Opt_3y 
               Caption         =   "Yes"
               Height          =   195
               Left            =   1680
               TabIndex        =   49
               Top             =   0
               Width           =   855
            End
            Begin VB.OptionButton Opt_3n 
               Caption         =   "No"
               Height          =   195
               Left            =   2880
               TabIndex        =   48
               Top             =   0
               Width           =   855
            End
            Begin VB.Label Lbl_vis3 
               BackStyle       =   0  'Transparent
               Height          =   255
               Left            =   0
               TabIndex        =   50
               Top             =   0
               Width           =   1335
            End
         End
         Begin VB.Frame fra_Visible4 
            BorderStyle     =   0  'None
            Height          =   300
            Left            =   240
            TabIndex        =   43
            Top             =   1900
            Width           =   4200
            Begin VB.OptionButton Opt_4y 
               Caption         =   "Yes"
               Height          =   195
               Left            =   1680
               TabIndex        =   45
               Top             =   0
               Width           =   855
            End
            Begin VB.OptionButton Opt_4n 
               Caption         =   "No"
               Height          =   195
               Left            =   2880
               TabIndex        =   44
               Top             =   0
               Width           =   855
            End
            Begin VB.Label Lbl_vis4 
               BackStyle       =   0  'Transparent
               Height          =   255
               Left            =   0
               TabIndex        =   46
               Top             =   0
               Width           =   1335
            End
         End
         Begin VB.Frame fra_Visible5 
            BorderStyle     =   0  'None
            Height          =   300
            Left            =   240
            TabIndex        =   39
            Top             =   2300
            Width           =   4200
            Begin VB.OptionButton Opt_5n 
               Caption         =   "No"
               Height          =   195
               Left            =   2880
               TabIndex        =   41
               Top             =   0
               Width           =   855
            End
            Begin VB.OptionButton Opt_5y 
               Caption         =   "Yes"
               Height          =   195
               Left            =   1680
               TabIndex        =   40
               Top             =   0
               Width           =   855
            End
            Begin VB.Label Lbl_vis5 
               BackStyle       =   0  'Transparent
               Height          =   255
               Left            =   0
               TabIndex        =   42
               Top             =   0
               Width           =   1335
            End
         End
         Begin VB.Frame fra_Visible6 
            BorderStyle     =   0  'None
            Height          =   300
            Left            =   240
            TabIndex        =   35
            Top             =   2700
            Width           =   4200
            Begin VB.OptionButton Opt_6n 
               Caption         =   "No"
               Height          =   195
               Left            =   2880
               TabIndex        =   37
               Top             =   0
               Width           =   855
            End
            Begin VB.OptionButton Opt_6y 
               Caption         =   "Yes"
               Height          =   195
               Left            =   1680
               TabIndex        =   36
               Top             =   0
               Width           =   855
            End
            Begin VB.Label Lbl_vis6 
               BackStyle       =   0  'Transparent
               Height          =   255
               Left            =   0
               TabIndex        =   38
               Top             =   0
               Width           =   1335
            End
         End
         Begin VB.Frame fra_Visible7 
            BorderStyle     =   0  'None
            Height          =   300
            Left            =   240
            TabIndex        =   31
            Top             =   3120
            Width           =   4200
            Begin VB.OptionButton Opt_7n 
               Caption         =   "No"
               Height          =   195
               Left            =   2880
               TabIndex        =   33
               Top             =   0
               Width           =   855
            End
            Begin VB.OptionButton Opt_7y 
               Caption         =   "Yes"
               Height          =   195
               Left            =   1680
               TabIndex        =   32
               Top             =   0
               Width           =   855
            End
            Begin VB.Label Lbl_vis7 
               BackStyle       =   0  'Transparent
               Height          =   255
               Left            =   0
               TabIndex        =   34
               Top             =   0
               Width           =   1335
            End
         End
         Begin VB.Frame fra_Visible2 
            BorderStyle     =   0  'None
            Height          =   300
            Left            =   240
            TabIndex        =   27
            Top             =   1100
            Width           =   4200
            Begin VB.OptionButton Opt_2y 
               Caption         =   "Yes"
               Height          =   195
               Left            =   1680
               TabIndex        =   29
               Top             =   0
               Width           =   855
            End
            Begin VB.OptionButton Opt_2n 
               Caption         =   "No"
               Height          =   195
               Left            =   2880
               TabIndex        =   28
               Top             =   0
               Width           =   855
            End
            Begin VB.Label Lbl_vis2 
               BackStyle       =   0  'Transparent
               Height          =   255
               Left            =   0
               TabIndex        =   30
               Top             =   0
               Width           =   1335
            End
         End
         Begin VB.Label Lbl_vis_on 
            BackStyle       =   0  'Transparent
            Caption         =   "Visible on :"
            Height          =   255
            Left            =   240
            TabIndex        =   55
            Top             =   240
            Width           =   2415
         End
      End
      Begin VB.Label lbl_Language 
         Caption         =   "Language :"
         Height          =   255
         Left            =   135
         TabIndex        =   84
         Top             =   210
         Width           =   2055
      End
      Begin VB.Label lbl_Title 
         Caption         =   "Title :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   135
         TabIndex        =   83
         Top             =   4050
         Width           =   2055
      End
      Begin VB.Label Lbl_qons 
         Caption         =   "Quality on screen :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   135
         TabIndex        =   82
         Top             =   2610
         Visible         =   0   'False
         Width           =   2055
      End
      Begin VB.Label Lbl_def 
         Caption         =   "Definition :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   135
         TabIndex        =   81
         Top             =   2130
         Visible         =   0   'False
         Width           =   2055
      End
      Begin VB.Label Lbl_width 
         Caption         =   "Width (in mm) :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   135
         TabIndex        =   80
         Top             =   1650
         Visible         =   0   'False
         Width           =   2055
      End
      Begin VB.Label Lbl_height 
         Caption         =   "Height (in mm) :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   135
         TabIndex        =   79
         Top             =   1170
         Visible         =   0   'False
         Width           =   2055
      End
      Begin VB.Label Lbl_ext 
         Caption         =   "Extension :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   135
         TabIndex        =   78
         Top             =   690
         Width           =   2055
      End
      Begin VB.Label lbl_TitleLanguage 
         Caption         =   "Language :"
         Height          =   255
         Left            =   135
         TabIndex        =   77
         Top             =   3570
         Width           =   2055
      End
      Begin VB.Label lbl_Int 
         Caption         =   "Internet flag"
         Height          =   255
         Left            =   135
         TabIndex        =   76
         Top             =   5010
         Width           =   1455
      End
      Begin VB.Label lbl_IntTitle 
         Caption         =   "Internet title :"
         Height          =   255
         Left            =   135
         TabIndex        =   75
         Top             =   4530
         Width           =   2055
      End
      Begin VB.Label lbl_Country 
         Caption         =   "Country :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4875
         TabIndex        =   74
         Top             =   4530
         Width           =   2055
      End
      Begin VB.Label lbl_Interest 
         Caption         =   "Media interest :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4875
         TabIndex        =   73
         Top             =   5010
         Width           =   2055
      End
   End
   Begin VB.CommandButton cmd_highDefSource 
      Caption         =   "..."
      Height          =   255
      Left            =   8640
      Style           =   1  'Graphical
      TabIndex        =   18
      Top             =   6870
      Width           =   495
   End
   Begin VB.CommandButton cmd_originalfile 
      Caption         =   "..."
      Height          =   255
      Left            =   8640
      Style           =   1  'Graphical
      TabIndex        =   17
      Top             =   6570
      Width           =   495
   End
   Begin VB.CommandButton cmd_Quit 
      Height          =   615
      Left            =   10980
      Style           =   1  'Graphical
      TabIndex        =   16
      Top             =   9195
      Width           =   675
   End
   Begin VB.CommandButton cmd_Save 
      Height          =   615
      Left            =   10260
      Style           =   1  'Graphical
      TabIndex        =   15
      Top             =   9195
      Width           =   675
   End
   Begin VB.CommandButton cmd_Memo 
      Height          =   615
      Left            =   9540
      Style           =   1  'Graphical
      TabIndex        =   14
      Top             =   9195
      Width           =   675
   End
   Begin VB.CommandButton cmd_File 
      Height          =   615
      Left            =   8820
      Style           =   1  'Graphical
      TabIndex        =   13
      Top             =   9195
      Width           =   675
   End
   Begin VB.CommandButton cmd_Move 
      Height          =   615
      Left            =   8100
      Style           =   1  'Graphical
      TabIndex        =   12
      Top             =   9195
      Width           =   675
   End
   Begin VB.CommandButton cmd_Visu 
      Height          =   615
      Left            =   7380
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   9195
      Width           =   675
   End
   Begin MSComDlg.CommonDialog dlg_open 
      Left            =   6420
      Top             =   9360
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.TextBox txt_highdefsource 
      Height          =   285
      Left            =   2280
      Locked          =   -1  'True
      TabIndex        =   7
      Top             =   6870
      Width           =   6255
   End
   Begin VB.TextBox txt_originalfile 
      Height          =   285
      Left            =   2280
      Locked          =   -1  'True
      TabIndex        =   5
      Top             =   6570
      Width           =   6255
   End
   Begin MSComctlLib.ImageList img_pictList 
      Left            =   5685
      Top             =   9285
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      MaskColor       =   8388736
      _Version        =   393216
   End
   Begin Project1.ArmCombobox cbo_MedType 
      Height          =   345
      Left            =   2415
      TabIndex        =   117
      Tag             =   "cbo_ObjectLangauge"
      Top             =   105
      Width           =   4890
      _ExtentX        =   8625
      _ExtentY        =   609
   End
   Begin VB.Label lbl_Label 
      Caption         =   "#Object ID"
      Height          =   255
      Index           =   0
      Left            =   7620
      TabIndex        =   88
      Tag             =   "lbl_ObjectID"
      Top             =   150
      Width           =   2175
   End
   Begin VB.Label Lbl_med_type 
      Caption         =   "Media type :"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   75
      TabIndex        =   85
      Top             =   180
      Width           =   2175
   End
   Begin VB.Label lbl_HiResH 
      Height          =   345
      Left            =   855
      TabIndex        =   20
      Top             =   8700
      Width           =   10785
   End
   Begin VB.Label lbl_HiRes 
      Caption         =   "Hires:"
      Height          =   255
      Left            =   120
      TabIndex        =   19
      Top             =   8685
      Width           =   615
   End
   Begin VB.Label lbl_Files 
      Caption         =   "_____________________ files ____________________"
      Height          =   255
      Left            =   795
      TabIndex        =   10
      Top             =   7155
      Width           =   4095
   End
   Begin VB.Label lbl_ThumbNail 
      Caption         =   "Thumb.:"
      Height          =   255
      Left            =   120
      TabIndex        =   9
      Top             =   8325
      Width           =   615
   End
   Begin VB.Label lbl_ThumbnailF 
      Height          =   345
      Left            =   855
      TabIndex        =   8
      Top             =   8340
      Width           =   10785
   End
   Begin VB.Label Label2 
      Caption         =   "High def. Source :"
      Height          =   255
      Left            =   120
      TabIndex        =   6
      Top             =   6870
      Width           =   1575
   End
   Begin VB.Label Label1 
      Caption         =   "Original file :"
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   6570
      Width           =   1455
   End
   Begin VB.Label lbl_PreviewF 
      Height          =   345
      Left            =   855
      TabIndex        =   3
      Top             =   7980
      Width           =   10785
   End
   Begin VB.Label lbl_FullF 
      Height          =   345
      Left            =   855
      TabIndex        =   2
      Top             =   7605
      Width           =   10785
   End
   Begin VB.Label lbl_Full 
      Caption         =   "Full:"
      Height          =   255
      Left            =   120
      TabIndex        =   1
      Top             =   7605
      Width           =   615
   End
   Begin VB.Label lbl_Preview 
      Caption         =   "Preview:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   7980
      Width           =   615
   End
End
Attribute VB_Name = "frm_techinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim ms_Code As String
Dim mi_iConc As Integer
Dim ms_Vo() As String
Dim ms_Title() As String
Dim ms_IntTitle() As String
Dim ms_AdjustTitle As String
Dim mb_Def() As Boolean
Dim mb_Preview() As Boolean
Dim mb_Quality() As Boolean
Dim ms_Default() As String
Dim mb_Loading As Boolean
Dim mb_Change As Boolean

Dim ms_RealPath As String
Dim ms_UserPath As String

Private Const SEP = "ой"                  'standard armstrong separator
Private Const FForm = "Frm_Techinfo: "
Private Const C_NOROW = "No row affected."
Dim mNumber As Long
Dim mSource As String
Private ms_Server As String
'name of database to connect
Private ms_Db As String
'user name when opening connection to sql server
Private ms_User As String
'user passwrod
Private ms_Pwd As String
'application name displayed in connection row in sql server manager
Private ms_App As String

Private mo_Tools As DPC_Tools
Private ma_RefLanguage() As MediaRefLanguage
Private mb_InternalChange As Boolean
Private ms_Language_Code As String
Private ms_Login_Name As String

Dim mBlob() As MediaBlob
Private Type MediaBlob
    MD_Code As String
    NewZip As Long
    OldZip As Long
    MD_Type As String
    SrcSize As Long
    CprSize As Long
    CprName As String
    MD_File As String
    FileName As String
End Type

Private Type MediaRefLanguage
  MAL_Lang  As Long
  MAL_Desc  As String
  MAL_InternetDesc1 As String
  MAL_InternetURL1  As String
  MAL_InternetDesc2 As String
  MAL_InternetURL2  As String
  MAL_VersionDesc As String
  
  Changed As Boolean
  RecordExists As Boolean
End Type

Private Function MoveUpd() As Boolean
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ll_lngrows As Long

On Error GoTo Err_MoveUpd

MoveUpd = False
mNumber = C_ERRORRAISE + 157
mSource = FForm & "MoveUpd/ "

ls_req = "EXEC media_upd3 '" & QuoteParam(gs_MediaCode) & "'," & gut_Param.Str14 & "," & gut_Param.Str20

If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQLRowCount(ll_Statement, ll_lngrows)
    If ll_lngrows = 0 Then
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        Err.Raise mNumber, mSource, C_NOROW
    End If
    MoveUpd = OK
Else
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Err.Raise mNumber, mSource, ls_req
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Function


Err_MoveUpd:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
End Function

Private Sub init_Visible_On()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Code As String
Dim ls_Desc As String
ReDim ms_Vo(1, 0)
Dim li_NbVo As Integer

ls_req = "EXEC Media_Displays_t_lst '" & QuoteParam(gut_LangLogin.Code) & "'"

On Error GoTo suite

If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If

Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Code = ODBCData(ll_Statement, 1)
        ls_Desc = ODBCData(ll_Statement, 2)
        Select Case li_NbVo
            Case 0: frm_techinfo.Lbl_vis1.Caption = ls_Desc
                fra_Visible1.Visible = True
            Case 1: frm_techinfo.Lbl_vis2.Caption = ls_Desc
                fra_Visible2.Visible = True
            Case 2: frm_techinfo.Lbl_vis3.Caption = ls_Desc
                fra_Visible3.Visible = True
            Case 3: frm_techinfo.Lbl_vis4.Caption = ls_Desc
                fra_Visible4.Visible = True
            Case 4: frm_techinfo.Lbl_vis5.Caption = ls_Desc
                 fra_Visible5.Visible = True
           Case 5: frm_techinfo.Lbl_vis6.Caption = ls_Desc
                 fra_Visible6.Visible = True
           Case 6: frm_techinfo.Lbl_vis7.Caption = ls_Desc
                fra_Visible7.Visible = True
        End Select
        li_NbVo = li_NbVo + 1
        ReDim Preserve ms_Vo(1, li_NbVo)
        ms_Vo(0, li_NbVo - 1) = ls_Code
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

suite:
    StdError
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
End Sub

Private Function Control() As Boolean
Dim i As Integer
Dim mb_One As Boolean
Dim la_MediaRefLang As MediaRefLanguage

Control = KO
mb_One = KO

If cbo_MedType.SelectedItem Is Nothing Then
    SendMessage 73, "You must fill every field", gut_LangLogin.Code
    cbo_MedType.SetFocus
    MouseOn
    Exit Function
End If

If mo_Tools.GetComboKey(cbo_MedType) = "M009" Then
  If (cbo_Extension.SelectedItem Is Nothing) Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_Extension.SetFocus
      MouseOn
      Exit Function
  End If
  
  If (cbo_CADType.SelectedItem Is Nothing) Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_CADType.SetFocus
      MouseOn
      Exit Function
  End If
  
  If (cbo_ObjectLangauge.SelectedItem Is Nothing) Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_ObjectLangauge.SetFocus
      MouseOn
      Exit Function
  End If
  
  If txt_Version.Visible And txt_Version.Text = "" Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      txt_Version.SetFocus
      MouseOn
      Exit Function
  End If

  If (cbo_Author.SelectedItem Is Nothing) Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_Author.SetFocus
      MouseOn
      Exit Function
  End If

  If (cbo_Owner.SelectedItem Is Nothing) Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_Owner.SetFocus
      MouseOn
      Exit Function
  End If

  For i = 0 To UBound(ma_RefLanguage)
    la_MediaRefLang = ma_RefLanguage(i)
    If la_MediaRefLang.MAL_Lang = 2 And ((la_MediaRefLang.MAL_Desc = "") Or (la_MediaRefLang.MAL_InternetDesc1 = "")) Then
        SendMessage 74, "You must fill the English title", gut_LangLogin.Code
        MouseOn
        Exit Function
    End If
  
    If (((la_MediaRefLang.MAL_Desc <> "") Or _
        (la_MediaRefLang.MAL_InternetDesc1 <> "") Or _
        (la_MediaRefLang.MAL_InternetURL1 <> "") Or _
        (la_MediaRefLang.MAL_InternetDesc2 <> "") Or _
        (la_MediaRefLang.MAL_InternetURL2 <> "") Or _
        (la_MediaRefLang.MAL_VersionDesc <> "")) And _
        ((la_MediaRefLang.MAL_Desc = "") Or _
        (la_MediaRefLang.MAL_InternetDesc1 = ""))) Then
        SendMessage 74, "You must fill every field", gut_LangLogin.Code
        mb_InternalChange = True
        Call ShowRefLanguage(la_MediaRefLang.MAL_Lang)
        mb_InternalChange = False
        MouseOn
        Exit Function
    End If
  Next i

Else
  If (cbo_Ext.Text = "") Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_Ext.SetFocus
      MouseOn
      Exit Function
  End If

  If cbo_Country = "" Then
    SendMessage 73, "You must fill every field", gut_LangLogin.Code
    cbo_Country.SetFocus
    MouseOn
    Exit Function
  End If

  If cbo_Interest = "" Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_Interest.SetFocus
      MouseOn
      Exit Function
  End If

  If txt_Height.Visible And txt_Height = "" Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      txt_Height.SetFocus
      MouseOn
      Exit Function
  End If
  If txt_Width.Visible And txt_Width = "" Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      txt_Width.SetFocus
      MouseOn
      Exit Function
  End If
  If cbo_Def.Visible And cbo_Def = "" Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_Def.SetFocus
      MouseOn
      Exit Function
  End If
  If cbo_Qons.Visible And cbo_Qons = "" Then
      SendMessage 73, "You must fill every field", gut_LangLogin.Code
      cbo_Qons.SetFocus
      MouseOn
      Exit Function
  End If
  
  For i = 0 To UBound(ms_Title, 2) - 1
      If ms_Title(0, i) = "E" And ms_Title(1, i) = "" Then
          SendMessage 74, "You must fill the English title", gut_LangLogin.Code
          MouseOn
          Exit Function
      End If
  '    If ms_Title(0, i) = csp_Language.ListTabText(csp_Language.ListIndex, 1) And ms_Title(1, i) = "" Then
      If ms_Title(0, i) = GetTagValue(lvw_Language.SelectedItem, 0) And ms_Title(1, i) = "" Then
          SendMessage 80, "No document title in the document's Language, you may want to enter one", gut_LangLogin.Code
          mb_One = OK
          MouseOn
      End If
  Next i

  For i = 0 To UBound(ms_IntTitle, 2) - 1
      If ms_IntTitle(0, i) = "E" And ms_IntTitle(1, i) = "" Then
          SendMessage 74, "You must fill the English title", gut_LangLogin.Code
          MouseOn
          Exit Function
      End If
      If ms_IntTitle(0, i) = GetTagValue(lvw_Language.SelectedItem, 0) And ms_IntTitle(1, i) = "" And Not mb_One Then
          SendMessage 80, "No document title in the document's Language, you may want to enter one", gut_LangLogin.Code
          MouseOn
      End If
  Next i
End If


    

Control = OK

End Function


Private Sub get_sc_csts()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Field, ls_Text As String
   
On Error GoTo suite

ls_req = "EXEC Screen_Csts 'tech_info','" & QuoteParam(gut_LangLogin.Code) & "'"

If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If

Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Field = ODBCData(ll_Statement, 1)
        ls_Text = ODBCData(ll_Statement, 2)
        Select Case ls_Field
            Case "title": Caption = ls_Text
            Case "def": Lbl_def = ls_Text
            Case "File_Ext": Lbl_ext = ls_Text
            Case "lbl_title": lbl_Title = ls_Text
            Case "lbl_inttitle": lbl_IntTitle = ls_Text
            Case "quality": Lbl_qons = ls_Text
            Case "view_h": Lbl_height = ls_Text
            Case "view_w": Lbl_width = ls_Text
            Case "visible": Lbl_vis_on = ls_Text
            Case "lbl_mt": Lbl_med_type = ls_Text
            Case "lbl_lang": lbl_Language = ls_Text
            Case "lbl_lang2": lbl_TitleLanguage = ls_Text
            Case "lbl_int": lbl_Int = ls_Text
            Case "advert_msg": ms_AdjustTitle = ls_Text
            Case "lbl_preview": lbl_Preview = ls_Text
            Case "lbl_full": lbl_Full = ls_Text
            Case "lbl_country": lbl_Country = ls_Text
            Case "lbl_interest": lbl_Interest = ls_Text
            Case "lbl_Thumbnail": lbl_ThumbNail = ls_Text       ' JN bugfix
            Case "lbl_HiRes": lbl_HiRes = ls_Text               ' JN taks810
        End Select
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

suite:
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
StdError
End Sub

Private Sub GetExtension()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
ReDim mb_Def(0) As Boolean
ReDim mb_Quality(0) As Boolean
ReDim mb_Preview(0) As Boolean
ReDim ms_Default(5, 0) As String

On Error GoTo suite

ls_req = "EXEC media_File_Ext_cbo"

If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If

cbo_Ext.Clear
cbo_ExtCode.Clear
Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        cbo_ExtCode.AddItem ODBCData(ll_Statement, 1)
        cbo_Ext.AddItem ODBCData(ll_Statement, 2)
        If ODBCData(ll_Statement, 3) = "X" Then
            mb_Def(UBound(mb_Def)) = OK
        Else
            mb_Def(UBound(mb_Def)) = KO
        End If
        If ODBCData(ll_Statement, 4) = "X" Then
            mb_Preview(UBound(mb_Preview)) = OK
        Else
            mb_Preview(UBound(mb_Preview)) = KO
        End If
        If ODBCData(ll_Statement, 5) = "X" Then
            mb_Quality(UBound(mb_Quality)) = OK
        Else
            mb_Quality(UBound(mb_Quality)) = KO
        End If
        ms_Default(0, UBound(ms_Default, 2)) = ODBCData(ll_Statement, 6)
        ms_Default(1, UBound(ms_Default, 2)) = ODBCData(ll_Statement, 7)
        ms_Default(2, UBound(ms_Default, 2)) = ODBCData(ll_Statement, 8)
        ms_Default(3, UBound(ms_Default, 2)) = ODBCData(ll_Statement, 9)
        ms_Default(4, UBound(ms_Default, 2)) = ODBCData(ll_Statement, 10)
        ms_Default(5, UBound(ms_Default, 2)) = ODBCData(ll_Statement, 11)
        ReDim Preserve mb_Def(UBound(mb_Def) + 1)
        ReDim Preserve mb_Preview(UBound(mb_Preview) + 1)
        ReDim Preserve mb_Quality(UBound(mb_Quality) + 1)
        ReDim Preserve ms_Default(5, UBound(ms_Default, 2) + 1)
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

suite:
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
StdError
End Sub

Private Sub Init_Lang_For_Title()
Dim i As Integer
ReDim ms_Title(1, 0) As String
ReDim ms_IntTitle(1, 0) As String

'While i < csp_TitleLanguage.ListCount
While i < lvw_TitleLanguage.ListItems.Count
    ReDim Preserve ms_Title(1, i + 1)
    ms_Title(0, i) = GetTagValue(lvw_TitleLanguage.ListItems(i + 1), 0)
    ms_Title(1, i) = ""
    ReDim Preserve ms_IntTitle(1, i + 1)
'    ms_IntTitle(0, i) = csp_TitleLanguage.ListTabText(i, 1)
    ms_IntTitle(0, i) = GetTagValue(lvw_TitleLanguage.ListItems(i + 1), 0)
    ms_IntTitle(1, i) = ""
    i = i + 1
Wend
End Sub

Private Sub init_media_mtnc()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim i As Integer

On Error GoTo suite

txt_Height.Text = ""
txt_Height.Visible = 0
txt_Width.Text = ""
txt_Width.Visible = 0
cbo_Ext.ListIndex = -1
cbo_Def.ListIndex = -1
cbo_Def.Visible = 0
cbo_Qons.ListIndex = -1

'cbo_MedType.ListIndex = -1
cbo_Country.ListIndex = -1
cbo_Interest.ListIndex = -1

Opt_1n.Value = -1
Opt_2n.Value = -1
Opt_3n.Value = -1
Opt_4n.Value = -1
Opt_5n.Value = -1
Opt_6n.Value = -1
Opt_7n.Value = -1
'debug.assert (lvw_Language.ListItems.Count > 0)
'csp_Language.ListIndex = 0
Set lvw_Language.SelectedItem = lvw_Language.ListItems(0)
'debug.assert (lvw_TitleLanguage.ListItems.Count > 0)
Set lvw_TitleLanguage.SelectedItem = lvw_TitleLanguage.ListItems(0)
txt_Title.Text = ""
txt_IntTitle.Text = ""
Exit Sub

suite:
End Sub

Private Sub SaveRefLanguage()
Dim ll_idx As Long
Dim ls_req As String

For ll_idx = 0 To UBound(ma_RefLanguage)
  If ma_RefLanguage(ll_idx).Changed Then
    If ma_RefLanguage(ll_idx).RecordExists Then
      ls_req = "media_reflanguage_upd $MD_Code$, $MAL_Lang$, $MAL_Desc$, $MAL_InternetDesc1$, $MAL_InternetURL1$, $MAL_InternetDesc2$, $MAL_InternetURL2$, $MAL_VersionDesc$, $U_Code$"
    Else
      ls_req = "media_reflanguage_ins $MD_Code$, $MAL_Lang$, $MAL_Desc$, $MAL_InternetDesc1$, $MAL_InternetURL1$, $MAL_InternetDesc2$, $MAL_InternetURL2$, $MAL_VersionDesc$, $U_Code$"
    End If
    ls_req = Replace(ls_req, "$MD_Code$", mo_Tools.SqlStrKey(gs_MediaCode), , , vbTextCompare)
    ls_req = Replace(ls_req, "$MAL_Lang$", mo_Tools.SqlIntKey(ma_RefLanguage(ll_idx).MAL_Lang), , , vbTextCompare)
    ls_req = Replace(ls_req, "$MAL_Desc$", mo_Tools.SqlStr(ma_RefLanguage(ll_idx).MAL_Desc), , , vbTextCompare)
    ls_req = Replace(ls_req, "$MAL_InternetDesc1$", mo_Tools.SqlStr(ma_RefLanguage(ll_idx).MAL_InternetDesc1), , , vbTextCompare)
    ls_req = Replace(ls_req, "$MAL_InternetURL1$", mo_Tools.SqlStr(ma_RefLanguage(ll_idx).MAL_InternetURL1), , , vbTextCompare)
    ls_req = Replace(ls_req, "$MAL_InternetDesc2$", mo_Tools.SqlStr(ma_RefLanguage(ll_idx).MAL_InternetDesc2), , , vbTextCompare)
    ls_req = Replace(ls_req, "$MAL_InternetURL2$", mo_Tools.SqlStr(ma_RefLanguage(ll_idx).MAL_InternetURL2), , , vbTextCompare)
    ls_req = Replace(ls_req, "$MAL_VersionDesc$", mo_Tools.SqlStr(ma_RefLanguage(ll_idx).MAL_VersionDesc), , , vbTextCompare)
    ls_req = Replace(ls_req, "$U_Code$", mo_Tools.SqlInt(0), , , vbTextCompare)
    Call mo_Tools.ExecuteSQLSafe(aDb, ls_req)
  End If
Next

End Sub

Private Function Insert_Media() As Boolean
Dim lReq As String, lIntFlag As String, lCursor As Long
Const C_REQ = "EXEC media_ins '$lang$','0','$height$','$width$','$def$',$qons$,$type$,$ext$,$country$,$interest$,'$int$','$origin$','$hdorigin$', $MD_Author$, $MD_Owner$, $MD_Version$, $MD_DocRefLang$, $MD_CADType$"
On Error GoTo Err_Insert_Media

Insert_Media = False
mSource = FForm & "Insert_Media/ "

lReq = C_REQ

lReq = Replace(lReq, "$lang$", QuoteParam(GetTagValue(lvw_Language.SelectedItem, 0)), , , vbTextCompare)
lReq = Replace(lReq, "$qons$", mo_Tools.SqlStrKey(cbo_QonsCode.List(cbo_Qons.ListIndex)), , , vbTextCompare)
lReq = Replace(lReq, "$type$", mo_Tools.SqlStrKey(mo_Tools.GetComboKey(cbo_MedType)), , , vbTextCompare)
If mo_Tools.GetComboKey(cbo_MedType) = "M009" Then
  lReq = Replace(lReq, "$ext$", mo_Tools.SqlStrKey(mo_Tools.GetComboKey(cbo_Extension)), , , vbTextCompare)
Else
  lReq = Replace(lReq, "$ext$", mo_Tools.SqlStrKey(cbo_ExtCode.List(cbo_Ext.ListIndex)), , , vbTextCompare)
End If
lReq = Replace(lReq, "$country$", mo_Tools.SqlStrKey(cbo_CountryCode.List(cbo_Country.ListIndex)), , , vbTextCompare)
lReq = Replace(lReq, "$interest$", mo_Tools.SqlStrKey(cbo_InterestCode.List(cbo_Interest.ListIndex)), , , vbTextCompare)
lReq = Replace(lReq, "$origin$", QuoteParam(txt_originalfile), , , vbTextCompare)
lReq = Replace(lReq, "$hdorigin$", QuoteParam(txt_highdefsource), , , vbTextCompare)

lReq = Replace(lReq, "$MD_Author$", mo_Tools.SqlIntKey(mo_Tools.GetComboKey(cbo_Author)), , , vbTextCompare)
lReq = Replace(lReq, "$MD_Owner$", mo_Tools.SqlIntKey(mo_Tools.GetComboKey(cbo_Owner)), , , vbTextCompare)
lReq = Replace(lReq, "$MD_Version$", mo_Tools.SqlInt(txt_Version.Text), , , vbTextCompare)
lReq = Replace(lReq, "$MD_DocRefLang$", mo_Tools.SqlIntKey(mo_Tools.GetComboKey(cbo_ObjectLangauge)), , , vbTextCompare)
lReq = Replace(lReq, "$MD_CADType$", mo_Tools.SqlIntKey(mo_Tools.GetComboKey(cbo_CADType)), , , vbTextCompare)


If chk_Int.Value = 1 Then lIntFlag = "X"
lReq = Replace(lReq, "$int$", lIntFlag, , , vbTextCompare)

If cbo_Def.ListIndex <> -1 Then
    lReq = Replace(lReq, "$height$", QuoteParam(txt_Height), , , vbTextCompare)
    lReq = Replace(lReq, "$width$", QuoteParam(txt_Width), , , vbTextCompare)
    lReq = Replace(lReq, "$def$", QuoteParam(cbo_DefCode.List(cbo_Def.ListIndex)), , , vbTextCompare)
Else
    lReq = Replace(lReq, "$height$", "", , , vbTextCompare)
    lReq = Replace(lReq, "$width$", "", , , vbTextCompare)
    lReq = Replace(lReq, "$def$", "", , , vbTextCompare)
End If

lCursor = aDb.OpenSQL(lReq, -1, 0)
If lCursor <= 0 Then
    Err.Raise mNumber, mSource, lReq
End If

ms_Code = aDb.GetFields(lCursor, 0)
If ms_Code <> "" Then
    gs_MediaCode = ms_Code
    Insert_Media = True
End If

aDb.Close lCursor
Exit Function

Err_Insert_Media:
    UploadSQLError aDb, adb_err, mSource & lReq
End Function

Private Function Update_media() As Boolean
Dim lReq As String, lIntFlag As String
Const C_REQ = "EXEC media_upd '$code$', '$lang$', '$height$', '$width$', '$def$', $qons$, $type$, $ext$, $country$, $interest$, '$int$', $conc$, '$Origin$', '$HDOrigin$', $MD_Author$, $MD_Owner$, $MD_Version$, $MD_DocRefLang$, $MD_CADType$"

On Error GoTo Err_UpdMedia

Update_media = False

mSource = FForm & "Update_media/ "

lReq = C_REQ
lReq = Replace(lReq, "$code$", QuoteParam(gs_MediaCode), , , vbTextCompare)
lReq = Replace(lReq, "$lang$", QuoteParam(GetTagValue(lvw_Language.SelectedItem, 0)), , , vbTextCompare)
lReq = Replace(lReq, "$qons$", mo_Tools.SqlStrKey(cbo_QonsCode.List(cbo_Qons.ListIndex)), , , vbTextCompare)
lReq = Replace(lReq, "$type$", mo_Tools.SqlStrKey(mo_Tools.GetComboKey(cbo_MedType)), , , vbTextCompare)
If mo_Tools.GetComboKey(cbo_MedType) = "M009" Then
  lReq = Replace(lReq, "$ext$", mo_Tools.SqlStrKey(mo_Tools.GetComboKey(cbo_Extension)), , , vbTextCompare)
Else
  lReq = Replace(lReq, "$ext$", mo_Tools.SqlStrKey(cbo_ExtCode.List(cbo_Ext.ListIndex)), , , vbTextCompare)
End If
lReq = Replace(lReq, "$country$", mo_Tools.SqlStrKey(cbo_CountryCode.List(cbo_Country.ListIndex)), , , vbTextCompare)
lReq = Replace(lReq, "$interest$", mo_Tools.SqlStrKey(cbo_InterestCode.List(cbo_Interest.ListIndex)), , , vbTextCompare)
lReq = Replace(lReq, "$conc$", mi_iConc, , , vbTextCompare)
lReq = Replace(lReq, "$Origin$", QuoteParam(txt_originalfile), , , vbTextCompare)
lReq = Replace(lReq, "$HDOrigin$", QuoteParam(txt_highdefsource), , , vbTextCompare)


lReq = Replace(lReq, "$MD_Author$", mo_Tools.SqlInt(mo_Tools.GetComboKey(cbo_Author)), , , vbTextCompare)
lReq = Replace(lReq, "$MD_Owner$", mo_Tools.SqlInt(mo_Tools.GetComboKey(cbo_Owner)), , , vbTextCompare)
lReq = Replace(lReq, "$MD_Version$", mo_Tools.SqlInt(txt_Version.Text), , , vbTextCompare)
lReq = Replace(lReq, "$MD_DocRefLang$", mo_Tools.SqlInt(mo_Tools.GetComboKey(cbo_ObjectLangauge)), , , vbTextCompare)
lReq = Replace(lReq, "$MD_CADType$", mo_Tools.SqlInt(mo_Tools.GetComboKey(cbo_CADType)), , , vbTextCompare)

If chk_Int.Value = 1 Then lIntFlag = "X"
lReq = Replace(lReq, "$int$", lIntFlag, , , vbTextCompare)

If cbo_Def.ListIndex <> -1 Then
    lReq = Replace(lReq, "$height$", QuoteParam(txt_Height), , , vbTextCompare)
    lReq = Replace(lReq, "$width$", QuoteParam(txt_Width), , , vbTextCompare)
    lReq = Replace(lReq, "$def$", QuoteParam(cbo_DefCode.List(cbo_Def.ListIndex)), , , vbTextCompare)
Else
    'lReq = "','','','','"
    lReq = Replace(lReq, "$height$", "", , , vbTextCompare)
    lReq = Replace(lReq, "$width$", "", , , vbTextCompare)
    lReq = Replace(lReq, "$def$", "", , , vbTextCompare)
End If

If Not aDb.ExecuteSQL(lReq) Then
    Err.Raise mNumber, mSource, lReq
End If

If aDb.SQLRowsAffected <= 0 Then
    Err.Raise mNumber, mSource, C_NOROW
End If

Update_media = True
Exit Function

Err_UpdMedia:
    UploadSQLError aDb, adb_err, mSource & lReq
End Function

Private Function VisibleOn(ByVal aDeleteFirst As Boolean) As Boolean

On Error GoTo Err_LoopVisible

VisibleOn = False

mSource = FForm & "VisibleOn/ "

'Delete first in case of update
If aDeleteFirst Then
    If Not DBDel_MDCode("media_Visible_On_del", gs_MediaCode) Then Err.Raise mNumber, mSource, "Delete"
End If

If Opt_1y.Value = -1 Then
    If Not DBAdd_VisibleOn(gs_MediaCode, QuoteParam(ms_Vo(0, 0))) Then Err.Raise mNumber, mSource, "Add"
End If
If Opt_2y.Value = -1 Then
    If Not DBAdd_VisibleOn(gs_MediaCode, QuoteParam(ms_Vo(0, 1))) Then Err.Raise mNumber, mSource, "Add"
End If
If Opt_3y.Value = -1 Then
    If Not DBAdd_VisibleOn(gs_MediaCode, QuoteParam(ms_Vo(0, 2))) Then Err.Raise mNumber, mSource, "Add"
End If
If Opt_4y.Value = -1 Then
    If Not DBAdd_VisibleOn(gs_MediaCode, QuoteParam(ms_Vo(0, 3))) Then Err.Raise mNumber, mSource, "Add"
End If
If Opt_5y.Value = -1 Then
    If Not DBAdd_VisibleOn(gs_MediaCode, QuoteParam(ms_Vo(0, 4))) Then Err.Raise mNumber, mSource, "Add"
End If
If Opt_6y.Value = -1 Then
    If Not DBAdd_VisibleOn(gs_MediaCode, QuoteParam(ms_Vo(0, 5))) Then Err.Raise mNumber, mSource, "Add"
End If
If Opt_7y.Value = -1 Then
    If Not DBAdd_VisibleOn(gs_MediaCode, QuoteParam(ms_Vo(0, 6))) Then Err.Raise mNumber, mSource, "Add"
End If
    
VisibleOn = True
Exit Function

Err_LoopVisible:
    Err.Raise mNumber, mSource, "Loop visible on"
End Function

Private Function Titles(ByVal aDeleteFirst As Boolean) As Boolean

On Error GoTo Err_InsTitles

Titles = False
mSource = FForm & "Titles/ "

If aDeleteFirst Then
    If Not DBDel_MDCode("media_title_del", gs_MediaCode, False) Then Err.Raise mNumber, mSource, "Delete"
    If Not DBDel_MDCode("media_internet_title_del", gs_MediaCode, False) Then Err.Raise mNumber, mSource, "Delete"
End If

If Not DBAdd_Title(gs_MediaCode) Then Err.Raise mNumber, mSource, "Add Title"
If Not DBAdd_InternetTitle(gs_MediaCode) Then Err.Raise mNumber, mSource, "Add Internet_Title"

Titles = True
Exit Function

Err_InsTitles:
    Err.Raise mNumber, mSource
End Function

Private Sub Cbo_ext_Click()
MouseOff
cmd_File.Visible = KO
cmd_Move.Visible = KO
If Not mb_Loading Then
    mb_Change = OK
End If
If cbo_Ext.ListIndex <> -1 Then
    cbo_Def.Visible = mb_Def(cbo_Ext.ListIndex)
    txt_Height.Visible = mb_Def(cbo_Ext.ListIndex)
    txt_Width.Visible = mb_Def(cbo_Ext.ListIndex)
    cbo_Qons.Visible = mb_Quality(cbo_Ext.ListIndex)
    Lbl_def.Visible = mb_Def(cbo_Ext.ListIndex)
    Lbl_height.Visible = mb_Def(cbo_Ext.ListIndex)
    Lbl_width.Visible = mb_Def(cbo_Ext.ListIndex)
    Lbl_qons.Visible = mb_Quality(cbo_Ext.ListIndex)
    txt_Height.Text = ms_Default(0, cbo_Ext.ListIndex)
    txt_Width.Text = ms_Default(1, cbo_Ext.ListIndex)
    cbo_Def.ListIndex = ComboFindItem(cbo_DefCode, ms_Default(2, cbo_Ext.ListIndex))
    cbo_Qons.ListIndex = ComboFindItem(cbo_QonsCode, ms_Default(3, cbo_Ext.ListIndex))
    'cbo_MedType.ListIndex = ComboFindItem(cbo_MedTypeCode, ms_Default(4, cbo_Ext.ListIndex))
    cbo_Interest.ListIndex = ComboFindItem(cbo_InterestCode, ms_Default(5, cbo_Ext.ListIndex))
End If
MouseOn
End Sub
Private Sub fill_txt_title()
Dim i As Integer

i = 0
While ms_Title(0, i) <> GetTagValue(lvw_TitleLanguage.SelectedItem, 0)
    i = i + 1
Wend
txt_Title = ms_Title(1, i)
End Sub
Private Sub fill_txt_int_title()
Dim i As Integer

i = 0
While ms_IntTitle(0, i) <> GetTagValue(lvw_TitleLanguage.SelectedItem, 0)
    i = i + 1
Wend
txt_IntTitle = ms_IntTitle(1, i)
End Sub

Private Sub cbo_MedType_ComboItemSelected()
  
  fra_Other.Visible = False
  fra_CADObject.Visible = False
  If mo_Tools.GetComboKey(cbo_MedType) = "M009" Then
    fra_CADObject.Visible = True
    cmd_Save.Enabled = False
  Else
    fra_Other.Visible = True
    cmd_Save.Enabled = True
  End If

End Sub

Private Sub ShowRefLanguage(ByVal al_MAL_Code As Long)
Dim ll_idx As Long

  For ll_idx = 0 To UBound(ma_RefLanguage)
    If ma_RefLanguage(ll_idx).MAL_Lang = al_MAL_Code Then
      txt_ObjectDescription.Text = ma_RefLanguage(ll_idx).MAL_Desc
      txt_InternetDesc1.Text = ma_RefLanguage(ll_idx).MAL_InternetDesc1
      txt_InternetURL1.Text = ma_RefLanguage(ll_idx).MAL_InternetURL1
      txt_InternetDesc2.Text = ma_RefLanguage(ll_idx).MAL_InternetDesc2
      txt_InternetURL2.Text = ma_RefLanguage(ll_idx).MAL_InternetURL2
      txt_VersionDesc.Text = ma_RefLanguage(ll_idx).MAL_VersionDesc
      Exit Sub
    End If
  Next
  txt_ObjectDescription.Text = ""
  txt_InternetDesc1.Text = ""
  txt_InternetURL1.Text = ""
  txt_InternetDesc2.Text = ""
  txt_InternetURL2.Text = ""
  txt_VersionDesc.Text = ""
End Sub

Private Sub cbo_TextLanguage_ComboItemSelected()
  mb_InternalChange = True
  Call ShowRefLanguage(Val(mo_Tools.GetComboKey(cbo_TextLanguage)))
  mb_InternalChange = False
End Sub

Private Sub lvw_Language_Click()
pic_Language.Picture = img_pictList.ListImages(lvw_Language.SelectedItem.SmallIcon).Picture
'pic_Language.Picture = LoadResPicture(CInt(csp_Language.ListTabText(csp_Language.ListIndex, 3)), 1)
frm_Language.Visible = KO
End Sub

Private Sub lvw_Language_LostFocus()
frm_TitleLanguage.Visible = KO
frm_Language.Visible = KO

End Sub

Private Sub lvw_TitleLanguage_Click()

MouseOff
If Not lvw_TitleLanguage.SelectedItem Is Nothing Then
    pic_TitleLanguage.Picture = img_pictList.ListImages(lvw_TitleLanguage.SelectedItem.SmallIcon).Picture
'    pic_TitleLanguage.Picture = LoadResPicture(CInt(csp_TitleLanguage.ListTabText(csp_TitleLanguage.ListIndex, 3)), 1)
    frm_TitleLanguage.Visible = KO
    fill_txt_title
    fill_txt_int_title
    frm_Language.Visible = KO
End If
MouseOn

End Sub

Private Sub lvw_TitleLanguage_LostFocus()
frm_TitleLanguage.Visible = KO

End Sub


Private Sub Form_Load()
Dim ls_UserPath As String
Dim ls_RealPath As String
Dim i As Integer

MouseOff
mb_InternalChange = True

If gl_CodePage <> 1252 And gl_CodePage <> 0 Then ChangeCharset Me

Set mo_Tools = New DPC_Tools
Set mo_Tools.ArmDb = aDb
Call mo_Tools.Load_A_Com
Call mo_Tools.Load_A_ComControls(Me.Controls, aDb, gut_LangLogin.Code)

ReDim ma_RefLanguage(-1 To -1)
ReDim mBlob(3)

mb_Loading = OK
gut_LangWork.Code = gut_LangLogin.Code
ms_Language_Code = gut_LangLogin.Code
ms_Login_Name = "MSEDLAK"
mb_Change = KO

cmd_Save.Picture = LoadResPicture(RES_OK, 1)
cmd_Quit.Picture = LoadResPicture(RES_QUIT, 1)
cmd_Memo.Picture = LoadResPicture(RES_MEMO, 1)
cmd_File.Picture = LoadResPicture(RES_FILEMANAGER, 1)
cmd_Move.Picture = LoadResPicture(RES_MOVEFILE, 1)
cmd_Visu.Picture = LoadResPicture(RES_MEDIA, 1)
pic_Language.Picture = LoadResPicture(RES_ENGLISH, 1)
pic_TitleLanguage.Picture = LoadResPicture(RES_ENGLISH, 1)

    ' NEW remove ListView begin
    Call InitImageList(img_pictList)
    Call InitListView(lvw_Language, img_pictList)
    Call InitListView(lvw_TitleLanguage, img_pictList)
    ' NEW remove ListView end
  fra_Other.Visible = False
  fra_CADObject.Visible = False

get_sc_csts

'Empty file names
lbl_PreviewF.Caption = ""
lbl_FullF.Caption = ""
lbl_ThumbnailF.Caption = ""
lbl_HiResH.Caption = ""         ' JN task810

FillCbo "Definition", cbo_DefCode, cbo_Def
FillCbo "Media_Quality_On_Screen", cbo_QonsCode, cbo_Qons
'FillCbo "Media_Type", cbo_MedTypeCode, cbo_MedType
FillCbo "Countries", cbo_CountryCode, cbo_Country
FillCbo "Media_Interest", cbo_InterestCode, cbo_Interest
GetExtension
init_Visible_On
'FillCspLanguage csp_Language
FillLvwLanguage lvw_Language
Set lvw_Language.SelectedItem = lvw_Language.ListItems(1)
'csp_Language.ListIndex = 0
'FillCspLanguage csp_TitleLanguage
FillLvwLanguage lvw_TitleLanguage
Set lvw_TitleLanguage.SelectedItem = lvw_TitleLanguage.ListItems(1)
'csp_TitleLanguage.ListIndex = 0
Init_Lang_For_Title
init_media_mtnc


Call mo_Tools.EnableControl(txt_ObjectID, False)
cbo_CADType.Request = "SELECT MST_Code, MST_Desc FROM media_subtype WHERE drop_flag=''"
cbo_ObjectLangauge.Request = "SELECT RF_Code, RF_Desc FROM A_References_ML WHERE GR_Code=3 AND Language_Code='" & gut_LangLogin.Code & "' AND Z_status=1"
cbo_TextLanguage.Request = "SELECT RF_Code, RF_Desc FROM A_References_ML WHERE GR_Code=3 AND Language_Code='" & gut_LangLogin.Code & "' AND Z_status=1"
cbo_Author.Request = "SELECT MA_Code, MA_Desc FROM media_authors WHERE Drop_Flag=''"
cbo_Owner.Request = "SELECT U_Code, U_Login_Name FROM GEN_Systems_Users WHERE ISNULL(U_Login_Name, '') <> '' AND Drop_Flag <> 'X' ORDER BY U_Login_Name"
cbo_Extension.Request = "SELECT FE.FE_Code, FE.FE_Desc FROM media_file_ext FE WHERE FE.MT_Code='M009'"
cbo_MedType.Request = "SELECT MT_Code, MT_Desc FROM media_type WHERE Language_Code='" & gut_LangLogin.Code & "'"

If gs_Action = "add" Then
    gut_Param.Str18 = ""
    gut_Param.Str19 = ""
    gut_Param.Str21 = ""
    gut_Param.Str22 = ""
    Call LoadRefLanguage("")
Else
    def_media_mtnc
'    csp_TitleLanguage_Click
    lvw_TitleLanguage_Click
    GetMediaInfo
    gut_Param.Str18 = ms_RealPath
    If mo_Tools.GetComboKey(cbo_MedType) = "M009" Then
      gut_Param.Str19 = cbo_Extension.Text
    Else
      gut_Param.Str19 = cbo_Ext
    End If
End If

If gs_Action = "del" Then
    init_media_supp
End If

If gs_Action = "moreinfo" Then
    init_media_supp
    pic_TitleLanguage.Enabled = OK
End If



'Manage buttons depending on action
cmd_Visu.Visible = False
cmd_Move.Visible = False
cmd_File.Visible = False
cmd_Memo.Visible = False
cmd_Save.Visible = False
cmd_Quit.Visible = True
Select Case gs_Action
Case "add"
    cmd_Save.Visible = True
Case "upd"
    cmd_Visu.Visible = True
    cmd_File.Visible = True
    cmd_Move.Visible = True
    cmd_Memo.Visible = True
    cmd_Save.Visible = True
Case "del"
    cmd_Save.Visible = True
Case "moreinfo"
    cmd_Visu.Visible = True
    cmd_Memo.Visible = True
End Select

mb_Loading = KO
mb_InternalChange = False
MouseOn

End Sub

Private Sub GetMediaInfo()
Dim ls_req As String
Dim ll_Statement As Long
Dim li_Status As Integer

ls_req = "EXEC Media_Path_sel '" & gs_MediaCode & " ', '" & gut_LangLogin.Code & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If
Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ms_UserPath = ODBCData(ll_Statement, 1)
        ms_RealPath = ODBCData(ll_Statement, 2)
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

suite:
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
StdError
End Sub

Private Sub init_media_supp()

pic_Language.Enabled = 0
txt_Height.Locked = -1
txt_Width.Locked = -1
cbo_Ext.Enabled = 0
cbo_Def.Enabled = 0
cbo_Qons.Enabled = 0
cbo_MedType.Enabled = 0
cbo_Country.Enabled = 0
cbo_Interest.Enabled = 0
pic_TitleLanguage.Enabled = 0
txt_Title.Locked = -1
txt_IntTitle.Locked = -1
chk_Int.Enabled = 0
txt_originalfile.Enabled = KO
txt_highdefsource.Enabled = KO

cmd_originalfile.Visible = KO
cmd_highDefSource.Visible = KO

Opt_1y.Enabled = 0
Opt_1n.Enabled = 0
Opt_2y.Enabled = 0
Opt_2n.Enabled = 0
Opt_3y.Enabled = 0
Opt_3n.Enabled = 0
Opt_4y.Enabled = 0
Opt_4n.Enabled = 0
Opt_5y.Enabled = 0
Opt_5n.Enabled = 0
Opt_6y.Enabled = 0
Opt_6n.Enabled = 0
Opt_7y.Enabled = 0
Opt_7n.Enabled = 0

End Sub

Private Sub LoadRefLanguage(ByVal as_MD_code As String)
Dim ls_req As String
Dim lc_Cursor As Long
Dim ll_idx As Long

  ls_req = "SELECT REF.RF_Code,MAL.* FROM A_References_ML REF LEFT JOIN media_reflanguage MAL ON (MAL.MD_Code=$MD_Code$ AND MAL.MAL_Lang=REF.RF_Code) WHERE REF.GR_Code=3 AND REF.Language_Code='E' ORDER BY REF.RF_Code"
  ls_req = Replace(ls_req, "$MD_Code$", mo_Tools.SqlStr(as_MD_code), , , vbTextCompare)
  lc_Cursor = aDb.OpenSQL(ls_req)
  
  If aDb.RowCount(lc_Cursor) > 0 Then
    ReDim ma_RefLanguage(aDb.RowCount(lc_Cursor) - 1)
  Else
    ReDim ma_RefLanguage(-1 To -1)
  End If
  
  ll_idx = 0
  While Not aDb.EOF(lc_Cursor)
    ma_RefLanguage(ll_idx).MAL_Lang = aDb.GetFields(lc_Cursor, "RF_Code")
    ma_RefLanguage(ll_idx).MAL_Desc = aDb.GetFields(lc_Cursor, "MAL_Desc")
    ma_RefLanguage(ll_idx).MAL_InternetDesc1 = aDb.GetFields(lc_Cursor, "MAL_InternetDesc1")
    ma_RefLanguage(ll_idx).MAL_InternetURL1 = aDb.GetFields(lc_Cursor, "MAL_InternetURL1")
    ma_RefLanguage(ll_idx).MAL_InternetDesc2 = aDb.GetFields(lc_Cursor, "MAL_InternetDesc2")
    ma_RefLanguage(ll_idx).MAL_InternetURL2 = aDb.GetFields(lc_Cursor, "MAL_InternetURL2")
    ma_RefLanguage(ll_idx).MAL_VersionDesc = aDb.GetFields(lc_Cursor, "MAL_VersionDesc")
    ma_RefLanguage(ll_idx).RecordExists = (aDb.GetFields(lc_Cursor, "MD_Code") <> "")
    ma_RefLanguage(ll_idx).Changed = False
    ll_idx = ll_idx + 1
    Call aDb.Next(lc_Cursor)
  Wend
  Call aDb.Close(lc_Cursor)
  
End Sub

Private Sub def_media_mtnc()

Dim ls_req As String
Dim lc_Cursor As Long
Dim ls_Text As String
Dim ls_Text2 As String
Dim ls_Def As String
Dim ls_Qons As String
Dim ls_Lang As String
Dim i As Integer
Dim ll_i As Long
Dim ll_Statement As Long
Dim li_Status As Integer

On Error GoTo suite

Call LoadRefLanguage(gs_MediaCode)
ls_req = "EXEC media_dtl '" & QuoteParam(gs_MediaCode) & "','" & gut_LangLogin.Code & "'"

lc_Cursor = aDb.OpenSQL(ls_req)
If aDb.RowCount(lc_Cursor) = 1 Then
    
    fra_CADObject.Visible = False
    fra_Other.Visible = False
    
    txt_ObjectID.Text = right(gs_MediaCode, Len(gs_MediaCode) - 1)
    Call cbo_MedType.AddItem(Array(aDb.GetFields(lc_Cursor, "MT_Code"), aDb.GetFields(lc_Cursor, "MT_Desc")), True)

    If aDb.GetFields(lc_Cursor, "MT_Code") = "M009" Then
      Call cbo_Author.AddItem(Array(aDb.GetFields(lc_Cursor, "MD_Author"), aDb.GetFields(lc_Cursor, "MD_AuthorDesc")), True)
      Call cbo_Owner.AddItem(Array(aDb.GetFields(lc_Cursor, "MD_Owner"), aDb.GetFields(lc_Cursor, "MD_OwnerDesc")), True)
      Call cbo_ObjectLangauge.AddItem(Array(aDb.GetFields(lc_Cursor, "MD_DocRefLang"), aDb.GetFields(lc_Cursor, "MD_DocRefLangDesc")), True)
      Call cbo_CADType.AddItem(Array(aDb.GetFields(lc_Cursor, "MD_CADType"), aDb.GetFields(lc_Cursor, "MD_CADTypeDesc")), True)
      Call cbo_Extension.AddItem(Array(aDb.GetFields(lc_Cursor, "FE_Code"), aDb.GetFields(lc_Cursor, "FE_Desc")), True)
      Call cbo_TextLanguage.AddItem(Array(aDb.GetFields(lc_Cursor, "MAL_Lang"), aDb.GetFields(lc_Cursor, "MAL_LangDesc")), True)
      txt_Version.Text = aDb.GetFields(lc_Cursor, "MD_Version")
      chk_InternetFlag.Value = IIf(aDb.GetFields(lc_Cursor, "internet_flag") = "X", vbChecked, vbUnchecked)
      Call ShowRefLanguage(aDb.GetFields(lc_Cursor, "MAL_Lang"))
      fra_CADObject.Visible = True
      cmd_Save.Enabled = False
    Else
      ls_Lang = aDb.GetFields(lc_Cursor, "MD_Language_Code")
      ll_i = 1
      
  '        csp_Language.ListIndex = 0
  '        While csp_Language.ListTabText(csp_Language.ListIndex, 1) <> ls_Lang
      While GetTagValue(lvw_Language.ListItems(ll_i), 0) <> ls_Lang
          ll_i = ll_i + 1
  '            csp_Language.ListIndex = csp_Language.ListIndex + 1
      Wend
      Set lvw_Language.SelectedItem = lvw_Language.ListItems(ll_i)
      pic_Language.Picture = img_pictList.ListImages(lvw_Language.SelectedItem.SmallIcon).Picture
  '        pic_Language.Picture = LoadResPicture(CInt(csp_Language.ListTabText(csp_Language.ListIndex, 3)), 1)
      cbo_ExtCode = aDb.GetFields(lc_Cursor, "FE_Code")
      cbo_Ext.ListIndex = cbo_ExtCode.ListIndex
      txt_Height = aDb.GetFields(lc_Cursor, "MD_height")
      txt_Width = aDb.GetFields(lc_Cursor, "MD_width")
      ls_Def = aDb.GetFields(lc_Cursor, "def_code")
      If ls_Def <> "" Then
          cbo_DefCode = ls_Def
          cbo_Def.ListIndex = cbo_DefCode.ListIndex
      End If
      ls_Qons = aDb.GetFields(lc_Cursor, "QS_Code")
      If ls_Qons <> "" Then
          cbo_QonsCode = ls_Qons
          cbo_Qons.ListIndex = cbo_QonsCode.ListIndex
      End If
      cbo_Qons.ListIndex = cbo_QonsCode.ListIndex
      cbo_CountryCode = aDb.GetFields(lc_Cursor, "CT_Code")
      cbo_Country.ListIndex = cbo_CountryCode.ListIndex
      cbo_InterestCode = aDb.GetFields(lc_Cursor, "MI_Code")
      cbo_Interest.ListIndex = cbo_InterestCode.ListIndex
      If aDb.GetFields(lc_Cursor, "internet_flag") = "X" Then
          chk_Int.Value = 1
      End If
      fra_Other.Visible = True
      cmd_Save.Enabled = True
    End If
    mi_iConc = aDb.GetFields(lc_Cursor, "iConcurrency")
    lbl_FullF = aDb.GetFields(lc_Cursor, "MD_SourceFile")
    gut_Param.Str21 = lbl_FullF
    lbl_PreviewF = aDb.GetFields(lc_Cursor, "MD_SourceFile2")
    gut_Param.Str22 = lbl_PreviewF
    'fill the data origin
    txt_originalfile = aDb.GetFields(lc_Cursor, "MD_ORIGIN")
    txt_highdefsource = aDb.GetFields(lc_Cursor, "MD_HIGHDEFORIGIN")
    lbl_ThumbnailF = aDb.GetFields(lc_Cursor, "MD_SourceFile3")
    lbl_HiResH.Caption = aDb.GetFields(lc_Cursor, "MD_SourceFile4")      ' JN task810
  End If
  Call aDb.Close(lc_Cursor)


ls_req = "EXEC media_Visible_On_lst '" & QuoteParam(gs_MediaCode) & "','" & gut_LangLogin.Code & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If
Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Text = ODBCData(ll_Statement, 1)
        If Lbl_vis1 = ls_Text Then Opt_1y.Value = OK
        If Lbl_vis2 = ls_Text Then Opt_2y.Value = OK
        If Lbl_vis3 = ls_Text Then Opt_3y.Value = OK
        If Lbl_vis4 = ls_Text Then Opt_4y.Value = OK
        If Lbl_vis5 = ls_Text Then Opt_5y.Value = OK
        If Lbl_vis6 = ls_Text Then Opt_6y.Value = OK
        If Lbl_vis7 = ls_Text Then Opt_7y.Value = OK
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)

ls_req = "EXEC media_title_lst '" & QuoteParam(gs_MediaCode) & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If

Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Text = ODBCData(ll_Statement, 1)
        ls_Text2 = ODBCData(ll_Statement, 2)
        i = 0
'        While csp_TitleLanguage.ListTabText(i, 1) <> ls_Text2
        While GetTagValue(lvw_TitleLanguage.ListItems(i + 1), 0) <> ls_Text2
            i = i + 1
            If ls_Text2 = "E" Then
                txt_Title = ls_Text
            End If
        Wend
        ms_Title(1, i) = ls_Text
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)

ls_req = "EXEC media_internet_title_lst '" & QuoteParam(gs_MediaCode) & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If

Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Text = ODBCData(ll_Statement, 1)
        ls_Text2 = ODBCData(ll_Statement, 2)
        i = 0
        While GetTagValue(lvw_TitleLanguage.ListItems(i + 1), 0) <> ls_Text2
            i = i + 1
            If ls_Text2 = "E" Then
                txt_IntTitle = ls_Text
            End If
        Wend
        ms_IntTitle(1, i) = ls_Text
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

suite:
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
StdError
End Sub



Private Sub pic_Language_Click()
MouseOff
frm_Language.Visible = Not frm_Language.Visible
'csp_Language.SetFocus
lvw_Language.SetFocus
MouseOn
End Sub

Private Sub pic_TitleLanguage_Click()
MouseOff
frm_TitleLanguage.Visible = Not frm_TitleLanguage.Visible
'csp_TitleLanguage.SetFocus
lvw_TitleLanguage.SetFocus
MouseOn
End Sub

Private Sub cmd_save_Click()
Dim i As Integer
Dim j As Integer
Dim lb_FoundNewLine As Boolean
Dim ls_Title As String

On Error GoTo Err_TechInfoSave

MouseOff
gb_Return = OK
mNumber = C_ERRORRAISE + 159
mSource = FForm & "cmd_save_Click/ "

Select Case gs_Action
Case "add":
    If Not Control Then
      MouseOn
      Exit Sub
    End If
    
    If mo_Tools.GetComboKey(cbo_MedType) = "M009" Then
      gut_Param.Str11 = False
    Else
      If cbo_Ext.ListIndex >= 0 Then
        gut_Param.Str11 = mb_Preview(cbo_Ext.ListIndex)
      Else
        gut_Param.Str11 = False
      End If
    End If
    
    If FilesCreation Then
        cmd_Memo.Visible = OK
        cmd_File.Visible = OK
        cmd_Move.Visible = OK
        gut_Param.Str12 = ""
        mi_iConc = 1
        
        If Not MediaAssociation Then Err.Raise mNumber, mSource, "/Add"
        
        mb_Change = KO
        
    Else
        cmd_Memo.Visible = KO
        cmd_File.Visible = KO
        cmd_Move.Visible = KO
        Err.Raise mNumber, mSource, "/Add"
    End If
Case "del":
    If SendMessage(5, "Delete record ?", gut_LangLogin.Code, vbQuestion + vbYesNo, "Delete ") <> vbYes Then
        gb_Return = False
        MouseOn
        Unload Me
        Exit Sub
    End If

    If GetBlobLink Then
     'delete blobs when existing referenced links doesn't exist anymore
        If Not FilesDelete Then
            Err.Raise mNumber, mSource, "/DeleteFile"
        End If
        
        For i = 1 To 3
            If mBlob(i).OldZip <> 0 Then
                If Not DeleteBlob(mBlob(i).OldZip) Then
                    Err.Raise mNumber, mSource, "/DeleteBlob"
                End If
            End If
        Next i
    Else
        Err.Raise C_ERRORRAISE + 106, mSource, "/GetBlobLink"
        MouseOn
        Exit Sub
    End If
    Unload Me
Case "upd":
    If mo_Tools.GetComboKey(cbo_MedType) = "M009" Then
      gut_Param.Str11 = False
    Else
      If cbo_Ext.ListIndex >= 0 Then
        gut_Param.Str11 = mb_Preview(cbo_Ext.ListIndex)
      Else
        gut_Param.Str11 = False
      End If
    End If
    If FilesUpdate Then
        ' task 409 - JN - node update done by media manager
'        frm_im_main.Tv_MediaOutline.LocalDelItem gs_MediaCode
'        frm_im_main.Tv_MediaOutline.LocalAddItem gs_MediaCode
        Unload Me
    Else
        Err.Raise mNumber, mSource, "/FilesUpdate"
    End If
End Select


MouseOn
Unload Me
Exit Sub

Err_TechInfoSave:
    MouseOn
    Select Case Err.Number - C_ERRORRAISE = 429
    Case 106
        SendMessage 106, "No media associated or impossible to display it.", gut_LangLogin.Code
    Case Else
        SendMessage 159, "Server may be too busy. Please try again before contacting your IT support.", gut_LangLogin.Code
    End Select

End Sub
Private Function FilesCreation() As Boolean
Dim lb_TranOpened As Boolean
Const C_MSG As String = "Error while creating Media definition. Please contact your IT support."

On Error GoTo Err_FilesCreation

FilesCreation = False

mNumber = C_ERRORRAISE + 148
mSource = FForm & "FilesCreation/ "

DoEvents

If BeginTran("FilesCreation") Then
    lb_TranOpened = True
    
    If Not Insert_Media Then Err.Raise mNumber, mSource, C_MSG
    Call SaveRefLanguage
    If Not VisibleOn(False) Then Err.Raise mNumber, mSource, C_MSG
    If Not Titles(False) Then Err.Raise mNumber, mSource, C_MSG
    If Not CommitTran("FilesCreation") Then Err.Raise mNumber, mSource, C_MSG
    
    lb_TranOpened = False
Else
    Err.Raise mNumber, mSource, C_MSG
End If

FilesCreation = True
Exit Function

Err_FilesCreation:
    If lb_TranOpened Then
        If Not (RollbackTran("FilesCreation")) Then
            UploadSQLError aDb, adb_err, mSource
            End
        End If
    End If
End Function

Private Function FilesUpdate() As Boolean
Dim i As Integer
Dim ls_Title As String
Dim lb_TranOpened As Boolean
Const C_MSG As String = "Error while updating Media definition. Please contact your IT support."

On Error GoTo Err_FilesUpdate

FilesUpdate = False
mNumber = C_ERRORRAISE + 157
mSource = FForm & "FilesUpdate/ "

If Not Control Then Exit Function

If BeginTran("FilesUpdate") Then
    lb_TranOpened = True
    
    If Not Update_media Then Err.Raise mNumber, mSource, C_MSG
    Call SaveRefLanguage
    If Not VisibleOn(True) Then Err.Raise mNumber, mSource, C_MSG
    If Not Titles(True) Then Err.Raise mNumber, mSource, C_MSG
    If Not CommitTran("FilesUpdate") Then Err.Raise mNumber, mSource, C_MSG
                
    lb_TranOpened = False
    mi_iConc = mi_iConc + 1
    cmd_File.Visible = True
    cmd_Move.Visible = True
    If mb_Change Then
        If Not MediaAssociation Then Err.Raise mNumber, mSource, C_MSG
    End If
    mb_Change = False
    
Else
    Err.Raise mNumber, mSource, C_MSG
End If

FilesUpdate = True
Exit Function

Err_FilesUpdate:
    If lb_TranOpened Then
        If Not (RollbackTran("FilesUpdate")) Then
            UploadSQLError aDb, adb_err, mSource
            End
        End If
    End If
End Function

Private Sub cmd_File_Click()
Dim i As Integer
Dim j As Integer
Dim lb_FoundNewLine As Boolean
Dim ls_Title As String

On Error GoTo Err_File_Click

MouseOff

mNumber = C_ERRORRAISE + 159
mSource = FForm & "cmd_File_Click/ "

If Not MediaAssociation Then Err.Raise mNumber, mSource, "/Add"

If gb_Return Then
    Select Case gs_Action
    Case "add"
        If gut_Param.Str15 = OK Then
'            frm_im_main.Tv_MediaOutline.LocalAddItem gs_MediaCode
        End If
        gs_MediaCode = ms_Code
'    Case "upd"                                                             ' JN bugfix 9.12.2010
'        frm_im_main.Tv_MediaOutline.LocalDelItem gs_MediaCode
'        frm_im_main.Tv_MediaOutline.LocalAddItem gs_MediaCode
    End Select
End If
    
Unload Me
MouseOn
Exit Sub

Err_File_Click:
    MouseOn
    SendMessage 164, "Error while creating media and association.", gut_LangLogin.Code
End Sub

Private Sub cmd_highDefSource_Click()
    dlg_open.InitDir = "c:\"
    dlg_open.DialogTitle = "Choose " & Caption
    dlg_open.FileName = txt_highdefsource

    dlg_open.ShowOpen
    txt_highdefsource = dlg_open.FileName
End Sub

Private Sub cmd_Memo_Click()
gut_Param.Str1 = gs_MediaCode
gut_Param.Str2 = "Memo"
gut_Param.Str3 = "Type_Of_Memo"
gut_Param.Str4 = "EXEC media_memo_ins2"
gut_Param.Str5 = "EXEC media_memo_lst"
gut_Param.Str6 = "EXEC media_memo_del"
gut_Param.Str7 = "EXEC media_memo_upd"
If gs_Action = "upd" Then
    gut_Param.Str8 = "1"
Else
    gut_Param.Str8 = "0"
End If

Memo_mtnc.show 1

Unload Me

End Sub

Private Sub cmd_Move_Click()

MouseOff
gut_Param.Str20 = mi_iConc
gb_Return = KO
DirectorySel.show 1
If gb_Return Then
    If Not MoveUpd Then
        SendMessage 157, "Directory move failed.", gut_LangLogin.Code
    End If
End If
MouseOn

Unload Me

End Sub

Private Sub cmd_originalfile_Click()
    dlg_open.InitDir = "c:\"
    dlg_open.DialogTitle = "Choose " & Caption
    dlg_open.FileName = txt_originalfile

    dlg_open.ShowOpen
    txt_originalfile = dlg_open.FileName
End Sub

Private Sub cmd_Quit_Click()
    Unload Me
End Sub

Private Sub cmd_Visu_Click()
Dim ls_PathCode As String
Dim li_Index As Integer

On Error GoTo Err_Visu_Click

MouseOff

Media_dsp.ms_Caller = "media"
Media_dsp.ms_Title = txt_Title.Text
Media_dsp.show 1

MouseOn
Exit Sub

Err_Visu_Click:
    SendMessage 106, "No media associated or impossible to display it.", gut_LangLogin.Code
    MouseOn
End Sub

Private Sub txt_Height_LostFocus()

If Not ChkNumeric(Formatage(txt_Height, 0), 0) Then
    txt_Height.SetFocus
    MouseOn
    Exit Sub
Else
    txt_Height = Formatage(txt_Height, 0)
End If

End Sub

Private Sub SetRefLanguage(ByVal al_MAL_Code As Long, ByVal as_FieldName As String, ByVal as_Value As String)
Dim ll_idx As Long

  For ll_idx = 0 To UBound(ma_RefLanguage)
    If ma_RefLanguage(ll_idx).MAL_Lang = al_MAL_Code Then
      Select Case as_FieldName
      Case "txt_ObjectDescription"
        ma_RefLanguage(ll_idx).MAL_Desc = as_Value
      Case "txt_InternetDesc1"
        ma_RefLanguage(ll_idx).MAL_InternetDesc1 = as_Value
      Case "txt_InternetDesc2"
        ma_RefLanguage(ll_idx).MAL_InternetDesc2 = as_Value
      Case "txt_InternetURL1"
        ma_RefLanguage(ll_idx).MAL_InternetURL1 = as_Value
      Case "txt_InternetURL2"
        ma_RefLanguage(ll_idx).MAL_InternetURL2 = as_Value
      Case "txt_VersionDesc"
        ma_RefLanguage(ll_idx).MAL_VersionDesc = as_Value
      Case Else
        Err.Raise C_ERRORRAISE + 152, "SetRefLanguage", "Unknown fieldname: " & as_FieldName
      End Select
      ma_RefLanguage(ll_idx).Changed = True
      Exit For
    End If
  Next
End Sub

Private Sub txt_ObjectDescription_Change()
  If mb_InternalChange Then Exit Sub
  Call SetRefLanguage(mo_Tools.GetComboKey(cbo_TextLanguage), "txt_ObjectDescription", txt_ObjectDescription.Text)
End Sub

Private Sub txt_InternetDesc1_Change()
  If mb_InternalChange Then Exit Sub
  Call SetRefLanguage(mo_Tools.GetComboKey(cbo_TextLanguage), "txt_InternetDesc1", txt_InternetDesc1.Text)
End Sub

Private Sub txt_InternetDesc2_Change()
  If mb_InternalChange Then Exit Sub
  Call SetRefLanguage(mo_Tools.GetComboKey(cbo_TextLanguage), "txt_InternetDesc2", txt_InternetDesc2.Text)
End Sub

Private Sub txt_InternetURL1_Change()
  If mb_InternalChange Then Exit Sub
  Call SetRefLanguage(mo_Tools.GetComboKey(cbo_TextLanguage), "txt_InternetURL1", txt_InternetURL1.Text)
End Sub

Private Sub txt_InternetURL2_Change()
  If mb_InternalChange Then Exit Sub
  Call SetRefLanguage(mo_Tools.GetComboKey(cbo_TextLanguage), "txt_InternetURL2", txt_InternetURL2.Text)
End Sub

Private Sub txt_VersionDesc_Change()
  If mb_InternalChange Then Exit Sub
  Call SetRefLanguage(mo_Tools.GetComboKey(cbo_TextLanguage), "txt_VersionDesc", txt_VersionDesc.Text)
End Sub

Private Sub txt_IntTitle_Change()
fill_IntTitle
End Sub

Private Sub txt_Title_Change()
fill_title
End Sub
Private Sub fill_title()
Dim i As Integer

i = 0
While ms_Title(0, i) <> GetTagValue(lvw_TitleLanguage.SelectedItem, 0)
    i = i + 1
Wend
ms_Title(1, i) = txt_Title
End Sub
Private Sub fill_IntTitle()
Dim i As Integer

i = 0
While ms_IntTitle(0, i) <> GetTagValue(lvw_TitleLanguage.SelectedItem, 0)
    i = i + 1
Wend
ms_IntTitle(1, i) = txt_IntTitle
End Sub

Private Sub txt_Title_LostFocus()
MouseOff
If txt_IntTitle = "" Then
    txt_IntTitle = Left(txt_Title, 30)
Else
    If txt_IntTitle <> Left(txt_Title, 30) And gs_Action <> "del" And Not mb_Loading Then
        If (MsgBox(ms_AdjustTitle, 4)) = 6 Then
            txt_IntTitle = Left(txt_Title, 30)
        End If
    End If
End If
MouseOn
End Sub

Private Sub txt_width_LostFocus()

If Not ChkNumeric(Formatage(txt_Width, 0), 0) Then
    txt_Width.SetFocus
    MouseOn
    Exit Sub
Else
    txt_Width = Formatage(txt_Width, 0)
End If

End Sub

Private Function BeginTran(as_Tran As String) As Boolean
Dim ls_req As String

On Error GoTo Err_BeginTran

BeginTran = False
mSource = FForm & "BeginTran/ "

ls_req = "BEGIN TRANSACTION " & as_Tran
If Not aDb.ExecuteSQL(ls_req) Then
    Err.Raise C_ERRORRAISE + 151, mSource, ls_req
End If

BeginTran = True
Exit Function

Err_BeginTran:
    UploadSQLError aDb, adb_err, mSource & ls_req
End Function

Private Function CommitTran(as_Tran As String) As Boolean
Dim ls_req As String

On Error GoTo Err_CommitTran
CommitTran = False
mSource = FForm & "CommitTran/ "

ls_req = "COMMIT TRANSACTION " & as_Tran
If Not aDb.ExecuteSQL(ls_req) Then
    Err.Raise C_ERRORRAISE + 152, mSource, as_Tran
End If

CommitTran = True
Exit Function

Err_CommitTran:
    UploadSQLError aDb, adb_err, mSource & ls_req
End Function

Private Function RollbackTran(as_Tran As String) As Boolean

On Error GoTo Err_RollBackTran

RollbackTran = False
mSource = FForm & "RollbackTran/ "

If Not aDb.ExecuteSQL("ROLLBACK TRANSACTION " & as_Tran) Then
    Err.Raise C_ERRORRAISE + 153, mSource, as_Tran
End If

RollbackTran = True
Exit Function

Err_RollBackTran:
    UploadSQLError aDb, adb_err, mSource
End Function

Private Function DeleteBlob(aZipCode As Long) As Boolean
Dim ls_req As String

On Error GoTo Err_DeleteBlob

DeleteBlob = KO
mNumber = C_ERRORRAISE + 156
mSource = FForm & "DeleteBlob/ "

ls_req = "EXEC Media_Zip_del '" & aZipCode & "'"

If Not aDb.ExecuteSQL(ls_req) Then
    Err.Raise mNumber, mSource, ls_req
End If

If aDb.SQLRowsAffected <= 0 Then
    Err.Raise mNumber, mSource, C_NOROW
End If

DeleteBlob = True
Exit Function

Err_DeleteBlob:
    UploadSQLError aDb, adb_err, mSource & ls_req
End Function

Private Function GetBlobLink() As Boolean
Dim ls_req As String
Dim ll_cursor As Long
Dim lMediaType As String
Dim lOldZip As Long

On Error GoTo Err_GetBlobLink
  
GetBlobLink = False

mSource = FForm & "GetBlobLink/ "
  
ls_req = "SELECT Zip_code,MediaType FROM Media_BlobLink WHERE MD_code ='" & gs_MediaCode & "'"

ll_cursor = aDb.OpenSQL(ls_req, -1, 0)
If ll_cursor <= 0 Then
    Err.Raise C_ERRORRAISE + 162, mSource, ls_req
End If

mBlob(1).OldZip = 0
mBlob(2).OldZip = 0
mBlob(3).OldZip = 0

Call aDb.First(ll_cursor)
While Not aDb.EOF(ll_cursor)
    lOldZip = aDb.GetFields(ll_cursor, 0)
    lMediaType = aDb.GetFields(ll_cursor, 1)
    Select Case UCase(lMediaType)
    Case "V": mBlob(1).OldZip = lOldZip
    Case "P": mBlob(2).OldZip = lOldZip
    Case "F": mBlob(3).OldZip = lOldZip
    End Select
    
    Call aDb.Next(ll_cursor)
Wend

GetBlobLink = True
aDb.Close ll_cursor
Exit Function

Err_GetBlobLink:
    UploadSQLError aDb, adb_err, mSource & ls_req
    aDb.Close ll_cursor
End Function

Private Function FilesDelete() As Boolean
Dim lb_TranOpened As Boolean, lTran As String
Const C_MSG As String = "Error while deleteing Media and references. Please contact your IT support."

On Error GoTo Err_FilesDelete

FilesDelete = False
mNumber = C_ERRORRAISE + 166
mSource = FForm & "FilesDelete/ "
lTran = "FilesDelete"

If BeginTran(lTran) Then
    lb_TranOpened = True
    
    If Not DBDel_MDCode("Media_memo_del2", gs_MediaCode) Then Err.Raise mNumber, mSource, C_MSG
    If Not DBDel_MDCode("media_visible_on_del", gs_MediaCode) Then Err.Raise mNumber, mSource, C_MSG
    If Not DBDel_MDCode("media_title_del", gs_MediaCode, True) Then Err.Raise mNumber, mSource, C_MSG
    If Not DBDel_MDCode("media_internet_title_del", gs_MediaCode, True) Then Err.Raise mNumber, mSource, C_MSG
    If Not DBDel_MDCode("media_CountriesLanguage_del2", gs_MediaCode) Then Err.Raise mNumber, mSource, C_MSG
    If Not DBDel_MDCode("Media_BlobLink_del", gs_MediaCode) Then Err.Raise mNumber, mSource, C_MSG
    If Not DBDel_MDCode("Media_Product_Classif_del2", gs_MediaCode) Then Err.Raise mNumber, mSource, C_MSG
    If Not DBDel_MDCode("media_advert_classif_del2", gs_MediaCode) Then Err.Raise mNumber, mSource, C_MSG
    If Not DBDel_MDCode("Media_INM_Del", gs_MediaCode) Then Err.Raise mNumber, mSource, C_MSG
    If Not Delete_Media Then Err.Raise mNumber, mSource, C_MSG
    If Not CommitTran(lTran) Then Err.Raise mNumber, mSource, C_MSG
    
    lb_TranOpened = False
    
Else
    Err.Raise mNumber, mSource, C_MSG
End If

FilesDelete = True
Exit Function

Err_FilesDelete:
    If lb_TranOpened Then
        If Not (RollbackTran(lTran)) Then
            UploadSQLError aDb, adb_err, mSource
            End
        End If
    End If
End Function

Private Function Delete_Media() As Boolean
Dim ls_req As String
Dim ll_cursor As Long

On Error GoTo Err_Delete_Media
  
Delete_Media = False
mSource = FForm & "Delete_Media/ "
  
ls_req = "EXEC media_del '" & gs_MediaCode & "'," & mi_iConc
    
If Not aDb.ExecuteSQL(ls_req) Then
    Err.Raise C_ERRORRAISE + 166, mSource, ls_req
End If

If aDb.SQLRowsAffected <= 0 Then
    Err.Raise mNumber, mSource, C_NOROW
End If

Delete_Media = True
Exit Function

Err_Delete_Media:
    UploadSQLError aDb, adb_err, mSource & ls_req
End Function

Private Function MediaAssociation() As Boolean
Dim ls_ext As String
On Error GoTo Err_Association

MediaAssociation = False
mSource = FForm & "MediaAssociation/ "

gut_Param.Str20 = mi_iConc
If mo_Tools.GetComboKey(cbo_MedType) = "M009" Then
  ls_ext = cbo_Extension.Text
  gut_Param.Str16 = ls_ext
  gut_Param.Str17 = mo_Tools.GetComboKey(cbo_Extension)
Else
  ls_ext = cbo_Ext
  gut_Param.Str16 = ls_ext
  gut_Param.Str17 = cbo_ExtCode.List(cbo_Ext.ListIndex)
End If
gut_Param.Str12 = ms_UserPath

Dim lo_techInfoFile As New frm_TechinfoFile
lo_techInfoFile.U_Code = prg.U_Code
Set lo_techInfoFile.ArmDb = aDb
lo_techInfoFile.mExtension = ls_ext
If ls_ext = "JPG" Or ls_ext = "BMP" Or ls_ext = "GIF" Then
    lo_techInfoFile.b_Display = True
Else
    lo_techInfoFile.b_Display = False
End If
If lo_techInfoFile.Load_A_Com Then
    Call lo_techInfoFile.show(1, Me)
    Call lo_techInfoFile.Unload_A_Com
End If
Set lo_techInfoFile = Nothing

If gb_Return Then
    mi_iConc = gut_Param.Str20
    If LCase(gs_Action) = "add" Then gs_MediaCode = ms_Code
Else
    If gs_Action = "add" Then
        If Not FilesDelete Then
            Err.Raise mNumber, mSource
        End If
    End If

    'When quit in frm_TechinfoFile ==> No error ==> no message & quit this form
'    Unload Me
End If

MediaAssociation = True

Exit Function

Err_Association:
End Function

Function DBAdd_VisibleOn(ByVal aMD_code As String, ByVal aVO_code As String) As Boolean
Dim lReq As String
Const C_REQ = "EXEC media_Visible_On_ins '$MDcode$','$VO_code$'"

On Error GoTo Err_AddVisible

DBAdd_VisibleOn = False

mSource = FForm & "DBAdd_VisibleOn/ "

lReq = C_REQ
lReq = Replace(lReq, "$MDcode$", aMD_code, , , vbTextCompare)
lReq = Replace(lReq, "$VO_code$", aVO_code, , , vbTextCompare)

If Not aDb.ExecuteSQL(lReq) Then
    Err.Raise mNumber, mSource, lReq
End If

If aDb.SQLRowsAffected <= 0 Then
    Err.Raise mNumber, mSource, C_NOROW
End If

DBAdd_VisibleOn = True
Exit Function

Err_AddVisible:
    UploadSQLError aDb, adb_err, mSource & lReq
End Function

Function DBDel_MDCode(ByVal aProc As String, ByVal aMD_code As String, Optional aRowCount As Boolean) As Boolean
Dim lReq As String
Const C_REQ = "EXEC $proc$ '$MDcode$'"

On Error GoTo Err_DelMDCode

DBDel_MDCode = False

mSource = FForm & "DBDel_VisibleOn/ "

lReq = C_REQ
lReq = Replace(lReq, "$proc$", aProc, , , vbTextCompare)
lReq = Replace(lReq, "$MDcode$", aMD_code, , , vbTextCompare)

If Not aDb.ExecuteSQL(lReq) Then
    Err.Raise mNumber, mSource, lReq
End If

If IsMissing(aRowCount) Then
    'L'argument est manquant
Else
    If aRowCount Then
        If aDb.SQLRowsAffected <= 0 Then
            Err.Raise mNumber, mSource, C_NOROW
        End If
    End If
End If

DBDel_MDCode = True
Exit Function

Err_DelMDCode:
    UploadSQLError aDb, adb_err, mSource & lReq
End Function

Private Function DBAdd_InternetTitle(ByVal aMD_code As String) As Boolean
Dim lReq As String, lIdx As Long
Const C_REQ = "EXEC media_internet_title_ins '$MDcode$', '$title$', '$lang$'"

On Error GoTo Err_DBAdd_InternetTitle

DBAdd_InternetTitle = False

For lIdx = 0 To UBound(ms_IntTitle, 2) - 1
    If ms_IntTitle(1, lIdx) <> "" Then
        lReq = Replace(C_REQ, "$MDcode$", aMD_code, , , vbTextCompare)
        lReq = Replace(lReq, "$title$", QuoteParam(ms_IntTitle(1, lIdx)), , , vbTextCompare)
        lReq = Replace(lReq, "$lang$", GetTagValue(lvw_TitleLanguage.ListItems(lIdx + 1), 0), , , vbTextCompare)
        
        If Not aDb.ExecuteSQL(lReq) Then
            Err.Raise mNumber, mSource, lReq
        End If
        
        If aDb.SQLRowsAffected <= 0 Then
            Err.Raise mNumber, mSource, C_NOROW
        End If
    End If
Next
    
DBAdd_InternetTitle = True
Exit Function

Err_DBAdd_InternetTitle:
    UploadSQLError aDb, adb_err, mSource & lReq
End Function

Private Function DBAdd_Title(ByVal aMD_code As String) As Boolean
Dim lReq As String, lIdx As Long
Const C_REQ = "EXEC media_title_ins '$MDcode$', '$title$', '$lang$'"

On Error GoTo Err_DBAdd_Title

DBAdd_Title = False
mSource = FForm & "DBAdd_Title/ "

For lIdx = 0 To UBound(ms_Title, 2) - 1
    If ms_Title(1, lIdx) <> "" Then
        lReq = Replace(C_REQ, "$MDcode$", aMD_code, , , vbTextCompare)
        lReq = Replace(lReq, "$title$", QuoteParam(ms_Title(1, lIdx)), , , vbTextCompare)
        lReq = Replace(lReq, "$lang$", GetTagValue(lvw_TitleLanguage.ListItems(lIdx + 1), 0), , vbTextCompare)
        
        If Not aDb.ExecuteSQL(lReq) Then
            Err.Raise mNumber, mSource, lReq
        End If
        
        If aDb.SQLRowsAffected <= 0 Then
            Err.Raise mNumber, mSource, C_NOROW
        End If
        
    End If
Next

DBAdd_Title = True
Exit Function

Err_DBAdd_Title:
    UploadSQLError aDb, adb_err, mSource & lReq
End Function

' NEW Remove ListView begin

Private Function GetTagValue(ByVal ao_lvw As MSComctlLib.ListItem, ByVal al_Index As Long)
    Dim ls_values() As String
    ls_values = Split(ao_lvw.Tag, SEP)

    GetTagValue = ls_values(al_Index)

End Function

Private Function LoadImage(ByVal ao_ImageList As MSComctlLib.ImageList, ByVal al_resIndex As Long, ByVal al_resType As LoadResConstants) As Long
    Dim lo_image As MSComctlLib.ListImage
    Set lo_image = ao_ImageList.ListImages.Add(, "_" & al_resIndex, LoadResPicture(al_resIndex, al_resType))
    LoadImage = lo_image.Index
End Function

Private Sub InitListView(ByRef ao_lvw As MSComctlLib.ListView, Optional ByVal ao_imgList As MSComctlLib.ImageList = Nothing)
    ao_lvw.HideSelection = False        ' don't hide selection when lostFocus
    ao_lvw.View = lvwReport
    ao_lvw.LabelEdit = lvwManual       ' disable edit labels
    ao_lvw.Icons = ao_imgList
    ao_lvw.SmallIcons = ao_imgList
End Sub

Private Sub InitImageList(ByRef ao_imgList As MSComctlLib.ImageList)
    ao_imgList.ImageHeight = 32
    ao_imgList.ImageWidth = 32
    ao_imgList.MaskColor = vbMagenta

    ' at least one image must be loaded to correctly initialize imagelist
    Call LoadImage(ao_imgList, RES_OPENFOLDER, vbResBitmap)
End Sub
' NEW Remove ListView end


