subjects = new Array(
"Beliefs",
"History",
"Chemistry",
"Biology",
"Health",
"Cultures",
"Art",
"Geography",
"Agriculture",
"Food",
"Society",
"Literature",
"Education",
"Maths",
"Astronomy",
"Physics",
"Computers",
"Geology",
"Hobbies",
"Home",
"Armed",
"Politics",
"Media",
"Finance",
"Engineering",
"Music",
"Industry",
"Transport",
"Sport",
"Fashion",
"Law",
"Leisure"
)

var menuColour = new Array("Lightpink","Lightsalmon","Burlywood","Darkkhaki","Mediumseagreen","Paleturquoise","Lightskyblue","Plum","Lightgrey")
var headerColour = new Array("Hotpink","Tomato","Orange","Olive","Forestgreen","Darkturquoise","Dodgerblue","Mediumpurple","Gray")
var menuLengths = new Array(11,15,11,20,18,26,20,16,9)

topics = new Array
(
"Anglicanism=0:0-7",
"Religion=0:1-9",
"Islam=0:2-6",
"Sects=0:3-6",
"Catholicism=0:4-8",
"Cathedrals=0:5-7",
"Churches=0:6-6",
"Christian$=0:7-6",
"The Bible=0:8-4",
"Occult$=0:9-3",
"Judaism=0:10-4",
"Sikhism=0:11-4",
"Non-belief=0:12-10",
"Eastern$=0:13-4",
"UFOs & Aliens=0:14-5",
"Spiritualism=0:15-6",
"Paranormal=0:16-8",
"Astrology=0:17-4",
"Online$=0:18-3",
"Publications$=0:19-6",
"Hinduism=0:20-4",
"Buddhism=0:21-6",
"Creationism=0:22-7",
"Local$=1:0-7",
"General$=1:1-9",
"Books$=1:2-3",
"Egypt=1:3-6",
"Greeks=1:4-2",
"Romans=1:5-4",
"Vikings=1:6-1",
"Middle East=1:7-1",
"Middle Ages=1:8-1",
"Social$=1:9-1",
"Renaissance=1:10-1",
"Tudors=1:11-3",
"Industrial Revolution=1:12-2",
"Royal Family=1:13-2",
"Magazines$=1:14-1",
"School$=1:15-4",
"Castles=1:16-14",
"1st World War=1:17-8",
"Re-enactment=1:18-4",
"Medieval$=1:19-4",
"Battlefields=1:20-2",
"Napoloeon=1:21-1",
"2nd World War=1:22-8",
"American$=1:23-5",
"Regional$=1:24-4",
"Research$=1:25-1",
"Early Man=1:26-3",
"Encyclopedia$=1:27-1",
"School$=1:28-1",
"Archives=1:29-9",
"Archaeology=1:30-7",
"Victorians=1:31-1",
"Online$=1:32-1",
"Societies$=1:33-1",
"Timelines=1:34-3",
"Slavery=1:35-2",
"Museums$=1:36-20",
"Heritage=1:37-9",
"Prehistory=1:38-5",
"Rural$=1:39-4",
"Photographic$=1:40-1",
"Societies$=1:41-2",
"Family$=1:42-18",
"Mesoamerica=1:43-1",
"Information$=2:0-2",
"Understanding$=2:1-6",
"Organic$=2:2-3",
"School$=2:3-9",
"Molecules=2:4-3",
"Oxbridge$=2:5-2",
"Periodic Table=2:6-3",
"Links$=2:7-6",
"Chemical Formulae=2:8-1",
"Crystallography=2:9-2",
"Equipment$=2:10-2",
"Organisations$=2:11-5",
"Pollution=2:12-3",
"Magazines$=2:13-2",
"Spectroscopy=2:14-3",
"Organometallics=2:15-1",
"Software$=2:16-1",
"Pharmaceuticals=2:17-1",
"Enviromental$=2:18-1",
"General$=3:0-3",
"Biodiversity=3:1-3",
"Brain=3:2-1",
"Zoos=3:3-11",
"Ecology=3:4-1",
"Nature=3:5-8",
"Nature Museums=3:6-4",
"Wildlife=3:7-9",
"Botanic Gardens=3:8-8",
"Bats=3:9-2",
"Mammals=3:10-5",
"Plants$=3:11-6",
"Research$=3:12-1",
"Turtles=3:13-5",
"Books$=3:14-1",
"Nature Reserves=3:15-5",
"Forestry=3:16-1",
"Pond Life=3:17-0!web.ukonline.co.uk/conker/pond-dip/index.htm",
"Microbiology=3:18-3",
"Butterflies=3:19-4",
"Sharks=3:20-1",
"Insects=3:21-3",
"Moths=3:22-5",
"Biotechnology=3:23-1",
"Magazines$=3:24-4",
"Conservation=3:25-15",
"Genetics=3:26-3",
"Microscopy=3:27-2",
"Herpetology=3:28-6",
"Human$=3:29-3",
"Evolution=3:30-3",
"GCSE$=3:31-1",
"Organisations$=3:32-3",
"Online$=3:33-5",
"Molecular$=3:34-2",
"Whales=3:35-4",
"A Level$=3:36-2",
"Birds=3:37-5",
"Jobs$=3:38-0!www.biologyjobs.co.uk",
"General$=4:0-2",
"Journals$=4:1-6",
"NHS=4:2-9",
"Public$=4:3-5",
"Supplements$=4:4-8",
"First Aid=4:5-3",
"Organisations$=4:6-8",
"World Health=4:7-2",
"Media$=4:8-3",
"Blood=4:9-3",
"Anaesthetics=4:10-3",
"Deafness=4:11-6",
"Online$=4:12-13",
"Men's$=4:13-5",
"Alternative$=4:14-8",
"School Health=4:15-5",
"Women's$=4:16-5",
"Mental$=4:17-8",
"Infertility=4:18-4",
"Contraception=4:19-4",
"Babies$=4:20-12",
"HIV/AIDS=4:21-5",
"Dieting$=4:22-8",
"Smoking=4:23-4",
"Heart=4:24-3",
"Keep fit=4:25-5",
"Pharmacy=4:26-8",
"Injury=4:27-4",
"Nursing=4:28-4",
"Hospitals=4:29-4",
"Allergies=4:30-3",
"Psychology=4:31-6",
"Old Age$=4:32-6",
"Care Homes=4:33-4",
"Drugs & Vaccines=4:34-5",
"Charities$=4:35-7",
"Cosmetic Surgery=4:36-5",
"Sight=4:37-14",
"Diabetes=4:38-3",
"Ambulance=4:39-3",
"Private$=4:40-6",
"Dentistry=4:41-5",
"Obesity=4:42-4",
"Stem Cells=4:43-1",
"Alcohol$=4:44-5",
"Encyclopedia$=4:45-5",
"Research$=4:46-6",
"Cancer=4:47-10",
"Language=5:0-13",
"Linguistics=5:1-6",
"French$=5:2-10",
"Arabic$=5:3-11",
"World$=5:4-10",
"Anthropology=5:5-4",
"Images$=5:6-1",
"Ancient$=5:7-2",
"Scottish$=5:8-7",
"Irish$=5:9-8",
"Philosophy=5:10-7",
"German$=5:11-2",
"Iberian$=5:12-2",
"Italian$=5:13-6",
"Welsh$=5:14-9",
"America=5:15-14",
"Australasian$=5:16-7",
"Japan=5:17-6",
"Eastern Europe=5:18-9",
"Scandinavia=5:19-8",
"African$=5:20-7",
"Balkan$=5:21-9",
"Jewish$=5:22-8",
"The Classics=5:23-1",
"China=5:24-6",
"South Asia=5:25-11",
"South East Asia=5:26-5",
"General$=6:0-7",
"UK Galleries$=6:1-23",
"World Galleries$=6:2-13",
"Societies$=6:3-3",
"Contemporary$=6:4-7",
"Dealers$James Hyman Fine Art=6:5-7",
"Support$=6:6-6",
"Arts Centres=6:7-14",
"Personalised$=6:8-2",
"Urban$=6:9-4",
"Art Materials=6:10-6",
"Design=6:11-11",
"Museums$=6:12-9",
"Furniture$=6:13-6",
"Organizations$=6:14-4",
"Information$=6:15-4",
"Magazines$=6:16-7",
"Drawing=6:17-2",
"Artists=6:18-5",
"Prints & Posters=6:19-6",
"Crafts=6:20-5",
"Drama=6:21-14",
"Children$=6:22-4",
"Architecture=6:23-8",
"Collections$=6:24-5",
"Computer$=6:25-4",
"Auction Houses=6:26-4",
"Photography$=6:27-5",
"Learning$=6:28-8",
"Calligraphy=6:29-1",
"World$=6:30-3",
"Regional$=6:31-2",
"UK$=7:0-9",
"Climate Change=7:1-5",
"Maps=7:2-10",
"World$=7:3-4",
"Environment=7:4-11",
"Teaching$=7:5-10",
"Communities=7:6-2",
"Rivers=7:7-3",
"Sustainable=7:8-11",
"Planning=7:9-5",
"Organisations$=7:10-3",
"Towns=7:11-32",
"Villages=7:12-4",
"Deserts=7:13-5",
"Images$=7:14-11",
"Oceans=7:15-10",
"Coast=7:16-3",
"Mountains=7:17-4",
"Rainforest=7:18-4",
"Countryside=7:19-12",
"Population=7:20-5",
"Land Use=7:21-4",
"Surveying=7:22-5",
"Woodlands=7:23-2",
"Air Pollution=7:24-4",
"Global Warming=7:25-2",
"Parks=7:26-1",
"Grasslands=7:27-4",
"Polar Regions=7:28-4",
"Water Supply=7:29-10",
"Market Research$=7:30-4",
"Blogs$=7:31-1",
"Borough Councils=7:32-2",
"Countries=7:33-3",
"Guide Books=7:34-2",
"Houses=7:35-3",
"Regions=7:36-1",
"Counties$=7:37-29",
"Travelogues=7:38-4",
"London Boroughs=7:39-10",
"National Parks=7:40-6",
"Cities UK=7:41-25",
"Meteorology=7:42-10",
"Diving=7:43-1",
"Publications$=8:0-12",
"General$=8:1-5",
"Dairy=8:2-10",
"Beef=8:3-12",
"DEFRA=8:4-0!www.defra.gov.uk/farm/index.htm",
"Links$=8:5-3",
"Horticulture=8:6-7",
"Education$=8:7-9",
"Shows$=8:8-3",
"Rare Breeds=8:9-3",
"Online$=8:10-5",
"Poultry$=8:11-4",
"NFU=8:12-2",
"Exotic Animals=8:13-2",
"Arable=8:14-7",
"Organic$=8:15-5",
"Fruit & Nuts=8:16-17",
"Vegetables$=8:17-4",
"Farm Shops=8:18-6",
"Machinery$=8:19-3",
"Farm Buildings=8:20-3",
"Standards$=8:21-2",
"Research$=8:22-10",
"Organisations$=8:23-13",
"Smallholdings=8:24-6",
"Pests & Disease=8:25-7",
"Fertilisers=8:26-4",
"Animal Welfare=8:27-3",
"Irrigation=8:28-2",
"Software$=8:29-4",
"Third World=8:30-1",
"Game=8:31-2",
"Beekeeping=8:32-3",
"Horses$=8:33-3",
"Pigs=8:34-4",
"Fishing=8:35-6",
"Forestry=8:36-5",
"Sheep=8:37-14",
"Non-Food$=8:38-2",
"Regional$=8:39-2",
"Recipes=9:0-11",
"Celebrity Chefs=9:1-7",
"Retailing$=9:2-3",
"Meat=9:3-6",
"Fruit$=9:4-1",
"Fish & Chips=9:5-3",
"Local$=9:6-3",
"Healthy Eating=9:7-5",
"Hampers=9:8-5",
"Vegetables$=9:9-4",
"Safety$=9:10-5",
"Seafood=9:11-1",
"Vegetarian=9:12-5",
"GM=9:13-3",
"Ethics$=9:14-3",
"Organic$=9:15-8",
"Off License=9:16-3",
"Wines=9:17-11",
"Spirits=9:18-3",
"Champagne=9:19-5",
"Cocktails=9:20-5",
"Coffee=9:21-6",
"Tea=9:22-13",
"Dieting$=9:23-5",
"Cider=9:24-8",
"Soft drinks=9:25-5",
"Restaurants=9:26-13",
"Sweets=9:27-10",
"School$=9:28-8",
"Farmers Markets=9:29-6",
"Nutrition=9:30-8",
"Intolerance$=9:31-8",
"Grocery=9:32-8",
"Additives=9:33-1",
"Research$=9:34-3",
"Cheese=9:35-2",
"Babies$=9:36-1",
"Beer=9:37-8",
"Manufacturers=9:38-1",
"Alternative$=10:0-4",
"Volunteering=10:1-16",
"Gender=10:2-10",
"Youth$=10:3-10",
"Immigration=10:4-13",
"Race Issues=10:5-8",
"Recycling=10:6-10",
"Feminism=10:7-1",
"Emergencies=10:8-4",
"Sociology=10:9-3",
"Social Work=10:10-6",
"Social Policy=10:11-6",
"Rescue=10:12-6",
"Homelessness=10:13-5",
"Charities$=10:14-7",
"Discrimination=10:15-3",
"Poverty=10:16-6",
"Parenting=10:17-8",
"Employment=10:18-21",
"Disability=10:19-6",
"Trades Union=10:20-6",
"Royalty=10:21-6",
"Christmas=10:22-2",
"Weddings=10:23-4",
"Fire Safety=10:24-5",
"Leadership=10:25-3",
"Community=10:26-9",
"Expats=10:27-6",
"Bullying=10:28-4",
"Personnel=10:29-5",
"Deed Polls=10:30-0!www.deedpollsonline.co.uk",
"Consumers=10:31-11",
"Event Planning=10:32-2",
"Old Age=10:33-4",
"Childhood=10:34-3",
"Adoption=10:35-5",
"Child Welfare=10:36-12",
"Retirement=10:37-2",
"Death=10:38-4",
"Resources=11:0-6",
"Children's=11:1-13",
"Links$=11:2-0!www.bedfordstmartins.com/litlinks",
"Crime$=11:3-7",
"Shakespeare=11:4-3",
"Biography=11:5-3",
"War=11:6-2",
"Word Games=11:7-1",
"Short Stories=11:8-4",
"Authors=11:9-5",
"Reviews=11:10-3",
"Classics=11:11-7",
"Horror=11:12-3",
"Libraries=11:13-17",
"Dictionaries=11:14-3",
"Literary Prizes=11:15-5",
"Festivals$=11:16-3",
"Poetry=11:17-10",
"Copyright=11:18-2",
"Reading=11:19-3",
"Audiobooks=11:20-3",
"Better Writing=11:21-5",
"Organisations$=11:22-2",
"Bookshops=11:23-5",
"Secondhand=11:24-3",
"Publishers$=11:25-8",
"Modern Classics=11:26-1",
"Online=11:27-4",
"Science Fiction=11:28-5",
"Playwrights=11:29-1",
"Book Clubs=11:30-1",
"General$=12:0-7",
"Revision=12:1-7",
"Exams=12:2-9",
"Higher$=12:3-10",
"Colleges=12:4-5",
"Parents$=12:5-6",
"Essays=12:6-7",
"World$=12:7-5",
"Adult$=12:8-7",
"Home$=12:9-5",
"Publications$=12:10-5",
"Subjects$=12:11-9",
"Apprenticeships=12:12-6",
"Curriculum=12:13-6",
"Software$=12:14-6",
"Teaching=12:15-14",
"Publishers$=12:16-14",
"Equipment$=12:17-7",
"Classroom Assistants=12:18-3",
"Distance Learning=12:19-6",
"School Selection=12:20-6",
"Degree Courses=12:21-4",
"Standards$=12:22-4",
"State Schools=12:23-3",
"Private Schools=12:24-6",
"Public Schools=12:25-5",
"Grid for Learning$=12:26-20",
"Universities=12:27-41",
"Prep Schools=12:28-4",
"Charities$=12:29-3",
"Primary Schools=12:30-8",
"Grammar Schools=12:31-3",
"Unions$=12:32-8",
"Students Union=12:33-4",
"Gap years=12:34-3",
"Graduates=12:35-3",
"Students=12:36-13",
"Online$=12:37-1",
"Summer Schools=12:38-1",
"History$=13:0-3",
"General$=13:1-1",
"Online$=13:2-3",
"Puzzles$=13:3-2",
"Code Breaking=13:4-1",
"Calculating=13:5-1",
"Statistics=13:6-1",
"Events$=13:7-1",
"Numbers=13:8-1",
"Operational Research=13:9-1",
"Magazines$=13:10-1",
"Careers$=13:11-2",
"Teaching$=13:12-7",
"Associations$=13:13-6",
"Mathematicians=13:14-1",
"General$=14:0-10",
"History$=14:1-3",
"ESA=14:2-1",
"NASA=14:3-1",
"The Sun=14:4-4",
"Asteroids=14:5-5",
"Space Art=14:6-4",
"Children's$=14:7-7",
"Observing$=14:8-5",
"Man in Space=14:9-6",
"The Moon=14:10-11",
"Comets=14:11-4",
"Planets=14:12-8",
"Suppliers$=14:13-3",
"Space Centres=14:14-2",
"Societies$=14:15-10",
"Cosmology=14:16-8",
"Standards$=14:17-3",
"Infrared$=14:18-4",
"Galaxies=14:19-1",
"Radio$=14:20-9",
"Observatories$=14:21-12",
"Eclipses=14:22-1",
"Space Observatories=14:23-8",
"Imaging$=14:24-3",
"Magazines$=14:25-11",
"Education$=14:26-11",
"Research$=14:27-5",
"Search for Life=14:28-3",
"Planetariums=14:29-4",
"Hubble=14:30-3",
"Astrometry=14:31-2",
"Space Weather=14:32-3",
"Museums$=15:0-1",
"Colour=15:1-2",
"Optics=15:2-3",
"Fusion$=15:3-6",
"Electromagnetism=15:4-2",
"Plasma$=15:5-3",
"Materials Science=15:6-3",
"Quantum$=15:7-1",
"Research$=15:8-3",
"Education$=15:9-8",
"Constants$=15:10-2",
"General$=15:11-6",
"Physicists=15:12-7",
"Particle$=15:13-16",
"Experiments$=15:14-6",
"Glossary$=15:15-2",
"Blogs$=15:16-2",
"Nuclear$=15:17-7",
"Nanotechnology=15:18-4",
"Superconductivity=15:19-2",
"Institutes$=15:20-3",
"Energy$=15:21-4",
"Time=15:22-6",
"Astrophysics=15:23-3",
"News$=15:24-3",
"Sound=15:25-2",
"IT News=16:0-7",
"Games$=16:1-4",
"Books$=16:2-3",
"Help$=16:3-5",
"Magazines$=16:4-7",
"Domain Names=16:5-7",
"AI=16:6-2",
"Broadband=16:7-6",
"C languages=16:8-5",
"Programming=16:9-2",
"Graphics=16:10-3",
"IT Jobs=16:11-3",
"Microsoft=16:12-4",
"Apple=16:13-4",
"Web browsers=16:14-5",
"Spreadsheet=16:15-4",
"Societies$=16:16-2",
"IT Training=16:17-7",
"Database=16:18-3",
"Suppliers$=16:19-10",
"PDAs=16:20-3",
"Printers$=16:21-4",
"Real Time=16:22-2",
"Web Servers=16:23-3",
"SQL=16:24-3",
"Games$=16:25-2",
"Web Development=16:26-7",
"PERL=16:27-5",
"PHP=16:28-4",
"Security$=16:29-3",
"HTML=16:30-4",
"Javascript=16:31-2",
"History$=16:32-5",
"Linux=16:33-4",
"General$=17:0-5",
"Regional$=17:1-4",
"Fossils=17:2-14",
"Rocks=17:3-4",
"Minerals$=17:4-10",
"Earthquakes=17:5-7",
"Volcanoes=17:6-4",
"Dinosaurs=17:7-6",
"Equipment$=17:8-1",
"Mining=17:9-5",
"Quarries=17:10-6",
"Earthquakes=17:11-1",
"Palaeoanthropology=17:12-2",
"Geology Sites=17:13-1",
"Plate Tectonics=17:14-1",
"Surveys=17:15-1",
"Societies=17:16-1",
"USGS=17:17-1",
"Research=17:18-1",
"Competitions=18:0-1",
"Angling=18:1-3",
"Dogs=18:2-2",
"Cats=18:3-1",
"Camping=18:4-1",
"Hunting=18:5-2",
"Origami=18:6-1",
"Cage Birds=18:7-4",
"Chess=18:8-6",
"Pet Welfare=18:9-5",
"Board Games=18:10-3",
"Model Railways=18:11-4",
"Woodworking=18:12-5",
"Puzzles$=18:13-6",
"Radio Control=18:14-6",
"Jigsaws=18:15-3",
"Model making=18:16-1",
"Knitting=18:17-6",
"Bird watching=18:18-5",
"Needlework=18:19-2",
"Amateur Radio=18:20-1",
"Kite Flying=18:21-4",
"Fun=18:22-1",
"Photography$=18:23-1",
"Bridge=18:24-4",
"Paintballing=18:25-1",
"Stamp Collecting=18:26-4",
"Metal Detecting=18:27-5",
"Coins & Medals=18:28-6",
"Antiques=19:0-10",
"Furniture$=19:1-6",
"Plants$=19:2-6",
"Seeds=19:3-10",
"DIY Shops=19:4-8",
"Tools$=19:5-1",
"Moving$=19:6-5",
"Security$=19:7-5",
"Cleaning=19:8-1",
"Bathrooms=19:9-6",
"Saunas & Tubs=19:10-2",
"Conservation=19:11-2",
"Fireplaces=19:12-1",
"Buying & Selling$=19:13-2",
"Decorating$=19:14-7",
"Tool Hire=19:15-1",
"Kitchen=19:16-1",
"Renovation$=19:17-5",
"Magazines$=19:18-8",
"Garden Buildings=19:19-2",
"Plumbing=19:20-1",
"Electrics=19:21-1",
"Home Swap=19:22-3",
"Organic Gardening=19:23-4",
"Building$=19:24-3",
"Garden Online=19:25-13",
"Gardening Supplies=19:26-6",
"Gardens to Visit=19:27-5",
"Safety$=19:28-1",
"Garden Shows=19:29-2",
"Organisations$=19:30-5",
"Bird feeding=19:31-3",
"Garden Centres=19:32-2",
"Allotments=19:33-5",
"Visiting$=19:34-3",
"Flooring=19:35-6",
"Garden Furniture=19:36-3",
"Energy=19:37-1",
"DIY Help=19:38-6",
"Vegetables$=19:39-6",
"Glazing=19:40-9",
"Ceramics=19:41-4",
"MOD=20:0-0!www.mod.uk",
"Blogs$=20:1-2",
"Qinetiq=20:2-0!www.qinetiq.com/home/aboutqq.html",
"RAF=20:3-9",
"Ex-service=20:4-11",
"Organisations$=20:5-9",
"Anti-War=20:6-7",
"Magazines$=20:7-4",
"Reserves=20:8-3",
"RAF History=20:9-2",
"Support$=20:10-2",
"Aircraft$=20:11-4",
"US Forces=20:12-3",
"Defence Suppliers=20:13-7",
"Intelligence=20:14-5",
"British Army=20:15-5",
"Militaria=20:16-3",
"Army History=20:17-2",
"Naval History=20:18-10",
"Royal Artillery=20:19-2",
"Army Vehicles=20:20-2",
"Royal Marines=20:21-4",
"Royal Navy=20:22-14",
"Training$=20:23-3",
"Special Forces=20:24-5",
"Books$=20:25-3",
"World Navy=20:26-4",
"Warships=20:27-5",
"Displays=20:28-6",
"Museums$=20:29-17",
"Blogs$=21:0-10",
"World$=21:1-6",
"EU$=21:2-8",
"UN=21:3-3",
"Assemblies UK=21:4-6",
"Elections UK=21:5-4",
"Polls=21:6-3",
"Campaigns$=21:7-10",
"Magazines$=21:8-10",
"MPs=21:9-6",
"Parliament=21:10-5",
"Downing Street=21:11-5",
"Commonwealth=21:12-4",
"Political Parties=21:13-12",
"Think Tanks=21:14-17",
"Embassies=21:15-6",
"Government=21:16-21",
"Regional$=21:17-7",
"House of Lords=21:18-3",
"Publications$=21:19-4",
"Civil Service=21:20-5",
"Information$=21:21-7",
"London$=21:22-5",
"Local$=21:23-9",
"Directories$=22:0-2",
"Museums$=22:1-1",
"Jobs$=22:2-1",
"Radio=22:3-8",
"Mail=22:4-3",
"TV Production=22:5-1",
"Multimedia=22:6-1",
"Electronics$=22:7-1",
"World Press=22:8-13",
"Awards$=22:9-4",
"Internet Phone=22:10-1",
"Web Surfing=22:11-1",
"Television=22:12-10",
"Online TV=22:13-6",
"Alternative$=22:14-2",
"Conspiracy=22:15-1",
"Community$=22:16-2",
"Press Freedom=22:17-2",
"Internet TV=22:18-3",
"Online$=22:19-3",
"Mobile Phone=22:20-2",
"UK Press=22:21-14",
"Regional Press=22:22-23",
"Marketing$=22:23-1",
"Online$=22:24-10",
"Journalism=22:25-7",
"Advertising=22:26-1",
"Publishers$=22:27-2",
"Magazines$=22:28-4",
"Presentations=22:29-1",
"Subscribing=22:30-2",
"Women Online=22:31-3",
"Wireless=22:32-1",
"US Media=22:33-1",
"Newsletters=22:34-1",
"Couriers=22:35-9",
"Personal$=23:0-17",
"Accountancy=23:1-5",
"Loans=23:2-14",
"News$=23:3-12",
"Charity$=23:4-6",
"Glossary$=23:5-5",
"Royal Mint=23:6-0!www.royalmint.com",
"Security Printing=23:7-5",
"Currency=23:8-4",
"Mortgages=23:9-14",
"Research$=23:10-5",
"Credit Cards=23:11-5",
"Commercial$=23:12-6",
"Online Banking=23:13-8",
"Banks=23:14-19",
"World=23:15-4",
"Crime$=23:16-6",
"Building Societies=23:17-46",
"Betting=23:18-19",
"Magazines$=23:19-6",
"Women$=23:20-3",
"Premium Bonds=23:21-0!www.nsandi.com/products/pb/index.jsp",
"National Savings=23:22-0!www.nsandi.com",
"Advice$=23:23-11",
"Insurance=23:24-15",
"Education$=23:25-3",
"Stock Exchanges=23:26-4",
"Debt=23:27-14",
"Environment$=23:28-3",
"National Insurance=23:29-3",
"Regulation$=23:30-6",
"Equity Release=23:31-10",
"Pensions=23:32-19",
"Annuities=23:33-7",
"Jobs$=23:34-9",
"Actuaries=23:35-6",
"Business=23:36-14",
"Tax=23:37-10",
"Merchant Banks=23:38-5",
"Organisations$=23:39-7",
"Economics=23:40-8",
"Gambling=23:41-15",
"Payments=23:42-5",
"Lotteries=23:43-12",
"Cheque Cashing=23:44-5",
"Child Trust Funds=23:45-7",
"Shares=23:46-8",
"Magazines$=24:0-5",
"Organisations$=24:1-7",
"Training$=24:2-4",
"Directory$=24:3-3",
"Automotive$=24:4-4",
"Resources$=24:5-3",
"Energy$=24:6-9",
"Chemical$=24:7-5",
"Metallurgy=24:8-6",
"Telephones=24:9-3",
"News$=24:10-4",
"Jobs$=24:11-6",
"Organizations$=24:12-3",
"Electrical$=24:13-2",
"Mechanical$=24:14-2",
"Magazines$=24:15-1",
"Nanotechnology=24:16-2",
"Electronic$=24:17-1",
"Mining$Mining Technology=24:18-2",
"Materials=24:19-2",
"Hydraulics=24:20-1",
"Marine$=24:21-1",
"Robotics=24:22-4",
"Links$=24:23-3",
"Civil$=24:24-5",
"Consultancy$=24:25-1",
"Waste Management=24:26-3",
"Geotechnics=24:27-1",
"Petroleum=24:28-3",
"History$=24:29-2",
"Classical$=25:0-2",
"Download$=25:1-10",
"Pop$=25:2-2",
"World$=25:3-1",
"Jukebox=25:4-3",
"Traditional$=25:5-2",
"Church$=25:6-1",
"Recording Industry=25:7-1",
"Merchandise$=25:8-1",
"Concerts=25:9-2",
"Teaching$=25:10-3",
"Rap=25:11-1",
"Fan Clubs$=25:12-1",
"Radio$=25:13-2",
"Blogs$=25:14-1",
"Video$=25:15-2",
"Yahoo Music=25:16-0!uk.launch.yahoo.com",
"Venues$=25:17-6",
"Magazines$=25:18-6",
"CDs/DVDs=25:19-9",
"Learning$=25:20-4",
"Themes$=25:21-1",
"Singers=25:22-1",
"Instruments$=25:23-2",
"Organisations$=25:24-4",
"General$=25:25-1",
"Opera=25:26-3",
"Jazz=25:27-2",
"Orchestras=25:28-5",
"Dancing=25:29-4",
"Ballet=25:30-5",
"Home Business=26:0-1",
"Publishing=26:1-4",
"News$=26:2-1",
"PR=26:3-1",
"Standards$=26:4-1",
"Business People=26:5-3",
"Waste=26:6-2",
"Telecomms$=26:7-7",
"Property=26:8-1",
"Directory$=26:9-2",
"Water=26:10-14",
"Management=26:11-1",
"History$=26:12-2",
"Catering$=26:13-2",
"Marketing$Market Research Society=26:14-1",
"Sales=26:15-1",
"Advertising$=26:16-1",
"Oil$=26:17-13",
"Energy Supply$British Gas=26:18-4",
"Organisations$=26:19-4",
"Museums$=26:20-1",
"Food$=26:21-10",
"Retail$=26:22-2",
"Clothing Retail=26:23-1",
"Food Retail=26:24-1",
"Minerals$=26:25-1",
"Explosives=26:26-1",
"Automotive$=26:27-4",
"Construction$=26:28-6",
"Entertainment$=26:29-1",
"Shopping Centres=26:30-5",
"Lighting$=26:31-1",
"Book$=26:32-1",
"Nuclear$=26:33-1",
"Printing$=26:34-1",
"Packaging$=26:35-2",
"Manufacturing$=26:36-1",
"Paper$=26:37-1",
"Public Houses=26:38-1",
"London$=27:0-2",
"Agencies=27:1-3",
"Scotland=27:2-4",
"Roads=27:3-1",
"Public$=27:4-4",
"Gliding=27:5-5",
"Waterways=27:6-7",
"Aviation=27:7-6",
"Steam Traction=27:8-4",
"Road Safety=27:9-6",
"Airports=27:10-7",
"Cycling=27:11-12",
"Car Hire=27:12-11",
"Motorcycling=27:13-6",
"Trams=27:14-6",
"Sailing=27:15-9",
"Schools$=27:16-3",
"Coach Trips=27:17-5",
"Shipping=27:18-7",
"Travel Advice=27:19-6",
"Logistics=27:20-6",
"Car Makers=27:21-11",
"Railways=27:22-13",
"Road Freight=27:23-10",
"Railway History=27:24-8",
"Buses=27:25-8",
"Caravans=27:26-5",
"Car Deals=27:27-2",
"Vans=27:28-6",
"Ballooning=27:29-1",
"Shopping$Halfords=27:30-1",
"Olympics=28:0-1",
"General$=28:1-3",
"Cricket=28:2-7",
"Rugby=28:3-6",
"Croquet=28:4-4",
"Badminton=28:5-4",
"Canoeing=28:6-4",
"Gymnastics=28:7-0!www.british-gymnastics.org",
"Coaching$=28:8-2",
"Equipment$=28:9-2",
"Squash=28:10-8",
"Field$=28:11-1",
"Watersports=28:12-3",
"Weight Lifting=28:13-0!www.bwla.co.uk",
"Tennis=28:14-15",
"Motorsport=28:15-8",
"Volleyball=28:16-0!www.volleyballengland.org",
"Athletics=28:17-8",
"US$=28:18-10",
"Football=28:19-20",
"Golf=28:20-16",
"Horse Racing=28:21-22",
"Martial Arts=28:22-7",
"Archery=28:23-0!www.nfas.net",
"Lacrosse=28:24-0!www.englishlacrosse.co.uk",
"Winter$=28:25-2",
"Polo=28:26-0!www.hpa-polo.co.uk",
"Shooting=28:27-3",
"Parachuting=28:28-0!www.bpa.org.uk",
"Table Tennis=28:29-0!www.englishtabletennis.org.uk",
"Orienteering=28:30-0!www.britishorienteering.org.uk/asp/homepage.asp",
"Football Teams=28:31-13",
"Disabled$=28:32-7",
"Rowing=28:33-8",
"Press$=28:34-2",
"Fencing=28:35-2",
"Climbing=28:36-2",
"Caving=28:37-3",
"Swimming=28:38-2",
"Memorabilia$=28:39-1",
"Ladies$=29:0-16",
"Mens$=29:1-11",
"Shopping$=29:2-13",
"Sport$=29:3-7",
"Underwear=29:4-11",
"Perfume=29:5-5",
"Handbags=29:6-7",
"Shoes=29:7-12",
"Beauty=29:8-9",
"Watches=29:9-3",
"Latest$=29:10-1",
"Museums$=29:11-1",
"Jewellery=29:12-11",
"Accessories$=29:13-4",
"Lawyers=30:0-2",
"Wills=30:1-7",
"Crime$=30:2-10",
"Visas=30:3-0!www.ukvisas.gov.uk",
"MI5=30:4-2",
"Probation=30:5-5",
"Parole=30:6-3",
"Prison=30:7-15",
"Police=30:8-15",
"Police Forces=30:9-46",
"Jobs$=30:10-4",
"Magazines$=30:11-5",
"World Law=30:12-3",
"Legal=30:13-7",
"Abbreviations$=30:14-0!www.legalabbrevs.cardiff.ac.uk",
"Directory$=30:15-3",
"Human Rights=30:16-9",
"Children$=30:17-1",
"Ombudsman$=30:18-4",
"Internet$=30:19-1",
"Legal Aid=30:20-3",
"Training$=30:21-5",
"Private Investigators=30:22-1",
"Legal Documents=30:23-6",
"Resources$=30:24-3",
"Family Matters=30:25-5",
"Law Societies=30:26-3",
"Citizens Advice=30:27-0!www.adviceguide.org.uk",
"Law Courts=30:28-1",
"Immobilise=30:29-0!www.immobilise.com",
"Security=30:30-4",
"Justice=30:31-5",
"Film=31:0-8",
"Midlands$=31:1-11",
"Toys=31:2-1",
"DVDs=31:3-4",
"NW England=31:4-5",
"Lake District=31:5-2",
"NE England=31:6-7",
"SW England$=31:7-10",
"London$=31:8-7",
"Scotland$=31:9-4",
"S England=31:10-5",
"Theme Parks=31:11-22",
"Travel Agents=31:12-1",
"E England=31:13-8",
"Comedy=31:14-1",
"Holiday Parks=31:15-8",
"Walking=31:16-5",
"Theatre=31:17-25",
"Days out=31:18-4",
"Games$=31:19-2",
"Stately Homes=31:20-12",
"Tumblelogs=31:21-4",
"Museums$=31:22-13",
"What's on?=31:23-28",
"Shopping$=31:24-1",
"Electricals=31:25-6",
"SE England$=31:26-4",
"Festivals=31:27-7",
"Ten Pin Bowling=31:28-6",
"Cartoons=31:29-1",
"Hotels=31:30-1",
"Safari Parks=31:31-7",
"Circus=31:32-1",
"Camping=31:33-1",
"Wales=31:34-2"
)

var	st = 1
var stc = 1
var	currentMenu = 0
var	currentSubMenu = 0
var currentMenuItem = 0
var currentMenuLength = 0
var defaultPage = 0
var target = "*"
var	docBody 
var	maxTopics = 23
var	topicOffset = 0
var topicShift = 0
var	inPopup = 0
var timeoutSet = 0
var	topicsMatched = 0
var reverseMenu = 20

var windowBox = "width=850, height=500"

var ti = new Array
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

var tc = new Array
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

var	tp = new Array		// large enough for maxTopics
{
	"","","","","","","","","","",
	"","","","","","","","","","",
	"","","","","","","","","",""
}

var	tu = new Array		// maxTopics urls
{
	"","","","","","","","","","",
	"","","","","","","","","","",
	"","","","","","","","","",""
}

function hideSubMenu()
{
	if(currentSubMenu > 0)		// hide the sub menu as well
	{
		for(i = 1 ; i <= currentSubMenu + 1 ; i++)
		{
			men = 'm' + currentMenu + 's' + currentMenuItem + 'i' + i

			popupObject = document.getElementById(men).style
			popupObject.display = "none"
		}
	}
	currentSubMenu = 0
}

function menuHide(menuIndex)
{
	for(i = 1 ; i <= menuLengths[menuIndex - 1] ; i++)
	{
		popupObject = document.getElementById('m'+ menuIndex + 's' + i).style
		popupObject.display = "none"
	}

	hideSubMenu(menuIndex)
}

function hideMenu()
{
	if(menuLengths[currentMenu - 1] && timeoutSet)
	{
		menuHide(currentMenu)
		currentMenu = 0
	}
	currentMenuLength = 0
}

function hideMenuTO()
{
	if(currentMenuLength)
	{
		setTimeout("hideMenu()",500)
		timeoutSet = 1
	}
}

function forceHideMenu()
{
	if(currentMenuLength)
	{
		clearMenuTimeout()
		menuHide(currentMenu)
		currentMenu = 0
	}
	currentMenuLength = 0
}

function clearMenuTimeout()
{
	if(timeoutSet)
	{
		setTimeout("hideMenu()",999999)
		timeoutSet = 0
	}
}

function sm(menu, selectedMenuItem, submenus, selectedSubMenu,redirect)
{
	menulink = 999

	if(inPopup) 
	{
		hidesst()
	}

	clearMenuTimeout()

	if(currentMenu > 0)
	{
		popupObject = document.getElementById('m'+ currentMenu + 's0').style
		popupObject.backgroundColor = headerColour[currentMenu - 1]

		menuHide(currentMenu)
	}

	currentMenu = menu
	currentMenuLength = menuLengths[menu - 1]
	currentMenuItem = selectedMenuItem
	currentSubItem = selectedSubMenu

	for(i = 1 ; i <= menuLengths[menu - 1] ; i++)
	{
		submenu = 'm' + menu + 's' + i
		popupObject = document.getElementById(submenu).style
		popupObject.marginLeft = ((menu - 1) * 100) + 'px'

		popupObject.display = "block"
		popupObject.top = (i * 19) + 2 + 'px'
		popupObject.borderRightWidth = "1px"
		popupObject.borderLeftWidth = "1px"

		if(i == selectedMenuItem)
		{
			popupObject.backgroundColor = "yellow"

			if(submenus > 0)		// show the sub menu as well
			{
				if(menu != 8)
				{
					popupObject.borderRightWidth = "0px"
				}
				else
				{
					popupObject.borderLeftWidth = "0px"
					popupObject.marginLeft = "701px"
				}

				for(j = 1 ; j <= submenus + 1; j++)
				{
					if(i < reverseMenu)
					{
						ytop = ((i + j - 1) * 19) + 2

					}
					else
					{
						ytop = (i - j + 1) * 19
					}

					men = 'm'+ currentMenu + 's' + i + 'i' + j

					popupObject = document.getElementById(men).style
					popupObject.display = "block"

					popupObject.top = ytop + 'px'
					popupObject.zIndex = 1

					if((i >= reverseMenu) && (j != 1))
					{
						popupObject.borderBottomWidth = "0px"
					}

					if(menu == 8)
					{
						popupObject.marginLeft = 500 + 'px'
					}
					else
					{
						popupObject.marginLeft = ((menu * 100) - 1) + 'px'
					}
					popupObject.width = '200px'

					if(j == selectedSubMenu)
					{
						popupObject.backgroundColor = "yellow"
					}
					else if(j == submenus + 1)
					{
						popupObject.backgroundColor = "gray"
						if(i >= reverseMenu)
						{
							popupObject.top = (ytop - 2) + 'px'
							popupObject.borderBottomWidth = "1px"
						}
					}
					else 
					{
						popupObject.backgroundColor = menuColour[menu - 1]
					}
				}
			}
			currentSubMenu = submenus
		}
		else if (i != redirect)
		{
			popupObject.backgroundColor = menuColour[menu - 1]
		}
		else 
		{
			popupObject.backgroundColor = "Lemonchiffon"
		}
	}
}

function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id + 
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}

function commonTopics() 
{
	topics.sort(function(x,y) { 
      var a = String(x).toUpperCase() 
      var b = String(y).toUpperCase() 
      if (a > b) 
         return 1 
      if (a < b) 
         return -1 
      return 0 
    })

	topics.reverse()

	for(i = 0 ; i < maxTopics ; i++)
	{
		var tid = "topic" + i

		var str = "<div class=\"topicmenu\" id=\"" + tid + "\" onmousedown=\"hidesst()\")>"
		str += "<a href=\"#\"><font size=-1></font><\/a></div>"

		var newDiv = document.createElement('div')
		document.getElementsByTagName('body').item(0).appendChild(newDiv)
		newDiv.innerHTML = str

		thisMenu = document.getElementById(tid).style
		thisMenu.display = "block"
	}
}

function showPopup(topic, count)
{
	inPopup = 0
	if(count > 0)
	{
		sst1(topic,count,'t' + topic + 's1')
	}
}

function seealso(topic, count)
{
	hidesst()
	showPopup(topic, count)
}

function switchWindow(s)
{
	if(currentMenu == 0)
	{
		location.href = s
	}
	else	// reset timeout
	{
		setTimeout("switchWindow(\"" + s + "\")",5000)
	}
}

function setSwitch(s)
{
	setTimeout("switchWindow(\"" + s + "Topics.htm\")",5000)
	writeTopics() 
}

function writeTopics() 
{
	commonTopics() 
	clientSideInclude("common", "../common.htm")
	defaultPage = 0
	toggleMenus()

	if(location.href.search("#") >= 0)
	{
		suffix = location.href.split("#")[1]

		count = suffix % 100;
		topic = (suffix - count) / 100

		showPopup(topic, count)
	}

/*
	for(m = 0 ; m < drops.length ; m++)
	{
		addMenuDiv(m + 1,drops[m][0],0,0,0,"")

		mainmenu = menus[m]

		for(j = 0 ; j < mainmenu.length ; j++)
		{
			submenu = mainmenu[j]
			sl = submenu.length
			menuitem = drops[m][j + 1]

			if(sl > 1)
			{
				addMenuDiv(m + 1,menuitem + " >",j + 1,sl,0,"#")

				for(k = 0 ; k < sl ; k++)
				{
					addMenuDiv(m + 1,submenu[k],j + 1,7,k + 1,paths[m][j][k])
				}
			}
			else // no submenu, so direct link
			{
				addMenuDiv(m + 1,menuitem,j + 1,0,0,paths[m][j][0])
			}
		}
	}
*/
}


function defaultTopics() 
{
//	rotate()
	commonTopics() 
	clientSideInclude("common", "common.htm")
	defaultPage = 1
	toggleMenus()
}

function slink(subject,topic)
{
	nam = "" + ((subject * 100) + topic)

	newWindow = window.open("",nam,windowBox)

	newWindow.location.href = "../BBlinks.htm"
}

function mlink(main,sub)
{
	nam = "" + ((main * 100) + sub)

	newWindow = window.open("",nam,windowBox)

	if(location.href.search("default.htm") < 0)
	{
		newWindow.location.href = "../BBmenus.htm"
	}
	else
	{
		newWindow.location.href = "BBmenus.htm"
	}
}

function hlink(help)
{
	inDefaultPage = (location.href.search("default.htm") >= 0)

	if(!inDefaultPage || (help[0] == 'B'))
	{
		if(!inDefaultPage)
		{
			path = "../" + help
		}
		else
		{
			path = help
		}
		if(help[0] == 'B')
		{
			newWindow = window.open("","",windowBox)

			newWindow.location.href = path
		}
		else
		{
			location.href = path
		}
	}
}

function sublink(subject)
{
	path = subject + "/" + subject + ".htm"

	if(location.href.search("default.htm") < 0)
	{
		path = "../" + path
	}
	location.href = path
}

function newin(idx)
{
	nf = tp[idx]
	topic = ti[idx]
	count = tc[idx]

	path = nf.split("/")

	cf = location.href

	sameSubject = cf.search(path[path.length - 1])

	if(count < 1)	// open in new window
	{
		url = tu[idx]
		newWindow = window.open()
		newWindow.location.href = "http://" + url
	}
	else if(sameSubject < 0)		// will need to change subject
	{
		anchor = (++topic * 100) + count
		window.location.href = nf + "#" + anchor
	}
	else
	{
		topic++
		showPopup(topic, count)
	}
}

function toggleMenus() 
{
	// delete currently displayed nodes

	topicsShown = 0
	topicsHidden = 0
	topicsMatched = 0

	if (document.getElementById) 
	{
		allDivs = document.getElementsByTagName("div")

		for(i = 0 ; i < topics.length ; i++)
		{
			splitopic = topics[i].split("=")

			thisTopic = splitopic[0].toLowerCase()

			if(target == '*')
			{
				matched = true
			}
			else if(thisTopic == target)
			{
				matched = true
			}
			else if(thisTopic > target)
			{
				matched = (thisTopic < (target + "z"))
			}
			else
			{
				matched = false
			}

			if(!matched) continue

			if(topicsHidden < topicOffset)
			{
				topicsHidden++
				continue
			}

			url = splitopic[1].split("!")

			tu[topicsShown] = url[1]

			suffix = url[0].split(":")

			topindex = suffix[1].split("-")

			subj = subjects[parseInt(suffix[0])]

			var tid = "topic" + topicsShown

			thisDiv= document.getElementById(tid)

			thisDiv.setAttribute("onmouseover", "hideMenuTO()")

			anchors = thisDiv.getElementsByTagName("a")

			thisDiv.removeChild(anchors.item(0))

			var newAnchor = document.createElement('a')

			var path = ""

			if(defaultPage == 0)
			{
				path += "../"
			}

			tp[topicsShown] = path +  subj + "/" + subj + "Topics.htm"

			ti[topicsShown] = parseInt(topindex[0])
			tc[topicsShown] = parseInt(topindex[1])

			js = "javascript:newin(" + topicsShown + ")"

			newAnchor.setAttribute("href", js)

			html = "<font size=-1>" 

			id = splitopic[0].indexOf("$")

			if(id >= 0)
			{
				ft = splitopic[0].split("$")

				splitopic[0] = ft[0] + " " + subj
			}
			html += splitopic[0]

			newAnchor.innerHTML = html + "</font>"

			thisDiv.appendChild(newAnchor)

			topicsShown = topicsShown + 1

			if(topicsShown >= maxTopics) break
		}

		popupObject = document.getElementById("t1").style

		topicsMatched = topicsShown

		if(topicsShown < maxTopics)
		{
			popupObject.display = "none"

			while(topicsShown < maxTopics)
			{
				var tid = "topic" + topicsShown

				thisDiv= document.getElementById(tid)
				anchors = thisDiv.getElementsByTagName("a")

				thisDiv.removeChild(anchors.item(0))

				var newAnchor = document.createElement("a")

				thisDiv.appendChild(newAnchor)

				topicsShown = topicsShown + 1
			}
		}
		else
		{
			popupObject.display = "block"
		}
		popupObject = document.getElementById("t2").style
		if(topicOffset > 0)
		{
			popupObject.display = "block"
		}
		else
		{
			popupObject.display = "none"
		}
	}
}

function scrollTopics(up)
{
	if(up)
	{
		topicOffset += maxTopics - 1
	}
	else
	{
		topicOffset -= maxTopics - 1
	}
	toggleMenus() 
}


function blockEnter(evt) 
{
    evt = (evt) ? evt : event    
   	var charCode = (evt.charCode) ? evt.charCode :
        		((evt.which) ? evt.which : evt.keyCode)        
	target = document.selectTopic.topic.value

	if(charCode >= 32)
	{
		target += String.fromCharCode(charCode)
	}
	else if(charCode == 8)
	{
		target = target.substring(0,target.length - 1)
	}
	target = target.toLowerCase()
	topicOffset = 0
 	toggleMenus()
 
 	if((charCode == 13) && (topicsMatched == 1))
	{
		newin(0)
	}

    return true
}

function sst1(topic,subtopics,select)
{
	inPopup = 1

	st = topic
	stc = ++subtopics		// include banner

	if(currentMenu > 0)
	{
		forceHideMenu()		// just in case a menus is displayed
	}

	for(i = 1 ; i <= subtopics + 1 ; i++)
	{
		subtopic = 't' + topic + 's' + i

		popupObject = document.getElementById(subtopic).style
		popupObject.display = "block"

		if (i == 1)
			popupObject.backgroundColor = "YellowGreen"
		else if(subtopic == select)
			popupObject.backgroundColor = "yellow"
		else if (i > subtopics)
			popupObject.backgroundColor = "Lightgreen"
		else 
			popupObject.backgroundColor = "Aquamarine"
	}
}

function suggestTopic(subject)
{
	nam = "" + subject

	newWindow = window.open("",nam,"width=825, height=385")

	newWindow.location.href = "../BBtopics.htm"
}

function sst(topic,subtopics,select)
{
	subs = select.substr(select.length - 1)

	if(timeoutSet)
	{
		clearTO()
	}

	if(subs == 1)
	{
		hidesst()		// just in case one is displayed (it could be from topics)
	}
	sst1(topic,subtopics,select)
}

function hidesst()
{
	for(i = 1 ; i <= stc + 1; i++)
	{
		popupObject = document.getElementById('t'+ st + 's' + i).style
		popupObject.display = "none"
	}
}

function clearTO()
{
	setTimeout("hsst2()",999999)
	timeoutSet = 0
}

function hsst()
{
	if(inPopup) 
	{
		if(timeoutSet)
		{
			clearTO()
		}
		else
		{
			for(i = 1 ; i <= stc + 1; i++)
			{
				popupObject = document.getElementById('t'+ st + 's' + i).style
				popupObject.display = "none"
			}
		}
	}
}

function hsst2()
{
	if(timeoutSet)
	{
		clearTO()
		inPopup = 0
		hidesst()
	}
}

function hideTO()
{
	if(currentMenuLength)
	{
		setTimeout("hideMenu()",500)
		timeoutSet = 1
	}
	else if(inPopup) 
	{
		setTimeout("hsst2()",500)
		timeoutSet = 1
	}
}

/*
function rotate()
{
	if(document.images)
	{
		currentImage += 30
		if(currentImage == 360)
		{
			currentImage = 0
		}
		document.bball.src = "rotate/rotate" + currentImage + ".gif"

		setTimeout("rotate()",3000)
	}
}
*/

/*
function addMenuDiv(menu, menuText, item, submenus, submenu, path)
{
	var div = document.createElement('div')

	if((menu == 1) && (item == 0))
	{
		docBody = document.getElementsByTagName("body").item(0)
	}

	men =  "m" + menu + "s" + item

	if(submenu > 0)
	{
		men += "i" + submenu
	}
	funct = "sm(" + menu + "," + item + "," + submenus + "," + submenu + ")"

	div.setAttribute("class", "menu")
	div.setAttribute("id", men)
	div.setAttribute("onmouseover", funct)

	textNode=document.createTextNode(menuText)

	if(path == "")
	{
		div.appendChild(textNode)
	}
	else
	{
		if(path != "#")
		{
			path = "http://" + path
		}

		var anchor = document.createElement('a')

		anchor.setAttribute("href", path)

		if(path != "#")
		{
			anchor.setAttribute("TARGET", "_blank")
		}
		anchor.appendChild(textNode)
		div.appendChild(anchor)
	}
	docBody.appendChild(div)
}
*/

