// Program...........: Search.js
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 21/10/05
// Copyright.........: (c) Alvechurch Data
// Description.......: Template for the Site Search feature
// Parameter List....: Nothing
// Major change list.: 08/11/05     // Counts the hits per page
//                     24/03/06     // Add WriteMail 
//                     17/05/06     // Add writeHeader and writeRule so that this 
//                                  // can be called from every page on the site

// Note that all arrays are 1-based to match VFP

aHits = new Array();                // Number of hits on this page
aKeyWord = new Array();             // Array holding the keywords for 
aURL = new Array();                 // Array holding the URL of each page found
aSorted = new Array();              // Page array sorted by hits
aTitle = new Array();               // Title of each page found

aURL[1]='acc2002.htm';
aTitle[1]='Notes on the launch of Access 2002 and Office XP';
aKeyWord[1]='access, data, desktop, launch, office, pages, server, sql, 2000, 2002, xp, compatible, format, xml';
aHits[1]=0;
aURL[2]='accaddtoolbar.htm';
aTitle[2]='Adding custom toolbars to Access';
aKeyWord[2]='access, custom, toolbar, commandbutton, commandbar, vb, vba';
aHits[2]=0;
aURL[3]='accassist.htm';
aTitle[3]='How to remove the Office Assistant in Access';
aKeyWord[3]='access, office assistant, f1, help, office, remove, paperclip';
aHits[3]=0;
aURL[4]='accbackup.htm';
aTitle[4]='How to backup an Access database using VBA and DAO';
aKeyWord[4]='access, backup, database, dbengine, compact, vba, dao, split, copy, log, date, datestamp, config, configuration';
aHits[4]=0;
aURL[5]='acccentre.htm';
aTitle[5]='Centring controls on an Access form';
aKeyWord[5]='access, centre, center, controls, form, paint, painting, vba, screen, design, layout';
aHits[5]=0;
aURL[6]='acccommon.htm';
aTitle[6]='Using a Common Dialog control for Save As';
aKeyWord[6]='access, activex, color, colour, common, controls, dialog, excel, font, form, printer, save, user, choice, vba';
aHits[6]=0;
aURL[7]='acccompact.htm';
aTitle[7]='How to compact and repair an Access database';
aKeyWord[7]='access, bloat, database, compact, performance, repair, compact database';
aHits[7]=0;
aURL[8]='accconfirm.htm';
aTitle[8]='Wrapping the call to MsgBox in Access';
aKeyWord[8]='access, dialog, messagebox, msgbox, confirm, vba, wrap';
aHits[8]=0;
aURL[9]='accdao.htm';
aTitle[9]='Using DAO to put data on an Access form';
aKeyWord[9]='access, connect, data, data access object, database, edit, form, ado, dao, objects, vba, recordset';
aHits[9]=0;
aURL[10]='accdate.htm';
aTitle[10]='A list of Access functions which work with dates and times';
aKeyWord[10]='access, date, function, day, dateadd, datediff, datepart, format, hour, month, now, second, time, week, year';
aHits[10]=0;
aURL[11]='accdatestamp.htm';
aTitle[11]='How to create a filename from a datestamp';
aKeyWord[11]='access, backup, date, datestamp, file, filename, recordset, vba, day, month, year';
aHits[11]=0;
aURL[12]='accerrorlog.htm';
aTitle[12]='An Access Error Log';
aKeyWord[12]='access, vba, error, log';
aHits[12]=0;
aURL[13]='acckey.htm';
aTitle[13]='Generating primary keys for an Access database';
aKeyWord[13]='access, primary, key, autonumber, dao, identifier, integer, recordset, sequence, unique, vba';
aHits[13]=0;
aURL[14]='acclink.htm';
aTitle[14]='Linking tables into Access from another database';
aKeyWord[14]='access, backend, back end, backup, config, dao, database, frontend, front end, import, link, split, vba';
aHits[14]=0;
aURL[15]='acclinks.htm';
aTitle[15]='Links to other useful Access sites on the web';
aKeyWord[15]='access, link, web, microsoft';
aHits[15]=0;
aURL[16]='acclistbox.htm';
aTitle[16]='Linking parent and child listboxes in Access';
aKeyWord[16]='access, form, list, listbox, link, list, requery, rowsource, select, vba';
aHits[16]=0;
aURL[17]='acclogic.htm';
aTitle[17]='A list of Logical Operators in Access';
aKeyWord[17]='access, and, bit, boolean, eqv, exclusive, false, function, imp, logic, logical, not, null, operator, or, true, xor';
aHits[17]=0;
aURL[18]='accmethod.htm';
aTitle[18]='How to open the VBA method code editor automatically';
aKeyWord[18]='access, edit, method, code, macro, vba, code builder, event, startup';
aHits[18]=0;
aURL[19]='accmigr.htm';
aTitle[19]='Migrating to Access 2002 from earlier versions';
aKeyWord[19]='access, 2000, 2002, backup, compatible, database, format, migrate, sql, office, vba, xp';
aHits[19]=0;
aURL[20]='accnumber.htm';
aTitle[20]='List of Numeric Functions in Access';
aKeyWord[20]='access, function, abs, exp, fix, numeric, number, int, integer, log, pi, rnd, random, root, sqr';
aHits[20]=0;
aURL[21]='accrandom.htm';
aTitle[21]='Generate random numbers in Access';
aKeyWord[21]='access, vba, random number, rnd, randomize, rand';
aHits[21]=0;
aURL[22]='accsplit.htm';
aTitle[22]='Splitting Access code and data into frontend and backend databases';
aKeyWord[22]='access, 2000, 2002, backend, backup, database, frontend, link, network, split, wizard, xp';
aHits[22]=0;
aURL[23]='accsql.htm';
aTitle[23]='American date formats used by Access SQL';
aKeyWord[23]='access, access sql, american, us, database, date, format, function, sql, vba';
aHits[23]=0;
aURL[24]='accstartup.htm';
aTitle[24]='Use Access StartUp options to improve security';
aKeyWord[24]='access, database, form, menu, startup, security, vba, xp';
aHits[24]=0;
aURL[25]='accsubquery.htm';
aTitle[25]='Using queries and subqueries in Access';
aKeyWord[25]='access, list, query, queries, select, select criterion, sql, sql select, subqueries, sub-queries, subquery, sub-query, structure';
aHits[25]=0;
aURL[26]='accswitchboard.htm';
aTitle[26]='Access';
aKeyWord[26]='access, switchboard, manager, form';
aHits[26]=0;
aURL[27]='accswitchboard1.htm';
aTitle[27]='Creating a switchboard system in Microsoft Access';
aKeyWord[27]='access, switchboard, manager, form, navigate';
aHits[27]=0;
aURL[28]='accswitchboard2.htm';
aTitle[28]='Building the structure of a switchboard system in Microsoft Access';
aKeyWord[28]='access, switchboard, manager, form';
aHits[28]=0;
aURL[29]='accswitchboard3.htm';
aTitle[29]='Improving the appearance of a switchboard in Microsoft Access';
aKeyWord[29]='microsoft access, switchboard, manager, form, design';
aHits[29]=0;
aURL[30]='accswitchboard4.htm';
aTitle[30]='Behind the scenes of a switchboard system in Microsoft Access';
aKeyWord[30]='access, switchboard, manager, form';
aHits[30]=0;
aURL[31]='acctext.htm';
aTitle[31]='List of Access functions to process text';
aKeyWord[31]='access, case, compare, function, instr, join, lcase, lower, mid, left, like, right, space, split, strcomp, string, text, ucase, upper';
aHits[31]=0;
aURL[32]='acctips.htm';
aTitle[32]='Tips from Alvechurch Data for database developers using Microsoft Access';
aKeyWord[32]='ms access, access tutorial, access help, access tip, microsoft access, access 97, microsoft access 97, access 2000, microsoft access 2000, access xp, access database, relational database, database design, index, contents, advice';
aHits[32]=0;
aURL[33]='acctoolbarid.htm';
aTitle[33]='ID codes for CommandBarButtons in Access';
aKeyWord[33]='access, custom, toolbar, commandbarbutton, commandbar, id, icon, vb, vba';
aHits[33]=0;
aURL[34]='acctopten.htm';
aTitle[34]='Access Tips and Hints from Alvechurch Data';
aKeyWord[34]='access, code, compact, control, design, field, form, hints, image, index, module, name, speed, tab, tips, top ten';
aHits[34]=0;
aURL[35]='accusers.htm';
aTitle[35]='Tips for users of Access 97, Access 2000 & Access XP';
aKeyWord[35]='microsoft access, access 97, microsoft access 97, access 2000, access xp, access database, access tips, access hints, user, introduction, tutorial';
aHits[35]=0;
aURL[36]='adtabout.htm';
aTitle[36]='Information about Alvechurch Data Ltd.';
aKeyWord[36]='about, address, alvechurch, contact, email, foxpro, access, franklin, village';
aHits[36]=0;
aURL[37]='adtacc.htm';
aTitle[37]='Microsoft Access Database Training';
aKeyWord[37]='access database training, access, access tutorial, access course, access workshop, database, training, course';
aHits[37]=0;
aURL[38]='adtbcs.htm';
aTitle[38]='British Computer Society';
aKeyWord[38]='alvechurch, british, computer, society, birmingham, bcs';
aHits[38]=0;
aURL[39]='adtcry.htm';
aTitle[39]='Crystal Reports Training Course';
aKeyWord[39]='crystal, report, training, course';
aHits[39]=0;
aURL[40]='adtdata.htm';
aTitle[40]='Database Design Course';
aKeyWord[40]='database, design, database design, relational database, course, training';
aHits[40]=0;
aURL[41]='adtdeliver.htm';
aTitle[41]='Our process for database development projects';
aKeyWord[41]='database development, database maintenance, database application, visual foxpro development, access development';
aHits[41]=0;
aURL[42]='adtdev.htm';
aTitle[42]='Alvechurch Data have fifteen years experience developing databases for small business use.';
aKeyWord[42]='database development, database maintenance, database application, visual foxpro development, access development';
aHits[42]=0;
aURL[43]='adtfox.htm';
aTitle[43]='Foxpro and Visual FoxPro training for database developers and users';
aKeyWord[43]='foxpro, training, foxpro tutorial, foxpro course, visual foxpro training, microsoft visual foxpro, workshop, database training';
aHits[43]=0;
aURL[44]='adtgen.htm';
aTitle[44]='Terms and conditions for training courses at Alvechurch Data';
aKeyWord[44]='alvechurch, conditions, course, courses, email, terms, training';
aHits[44]=0;
aURL[45]='adtlegal.htm';
aTitle[45]='Alvechurch Data Copyright, Privacy and Legal information';
aKeyWord[45]='alvechurch, company, contact, copyright, email, foxdance, javascript, legal, mcp, privacy, web, bt';
aHits[45]=0;
aURL[46]='adtslant.htm';
aTitle[46]='A joint web database project with Slant Design';
aKeyWord[46]='access, database, ftp, slant, web, xml';
aHits[46]=0;
aURL[47]='adtsupp.htm';
aTitle[47]='How we can help you with database maintenance and support';
aKeyWord[47]='access database, database maintenance, database support, visual foxpro development, access development, database maintenance';
aHits[47]=0;
aURL[48]='adttips.htm';
aTitle[48]='Hints and Tips for Visual FoxPro and Access';
aKeyWord[48]='hints, tips, access, visual, foxpro, bells, help, vfp, advice';
aHits[48]=0;
aURL[49]='adttrain.htm';
aTitle[49]='Details of the training courses offered by Alvechurch Data';
aKeyWord[49]='access database training, crystal training, foxpro training, workshop';
aHits[49]=0;
aURL[50]='alvecanal.htm';
aTitle[50]='Boats on the Worcester and Birmingham Canal at Alvechurch';
aKeyWord[50]='alvechurch, birmingham, canal, village, worcester';
aHits[50]=0;
aURL[51]='alvechurch.htm';
aTitle[51]='The village of Alvechurch, Worcestershire';
aKeyWord[51]='alvechurch, birmingham, village, worcester, seal';
aHits[51]=0;
aURL[52]='alvecrown.htm';
aTitle[52]='The Crown Inn at Withybed Green, Alvechurch';
aKeyWord[52]='alvechurch, canal, crown, inn, withybed';
aHits[52]=0;
aURL[53]='alvedoctors.htm';
aTitle[53]='Christmas decorations in Alvechurch';
aKeyWord[53]='alvechurch, christmas';
aHits[53]=0;
aURL[54]='alvefeat.htm';
aTitle[54]='Features of Alvechurch, Worcestershire';
aKeyWord[54]='alvechurch, worcester, crown, canal, morris';
aHits[54]=0;
aURL[55]='alvehall.htm';
aTitle[55]='Alvechurch Village Hall';
aKeyWord[55]='alvechurch, village';
aHits[55]=0;
aURL[56]='alvehist.htm';
aTitle[56]='History of Alvechurch, Worcestershire';
aKeyWord[56]='alvechurch, birmingham, church, canal';
aHits[56]=0;
aURL[57]='alveloc.htm';
aTitle[57]='Alvechurch, Worcestershire';
aKeyWord[57]='alvechurch, church, canal, worcester, birmingham, redditch, bromsgrove';
aHits[57]=0;
aURL[58]='alvemorris.htm';
aTitle[58]='Alvechurch Morris dancing at the Crown Inn at Withybed Green';
aKeyWord[58]='alvechurch, morris, crown, withybed';
aHits[58]=0;
aURL[59]='fox101advenv.htm';
aTitle[59]='Visual FoxPro Tutorial - More about the environment';
aKeyWord[59]='visual foxpro tutorial, fox 101, command window, sql, vfp 101';
aHits[59]=0;
aURL[60]='fox101case.htm';
aTitle[60]='Visual FoxPro Tutorial - Do Case';
aKeyWord[60]='visual foxpro tutorial, fox 101, structure, choice, choose, case, do case, select, selection, vfp 101';
aHits[60]=0;
aURL[61]='fox101code.htm';
aTitle[61]='Visual FoxPro Tutorial - Code';
aKeyWord[61]='visual foxpro tutorial, program code, fox 101, vfp 101';
aHits[61]=0;
aURL[62]='fox101data.htm';
aTitle[62]='Visual FoxPro Tutorial - Databases';
aKeyWord[62]='visual foxpro tutorial, fox 101, table, database, dbf, vfp 101';
aHits[62]=0;
aURL[63]='fox101dowhile.htm';
aTitle[63]='Visual FoxPro Tutorial - Do ... While loop';
aKeyWord[63]='visual foxpro tutorial, fox 101, structure, do, loop, while, until, repeat, repetition, vfp 101';
aHits[63]=0;
aURL[64]='fox101env.htm';
aTitle[64]='Visual FoxPro Tutorial - Development Environment';
aKeyWord[64]='visual foxpro tutorial, development environment, fox 101, command window, vfp 101, ide';
aHits[64]=0;
aURL[65]='fox101exe.htm';
aTitle[65]='Visual FoxPro Tutorial - Build an executable';
aKeyWord[65]='visual foxpro tutorial, fox 101, project manager, build executable, vfp 101';
aHits[65]=0;
aURL[66]='fox101for.htm';
aTitle[66]='Visual FoxPro Tutorial - For ... Next loop';
aKeyWord[66]='visual foxpro tutorial, fox 101, structure, for, loop, next, endfor, vfp 101';
aHits[66]=0;
aURL[67]='fox101form.htm';
aTitle[67]='Visual FoxPro Tutorial - Form Designer';
aKeyWord[67]='visual foxpro tutorial, fox 101, form design, vfp 101';
aHits[67]=0;
aURL[68]='fox101goto.htm';
aTitle[68]='Visual FoxPro Tutorial - The Goto statement';
aKeyWord[68]='visual foxpro tutorial, fox 101, structure, goto, vfp 101';
aHits[68]=0;
aURL[69]='fox101if.htm';
aTitle[69]='Visual FoxPro Tutorial - If ... Then ... EndIf';
aKeyWord[69]='visual foxpro tutorial, fox 101, structure, selection, choice, choose, if, then, else, endif';
aHits[69]=0;
aURL[70]='fox101intro.htm';
aTitle[70]='Visual FoxPro Tutorial - Introduction';
aKeyWord[70]='visual foxpro tutorial, fox 101, vfp 101';
aHits[70]=0;
aURL[71]='fox101navig.htm';
aTitle[71]='Visual FoxPro Tutorial - Navigation';
aKeyWord[71]='visual foxpro tutorial, fox 101, navigation controls, vfp 101';
aHits[71]=0;
aURL[72]='fox101proj.htm';
aTitle[72]='Visual FoxPro Tutorial - Project Manager';
aKeyWord[72]='visual foxpro tutorial, fox 101, project manager, vfp 101';
aHits[72]=0;
aURL[73]='fox101scan.htm';
aTitle[73]='Visual FoxPro Tutorial - Scan ... EndScan loop';
aKeyWord[73]='visual foxpro tutorial, fox 101, structure, for, scan, loop, next, vfp 101';
aHits[73]=0;
aURL[74]='fox101structure.htm';
aTitle[74]='Visual FoxPro Tutorial - Program control structures';
aKeyWord[74]='visual foxpro tutorial, fox 101, structure, loop, if, case, select, vfp 101';
aHits[74]=0;
aURL[75]='fox101table.htm';
aTitle[75]='Visual FoxPro Tutorial - Data Tables';
aKeyWord[75]='visual foxpro tutorial, fox 101, table design, vfp 101';
aHits[75]=0;
aURL[76]='fox101var.htm';
aTitle[76]='Visual FoxPro Tutorial - Variables';
aKeyWord[76]='visual foxpro tutorial, fox 101, variables, names, naming convention, integer, string, real, date, public, private, local, vfp 101';
aHits[76]=0;
aURL[77]='foxautocomplete.htm';
aTitle[77]='Autocomplete in VFP9';
aKeyWord[77]='vfp9, autocomplete, lookup, autofill';
aHits[77]=0;
aURL[78]='foxautocomptable.htm';
aTitle[78]='Autocomplete table structure';
aKeyWord[78]='vfp9, autocomplete, table structure, lookup, autofill';
aHits[78]=0;
aURL[79]='foxbits.htm';
aTitle[79]='List of logical commands and functions in FoxPro';
aKeyWord[79]='foxpro, boolean, boolean operator, bit, function, logical, operator, and, or, xor, bitset, bitclear, bittest, bitand, bitor, bitxor';
aHits[79]=0;
aURL[80]='foxbuildproj.htm';
aTitle[80]='A button to build a project';
aKeyWord[80]='vfp, foxpro, command, add, button, screen, build, project, desktop';
aHits[80]=0;
aURL[81]='foxcalculate.htm';
aTitle[81]='The Calculate() function - an alternative to SQL';
aKeyWord[81]='foxpro, calculate, max, min, avg, std, sum, count, sql';
aHits[81]=0;
aURL[82]='foxcalculator.htm';
aTitle[82]='Using the calculator built into FoxPro';
aKeyWord[82]='foxpro, calculator, calculation, memory, accessory';
aHits[82]=0;
aURL[83]='foxcalendar.htm';
aTitle[83]='Using the calendar built into FoxPro';
aKeyWord[83]='foxpro, calendar, mscal.ocx, resource, calculator, diarydate, date';
aHits[83]=0;
aURL[84]='foxcannotquit.htm';
aTitle[84]='Cannot quit Visual FoxPro';
aKeyWord[84]='visual foxpro tutorial, build executable, cannot quit visual foxpro';
aHits[84]=0;
aURL[85]='foxcheck.htm';
aTitle[85]='Generating a CheckSum with SYS(2007)';
aKeyWord[85]='checksum, check sum, foxpro, parity, 2007, security, sys, valid, vfp';
aHits[85]=0;
aURL[86]='foxclip.htm';
aTitle[86]='Reading and writing text on the Windows clipboard in FoxPro';
aKeyWord[86]='foxpro, clip, clipboard, windows clipboard, paste, excel, word, cliptext, datatoclip, copy';
aHits[86]=0;
aURL[87]='foxcommand.htm';
aTitle[87]='Description of useful FoxPro commands and functions';
aKeyWord[87]='foxpro, vfp, commands, functions, clear, memory, close, quit, cancel, cd';
aHits[87]=0;
aURL[88]='foxconfig.htm';
aTitle[88]='Using and distributing the FoxPro configuration file';
aKeyWord[88]='vfp, foxpro, codepage, config, configuration, fpd, fpw, include, option, resource, start, startup, visible';
aHits[88]=0;
aURL[89]='foxconfirm.htm';
aTitle[89]='Wrapping the call to MessageBox() in FoxPro';
aKeyWord[89]='vfp, foxpro, messagebox, confirm, wrap';
aHits[89]=0;
aURL[90]='foxconvert.htm';
aTitle[90]='Converting from FPW 2.6 to VFP';
aKeyWord[90]='vfp, foxpro, convert, fpw, upgrade, dos, windows';
aHits[90]=0;
aURL[91]='foxconvert1.htm';
aTitle[91]='Converting FPW 2.6 data';
aKeyWord[91]='vfp, foxpro, convert, fpw, upgrade, dos, windows';
aHits[91]=0;
aURL[92]='foxconvert2.htm';
aTitle[92]='Converting FPW 2.6 program code';
aKeyWord[92]='vfp, foxpro, convert, fpw, upgrade, dos, windows';
aHits[92]=0;
aURL[93]='foxconvert3.htm';
aTitle[93]='Converting FPW 2.6 menus';
aKeyWord[93]='vfp, foxpro, convert, fpw, upgrade, dos, windows';
aHits[93]=0;
aURL[94]='foxconvert4.htm';
aTitle[94]='Converting FPW 2.6 reports';
aKeyWord[94]='vfp, foxpro, convert, fpw, upgrade, dos, windows';
aHits[94]=0;
aURL[95]='foxconvert5.htm';
aTitle[95]='Converting FPW 26 screens';
aKeyWord[95]='vfp, foxpro, convert, fpw, upgrade, dos, windows';
aHits[95]=0;
aURL[96]='foxconvert6.htm';
aTitle[96]='Converting from FPW 26 to VFP';
aKeyWord[96]='vfp, foxpro, convert, fpw, upgrade, dos, windows';
aHits[96]=0;
aURL[97]='foxcopyto.htm';
aTitle[97]='Copy data to CSV and other formats of delimited files in FoxPro';
aKeyWord[97]='foxpro, copy, csv, delimited, format, export, comma, file, xml, html, sdf';
aHits[97]=0;
aURL[98]='foxcustom.htm';
aTitle[98]='How to show custom controls from your class library on the Form Control toolbar.';
aKeyWord[98]='foxpro, vfp, custom, control, class, library, form, toolbar';
aHits[98]=0;
aURL[99]='foxdance.htm';
aTitle[99]='Foxdance by Moonlight';
aKeyWord[99]='foxdance by moonlight, christmas, copyright';
aHits[99]=0;
aURL[100]='foxdate.htm';
aTitle[100]='A list of FoxPro commands which handle date and time';
aKeyWord[100]='foxpro, date, time, command, function, cdow, cmonth, ctod, ctot, dmy, dow, dtoc, dtos, gomonth, month, century, strict, strictdate';
aHits[100]=0;
aURL[101]='foxdesktop.htm';
aTitle[101]='Exporting files to the users desktop with FoxPro';
aKeyWord[101]='foxpro, desktop, script, wsh, export, word, excel, strtofile, file';
aHits[101]=0;
aURL[102]='foxfclose.htm';
aTitle[102]='Close a low level file in FoxPro';
aKeyWord[102]='foxpro, vfp, low level, file, fclose';
aHits[102]=0;
aURL[103]='foxfcreate.htm';
aTitle[103]='Create a low level file in FoxPro';
aKeyWord[103]='foxpro, vfp, low level, file, fcreate';
aHits[103]=0;
aURL[104]='foxfile.htm';
aTitle[104]='Functions for file names in FoxPro';
aKeyWord[104]='foxpro, function, filename, file, justdrive, justpath, juststem, justext, folder, path, drive, directory';
aHits[104]=0;
aURL[105]='foxfiles.htm';
aTitle[105]='Several ways of distributing the support files for a FoxPro executable';
aKeyWord[105]='vfp, foxpro, distribution, files, setup, wizard, install, installshield, file, dll';
aHits[105]=0;
aURL[106]='foxfind.htm';
aTitle[106]='Using wild cards in the FoxPro Find dialog';
aKeyWord[106]='find, search, wild, cards, foxpro';
aHits[106]=0;
aURL[107]='foxflash.htm';
aTitle[107]='FoxPro form flashes on the screen and vanishes';
aKeyWord[107]='visual foxpro, runttime, exec, flash, vanish';
aHits[107]=0;
aURL[108]='foxfopen.htm';
aTitle[108]='Open a low level file in FoxPro';
aKeyWord[108]='foxpro, vfp, low level, file, fopen';
aHits[108]=0;
aURL[109]='foxfread.htm';
aTitle[109]='Reading a low level file in FoxPro';
aKeyWord[109]='foxpro, vfp, low level, file, fread, fgets, feof';
aHits[109]=0;
aURL[110]='foxfwrite.htm';
aTitle[110]='Writing to a low level file in FoxPro';
aKeyWord[110]='foxpro, vfp, low level, file, fwrite, fputs';
aHits[110]=0;
aURL[111]='foxgotcha.htm';
aTitle[111]='Tips for Visual FoxPro';
aKeyWord[111]='foxpro, gotcha, tip, hint, sql, select, file, array, local';
aHits[111]=0;
aURL[112]='foxgrid.htm';
aTitle[112]='How to replace the textbox in a Foxpro grid with a checkbox or another control.';
aKeyWord[112]='foxpro, grid, form, control, checkbox, tickbox, add a control to a grid';
aHits[112]=0;
aURL[113]='foxhide.htm';
aTitle[113]='Hide the main system window';
aKeyWord[113]='vfp, foxpro, hide, main, system, top level, toplevel, window';
aHits[113]=0;
aURL[114]='foxhtml.htm';
aTitle[114]='Several ways of generating HTML for web pages from FoxPro';
aKeyWord[114]='foxpro, html, strtofile, string, text, file, web, genhtml, textmerge, merge, wizard, edit, web page';
aHits[114]=0;
aURL[115]='foxlibrary.htm';
aTitle[115]='Building a class library of custom base classes in VFP';
aKeyWord[115]='foxpro, vfp, base, class, library, subclass, custom control, component gallery';
aHits[115]=0;
aURL[116]='foxlinks.htm';
aTitle[116]='Links to other useful FoxPro sites on the web';
aKeyWord[116]='foxpro, link, web, wiki, hentzenwerke, lewis, microsoft, bcs';
aHits[116]=0;
aURL[117]='foxlookup.htm';
aTitle[117]='A fast way to let users select data from a lookup table in Visual FoxPro';
aKeyWord[117]='foxpro, lookup, combo, combobox, find, lookup, fast, text, textbox, autocomplete';
aHits[117]=0;
aURL[118]='foxlotus.htm';
aTitle[118]='Lotus Approach data in FoxPro';
aKeyWord[118]='foxpro, lotus, approach, slant, access, ado, xp, web';
aHits[118]=0;
aURL[119]='foxlowlevel.htm';
aTitle[119]='Low level file handling in FoxPro';
aKeyWord[119]='foxpro, vfp, low level, file, fcreate, fread, fwrite, fopen, fclose, fflush';
aHits[119]=0;
aURL[120]='foxmerge.htm';
aTitle[120]='Using TextMerge to export text files, html or xml from FoxPro';
aKeyWord[120]='vfp, foxpro, text, texmerge, delimiter, file, export, merge, strtofile, html, xml, csv';
aHits[120]=0;
aURL[121]='foxmessage.htm';
aTitle[121]='Various ways of displaying messages to the user in FoxPro';
aKeyWord[121]='foxpro, message, messagebox, wait, msgbox, status, wait, window, list, listbox, user, timeout, interface';
aHits[121]=0;
aURL[122]='foxmulti.htm';
aTitle[122]='Multiple selections in a FoxPro listbox';
aKeyWord[122]='multiselect, multi select, multi-select, listbox, vfp, fox';
aHits[122]=0;
aURL[123]='foxnumber.htm';
aTitle[123]='FoxPro numeric functions and commands';
aKeyWord[123]='foxpro, numeric, function, abs, calculate, ceiling, int, exp, int, log, min, max, mod, rand, random, sign, str';
aHits[123]=0;
aURL[124]='foxobject.htm';
aTitle[124]='Using objects to pass parameters and return values in FoxPro';
aKeyWord[124]='foxpro, array, class, form, function, parameter, pass, procedure, object, return';
aHits[124]=0;
aURL[125]='foxoption.htm';
aTitle[125]='FoxPro command line switches';
aKeyWord[125]='vfp, foxpro, command, config, environmant, line, option, start, startup, switch';
aHits[125]=0;
aURL[126]='foxsearch.htm';
aTitle[126]='Search page for Alvechurch Data web pages';
aKeyWord[126]='alvechurch, data, search, find, javascript';
aHits[126]=0;
aURL[127]='foxsense.htm';
aTitle[127]='Intellisense in FoxPro';
aKeyWord[127]='foxpro, code, comment, html, intellisense, table, wiki';
aHits[127]=0;
aURL[128]='foxsp1.htm';
aTitle[128]='Service Pack 1 for VFP 8';
aKeyWord[128]='vfp, foxpro, download, service, pack, microsoft';
aHits[128]=0;
aURL[129]='foxstart.htm';
aTitle[129]='Startup options for FoxPro';
aKeyWord[129]='vfp, foxpro, command, config, configuration, desktop, environment, load, option, project, startup, switch';
aHits[129]=0;
aURL[130]='foxswitch.htm';
aTitle[130]='Switching between Foxpro development and runtime';
aKeyWord[130]='foxpro, tips, development, environment, lparameter, parameter, path, pcount, runtime, startup, version';
aHits[130]=0;
aURL[131]='foxtable.htm';
aTitle[131]='Commands and functions to manipulate tables in FoxPro';
aKeyWord[131]='foxpro, table, function, command, alias, aused, array, cdx, dbf, field, fsize, index, key, order, reccount, recno, tag, used';
aHits[131]=0;
aURL[132]='foxtally.htm';
aTitle[132]='Avoid problems when you create an array of data with SQL in FoxPro';
aKeyWord[132]='foxpro, array, cursor, empty, memory, sql, table, tally, _tally, variable';
aHits[132]=0;
aURL[133]='foxtext.htm';
aTitle[133]='Text commands and functions in FoxPro';
aKeyWord[133]='foxpro, text, function, alltrim, at, ctod, dtoc, dtos, filetostr, strtofile, left, len, like, lower, strtran, strextract, stuff, subst, upper';
aHits[133]=0;
aURL[134]='foxtips.htm';
aTitle[134]='Tips from Alvechurch Data for database developers in Visual FoxPro';
aKeyWord[134]='foxpro, foxpro tutorial, database developer, development, microsoft foxpro, microsoft visual foxpro, foxpro tips, vfp tips, relational database, database design, foxpro help, vfp help';
aHits[134]=0;
aURL[135]='foxtopten.htm';
aTitle[135]='Tips for FoxPro';
aKeyWord[135]='foxpro, copyright, design, excel, form, index, office, public, screen, table, tip, word, top ten';
aHits[135]=0;
aURL[136]='foxtriviaa.htm';
aTitle[136]='Answers to Foxpro trivia quiz';
aKeyWord[136]='foxpro, fox, trivia, quiz, answer';
aHits[136]=0;
aURL[137]='foxtriviaq.htm';
aTitle[137]='Foxpro trivia quiz';
aKeyWord[137]='foxpro, fox, question, quiz, trivia';
aHits[137]=0;
aURL[138]='foxusers.htm';
aTitle[138]='Tips from Alvechurch Data for users of Microsoft FoxPro';
aKeyWord[138]='foxpro, foxpro tutorial, database development, microsoft foxpro, microsoft visual foxpro, foxpro tips, vfp, relational database, database design, foxpro help, introduction, tutorial, user';
aHits[138]=0;
aURL[139]='foxvfp8.htm';
aTitle[139]='Features introduced with Visual FoxPro 8';
aKeyWord[139]='autoinc, browse, excel, foxpro, puzzle, sql, union, vfp, vfp8, wizard';
aHits[139]=0;
aURL[140]='grfcv.htm';
aTitle[140]='Geoff Franklin - resume of education and experience';
aKeyWord[140]='geoff franklin, access developer, foxpro developer, cv, resume, ou, bell, vw, open university, javascript, alvechurch, birmingham';
aHits[140]=0;
aURL[141]='/';
aTitle[141]='Alvechurch Data provide support for businesses using Microsoft FoxPro, Visual FoxPro and Access databases.';
aKeyWord[141]='foxpro, access, database, alvechurch, birmingham, midlands, development, training, visual foxpro, fox, database development';
aHits[141]=0;
aURL[142]='sitemap.htm';
aTitle[142]='Alvechurch Data Site Map of database programming topics';
aKeyWord[142]='alvechurch, data, site, map, sitemap, search, contents, list, index, topic';
aHits[142]=0;
aURL[143]='softaddr.htm';
aTitle[143]='Storing addresses in a consistent format';
aKeyWord[143]='address, consistent, field, format, postcode';
aHits[143]=0;
aURL[144]='softasc.htm';
aTitle[144]='ASCII codes';
aKeyWord[144]='ascii, code, codes, character, symbol';
aHits[144]=0;
aURL[145]='softback.htm';
aTitle[145]='How to create backups automatically in FoxPro and the Scripting Host';
aKeyWord[145]='database, foxpro, automatic, backup, date, datestamp, script, timestamp, vba, wsh';
aHits[145]=0;
aURL[146]='softdata.htm';
aTitle[146]='We do not know whether the word "data" is singular or plural';
aKeyWord[146]='data, datum, latin, singular, plural';
aHits[146]=0;
aURL[147]='softdataentry.htm';
aTitle[147]='How to design a form to make data entry easier';
aKeyWord[147]='access, foxpro, form, design, data, entry, easy, easier, poka yoke, mistake proofing, accurate, accuracy';
aHits[147]=0;
aURL[148]='softdupe.htm';
aTitle[148]='How to remove duplicate names and addresses from a database';
aKeyWord[148]='duplicate, deduplicate, name, address, postcode, record, soundex, table';
aHits[148]=0;
aURL[149]='softerr.htm';
aTitle[149]='Notes on the general techniques for handling errors';
aKeyWord[149]='access, foxpro, error, handling, handler, log, message, software, user';
aHits[149]=0;
aURL[150]='softfont.htm';
aTitle[150]='Choosing the best fonts for data entry';
aKeyWord[150]='data, data entry, font, style, courier, usability';
aHits[150]=0;
aURL[151]='softhanoi.htm';
aTitle[151]='Using the Tower of Hanoi as an efficient pattern for backup';
aKeyWord[151]='database, backup, copy, disc, disk, hanoi, pattern, schedule, software';
aHits[151]=0;
aURL[152]='softnorm.htm';
aTitle[152]='How and when to normalize a database';
aKeyWord[152]='address, database, design, field, foreign, form, key, normalise, normalize, normal, primary, relation, relationship, table';
aHits[152]=0;
aURL[153]='softphi.htm';
aTitle[153]='The golden ratio in form design';
aKeyWord[153]='form design, golden ratio, phi';
aHits[153]=0;
aURL[154]='softspec.htm';
aTitle[154]='How to help the client specify a database';
aKeyWord[154]='client, database, database development, design, specify, spec, specification, software';
aHits[154]=0;
aURL[155]='softtips.htm';
aTitle[155]='Tips from Alvechurch Data for Database Developers';
aKeyWord[155]='foxpro, foxpro tutorial, database developer, development, microsoft foxpro, visual foxpro, foxpro tips, vfp, relational database, database design, foxpro help, index, contents, advice';
aHits[155]=0;
aURL[156]='softtopten.htm';
aTitle[156]='Tips from Alvechurch Data for software developers';
aKeyWord[156]='case, comment, database, development, error, help, software, tips, top ten';
aHits[156]=0;
aURL[157]='useaccess.htm';
aTitle[157]='How to choose the right way of storing a small amount of data';
aKeyWord[157]='access, choose, excel, database, spreadsheet, word';
aHits[157]=0;
aURL[158]='useassist.htm';
aTitle[158]='How to remove the Office Assistant in Access';
aKeyWord[158]='access, office assistant, f1, help, office, remove, paperclip';
aHits[158]=0;
aURL[159]='usebackup.htm';
aTitle[159]='How to backup an Access database';
aKeyWord[159]='access, backup, copy, database, paste';
aHits[159]=0;
aURL[160]='usecut.htm';
aTitle[160]='Using Cut, Copy, Paste, and Undo in Access';
aKeyWord[160]='access, database, control, copy, cut, form, keyboard, paste, report, shortcut, short-cut, undo';
aHits[160]=0;
aURL[161]='usedataentry.htm';
aTitle[161]='Easier ways of entering data into an Access form';
aKeyWord[161]='access, data entry, shortcuts, date, today';
aHits[161]=0;
aURL[162]='usedesign.htm';
aTitle[162]='How to design a form in Access without the Wizard';
aKeyWord[162]='access, control, design, form, layout, order, select, tab, wizard';
aHits[162]=0;
aURL[163]='useimage.htm';
aTitle[163]='When to use Images and Object Frames in Access';
aKeyWord[163]='access, bound, form, frame, image, picture, toolbar';
aHits[163]=0;
aURL[164]='useinquery.htm';
aTitle[164]='How to use In and Between criteria in Access queries';
aKeyWord[164]='access, between, criterion, criteria, in, list, match, query, queries, select, sql';
aHits[164]=0;
aURL[165]='useline.htm';
aTitle[165]='Drawing straight lines on Access forms and reports';
aKeyWord[165]='access, draw, form, line, properties, property, report, straight';
aHits[165]=0;
aURL[166]='usequery.htm';
aTitle[166]='Update, Append, CrossTab and Delete queries in Access';
aKeyWord[166]='access, update query, append query, crosstab query, delete query, sql';
aHits[166]=0;
aURL[167]='usesearch.htm';
aTitle[167]='How to set the default search options in Microsoft Access';
aKeyWord[167]='access, default, dialog, fast, find, format, match, option, search, speed';
aHits[167]=0;
aURL[168]='usespeed.htm';
aTitle[168]='How to improve the speed of SQL queries in Access';
aKeyWord[168]='access, card, design, fast, index, optimise, query, queries, select, speed, sql, wild';
aHits[168]=0;
aURL[169]='usewild.htm';
aTitle[169]='Using wild cards to search in Access';
aKeyWord[169]='access, asterisk, card, find, match, search, star, wild card';
aHits[169]=0;


//----------------------------------------------------
// Function..........: Search
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 21/10/05
// Copyright.........: (c) Alvechurch Data
// Description.......: Implements the Site Search feature
// Parameter List....: Nothing
// Major change list.: 08/11/05      // Add laWords to hold target words
//                     24/03/06      // Call WriteMail if search fails

function search()
  {
  var laWords                        // Array of words
  var lnFound                        // Number of pages found
  var lcSubject                      // Subject line of message to be sent if search fails  
  var lcTarget                       // The word we're looking for
  var loPlaceHolder                  // Marks the top of the list
  
 
  loPlaceHolder=getPlaceHolder();
  clearResults(loPlaceHolder);
  
  lcTarget = document.searchForm.searchFor.value.toLowerCase()
  
  if (lcTarget == "")
    {
    writeHeader(loPlaceHolder, "Search Failed");
    writeRule(loPlaceHolder);  
    writeResult(loPlaceHolder, "Please enter a word for the search.")
    }
  else
    {
    writeHeader(loPlaceHolder, "Search Results for '" + lcTarget+ "'");
    writeRule(loPlaceHolder);  

    // Zero the hit counter and empty the array of hits
    lnFound = 0
    for (thisPage=1; thisPage < aKeyWord.length; thisPage++)
      {
      aHits[thisPage] = 0   
      }

    laWords=lcTarget.split(" ")
    for (lnWord = 0; lnWord < laWords.length; lnWord++)
      {
      
      for (thisPage=1; thisPage < aURL.length; thisPage++)
        {
        if(laWords[lnWord] == "")
          {
          // Do nothing - this is a rogue thrown up by split
          }
        else
          {
          if (aKeyWord[thisPage].indexOf(laWords[lnWord]) > -1)
            {         
            aHits[thisPage]++;
            if(aHits[thisPage]==1)
              {
              // This is the first word found on the page so record a hit
              lnFound++;   
              }
            }
          }  
        }
      }

    if (lnFound==0)
      {
      // Allow the user to send an email
      writeResult(loPlaceHolder, "I'm sorry but there is nothing in the index for '" + lcTarget + "'.")
      writeResult(loPlaceHolder, "Mail your question to us and we will try to give an answer. We might not be able to solve the problem but we will reply.")

      lcSubject = "mailto:sales@alvechurchdata.co.uk?subject=Search%20failed%20for%20" + escape(lcTarget)
      writeMail(loPlaceHolder, "Mail", lcSubject);
      writeResult(loPlaceHolder, "There is no charge for this service.")
      }
    else
      {
      // Write the array into a new window in the centre of the screen
      writeResult(loPlaceHolder, lnFound + " pages found.");
      showResults(loPlaceHolder, lnFound, lcTarget)
      lnFound=0;
      }
    }  
    
  writeResult(loPlaceHolder, "");
  writeLink(loPlaceHolder, "There is a full list of all pages from Alvechurch Data here", "sitemap.htm");  
    
  return false  
  }

//----------------------------------------------------
// Function..........: showResults
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 21/10/05
// Copyright.........: (c) Alvechurch Data
// Description.......: Shows the results
// Parameter List....: loPlaceHolder // Object marking the head of the list
//                     tnFound       // Number of pages found
//                     tcTarget      // Search target
// Major change list.:

function showResults(loPlaceHolder, tnFound, tcTarget)
  {
  var thisPage                       // Loop counter   

  // Put the pages with most hits first
  sortResults();

  for (thisPage=1; thisPage< aSorted.length; thisPage++)
    {
    writeLink(loPlaceHolder, aTitle[aSorted[thisPage]], aURL[aSorted[thisPage]]);
    }
    return false;
  }
  
//----------------------------------------------------
// Function..........: clearResults
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 21/10/05
// Copyright.........: (c) Alvechurch Data
// Description.......: Clears the results
// Parameter List....: loPlaceHolder // The head of the list of results
// Major change list.:

function clearResults(loPlaceHolder)
  {
  var dummy                           // The element we've just removed
  var i                               // Loop counter
  var numResults                      // The number of results
  var results                         // The results already shown on the page
    
  results = loPlaceHolder.childNodes;
  numResults = results.length;
  for (i=numResults - 1; i >= 0; i--)
    {
    dummy = loPlaceHolder.removeChild(results[i]);
    }
  return false;
  }

//----------------------------------------------------
// Function..........: writeResults
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 21/10/05
// Copyright.........: (c) Alvechurch Data
// Description.......: Writes a line to the results
// Parameter List....: loPlaceHolder   // The head of the list of results
//                     tcText          // The text to write
// Major change list.:

function writeResult(loPlaceHolder, tcText)
  {
  var p                                // The paragraph we're adding
  
  p=document.createElement("p");
  p.appendChild(document.createTextNode(tcText));
  loPlaceHolder.appendChild(p);
  return false;
  }

//----------------------------------------------------
// Function..........: writeHeader
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 17/05/06
// Copyright.........: (c) Alvechurch Data
// Description.......: Writes a header element to the page
// Parameter List....: toPlaceHolder // Where the header will appear
//                     tcText        // Text of the header
// Major change list.:

function writeHeader(loPlaceHolder, tcText)
  {
  var h                                // The header we're adding
  
  h=document.createElement("h1");
  h.appendChild(document.createTextNode(tcText));
  loPlaceHolder.appendChild(h);
  return false;
  }

//----------------------------------------------------
// Function..........: writeRule
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 17/05/06
// Copyright.........: (c) Alvechurch Data
// Description.......: Writes a rule to the page
// Parameter List....: toPlaceHolder // Where the header will appear
// Major change list.:

function writeRule(loPlaceHolder)
  {
  var r                                // The rule we're adding
  
  h=document.createElement("hr");
  loPlaceHolder.appendChild(h);
  return false;
  }

//----------------------------------------------------
// Function..........: writeLink
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 21/10/05
// Copyright.........: (c) Alvechurch Data
// Description.......: Writes a link to the results
// Parameter List....: toPlaceHolder // The head of the list of results
//                     tcText        // TExt to describe the link
//                     tcURL         // The URL we're linking to
// Major change list.:

function writeLink(loPlaceHolder, tcText, tcURL)
  {
  var link
  link=document.createElement("a");
  link.setAttribute("href", tcURL)
  link.appendChild(document.createTextNode(tcURL));
  link.appendChild(document.createElement("br"));
  loPlaceHolder.appendChild(document.createTextNode(tcText + " - "));
  loPlaceHolder.appendChild(link);
  return false;
  }

//----------------------------------------------------
// Function..........: writeMail
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 24/03/06
// Copyright.........: (c) Alvechurch Data
// Description.......: Writes a mailto link to the results
// Parameter List....: toPlaceHolder // Where the link will appear
//                     tcText        // Text to describe the link
//                     tcURL         // The URL we're linking to
// Major change list.:

function writeMail(loPlaceHolder, tcText, tcURL)
  {
  var link
  link=document.createElement("a");
  link.setAttribute("href", tcURL);
  link.appendChild(document.createTextNode(tcText));
  link.appendChild(document.createElement("br"));
  loPlaceHolder.appendChild(link);
  return false;
  }

//----------------------------------------------------
// Function..........: getPlaceHolder
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 21/10/05
// Copyright.........: (c) Alvechurch Data
// Description.......: Gets the placeholder object
// Parameter List....: Nothing
// Returns...........: The placeHolder object
// Major change list.:

function getPlaceHolder()
  { 
  return (document.getElementById) ? document.getElementById("placeHolder")
                                   : document.all.placeHolder
  } 

//----------------------------------------------------
// Function..........: sortResults
// Author............: Geoff Franklin
// Project...........: Web Page Utility
// Created...........: 21/10/05
// Copyright.........: (c) Alvechurch Data
// Description.......: Sorts the array of hits
// Parameter List....: None - but reads aHits and fills aSorted
// Major change list.:

function sortResults()
  {
  var i                               // Loop counter through Hits array
  var j                               // Loop through each number of hits
  var k                               // Index to sorted array
  var lnMaxHits                       // Maximum number of hits

  // Find the largest element in the array
  lnMaxHits = 0;
  for (i = 1; i<=aHits.length; i++)
    {
    if(aHits[i] > lnMaxHits)
      {
      lnMaxHits = aHits[i]
      }
    }

  // Remove all the elements from the Sorted array
  // and create the array again
  aSorted.length = 0;
  
  k = 1
  
  // Look for each possible number of hits starting
  // with the largest so we transfer the best match first
  for (j = lnMaxHits; j > 0; j--)
    {
    for (q = 1; q<=aHits.length; q++)
      {
      if (aHits[q]==j)
        { 
        aSorted[k] = q;
        k++;
        }
      }
    }
  return false;
  }