<!--

var business = new Array("Beacon Car Sales","N.a.i.l","21st Century Ltd","S Pears","S D L","Frank Smith Skip Hire","Smith Skip Hire","Autographix","Lancashire Car Ports","Virgo Sheet Metal Ltd","B & C Plumbing & Heating Supplies","S Pears Slating & Tiling North West Ltd.","Ribble Valley Soft Drinks","R H Motors","Brian Guest Motor Body Repairs","Freedom For Children Foundation","Virgo Sheet Metal Ltd.","Plusgrow","Wyrefields Industrial Estate Management Co. Ltd.","Marsden Chemicals Ltd.","Poulton Van & Car Sales","Peter Anne Design Ltd.","S E G Europe","1st West Coast Motor Auctions Ltd","Window And Door Medics Albright Windows","G's Gateaux & Bakers","Lonicans Bakery","Norbain","Blackpool Electrical Traders Ltd.","S E G (europe) Ltd.","Metalworks Design","Malcolm McCulloch & Sons Ltd","V A Whitley","Trilanco Animal Health Wholesalers","Fylde Precision Toolmakers Ltd.","Storepar Ltd.","New Look Construction Ltd","New Media (UK) Ltd","Brimet Fabrications","Wyrefield Garage","Autocol Ltd.","D T Signwriters","Wyrefield Garage","Pearson Thompson & Callery","Royal Mail","Loynds International Ltd.","Magnum Finance & Leasing Ltd","Silverfield Ltd","Tec Coatings","Blackpool Auto Recovery B.a.r","Aldon Coachworks","E Vallance Transport Services Ltd. E V T S","Silverfield Ltd.","Austin Marshall Refurbishment Ltd.","Magnum Asset Finance Ltd.","L E D Systems Ltd.","Willowdome Ltd","Wyre Housing Association Ltd.","F X Leisure Ltd.","Wyre Housing Association","Simmons Commercials","P E I Delta Ltd","Tile Ceramics Ltd.","S K Publications","P E I Omega Ltd.","Macadam","Specialised Breakdown & Recovery Services","Howdens Joinery Co","Malcolm Mcculloch & Sons Ltd.","The Fireplace Superstore","Tile Ceramics Ltd","Serck Intertruck","Adrian Leen","C Williamson","Olivers Cars","Steven J Gartside","Diamond Linx Freight & Shipping Ltd.","Eagle Freight & Shipping Ltd.","The Wood Floor Store","B R M Engineering Supplies","Enterprise Helpline Ltd.","A H Cars","Weddel Swift Distribution Ltd","Beechwood Engineering","Amcron Engineering","Poulton Press","Poulton Trade Windows","Poulton Windows Direct","H20 Sport & Marine","M I-Flues Ltd.","Mere Side Artware","Brian Powell","Chequers Cafe","K-Shield Installations","Stately Stone","Northern Citrus Products","Second Chance Ltd","Gartside Bros Ltd.","W & F Counsell W & F Counsell Evening Services","Poulton Windows Direct","Spectrum Plastics Ltd.","Chapman Engineering","Qualtrade Ltd","Mere Side Artwear","R J Consultancy","Custom Colours","Alan Atkinson","Blackpool Tool & Die Co. Ltd.","T E T Glass Fibre Mouldings","Plasma Parts.Com","Lebus International Engineers Ltd.","Archway Travel","W & F Counsell","Baxter Asphalt Ltd.","Faros Engineering Ltd.","First Surveys","Glasdon Manufacturing Ltd.","Storepar Ltd","Planet Print","Portland Films","Furness Tiles Halls Tiles","G B R Metals","Dls Motors","Gannon Oils Ltd.","D-Drill (master Drillers) Ltd.","Amcron Pipe Work","Beechwood Engineering");
var service = new Array("Advertising - Media","Amusement Services","Arrangement Of Freight Transport","Audio-Visual Equipment & Supplies","Automotive Services Except Repair & Carwashes","Bags - Paper, Plastic & Fabric - Suppliers","Blouses & Shirts Female","Bottled & Canned Soft Drinks","Bus Charter Services  Except Local","Business Services","Car Auctions","Car Breakdown & Recovery Services","Car Dealers","Car Radiator Servicing & Repairs","Cars & Other Motor Vehicles","Catering Food & Drink Suppliers","Chemical Preparations","Commercial Art & Graphic Design","Commercial Printing  Lithographic","Commercial Vehicle Breakdown & Recovery Services","Construction Contractors - General","Construction Machinery","Copying & Duplicating Services","Cutting Tools & Machine Tool Accessories","Delivery Services","Double Glazing Repairs","Double Glazing Suppliers","Drilling Oil & Gas Wells","Electrical Appliances  Tv & Radios","Electrical Equipment & Supplies","Electrical Equipment & Wiring","Electrical Work","Electricians & Electrical Contractors","Electronic Parts & Equipment","Engineering Services","Equipment Rental & Leasing","Fabricated Metal Products","Fertilisers","Financial Advisers- Independent","Fireplaces & Mantelpieces","Floor Covering Stores","Floor Laying & Floor Work","Floorcoverings - Retail","Fresh Fruits & Vegetables","Frozen Fruits  Juices & Vegetables","Fruit & Vegetables - Wholesale","Garage Services","Garden Ornament Mnfrs","General Automotive Repair Shops","Giftware Mnfrs","Glass & Glazing Work","Glass Fibre Moulding Materials & Mnfrs","Golf Equipment & Supplies","Groceries & Related Products","Hardware","Housing Associations, Societies, Trusts & Co-Operatives","Industrial Buildings & Warehouses","Industrial Machinery & Equipment","Iron & Steel Forgings","Joinery Manufacturers","Lessors Of Property","Local Trucking With Storage","Wood  Plywood & Millwork","Wood & Building Materials","Management Consulting Services","Manufacturers","Meat - Wholesale","Metal Finishing Services","Metal Products - Fabricated","Oil Fuel Distributors","Paints  Varnishes & Supplies","Petroleum Products Wholesalers  Except Bulk Terminals","Plastic Products","Plastics  Foil And Coated Paper Bags","Postal Services","Pottery Products","Powder Coatings","Prepackaged Software","Printed Circuit Services","Printers","Publishers","Quantity Surveyors","Real Estate Agents & Managers","Repair Services","Restaurants","Retail Shops","Roofing  Siding & Sheet Metal Work","Roofing Services","Security Equipment","Sheet Metal Work","Signs & Advertising Displays","Skip Hire & Rubbish Clearance & Collection","Soft Drinks - Mnfrs","Sporting Goods & Bicycle Stores","Structural Clay Products","Synthetic & Silk Fabric Mills","Television & Radio Production Services","Terrazzo  Tile  Marble & Mosaic Work","Tile Stockists","Top  Body & Upholstery Repair Shops & Paint Shops","Trusts","Used Motor Vehicle Dealers","Veterinary Pharmacies","Veterinary Surgeons & Practitioners","Welding Equipment - Sales & Service");

function viewCountryList() {
  var message = 'The countries you can compare against are:\n\n';
  for(var i=0;i<countries.length;i++) {
    message += countries[i]+',';
    if(i % 10 == 0) {
      message += '\n';
    }
  }
  window.alert(message);
}

//--------------------------------------
var caseSensitive = new autocomplete();
for(var i=0;i<business.length;i++) {
  caseSensitive.addWord(business[i]);
}
var caseSensitivei = new autocomplete();
for(var i=0;i<service.length;i++) {
  caseSensitive.addWord(service[i]);
}
//--------------------------------------

var caseInSensitive = new autocomplete();
caseInSensitive.ignoreCase();
for(var i=0;i<business.length;i++) {
  caseInSensitive.addWord(business[i]);
}
var caseInSensitivei = new autocomplete();
caseInSensitivei.ignoreCase();
for(var i=0;i<service.length;i++) {
  caseInSensitivei.addWord(service[i]);
}
//--------------------------------------
//One method of assigning values to an array
var workersByName = new Array();
workersByName[0] = 'Jim Melanson 88738';
workersByName[1] = 'Giuseppe Verde 12345';
workersByName[2] = 'John Black 54321';
workersByName[3] = 'Johan Gustavson 34521';
workersByName[4] = 'Johanne Grumbaldi 32154';
workersByName[5] = 'Bee Sting 21345';
workersByName[6] = 'Beatrice Connors 21435';
workersByName[7] = 'Beatrix Potter 53421';

//Another method of assigning values to an array
var workersBySurname = new Array('Melanson, Jim 88738','Verde, Giuseppe 12345','Black, John 54321','Gustavson, Johan 34521','Grumbaldi, Johanne 32154','Sting, Bee 21345','Connors, Beatrice 21435','Potter, Beatrix 53421');
var workersByBadge = new Array('88738 Jim Melanson','12345 Giuseppe Verde','54321 John Black','34521 Johan Gustavson','32154 Johanne Grumbaldi','21345 Bee Sting','21435 Beatrice Connors','53421 Beatrix Potter');

//Now the object
var workExample = new autocomplete();
workExample.ignoreCase();
workExample.addArray(workersBySurname);
workExample.addArray(workersByName);
workExample.addArray(workersByBadge);



//--------------------------------------
var personalList = new autocomplete();

function addPersonalWord() {
  var allowThisWord = true;
  var compare = new Array();
  compare = personalList.list();
  if(compare) {
    for(var ci=0;ci<compare.length;ci++) {
      if(compare[ci]==document.getElementById('personalword').value) {
        window.alert('You previously added '+document.getElementById('personalword').value+' to the list!');
        allowThisWord = false;
      }
    }
  }
  if(allowThisWord) {
    if(document.getElementById('personalword').value) {
      personalList.addWord(document.getElementById('personalword').value);
    }
    document.getElementById('personalwordcount').innerHTML = personalList.count();
    document.getElementById('personalword').value = '';
    document.getElementById('personalword').focus();
  }
}

function setCase(caseIs) {
  if(caseIs=='sensitive') {
    personalList.caseSensitive();
    document.getElementById('setInsensitive').style.backgroundColor = '#FFFCAD';
    document.getElementById('setInsensitive').style.color = '#FF0000';
    document.getElementById('setInsensitive').value = 'InSensitive';
    document.getElementById('setSensitive').style.backgroundColor = '#FF0000';
    document.getElementById('setSensitive').style.color = '#FFFCAD';
    document.getElementById('setSensitive').value = 'Sensitive*';
  } else {
    personalList.ignoreCase();
    document.getElementById('setInsensitive').style.backgroundColor = '#FF0000';
    document.getElementById('setInsensitive').style.color = '#FFFCAD';
    document.getElementById('setInsensitive').value = 'InSensitive*';
    document.getElementById('setSensitive').style.backgroundColor = '#FFFCAD';
    document.getElementById('setSensitive').style.color = '#FF0000';
    document.getElementById('setSensitive').value = 'Sensitive';
  }
}

//-->