{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
osCommerce Product Manager for Windows (oscpmwin).
Copyright ©2003-2007 by Mario A. Valdez-Ramirez.

You can contact Mario A. Valdez-Ramirez
by email at mario@mariovaldez.org or paper mail at
Olmos 809, San Nicolas, NL. 66495, Mexico.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
unit oscpmdata;

interface

USES Windows, Controls, Classes, SysUtils, ComCtrls, Graphics;


CONST
  opmC_FindByID = 1;
  opmC_FindByIndex = 2;
  opmC_FindByNode = 3;
  opmC_SQLSelect = 0;
  opmC_SQLInsert = 1;
  opmC_SQLUpdate = 2;
  opmC_SQLDelete = 3;
  opmC_SQLDelIns = 4;
  opmC_SQLDelInsNoZero = 5;
  opmC_ImageDontExist = 0;
  opmC_ImageMayExist = 1;
  opmC_ImageExists = 2;
  opmC_ImageIsEmpty = 3;
  opmC_ImageIsCorrupt = 4;
  opmC_ImageIsBeingProcessed = 5;
  opmC_ConnStatNo = 0;
  opmC_ConnStatYes = 1;
  opmC_ConnStatUnknown = 2;
  opmC_ConnStatIgnore = -1;
  opmC_ProgressNone = 0;
  opmC_ProgressIgnore = -1;
  opmC_PTotalIgnore = -1;
  opmC_SearchIgnore = 0;
  opmC_SearchNo = 1;
  opmC_SearchYes = 2;
  opmC_AppName1 = 'osCommerce Product Manager';
  opmC_AppName2 = 'for Windows';
  opmC_AppShortName = 'oscpmwin';
  opmC_Version = '0.4.1';
  opmC_VisHomepageURL = 'http://www.mariovaldez.net/software/oscpmwin/';
  opmC_HomepageURL = 'http://www.mariovaldez.net/software/oscpmwin/remote.php';
  opmC_WebForumsURL = 'http://www.mariovaldez.net/webapps/forums/remote.php';
  opmC_RedirParameter = 'v';
  opmC_Copyright = 'Copyright 2003-2007 by Mario A. Valdez-Ramirez';
  opmC_Email = 'mario@mariovaldez.org';
  opmC_EmailURL = 'mailto:mario@mariovaldez.org';
  opmC_OSCAppName = 'osCommerce 2.2';
  opmC_OSCHomepageURL = 'http://www.oscommerce.com/';
  opmC_OSCCopyright = 'by Harald Ponce de Leon';
  opmC_UserAgent = opmC_AppShortName + '/' + opmC_Version;
  opmC_CheckUpdates_URL = 'http://www.mariovaldez.net/software/oscpmwin/checkupdates.php';

  opmC_Max_DBQuery_Records = 700000;
  opmC_Max_DBQuery_Fields = 50;

  opmC_Max_Products_PerList = 50000;
  opmC_Max_Descriptions_PerList = 1000000;
  opmC_Max_Languages_PerList = 20;
  opmC_Max_Categories_PerList = 10000;
  opmC_Max_Menufacturers_PerList = 8000;
  opmC_Max_Taxes_PerList = 150;
  opmC_Max_Currencies_PerList = 25;
  opmC_Max_Config_PerList = 500;

  opmC_Def_PDFAuthor = '';
  opmC_Def_Username = 'root';
  opmC_Def_Password = 'root';
  opmC_Def_ImgURL = 'http://localhost/catalog/images/';
  opmC_Def_UploadURL = 'http://localhost/catalog/oscpm1_upload.php';
  opmC_Def_ProxyHost = 'proxy';
  opmC_Def_ProxyPort = 3128;
  opmC_Def_ModConnWait = 3000;
  opmC_Def_HTTPConnWait = 5000;
  opmC_Def_HTTPWaitFactor = 25;
  opmC_Def_ModConnRetries = 2;
  opmC_Def_HTTPConnRetries = 2;
  opmC_Def_HTTPProtocol = 'http';
  opmC_Def_ImgX = 200;
  opmC_Def_ImgY = 250;
  opmC_Def_ImgQ = 50;
  opmC_Def_PaddingColor = 16777215;
  opmC_Min_Port = 1;
  opmC_Max_Port = 65535;
  opmC_Min_ProxyPort = 1;
  opmC_Max_ProxyPort = 65535;
  opmC_Min_ModConnWait = 1000;
  opmC_Max_ModConnWait = 60000;
  opmC_Min_HTTPConnWait = 1000;
  opmC_Max_HTTPConnWait = 60000;
  opmC_Min_ModConnRetries = 1;
  opmC_Max_ModConnRetries = 50;
  opmC_Min_HTTPConnRetries = 1;
  opmC_Max_HTTPConnRetries = 50;
  opmC_Min_ImgX = 20;
  opmC_Max_ImgX = 1024;
  opmC_Min_ImgY = 20;
  opmC_Max_ImgY = 1024;
  opmC_Min_ImgQ = 0;
  opmC_Max_ImgQ = 100;
  opmC_RootCategory = 'Catalog';
  opmC_DefWindow_XSize = 1016;
  opmC_MinWindow_XSize = 300;
  opmC_MaxWindow_XSize = 2000;
  opmC_DefWindow_YSize = 600;
  opmC_MinWindow_YSize = 200;
  opmC_MaxWindow_YSize = 2000;
  opmC_DefPWindow_XSize = 500;
  opmC_MinPWindow_XSize = 500;
  opmC_MaxPWindow_XSize = 2000;
  opmC_DefPWindow_YSize = 500;
  opmC_MinPWindow_YSize = 500;
  opmC_MaxPWindow_YSize = 2000;
  opmC_DefCatList_Size = 200;
  opmC_MinCatList_Size = 50;
  opmC_MaxCatList_Size = 500;
  opmC_DefGauge_Size = 150;
  opmC_DefCurPan_Size = 40;
  opmC_DefMemPan_Size = 100;
  opmC_Def_DisplayLang = 1;
  opmC_Def_Col0X = 25;
  opmC_Def_Col1X = 40;
  opmC_Def_Col2X = 85;
  opmC_Def_Col3X = 90;
  opmC_Def_Col4X = 200;
  opmC_Def_Col5X = 100;
  opmC_Def_Col6X = 32;
  opmC_Def_Col7X = 76;
  opmC_Def_Col8X = 32;
  opmC_Def_Col9X = 100;
  opmC_Def_Col10X = 20;
  opmC_Def_Col20X = 110;
  opmC_Def_Col21X = 110;
  opmC_Def_Col22X = 110;
  opmC_MinColX = 25;
  opmC_Def_Col0Align = taLeftJustify;
  opmC_Def_Col1Align = taRightJustify;
  opmC_Def_Col2Align = taLeftJustify;
  opmC_Def_Col3Align = taLeftJustify;
  opmC_Def_Col4Align = taLeftJustify;
  opmC_Def_Col5Align = taLeftJustify;
  opmC_Def_Col6Align = taRightJustify;
  opmC_Def_Col7Align = taRightJustify;
  opmC_Def_Col8Align = taRightJustify;
  opmC_Def_Col9Align = taLeftJustify;
  opmC_Def_Col10Align = taCenter;
  opmC_Def_Col20Align = taLeftJustify;
  opmC_Def_Col21Align = taLeftJustify;
  opmC_Def_Col22Align = taLeftJustify;
  opmC_Def_RememberDisplay = 1;
  opmC_Def_HotTracking = 0;
  opmC_Def_Autoload = 1;
  opmC_Def_DragDrop = 0;
  opmC_Def_ImgDragDrop = 0;
  opmC_Def_ToolTips = 1;
  opmC_Def_Stripes = 1;
  opmC_Def_CacheIList = 1;
  opmC_Def_UseProxy = 0;
  opmC_Def_ProxyApply = 0;
  opmC_Def_StorePass = 1;
  opmC_Def_Silent = 0;
  opmC_Def_ConfirmDels = 1;
  opmC_Def_ConfirmDrag = 0;
  opmC_Def_ConfirmMods = 0;
  opmC_Def_AllowZeroPrice = 0;
  opmC_Def_AllowEditImageName = 0;
  opmC_Def_AllowNegativeQuantity = 0;
  opmC_Def_AutoDownImg = 0;
  opmC_Def_NoCacheImg = 0;
  opmC_Def_ResizeImg = 1;
  opmC_Def_WatermarkImg = 0;
  opmC_Def_WatermarkFile = '';
  opmC_Def_WatermarkBlend = 85;
  opmC_Min_WatermarkBlend = 0;
  opmC_Max_WatermarkBlend = 100;
  opmC_Def_PaddingImg = 1;
  opmC_Def_KeepARImg = 1;
  opmC_Def_ConfirmExit = 1;
  opmC_Def_CenterImage = 1;
  opmC_Def_DBDebugLog = 0;
  opmC_Def_HTTPCompress = 1;
  opmC_Def_WBDebug = 0;
  opmC_Def_GUILang = 'en';

  opmC_Def_CurrLSymbol = '$';
  opmC_Def_CurrRSymbol = '';
  opmC_Def_CurrCode = '';
  opmC_Def_CurrDecSep = '.';
  opmC_Def_CurrThoSep = ',';
  opmC_Def_CurrPrecision = 2;
  opmC_Def_CurrValue = 1;
  opmC_CurrName_MaxLen = 32;
  opmC_CurrCode_MaxLen = 3;
  opmC_CurrLSymbol_MaxLen = 12;
  opmC_CurrRSymbol_MaxLen = 12;
  opmC_CurrDecSep_MaxLen = 1;
  opmC_CurrThoSep_MaxLen = 1;
  opmC_CurrPrecision_Max = 9;
  opmC_CurrPrecision_Min = 0;
  opmC_CurrValue_MaxLen = 14;
  opmC_CurrValue_MaxInt = 5;
  opmC_CurrValue_MaxDec = 8;
  opmC_TaxValue_MaxLen = 8;
  opmC_TaxValue_MaxInt = 3;
  opmC_TaxValue_MaxDec = 4;
  opmC_DBUsername_MaxLen = 128;
  opmC_DBPassword_MaxLen = 128;
  opmC_ProdModel_MaxLen = 25;
  opmC_ProdName_MaxLen = 64;
  opmC_ProdWeight_MaxLen = 6;
  opmC_ProdWeight_MaxInt = 3;
  opmC_ProdWeight_MaxDec = 2;
  opmC_ProdPrice_MaxLen = 16;
  opmC_ProdPrice_MaxInt = 11;
  opmC_ProdPrice_MaxDec = 4;
  opmC_ProdQuantity_MaxLen = 16;
  opmC_ProdURL_MaxLen = 255;
  opmC_ProdImageURL_MaxLen = 64;
  opmC_ProdDescription_MaxLen = 32000;
  opmC_ProdSpecial_MaxLen = 16;
  opmC_ProdSpecial_MaxInt = 11;
  opmC_ProdSpecial_MaxDec = 4;
  opmC_CatName_MaxLen = 32;
  opmC_LangName_MaxLen = 32;
  opmC_ManName_MaxLen = 32;
  opmC_PDFAuthor_MaxLen = 128;

  opmC_CatList_Spacer = ' ';
  opmC_Bevel_Size = 2;
  opmC_Wait_Mouse = crHourGlass;
  opmC_Normal_Mouse = crDefault;
  opmC_MaxPast_Usernames = 10;
  opmC_MaxPast_ImgURL = 10;
  opmC_MaxPast_UploadURL = 10;
  opmC_MaxPast_Proxy = 10;
  opmC_Unamed_Cat = '- - - - - - - -';
  opmC_Unamed_Man = '- - - - - - - -';
  opmC_Unamed_Prod = '- - - - - - - -';
  opmC_Unamed_Tax = '- - - - - - - -';
  opmC_Unamed_Currency = '- - - - - - - -';
  opmC_Unamed_CurrencyCode = 'XXX';
  opmC_Def_ExportExt = 'txt';
  opmC_Def_ExportFilename = 'export_products.txt';
  opmC_Def_ExportFilter = '*.txt;*.csv;*.tab';
  opmC_Def_ImportExt = 'txt';
  opmC_Def_ImportFilename = 'import_products.txt';
  opmC_Def_ImportFilter = '*.txt;*.csv;*.tab';
  opmC_ExportSeparator = #9;
  opmC_ExportJSeparator = ' | ';
  opmC_ExportJHSeparator = '-';
  opmC_PasswordChar = '*';

  opmC_WebScriptVersion = '0.9.6';
  opmC_WebScriptOKCode = 'MVOSCPM1_NOERROR';
  opmC_WebScriptERRORCode = 'MVOSCPM1_ERROR';
  opmC_WebScriptCorruptCode = 999;
  opmC_WebScriptDefaultCode = 100;
  opmC_WebScriptUnknownCode = 200;
  opmC_WebDefaultCode = 50;

  opmC_InsertProdID = 99999999;
  opmC_MaxMemoryLoad = 90;
  opmC_DefaultFont = 'Arial';
  opmC_DefaultFontHeight = -11;
  opmC_DefaultFontCharset = DEFAULT_CHARSET;
  opmC_DefaultFontStyle = [];
  opmC_Min_FontHeight = 6;
  opmC_Max_FontHeight = 100;
  opmC_Def_Clip_ColSize = 30;
  opmC_Min_Clip_ColSize = 3;
  opmC_Max_Clip_ColSize = 400;
  opmC_Def_PRNDirectPrint = 0;
  opmC_PrintTitle_Separator = '-';
  opmC_MiliSecIncrement = 1000;
  opmC_DBTableID_Categories = 'TABLE_CATEGORIES';
  opmC_DBTableID_Manufacturers = 'TABLE_MANUFACTURERS';
  opmC_DBTableID_Languages = 'TABLE_LANGUAGES';
  opmC_DBTableID_Products = 'TABLE_PRODUCTS';
  opmC_DBTableID_Specials = 'TABLE_SPECIALS';
  opmC_DBTableID_ProductsDescription = 'TABLE_PRODUCTS_DESCRIPTION';
  opmC_DBTableID_TaxClass = 'TABLE_TAX_CLASS';
  opmC_DBTableID_Currencies = 'TABLE_CURRENCIES';
  opmC_DBTableID_Configuration = 'TABLE_CONFIGURATION';
  opmC_DBTableID_ProductsToCategories = 'TABLE_PRODUCTS_TO_CATEGORIES';
  opmC_DBTableID_CategoriesDescription = 'TABLE_CATEGORIES_DESCRIPTION';
  opmC_DBTableID_TaxRates = 'TABLE_TAX_RATES';
  opmC_DBTableID_ManufacturersInfo = 'TABLE_MANUFACTURERS_INFO';
  opmC_DebugFile = 'OSCDEBUG.TXT';
  opmC_DebugFileSeparator = '======================================';
  opmC_Def_PDate = 36161;  {01/01/1999}
  opmC_Max_PDate = 44196;  {31/12/2020}
  opmC_Min_PDate = 29221;  {01/01/1980}
  opmC_PDate_Format = 'yyyy-MM-dd';
  opmC_Def_Past_PAvailDate = opmC_Def_PDate;
  opmC_Def_Past_PManufacturer = 0;
  opmC_Def_Past_PTaxClass = 0;
  opmC_Def_Past_PImageDir = '';

  opmC_DirReports = 'reports';
  opmC_Report_ProdList1 = 'prodlist1.frf';
  opmC_Def_ReportExt = 'frf';
  opmC_Def_PrintPDFExt = 'pdf';
  opmC_Def_PrintPDFFilename = 'prodlist1.pdf';
  opmC_Def_PrintPDFFilter = '*.pdf';

  opmC_ETABitrates = '28 kbps (dialup)'#13#10'56 kbps (dialup)'#13#10'64 kbps (ISDN)'#13#10'128 kbps (ISDN, ADSL, Cable)'#13#10'256 kbps (ADSL, Cable)'#13#10'512 kbps (ADSL, Cable)'#13#10'1500 kbps (ADSL, Cable, LAN)';
  opmC_Def_ETABase = '28';

  opmC_SC_Parent = 9999999;
  opmC_SC_BaseID = 10000000;
  opmC_SC_TrashCanID = 10000001;
  opmC_SC_TrashCanIndex = 10000001;

  opmC_Capa_OSCommerce = 'OSCSTANDARD';
  opmC_Capa_ZenCart = 'ZENCART';
  opmC_Capa_MorePics6 = 'MOREPICS6';
  opmC_Capa_TotalB2B = 'TOTALB2B';
  opmC_Capa_PollBooth = 'POLLBOOTH';
  opmC_Capa_HeaderTags = 'HEADERTAGS';

  opmC_DirBackups = 'backups';
  opmC_Def_BackupExt = 'gz';
  opmC_Def_BackupFilename = '';
  opmC_Def_BackupFilter = '*.gz';
  opmC_TmpBak_Filename = 'oscpmtmp.bak';

  opmC_DBTag_RecBegin = 'BR';
  opmC_DBTag_RecEnd = 'ER';
  opmC_DBTag_DataField = 'DF';
  opmC_DBTag_DataBegin = '[';
  opmC_DBTag_DataEnd = ']';
  opmC_DBTag_Comment = '#';
  opmC_DBTag_Stat = 'ST';
  opmC_DBTag_FieldList = 'FL';

  opmC_ConfigKey_StoreName = 'STORE_NAME';
  opmC_HashingStrengh = 100;
  opmC_DefErrorDataLen = 200; 


TYPE
  opmR_Category = RECORD
                     ID : LONGINT;
                     Parent : LONGINT;
                     Name : STRING;
                     TreeIndex : LONGINT;
                     ListIndex : LONGINT;
                     ImageURL : STRING;
                   END;
  opmR_SingleCategory = RECORD
                          ID : LONGINT;
                          Parent : LONGINT;
                          Name : STRING;
                          LanguageID : LONGINT;
                          ImageURL : STRING;
                        END;
  opmR_Manufacturer = RECORD
                         ID : LONGINT;
                         Name : STRING;
                         ListIndex : LONGINT;
                         ImageURL : STRING;
                       END;
  opmR_Language = RECORD
                     ID : LONGINT;
                     Name : STRING;
                     ListIndex : LONGINT;
                   END;
  opmR_Product = RECORD
                     ID : LONGINT;
                     Model : STRING;
                     Quantity : LONGINT;
                     Price : CURRENCY;
                     Weight : CURRENCY;
                     ManufacturerID : LONGINT;
                     CategoryID : LONGINT;
                     DisplayName : STRING;
                     ImageURL : STRING;
                     Available : LONGINT;
                     Special : CURRENCY;
                     LanguageID : LONGINT;
                     Tax : LONGINT;
                     AvailDate : TDateTime;
                     CreationDate : TDateTime;
                     ChangeDate : TDateTime;
                     ImageURL1, ImageURL2, ImageURL3, ImageURL4, ImageURL5, ImageURL6 : STRING;
                   END;
  opmR_Description = RECORD
                       ID : LONGINT;
                       Name : STRING;
                       Description : STRING;
                       URL : STRING;
                       LanguageID : LONGINT;
                       Viewed : LONGINT;
                     END;
  opmR_Tax = RECORD
               ID : LONGINT;
               Name : STRING;
               ListIndex : LONGINT;
               SumRate : CURRENCY;
             END;
  opmR_Currency = RECORD
                   ID : LONGINT;
                   Name : STRING;
                   Code : STRING;
                   Left : STRING;
                   Right : STRING;
                   DecimalSep : STRING;
                   ThousandSep : STRING;
                   Precision : LONGINT;
                   Value : CURRENCY;
                   NewValue : CURRENCY;
                   ListIndex : LONGINT;
                   Default : BOOLEAN;
                 END;
  opmR_Config = RECORD
                  ID : LONGINT;
                  Title : STRING;
                  Key : STRING;
                  Value : STRING;
                  Description : STRING;
                  GroupID : LONGINT;
                  SetFunction : STRING;
                END;
  opmT_CategoryList = ARRAY [0..opmC_Max_Categories_PerList] OF opmR_Category;
  opmT_ManufacturerList = ARRAY [0..opmC_Max_Menufacturers_PerList] OF opmR_Manufacturer;
  opmT_LanguageList = ARRAY [0..opmC_Max_Languages_PerList] OF opmR_Language;
  opmT_ProductList = ARRAY [0..opmC_Max_Products_PerList] OF opmR_Product;
  opmT_DescriptionList = ARRAY [0..opmC_Max_Descriptions_PerList] OF opmR_Description;
  opmT_TaxList = ARRAY [0..opmC_Max_Taxes_PerList] OF opmR_Tax;
  opmT_SingleDescList = ARRAY [0..opmC_Max_Languages_PerList] OF opmR_Description;
  opmT_CurPosDescList = ARRAY [0..opmC_Max_Languages_PerList] OF INTEGER;
  opmT_CharsetList = ARRAY [0..255] OF STRING;
  opmT_SingleCatList = ARRAY [0..opmC_Max_Languages_PerList] OF opmR_SingleCategory;
  opmT_CurrencyList = ARRAY [0..opmC_Max_Currencies_PerList] OF opmR_Currency;
  opmT_ConfigList = ARRAY [0..opmC_Max_Config_PerList] OF opmR_Config;

  opmT_DBQuery_Dataset = ARRAY OF ARRAY OF STRING;
  opmR_DBQuery_Recordset = RECORD
                             RowCount : LONGINT;
                             ColCount : LONGINT;
                             DataRows : LONGINT;
                             DataCols : LONGINT;
                             DataSize : LONGINT;
                             OrigSize : LONGINT;
                             Data : opmT_DBQuery_Dataset;
                           END;


VAR
  opmG_TMPPath : STRING;
  opmG_ETABase : LONGINT;
  opmG_PDFAuthor : STRING;
  opmG_DBUsername : STRING;
  opmG_DBPassword : STRING;
  opmG_WBImgURL : STRING;
  opmG_WBUploadURL : STRING;
  opmG_WBProxyHost : STRING;
  opmG_WBProxyPort : LONGINT;
  opmG_ModConnWait : LONGINT;
  opmG_HTTPConnWait : LONGINT;
  opmG_ModConnRetries : LONGINT;
  opmG_HTTPConnRetries : LONGINT;
  opmG_WBImgX : LONGINT;
  opmG_WBImgY : LONGINT;
  opmG_WBImgQ : LONGINT;
  opmG_WBPaddingColor : LONGINT;
  opmG_UIWindow_XSize : LONGINT;
  opmG_UIWindow_YSize : LONGINT;
  opmG_UIWindow_XPos : LONGINT;
  opmG_UIWindow_YPos : LONGINT;
  opmG_UICatList_XSize : LONGINT;
  opmG_UICol0X, opmG_UICol1X, opmG_UICol2X, opmG_UICol3X, opmG_UICol4X, opmG_UICol5X, opmG_UICol6X, opmG_UICol7X, opmG_UICol8X, opmG_UICol9X, opmG_UICol10X : LONGINT;
  opmG_UICol20X, opmG_UICol21X, opmG_UICol22X : LONGINT;
  opmG_UIRememberDisplay : WORD;
  opmG_UIHotTracking : WORD;
  opmG_UIClickLoad : WORD;
  opmG_UIDragDrop : WORD;
  opmG_UIImgDragDrop : WORD;
  opmG_UIToolTips : WORD;
  opmG_UIStripes : WORD;
  opmG_UICacheIList : WORD;
  opmG_UseProxy : WORD;
  opmG_ProxyApply : WORD;
  opmG_DBStorePass : WORD;
  opmG_UISilent : WORD;
  opmG_UIConfirmDels : WORD;
  opmG_UIConfirmDrag : WORD;
  opmG_UIConfirmMods : WORD;
  opmG_UIAllowZeroPrice : WORD;
  opmG_UIAllowEditImageName : WORD;
  opmG_UIAllowNegativeQuantity : WORD;
  opmG_UIAutoDownImg : WORD;
  opmG_WBNoCacheImg : WORD;
  opmG_WBResizeImg : WORD;
  opmG_WBWatermarkImg : WORD;
  opmG_WBWatermarkFile : STRING;
  opmG_WBWatermarkBlend : LONGINT;
  opmG_WBPaddingImg : WORD;
  opmG_WBKeepARImg : WORD;
  opmG_UIConfirmExit : WORD;
  opmG_UICenterImage : WORD;
  opmG_DBDebugLog : WORD;
  opmG_HTTPCompress : WORD;
  opmG_UIWBDebug : WORD;
  opmG_UIGUILang : STRING;
  opmG_Past_PAvailDate : LONGINT;
  opmG_Past_PManufacturer : LONGINT;
  opmG_Past_PTaxClass : LONGINT;
  opmG_Past_PImageDir : STRING;
  opmG_FullUserAgent : STRING;

  opmG_PastUsername_BoxList : TStringList;
  opmG_PastImgURL_BoxList : TStringList;
  opmG_PastUploadURL_BoxList : TStringList;
  opmG_PastProxy_BoxList : TStringList;

  opmG_CategoryList : opmT_CategoryList;
  opmG_ManufacturerList : opmT_ManufacturerList;
  opmG_LanguageList : opmT_LanguageList;
  opmG_ProductList : opmT_ProductList;
  opmG_DescriptionList : opmT_DescriptionList;
  opmG_TaxList : opmT_TaxList;
  opmG_CurrencyList : opmT_CurrencyList;
  opmG_ConfigList : opmT_ConfigList;
  opmG_CategoryBoxList : TStringList;
  opmG_ManufacturerBoxList : TStringList;
  opmG_LanguageBoxList : TStringList;
  opmG_TaxBoxList : TStringList;
  opmG_CurrencyBoxList : TStringList;
  opmG_Cache_ImageDirList : TStringList;
  opmG_Cache_ImageList : TStringList;

  opmG_DBTableList : TStringList;

  opmG_DBQuery_Recordset : opmR_DBQuery_Recordset;

  opm_TotalCategories : LONGINT;
  opm_TotalManufacturers : LONGINT;
  opm_TotalLanguages : LONGINT;
  opm_TotalProducts : LONGINT;
  opm_TotalTaxes : LONGINT;
  opm_TotalCurrencies : LONGINT;
  opm_TotalConfig : LONGINT;

  opm_CurrentLang : LONGINT;
  opm_CurrentCategory : LONGINT;
  opm_CurrentMan : LONGINT;
  opm_CurrentProdID : LONGINT;
  opm_CurrentProdRecord : opmR_Product;
  opm_CurrentSingleDescList : opmT_SingleDescList;
  opm_CurrentPEditRecord : opmR_Product;
  opm_CurrentLangRecord : opmR_Language;
  opm_CurrentCatRecord : opmR_Category;
  opm_CurrentManRecord : opmR_Manufacturer;
  opm_CurrentTaxRecord : opmR_Tax;
  opm_CurrentCurrency : opmR_Currency;
  opm_Search_PCategory : LONGINT;
  opm_Search_PManufacturer : LONGINT;
  opm_Search_PModel, opm_Search_PName, opm_Search_PDesc : STRING;
  opm_Search_PSPrice, opm_Search_PImagURL, opm_Search_PAvailable : LONGINT;
  opm_Search_Quick : STRING;
  opm_CanExpandTree_Flag : BOOLEAN;
  opm_WeAreSearching : BOOLEAN;
  opm_WeAreFullScreen : BOOLEAN;
  opm_StopTreeOnChange : BOOLEAN;
  opmG_UIFontName : STRING;
  opmG_UIFontHeight : LONGINT;
  opmG_UIFontCharset : LONGINT;
  opmG_CharsetList : opmT_CharsetList;
  opmG_Clip_ColSize : LONGINT;
  opmG_PRNDirectPrint : WORD;
  opmG_DBTable_Categories : STRING;
  opmG_DBTable_Manufacturers : STRING;
  opmG_DBTable_Languages : STRING;
  opmG_DBTable_Products : STRING;
  opmG_DBTable_Specials : STRING;
  opmG_DBTable_ProductsDescription : STRING;
  opmG_DBTable_TaxClass : STRING;
  opmG_DBTable_Currencies : STRING;
  opmG_DBTable_Configuration : STRING;
  opmG_DBTable_ProductsToCategories : STRING;
  opmG_DBTable_CategoriesDescription : STRING;
  opmG_DBTable_TaxRates : STRING;
  opmG_DBTable_ManufacturersInfo : STRING;
  opmG_PList_LastOrderColumn : LONGINT;
  opmG_PList_LastOrderType : BOOLEAN;
  opmG_Cur_PPrintID : LONGINT;
  opmG_Cur_PPrintRecord : opmR_Product;
  opmG_Cur_PrintListItem : TListItem;
  opmG_Cur_PPrintEOF : BOOLEAN;
  opmG_Cur_PPrintTitle : STRING;
  opmG_Cur_PPrintTitle2 : STRING;
  opmG_Cur_PDFSubject : STRING;

  opmG_Capa_OSCommerce : BOOLEAN;
  opmG_Capa_ZenCart : BOOLEAN;
  opmG_Capa_MorePics6 : BOOLEAN;
  opmG_Capa_TotalB2B : BOOLEAN;
  opmG_Capa_PollBooth : BOOLEAN;
  opmG_Capa_HeaderTags : BOOLEAN;
  opmG_CurrentStoreName : STRING;

  opm_CurrentProdID_CB : LONGINT;
  opm_CurrentProdRecord_CB : opmR_Product;
  opm_CurrentSingleDescList_CB : opmT_SingleDescList;

  opmG_StripeColor : TColor;

  opmG_PHPInfo : STRING;



IMPLEMENTATION

INITIALIZATION

  opmG_CategoryBoxList := TStringList.Create;
  opmG_ManufacturerBoxList := TStringList.Create;
  opmG_LanguageBoxList := TStringList.Create;
  opmG_TaxBoxList := TStringList.Create;
  opmG_CurrencyBoxList := TStringList.Create;
  opmG_PastUsername_BoxList := TStringList.Create;
  opmG_PastImgURL_BoxList := TStringList.Create;
  opmG_PastUploadURL_BoxList := TStringList.Create;
  opmG_PastProxy_BoxList := TStringList.Create;
  opmG_Cache_ImageDirList := TStringList.Create;
  opmG_Cache_ImageList := TStringList.Create;
  opmG_DBTableList := TStringList.Create;
  DateSeparator := '-';
  ShortDateFormat	:= 'yyyy/mm/dd';
  DecimalSeparator := '.';
  ThousandSeparator := ',';
  opmG_CharsetList[0] := 'ansi';
  opmG_CharsetList[1] := 'default';
  opmG_CharsetList[2] := 'symbol';
  opmG_CharsetList[77] := 'mac';
  opmG_CharsetList[128] := 'shiftjis';
  opmG_CharsetList[129] := 'hangeul';
  opmG_CharsetList[130] := 'johab';
  opmG_CharsetList[134] := 'gb2312';
  opmG_CharsetList[136] := 'chinesebig5';
  opmG_CharsetList[161] := 'greek';
  opmG_CharsetList[162] := 'turkish';
  opmG_CharsetList[163] := 'vietnamese';
  opmG_CharsetList[177] := 'hebrew';
  opmG_CharsetList[178] := 'arabic';
  opmG_CharsetList[186] := 'baltic';
  opmG_CharsetList[204] := 'russian';
  opmG_CharsetList[222] := 'thai';
  opmG_CharsetList[238] := 'easteurope';
  opmG_CharsetList[255] := 'oem';

  opmG_DBQuery_Recordset.RowCount := 0;
  opmG_DBQuery_Recordset.ColCount := 0;
  opmG_DBQuery_Recordset.DataRows := 0;
  opmG_DBQuery_Recordset.DataCols := 0;
  SetLength (opmG_DBQuery_Recordset.Data, opmG_DBQuery_Recordset.RowCount, opmG_DBQuery_Recordset.ColCount);


FINALIZATION

  FreeAndNIL (opmG_CategoryBoxList);
  FreeAndNIL (opmG_ManufacturerBoxList);
  FreeAndNIL (opmG_LanguageBoxList);
  FreeAndNIL (opmG_TaxBoxList);
  FreeAndNIL (opmG_CurrencyBoxList);
  FreeAndNIL (opmG_PastUsername_BoxList);
  FreeAndNIL (opmG_PastImgURL_BoxList);
  FreeAndNIL (opmG_PastUploadURL_BoxList);
  FreeAndNIL (opmG_PastProxy_BoxList);
  FreeAndNIL (opmG_Cache_ImageDirList);
  FreeAndNIL (opmG_Cache_ImageList);
  FreeAndNIL (opmG_DBTableList);

end.
