/* Popular phrases - VETPRODUCTSDIRECT - 13:10:50, Fri Feb 10, 2012 */
var asPhrases=new Array ('comfortis','frontline','revolution','advantix','frontline plus','advocate','frontline plus for dogs','revolution for cats','comfortis for dogs','glucosamine for dogs','sentinel','malaseb','drontal','interceptor spectrum chew','advantix for dogs','malaseb medicated shampoo','interceptor','frontline plus 6 pack','flea treatment for dogs','dog nail clippers','revolution for dogs','capstar','heartworm tablets for dog','tick collar','dog worming','sashas blend','heartgard','protexin','feliway','retractable dog lead','baycox','sentinel spectrum for dog','hills prescription diet','dog worm tablets','frontline plus for cats','replacement covers','poultry','ivermectin','advocate for dogs','advocate for cats','dog ear cleaner','greenies','preventic tick collar','paws shampoo','drontal allwormer for dog','flea treatment for cats','hills science diet feline','sentinel spectrum chews','greenies for dogs','cat vaccinations','shedeze','dog flea tablets','liver treats','medicated dog shampoo','green lip mussel powder','vaccine','heartguard','dog muzzle','joint guard','vaccines for dogs','royal canin urinary so','kong','aloveen shampoo','profender','advantage','allwormer for dogs','dog toothpaste','aloveen','canine tranquil formula','cat lax','dog clippers','dog ear drops','omega 3 6 9','clippers','fidos','flea','hills dog food','furminator','shampoo','dog shampoo','comfortis flea tablet','sentinal','wahl dog clippers','cat allwormer','insect repellent for dogs','royal canin','milbemax','drontal allwormer chewabl','aloveen dog shampoo','dog incontinence','capstar for dogs','dog all wormer','all wormer','leather dog collars','cat worming','milbemax dog','pigs ears','denosyl','royal canin obesity','sasha','oster clippers','royal canin urinary','dog grooming clippers','citronella dog collar','tick','worming','advantage for cats','panoramis','dog ear infection','parvovirus vaccine','heartgard plus','urine off','pet pillow','paw','coccidiosis','dog beds','tick prevention for cats','puppy worming','poultry wormer','tick collars for dogs','catit','pernaease powder','dog vaccines','renal cat food','mange in dogs','seaflex','paragard','dog nail file','tick remover','joint supplement','dog bowls','hills prescription feline','muzzle','hills prescription','malaseb wash','cat repellent','milbemax cat','hills jd dog food','hills z d','hills td','fidos dog shampoo','drinkwell','ivomec','parvac','eukanuba healthy extras','flea treatment','worm tablets for cats','dog grooming brush','dog vitamins','fidos flea tick rinse','aloveen conditioner','advantage for dogs','training pads','dog barking collars','glucosamine','dog wormers','heartguard combo','gripsoft nail clippers','tapeworm tablets for dogs','greenies cats','nutrigel','flea tablets','flea spray','dog deodorant','dog car harness','royal canin mobility','vitamin b12 injectable','pet calm','royal canin dental','royal canin renal','medicated dog wash','hills prescription t d','diarrhoea','gentle leader','interceptor for dogs','omega 3 for cats','valuheart','megaderm','wombaroo','filtabac','cat flea','urine','sashas blend joint health','cat food urinary','flea control dogs','moxidectin','eye drops','monthly heartworm','eukanuba low residue','bayer advocate','dog collar','revolution cats','feliway for cats','sentinal spectrum','fido shampoo','toothpaste','shear magic clippers','dog training','small dog harness','capstar for cats','dog rocks','oster clipper blades','sensitive','essential 6','heartworm treatment','hills science dog food','tick tablets','frontline cats','eukanuba','eukanuba dog food','bed','antibiotics','eye','worm tablets for dogs','popantel allwormers','loyalty points','advance dog food','flea and tick collar','citronella collar','flea and tick for dogs','hound house','cat flea tablets','futon','frontline spray','royal canin dog food','litter','flea shampoo for dogs','postage','dog conditioner','nail clippers','sanitary pants','retractable leads','exetick','royal canin hypoallergenic','frontline flea dogs','iron supplement','vitamin k','dog anxiety','bandages','dog harness','cat food','levamisole','glyde','preventic','canine omegaderm for dogs','dog antibiotics','popantel','jerhigh','pyohex shampoo','back seat buddy','nylabone','glucosamine chondroitin','bird play gym','syringe','dog mosquito repellent','horse wormer','mange mites','paw triderm calming gel','sentinel spectrum','tick control for cats','halti','flea products','shoo tag','collar','shipping calculator','frontline spray for dogs','tuff lock leads','missing link','mosquito','nutriderm','electrolytes','cat urine off','interceptor small dogs','thundershirt','glucosamine tablets','paw osteosupport','eukanuba puppy food','kitten worming','t d','heartworm','citronella spray','advantix large dog','aquadent','tapewormer cats','omegaderm','mange treatment','cat wormer','cat collar','wahl clipper blades','flea rinse','epi-otic','cat litter','harness','tapewormers dogs','prescription diet','shipping','sporn harness','husher muzzle','dog allergy food','pyohex','ear cleaner','car seat covers','comfortis tablets','tapeworm tablets','milbemax worm tablets','frisbee','arthritis dogs','aloveen oatmeal shampoo','dog toys','z d','halter','undercoat brush','eukanuba dog small breed','puppy','daily heartworm tablets','tapeworm tablets for cats','lustre','cat feeder','probiotics','panacur','flea collar','skinneeez','worming for cats','horse gel','interceptor spectrum','adaptil','vitamin injection','program','tear stain remover','dog fly repellant','osteosupport','advantix for dogs over 25','insecticide for dogs','cd','royal canin dog','spray','pyohex conditioner','royal canin cat','hills prescription canine','flex','kiltix','prescription cat food','paratak plus','oster dog clippers','revolution blue','cat flea treatments','dog eye drops','staffie ball','bird','joint health','capstar flea tablets','ear drops','dog halters and leads','spirometra','kitten','separation anxiety','avenue retractable lead','ear','diabetic cat food','barking collars','easy walk harness','cat','urine off dog','endogard allwormer tablet','hills zd','undercoat rake','td','cat flea collar','frontline dogs','drontal tablets for dogs','wahl','vitamin c','calm','worm tablets','heartworm for dogs','shedding brush','chlorhexidine','dog bed covers','dog mites','lectade','dog grooming tools','natural dog shampoo','aussie dog toys','vitamin b','oatmeal dog shampoo','zantel','science diet','hills feline','leads','vaccines for cats','bird mite','water bowl','clicker','flea control','dog eye wipes','aristopet','ilium oticlean','feline td','hills jd','tuff lock dog lead','fly','sentinel tasty chews','sashas blend capsules','ilium','flea control cats','joint formula','dental cat food','kangaroo','revolution dogs','ambex dog wormer','fish food','paratak','selenium injectable','frontline for dogs','allwormer','heartworm tablets','eye clear','dimmitrol','bad breath','protexin powder','royal canin digestive low','wombaroo puppy milk','drontal allwormer','advance puppy','hills feline kd','drontal dog','drinkwell filters','urinary','vitamin e for dogs','needles','di-vetelact','sanitary pads','hills w d','cat calm','vp060','oster blades','low residue','sea jerky','feline tranquil formula','ear powder','cuz','kiltix collars','flea shampoo','bubble','wormers','heartguard plus chewable','cleaning and odour','postage costs','electric dog clippers','dog water toys','dry dog food','advance dental','dog halti','cuttlefish','dermcare','jerhigh dog treats','hills s d','ilium ear drops','ssscat','cat clippers','cat nail clippers','avitrol plus','wahl blades','tuff lock collar medium','anti bark collars','tick prevention for dogs','tear stain','parvac for dogs','car restraints','aristopet glucosamine','hills','solfac','hartz','dog flea tick collars','dog brushes','multi vitamins dogs','torus water bowl','kelp','dog whistle','royal canin cat urinary','hills cd cat food','liquid calcium for dogs','tick prevention','rope','cat arthritis','worming products','profender cat worming','oster a5','tick control dogs','dog pants','treat ball','k d','fly spray dogs','popantel tapewormer','hills dog food zd','dog','shoo','dog kennel extra large','worm large dog','urinary cat','livamol','x small dog harness','deodorant','indestructible dog balls','canvac 3 in 1','andis blades','digestive enzymes','dog wash','tick dog','aristopet poodle shampoo','nail','paw triderm','avitrol','ipakitine','fidos conditioner','calcium tablets for dogs','digestavite plus','omegaderm for dogs','cat toys','sashes blend','vetrap','sunscreen','chew','vets all natural','mites','b12','virbac tapewormer','cat treat','leave in conditioner','drontal cat','hydatid tapeworm','vibrating dog collar','mange','canimax','deodoriser dog','biotin 20kg','fidos flea shampoo','poultry worming','dog leads','dog intestinal wormer','advance','worming products for dogs','rabbit','prescription diet r d','program for cats','paw dermega','holee molee extreme','royal canin low fat','hessian','eukanuba dog biscuits','catit senses','gripsoft','fish treats for dogs','loyalty pet treats','permethrin','virbac tapeworm tablet','fish for dogs','balanced cal','flea bomb','1273','eukanuba puppy','black dog halti','clean ear solution','vitamins','wallaby teats','tuff lock cat collar','heartgard plus chewables','zd','bird wormer','liver sprinkles','sporn halter','cat vitamins','equimec','grooming clippers for cat','fly spray','popantel cat','pain relief for dogs','advocate cats','karlie action ball','worming tablets heartworm','feline tranquil','dog cologne','barking','kong ball','tetanus','ah202','cat allergy food','coflex','revolution blue for cats','sensitive stomach','fence','ringworm treatment','bottle','hills science','feeding bowls','kennel cough','neem oil','malaseb dog shampoo','epi otic','pork chews','fenbendazole','pig','fidos fre itch','prescription dog food','dog car cover','tick control for dogs','iams dog food','fresheeze ball','cydectin','virbac','tranquil','cat tick','fish treats','calcium sandoz','equivac','advance active dog food','carrier','endogard','behaviour','frontline plus cat','large dog balls','cage','worm tabs','revolution puppy','dog flea treatment','pain relief','dog flea','rope ball','glyde powder','pond clear','frontline spray for cats','equimax','dog diapers','hills feline light','multivitamin','clipper combs','cat worming products','queensland itch','tapeworm','711','canine tranquil','dog food','sheep wormer','kitten revolution','cat bed','hills feline c d','dog cages','andis','snooza pet futon','enzyplex','sea jerky tiddlers','joint guard for dogs','cuz ball','crate','heartgard combo','1ml syringes','iams','barking control','petkin','cat tags','troy b12 folic acid','seaflex for dogs','kennel','fido flea bomb','oohlala','milk replacer','frontline plus large','milbemax for dogs','kitten food','cat ear cleaner','omega 3 6','hills joint diet','arthritis','hills kd','aquarium','hills cd','furminator deluxe','eukanuba fp response','durapet','ear mites','frontline plus 6 pack cat','frontline plus small dogs','iams cat food','cat supplement','urine free','pernaease','canvac','hexarinse','poultry lice','eye wipes','magnetic horse boots','paratak plus 40kg','chicken and bacon','teeth','breeders choice','bird worming','chewable worming','scram','sentinal chews','lotagen','cat bowls','frontline for cats','cd cat food','citronella','redeem points','bird medication','lustre aid','vets best','dog food sensitive','charcoal','hills t d','frontline+','cat food sensitive','drontal chewables','dog travel sickness','neem dog shampoo','greyhound','fleas on cats','arthritis tablets for dogs','hills canine r d','guardian','cat carrier','dog balls','nilverm','dog walking harness','trea-earv','gripsoft shampoo bather','dental spray gel','fly repellent','response','popantel worming tablets','pernaease 250gm','hills light','pheromone','ear clear','kitty babble ball','fel-o-vax 5','dog milk','flea and tick tablets','bird vitamins','drontal allwormer for cat','rfa-18-11','canine all wormer 10kg','loyalty pet','toilet training dogs','leucogen','swabs','advocate for dogs 4-10kg','dental kit dogs','zoom groom','bag','vegetarian pigs ears','royal canine neutered cat','liver pieces','dog slicker brush','greenies petite','heartworm all wormer','poultry products','advantage dogs','toys','snooza pet futon cover','eukanuba cat','divetelact','mussel','heat pads for dogs','canine omegaderm','liver treats for dogs','eukanuba response','osteocare','biolac','dog nail clippers large','guardian worming chews','c d','dog off','dentipet','ringworm treatment cats','odour control','hamish mcbeth','abs citronella refill','coal tar shampoo','dog water bowl','dog feeding bowls','poultry medication','vam','insulin','supplements','natural shampoo','feline omegaderm','holee','tuff lock collar large','paralysis tick control','dog ear','shipping costs','paw probiotic powder','dermcare shampoo','chloromine','hills m d','pet kiss','vytrate','dental chews','water toys for dogs','feline k d','cat shedding brush','horse vaccines','fevac','sentinel spec medium dog','tuff lock small','fp-6-xl','rebound tablets','dog insect repellant','pain relief dogs','dog injections','taurine','medicated conditioner dog','cat calcium','sentinel plus','oster a5 clippers','revolution teal','rfa','worming for birds','hills science diet','scissors','mars coat king home line','potassium supplement','shedding blade','sporn','hills science diet canine','ambex cat worming','dermaclens','lustre aid cologne','permoxin','pyoben','probiotics dogs','dental','hills canine','advantage cat','hills prescription diet c','paws dog shampoo','flea comb','hills prescription diet z d','oxymav','fish treats cats','closasole','royal canin cat obesity','black dog shampoo','stressed dog','bulk worming tablets','puppy flea treatment','k-mav','anxiety','hills feline s d','stainless flat','science diet dog','sheep','dry shampoo','ben6197','weatherbeeta','lint roller','treat pouch','revolution purple','revolution pink','rain scald','3m','program for dogs','paralysis tick','dog flea spray','malaseb medicated foam','dog seat belt','bitter spray','dog chew toys','hydatids','eye stain','urinary s o','black dog treat pouch','flea and tick cats','joint','stop cat spraying','rock','aloe vera','walkies','rawhide knotted bones','rapi-gel','advantix for cats','ear canker drops','advantix red','rfa-67','jd','cordless clippers','snuggle safe heat pad','scratch','pads','eye wipes cats','shark cartilage powder','hermit crab','rd feline','debrisol','dog urine','tick twister','eagle','tuff lock collar','kynoselen','urine removal','carefresh','brewers yeast','small collar','osteosupport capsules for','strangles vaccination','science cat','bio spot','remote collars','advantage plus for dogs','tick collars dogs','betadine','boundary collars','quit itch','dog collar electric','essential 6 for dogs','advocate 4-10kg','dog tags','emu oil shampoo','catnip','hills science puppy food','dog crates','diabetic dog food','fibre','repellant','moser','cat brush','fidos oatmeal shampoo','conjunctivitis','eukanuba biscuits','essential 6 spot on','fevac 3','dog ear wipes','bowl','peptosyl','kong puppy','malacetic','traveleze','eukanuba prescription dog','royal canin dog obesity','c1975','advance cat','flea tablets for cats','hills hairball','l-carnitine','eukanuba senior small','crab','tough dog toys','wahl clippers','points','royal canin cat renal','acidurin','shootag','dog ear mite','worming syrup','magnetic horse','canine worming','advantage plus','hills prescription dog','kitten flea','worming chews','osteoarthritis','seaflex cats','adaptil refill','rapigel','lorikeet','turtle food','dog toys for large dogs','indoor cat','megalast','praziquantel','dog flea and tick shampoo','allwormer tablets cat','rabbit products','ant free bowls','ear cleaning products','advance puppy food','gripsoft slicker brush','sensitive skin','whitening shampoo','hills r d','sulphur','impact','cuddly bunny','incontinence','large dog collars','equinox','milk thistle','omega dog','grooming brushes','s d','hills kitten','final touch','shampoo for sensitive dog','hills sd','ringworm cat','small dog allwormer','shear magic 10','canine multi and immune','feline t d','staffy toys','omega','glucosamine for cats','brute','itchyscratch','chicken','denosyl tablets','equiflex','swift','hills feline td','toys for dogs','eczema','hills canine td','white e','hills wd','heartguard plus','bark collar battery','shampoo and conditioner','dog toothbrush','dog chews','sphericon','natrozol','brush','profender for cats','ambex','ball waterer','ringworm dog','twist-a-ball','chihuahua harness','dog heartworm and worms','royal canin diabetic','sea','kangaroo milk','tooth brush','554','stop urination','tooth','bird lice','ilium ear','gumabone','oralject','advance dog dental','tapeworm tabs','kelp meal','sun','vitamin tablets','lead 180cm','drenching gun','white and bright shampoo','bird swing','large dog leads','rcdjl14','flea and tick for cats','combs','puppy food','feline greenies','wd','comfortis dogs','paw osteosupport capsules','travel calm','horse','storms','gape worm','name tags','pyohex lotion','ball with rope','dog bad breath','travel','protexin soluble','animalintex','worming paste horse','resisoothe','calcium','dental food dog','horse drench','smart trim','tryptophan','canex','hills i d','catalogue','renal','wombaroo high protein','omega 3 6 oil','troy worm ban','equivac 2 in 1','flea and tick wash','hillctd68','vam paste','worming flea dogs','goldfish','avenue','hills rd canine','feline i d','hills r d feline','zinc','slip lead','guinea','macaw','hills feline i','chewers','ammo','canine all wormer','kitten vaccination','scatmat','cat worming paste','hypoallergenic','wahl km 2','frontline original','hills science cat food','selenium','cat flea products','giveaway','hills diet dog food','pet pillow replacement','bay-o-pet kiltix collar','popantel tapeworm tablets','advance large breed puppy','insect','balls','701','frontline spray dogs','whistle','revolution red','dog bags','hessian cover','dry shampoo for dogs','vitamin b1','paw ear cleaner','horse electrolytes','skin mites','arthritis for cats','liver chews','yeast treats','dap diffuser','eukanuba dog restricted','hills advanced fitness','allwormer heartworm','small bites','ear ointment','cat grooming kit','bags on board','backseat buddy','ade','royal canin sensitivity','omega 3','teats','seaflex dogs','poodle shampoo','wahl clipper accessories','tea tree oil','l carnitine','drontal puppy','prescription diet kd','cat magnetic toy','two dog leads','hills z d low allergen','pet clippers','frontline plus dog','dog name tags','preventic collars','value plus iron mineral','ear mite drops','hills canine u d','hills canine j d','skin support','direa','shedding comb','value plus allwormer','royal canin junior','frontline small dog','fidos fresh coat','eye products','advocate 3 pack small dog','soccer ball','calcium tablets','revolution flea dogs','chlorine neutralizer','kitten flea treatment','csm','st francis','greenies teenie','skin and coat','ph-566','canine f p','sweet striped','prescription diet t d','chuckit flying squirrel','moulting aid','oxymav b','car','hills feline t d','royal canin urinary s o','pestene','breeding aid','ear wipes','puppy milk','579','pet fountain','cat anxiety','pig snouts','cat lead','infin8','fidos wash','diffuser','pet wipes','squirt','troy','epi-soothe','thunderstorms','dentees','buzz off','fidos rinse','ad-6-ld','bac to nature','neatsfoot oil','1694','ilium fungafite','fido fresh coat spray','ap542','dermal','spot on','safe t tag','recharge','hills feline mature','msm','td cat food','light','dog products','hills w.d cat food','slow','electric collars','clothing','scary sounds cd','pork twist','regulate','t d bites','otiderm','science diet for cats','great dane','snooza buddy bed','puppy teether','blade wash','fleas ticks heartworm','novartis','vets best rewards','oster','licorice','flea wash','tea tree','fel-o-vax 4','energy','zd feline','antibiotic eye drops','retractable pet leads','hairball','bed covers','cat-lax','calcium syrup','slow feed bowl','2928','advance cat food','antiinflammatory','harness medium','royal canin small breed','puppy milk replacer','dog bones','house breaking aid','low fat dog treats','tranquil paste','hills science indoor','advocate 6 pack','tropical fish flakes','cordless dog clippers','cat eye drops','milk','jerhigh bacon','acidurin tablets','hills dental','epi soothe','injections','imax','sentinel for dogs','itch','equimax gold','paw probiotic','equine vaccines','no bark collar','w d','cat bells','ad-6-xld','kramar','seaweed supplements','intestinal worms','christmas collar','animal bouncers','kitten wormer','rev-6-bl','two dog coupler','ad-6-md','blud','jd feline','play and learn','hope','urinary tract','raw food','cattle','49-4215','advance dog food 15kg','infin8 halter','lice','antibark collars','stop chew','dog worming products','senior dog food','49-0905','lint','bone meal','pet beds','horse worming','worm small dog tablet','tick treatment','episoothe','in the bag','oster comb','fido\'s shampoo','breeders','hemo15','canex cubes','l d','puppy treats','rd','royal canin junior large','weight gain','big l','skid stop slow feed bowl','incontinence pants','troy alpha ear cleaner','hills science diet large','eukanuba dog treats','program medium dogs','towel','flea control for dogs','pedigree','science diet kitten','bell','tablet applicator','sentinel dog','dog kennels','hamish','tuff lock 120cm','superior protection pack','kong wubba','shear magic blades','hookworm dogs','tick collar for cats','hills rd','toothbrush','worming for dogs','allwormer tablets','first aid','insectivore','advantage red','skin itch dogs','training pouch','c1990','itchy skin','canine senior multi','s3055','geo liquid','wombaroo possum milk','impact colostrum','slicker comb','soft chicken','rat','comfortis orange','royal canin vet cat hypo','zd cat food','salt','sentinel large','so cat food','neocare','tape worm','coal tar','wet wipes','nutrident','2936','sentinel medium','small dog collar','thrive d','busy buddy','antiseptic spray','equest','glucosamine dogs','hills k d','crystal pond','large dog harness','water fountain','shedding','oster rake','stethoscope','heating pad','4 calming paste','eye infection','love em','rawhide bones','cjs','jd prescription diet','mice','val5390','omega blend','goldfish pellets','laxative','science diet dog food','pawfume','bayopet','kd','coccivet','cat allergy','equinade','aquarium salt','heartguard blue','fel o vax 5','natural dog food','heartgard plus brown','duck','training dog collars','puppy shampoo','hills ld','coforta','comb sets','tick products for dogs','wound spray','hydrobath','renal diet dogs','grooming sprays','piperazine','cophos','muscaban','resi-soothe','vitazing','jointguard','medicated shampoo','tranquil for dogs','ph down','heartguard plus brown','mars','canine multi','cool bed','anti bark','toys for staffies','becobowl','soft toys dogs','r d','thiamine','car harness','black dog infin8','sashb100','antibacterial','hills prescription diet z','gripsoft nail','hoss gloss','sulfa 3','urinefree','toilet','k1','af096','pug','heartguard chewables blue','wardleys fish food','skin care for dogs','dry eye','cat worm tablets','joint plus','frontline cats fleas','paw sensitive','christmas','frontline for medium dogs','furminator large','heat','dog carrier','hills feline k d','advantix aqua','tick spray','thrive','heartworm combo','garlic','c d canine','dog fence','frontline flea','pet pillow frame','drontal small dog','skin and wound care','1147','enzymes for dogs','dog food arthritis','advantix red 6 pack large','choker collars','hills science dog','flexi','eukanuba dog','frontline tick','hammock','tapeworm for cats','travel sickness','black dog halter','malassezia','kennel beds','citronella collar refills','liver krisps','vetafarm parrot','canine dog worming','dog coat conditioners','eukanuba healthy joints','kitten paste','hills rd diet','drinkwell pet fountain','hills jd diet','dog skin conditions','dental care','ld','durapet bowl','hills science indoor cat','cat grooming','food maze','multi vitamin','hills prescription jd','vetafarm probiotic','antibiotic cream','eukanuba small puppy','kof kontrol','travel crate','1785','kong stuff','zd canine','westie dog toy','kidney dogs','drontal worming','iams cat','drontal chewable 10kg','coupler','vetafarm','bird antibiotic','car seat','hills prescription w d','dog futon','stake','kong toy','soluvet','nylabone regular','wormer tablets','bayer advantage','canin cat','arthritic','allwormer tablets for dogs','712','cat products','snooza futon','iams healthy naturals','mite treatment','car accessories','magnetic','bac','science diet cat food','tear','jerky','fountain','frontline plus medium dog','snuggle','cat attract','pet bed covers','revolution blue cat','loyalty lamb','frontline 6','porky twisted','yeoww','prescription i d','past orders','cat crates','advance large breed','dentastix','ajgd7','tough toys','cleaning','pill popper','cat food k d','toilet training','ctod','puppy suspension','allwormer 20kg','poultry worm ender','equiplus','retractable leash','dog snacks','spaniel bowl','royal canin dog neut','medicated cat shampoo','canine td','green amino','eukanuba puppy large','retractable dog leash','ag652','vita hearts','breath freshener','dog ear products','dog sunscreen','tufflock cat collars','skin disorders','shark','humunga','conditioner','cat flea spray','advantage flea treatment','fish jerky','hills science diet kitten','corn oil','urinary infection','fido\'s fre itch rinse','l d canine','eukanuba low residue cat','dog packs','cockatiel food','deter','hills prescription z d','hills feline light 3kg','fatty acids','cough','low allergen','kong small','algae','hypokal','choker chain','cattle tick','feline','heartworm dogs','zoom groom cat','cat deterrant spray','white dog','parrot food','kong medium','wahl clipper combs','hills puppy small bites','hills td small bites','wahl clippers km','hea-chp-gr','science diet feline','advanced growth','hills science kitten','worming for kittens','appetite','omega 3 6&9','feline vaccine','flea worm for dog','ado-6','retractable','slicker','r000','tropical fish food','styptic','get off','lamb morsels','respiratory','giant breed','isogel','methionine','fowl','football','calcium gluconate','behave','belt','mobility','wormout gel','grooming scissors','ph up','hills feline k','canine jd','rcvcr4','canine all','ag660','citronella spray refill','sentinel small dog','b6','chilly bone','bed replacement covers','large breed','fidos emu oil shampoo','oatmeal conditioner','cat grass','extra large pet beds','dog mite treatment','hills prescription td','tuff lock harness large','frontline plus 6','biteabone','promectin plus','allwormer tablets dogs','fc005','enduromax','wahl combs','colostrum','hide','no bark','flexi retractable leads','imaverol','chuckit balls','quit itch lotion','9961','popantel dog','waterless shampoo','crickets','worm dog 10kg','clean teeth cats','frontline tick treatment','nail file','fp-6-m','canine z d','temptations','litter beads','capstar flea treatment','fungi','hills feline original','water wubba','hills canine large breed','roo treats','chalk','apple','hillfl45','cat tooth brush','feline joint support','crystals','dog car','pond','aboistop','wombaroo kangaroo 0.7','pet bowls','formula','zd ultra','laser','dog flea shampoo','pawtscp','hills prescription l d','auto feeder','high potency vitamin c','quititch','royal canin large breed','frontline plus medium','bladder control for dogs','bayticol','lcarnitine','stop itch','earwipes','tranquil formula','rattie toy','cat deodoriser','pancreas','permoxin rinse','c','cattle dip','science diet canine','advance dog food cans','dog deterrent','bc 50','response fp','hillp18','green mussels powder','516','frog','fp-6-c','stainless steel buckets','skipper','rev','avian','combine','igloo','tufflock leads','paw puppy shampoo','hills feline t d diet','poo bags','remote','dog house','gentearclean','flea dermatitis','royal canin giant puppy','cophos b','hills c d can food','hills canine w d','frontline medium dog','val0990','hills senior','teats cat','value plus organic iron','remote control mouse for','slippery elm','advantix 10-25kg','roo','dog flea spoton','fido \'s fre-itch rinse','calcium supplement cats','eukanuba large dog','dog tick treatment','toycmas25','royal canin weight','floating toys','sentinel spec','felrd39','revive','water cleanser','w d canine','tick products cats','leave on conditioner','small dog food','vitamin a d e','proheart yellow','preserve','groomlhr','complete mix','hills feline kitten','honey','pump','stop barking dog','amp5','heartworm chewables','puppy formula','xmas','coat deodoriser','egg and biscuit','heartguard brown','dog tapeworm tablets','amp 5','comfortis green','hillcwd136','ssscat refill','tunnel','co','travel harness','aloe','quiet time','int6-interswc','fel o vax 4','enduro','clipper spray','3ml','hair clippers','wrap','ppppd','dronchew105','neatsfoot','canine joint','hills cd cans','happy hippo','fido \'s flea rinse','hills science cat','cat t d','dematting rake','5376','cat skin care','sentinel large dogs','royal canin so','pin brush','dog and cat worming','advantix dog','fido products','fido white','sash','heartguard green','hills td cat food','u d','alley cat','darwin frog','advance kitten','healthy extras','5546','1081','perch','tuff lock lead black','best mates','wash','podplyr','party collar','lamb liver treats','pawsenskit','maze','detangling dog hair','cube','dog rash','dehydration','dog flea collars','feramo d','fo-4-c','heartgard chewables brown','fetch','fly horse','karlie','pyoderm','fish feeder','iron vita','tablets','food pancreatitis','snuggle puppy','int001','tick and flea treatments','pizzle','worm treatment for cats','senior cat','black dog treat','mg002','ticks for cats','hills feline kidney','tapeworm treatment','dog shampoo pyohex','rattie','hills canine kd','antibark','frontline plus for small','royal canin dog mature','bag refills','knot','sentinel 3 pack','magnetic mattress','bristle brush','tug a rope','hea-chp-bl','giraffe','mg001','bow','eukanuba light','flea prevention','paramectin','cat immunisation','science diet senior','ado-6-ld','large harness','hillfao113','aussie dog','hollee','safe guard','rcvc-u100','rcvc-u150','604','985','hillcoc136','apple cider','stainless bowl','dog toys small','shedding tools','ball buddy treat holder','cat tunnel','hills canine ld','ar194','fuzzy companions','plush dummies','small dogs tasty chews','tuff lock large lead','felex','atopic dermatitis','advance kitten food','megalast ball','digital thermometer','canker','coa725','hemo 15','soothe','eukmbp75','int008','hills puppy large breed','small balls','hills prescription dog food','flea protection','fidos fresh','rcvdlf14','cat ball','tuff lock cat','sootha','pod','fp-6-s','feline tranquil tablets','loofa','hepargine','carbon','fiona','fidos black','cataction bungaree','cockatoo','shootag for people','dental spray','dog toys chicken','rope bones','fc002','flea treatment for puppy','science diet kitten food','fashion','pet accessories','fo-4-s','ct05','h3048','paw ear','tufflock medium collars','sanitary','beco','dried fish','loy-k6','cat kitten wormer','advance for dogs','value plus seaweed meal','fc004','heartgard combo green','pet rocks','royal canin large','aqua worm','advance dog 15kg','science diet small','teaser','skin supplements','feline wd','skin lotion','fido\'s fre-itch rinse','feline treats','black','paralysis','advocate large','dry skin dogs','sppl','aquarian algae eater chip','fido spray','poultice','rcdal10','royal canin for dogs','dog nail trimmers','advocate over 25kg','prescription feline','atomic bounc','hills cat food i d','fidos oat','octopus','pour on','royal canin mature','eye treatment for dogs','cat cd','flints','flea beds','so','grooming for dogs','carnitine','stunt pilot cat toy','popantel tapewormer cats','s d feline','dog intestinal','cat tick prevention','customer comments','parpc','stache','cat wipes','ben7051','cat flea shampoo','clip','tea tree oil shampoo','deer','flyer','sm05','halti size 0 x small new','cantd','show bows','dogzilla','tuff lock collar x small','sticky paws','coat spray','royal canin dog skin','hills prescription k d','fritz nurser kit','daisy','frontline 250ml','cophos b paste','comfortis pink','hillctd225','hillcs225','pit','terrarium','bone radiol','folic','tuff lock medium','paws joint','pkleadl01','hills cd cats','aloe vera shampoo','advocate 6','prices','b-complex powder','pork roll','fear','spot','chicken liver','hills science diet small','sentinel spectrum small','small dog nail clipper','skin food','calm 100ml','canine total','heartguard combo green','hills l d','heparin','fido\'s everyday','spray conditioner','eterna','hillcid9','flea tablets for dogs','troy calcium syrup','royal canin dog epi','play n squeak','paw0204','royal obesity','dental treats','ambex 5','stainless steel durapet','pkleadm01','remote trainer','hills feline food','ado-3-lc','travel rug','advocate 6 month','hippo','cuddlies snake','aquarium filters','stop repellent','euksbam75','paw conditioner','safari','drontal 35kg','allwormer 35kg','rooster','aa35','t-6-ld','aa34','the good oil','advance chicken','tick only','ear otic','aussie lint roller','dog splint','drugs','hillpsb3','episoothe shampoo','alkaline','cat multivitamins','dog groomer','hillfof45','dog omega 3','fbc','royal dental','hills j d dog food','hills small','heartworm and tick','feline sd','hills j','fidoatcon','profender worming','hills prescription j d','flea prevention for cats','small leads','poly-aid','cosmic mylar ball','calcium for dogs','tying up','white hide','flea spot on','play','hot rod','tick products for cats','spray shampoo','popeye','fcdcm','dog comb or brush','canine 120 chews','buster cat','dogs health','dog cookies','pts08','hills diet dog','dog shampoo 5l','cage cleaners','dogs all worm','collar medium','cat wash','rubber ball','hypo','senior multi','hillk45','dental kit','shrimp pellets','hills small dog food','prescription diet w d','hill for cats','dog coats 45cm','fcdtor','ht22','trueblue3','can covers','troy worming','cycle','hills opt care cat food','complete water treatment','dermatitis cats','cat paste','fresheeze rotating dental','snuggle pet','revolution cat flea','sporn medium','ajgd2','herpes','hillc18','ammonia','fat cat fishing bobber','canine chews','tiddlers','dental toys','poptape','science diet puppy small','summer','cat blankets','chamomile','dog food fish','aa93','choker chain heavy','h1166hg','amino','cat chews','frontline 6 pack cats','clip n cool','alpha','horse treats','ben567','paw shampoo conditioner','t d small','hillcl18','frontline cat 12 pack','aquarium heater','hill\'s j d','shots','hills food','hillcid45','fido\'s flea','high protein supplement','chickweed','frontline 6 pack dog','frontline plus six pack','hills t','premium performance','camouflage collar','doves','portable kennel','cattle baycox','dickwick','tick foggers','rev-3-t','flu','cat treat ball','dog food heart','frontline plus 6pk','fish antibiotic','racing oil','dog shampoo 1l','prescription j d','party collar rainbow','c d cat food','fingerbrush','sick','canine hills diet','saline solution','sentinel tasty chews larg','ak465','disc blue','tapeworm tablet cat','rice','ehv','hills dog food c d','hea-com-br','cordless','cool spray','chew bone pink','pulse 8','swingin','tuff lock camouflage','cd dog','dry skin wash','hol-ee','comfortis flea','hills advance','dp5','clean ups','soft brush','dental paste','soccer','comfortis brown dog','cord','dog food 8kg','horse oil','td diet','dog shampoo 1 litre','aj178','fido \'s oatmeal','paw treatment','cat restraint','dog shampoo lavender','ball biscuit ball','critter carrier','rake brush','reptile den','puppy plus','clear','pet stains','high calorie','chewies','c d feline food');
/* $Revision: 3828 $
 *
 */

if(typeof(_sli_init )!='object'){var _sli_init=new Array();}
if(typeof(sli_init )!='function'){function sli_init(){ for(var x=0;x<_sli_init.length;x++) _sli_init[x]();}}
if(typeof(asPhrases)!='object'){ var asPhrases = new Array(); }
if(typeof(__SLI_customisations)!='object'){var __SLI_customisations = new Object();}
if(typeof(__SLI_ClientDefaults)!='object'){ var __SLI_ClientDefaults=[]; }
if(typeof(__SLI_validSearchBoxes)!='object'){ var __SLI_validSearchBoxes = new Array(); }
if(typeof(__SLI_asug_used_flag)!='object'){ var __SLI_asug_used_flag = false; }
if(typeof(__SLI_width)!='object'){ var __SLI_width = 0; }
if(typeof(sli_targeturl)!='object'){ var sli_targeturl = ""; }


    __AutoComplete = new Object(); //namespace...
    __AutoComplete_mouseMoved=false;

    // Basic UA detection
    isIE = document.all ? true : false;
    isGecko = navigator.userAgent.toLowerCase().indexOf('gecko') != -1;
    isOpera = navigator.userAgent.toLowerCase().indexOf('opera') != -1;

    /* defaults and options */

    var __SLI_ApplicationName = 'AutoSuggest';
        __SLI_customisations[ 'AutoSuggest' ] =
                {
                    'ShowBrandingFooter' : true
                    ,
                    'TextBoxIDPrefix' : 'sli_search_'
                    ,
                    'BrandingFooterImagePath' : 'http://assets.resultspage.com/autosuggest/sli_systems-powered_150_15.gif'
                    ,
                    'BrandingFooterTitleTooltip' : 'AutoSuggest Powered by SLI Systems'
                    ,
                    'DropListMinWidth' : 150
                    ,
                    'MaxListItems' : 10
                    ,
                    'Alignment' : true
                    ,
                    'TextBoxIDCustom' : []
                    ,
                    'ValidSearchBoxes' : false 
                    ,
                    'IE6SelectBox' : false 
                    ,
                    'IE6SelectBoxPadding' : 0
                    ,
                    'TargetURL' : ''
                    ,
                    'IframeAlignment' : false
                    ,
                    'AlignmentBorderBug' : false
                    ,
                    'IE6OnFocus' : false
                };
    /* 0 = keyname, 1 = value */
    for( defaultValuePair in __SLI_ClientDefaults )
    {
        __SLI_customisations[__SLI_ApplicationName][__SLI_ClientDefaults[defaultValuePair][0]]=__SLI_ClientDefaults[defaultValuePair][1];
    }

    /* pre-fetch branding footer image if being used...
     */
    if( __SLI_customisations[ __SLI_ApplicationName ][ 'ShowBrandingFooter' ] )
    {
        
        if(location.protocol == "https:")
        {
            __SLI_customisations[ __SLI_ApplicationName ][ 'BrandingFooterImagePath' ] = __SLI_customisations[ __SLI_ApplicationName ][ 'BrandingFooterImagePath' ].replace(/http:/i, 'https:');
        }
    
        var __AutoCompleteBranding = new Image();
        __AutoCompleteBranding.src=__SLI_customisations[ __SLI_ApplicationName ][ 'BrandingFooterImagePath' ];
    }


    function AutoComplete_init()
    {
        if(!isOpera)
        {
            var oldonresize=function(){};
            if(typeof(window.onresize)=='function')
                oldonresize = window.onresize;//play nicely with other people's toys
            window.onresize= function(){ oldonresize(); AutoComplete_HideAll(); AutoComplete_Create( asPhrases ); }

            AutoComplete_Create( asPhrases );
            
            var els = document.getElementsByTagName('input');
            if(els)
            {
               for ( i = 0; i < els.length; i++ )
               {
                  if(els[i].name == "asug")
                  {
                     els[i].disabled = true;
                  }
               }
            }
        }
    }




    /**
    * Attachs the autocomplete object to a form element. Sets
    * onkeypress event on the form element.
    *
    * @param string formElement Name of form element to attach to
    * @param array  data        Array of strings of which to use as the autocomplete data
    */
    //function AutoComplete_Create (id, data)
    /*
     * iterate over 'sli_search_*' assumes one or more search boxes numbered from 1...
    */
    function AutoComplete_Create( data )
    {
        var idx=1, e, id, searchBoxPrefix=__SLI_customisations[ __SLI_ApplicationName ][ 'TextBoxIDPrefix' ];
        while( e = document.getElementById(searchBoxPrefix+idx) )
        {
            AutoComplete_AttachHandlers(e, data);
            if( __SLI_customisations[ __SLI_ApplicationName ][ 'ValidSearchBoxes' ] )
            {
                __SLI_validSearchBoxes.push(searchBoxPrefix+idx);
            }
            idx++;
        }
        
        
        //this array comes from the customised list
        var otherTextBoxIdList = __SLI_customisations[ __SLI_ApplicationName ][ 'TextBoxIDCustom' ];
        if( otherTextBoxIdList)
        {
            for(idx=0;idx<otherTextBoxIdList.length;idx++)
            {
                e = document.getElementById(otherTextBoxIdList[idx]);
                if(e)
				{
					if( __SLI_customisations[ __SLI_ApplicationName ][ 'ValidSearchBoxes' ] )
                	{
	                    __SLI_validSearchBoxes.push( otherTextBoxIdList[idx] );
                	}
					AutoComplete_AttachHandlers(e, data);
				}
            }
        }
        
    } 

    function AutoComplete_AttachHandlers(e, data){
        var iframe,id;
        id=e.id;


        __AutoComplete[id] = {'data':data,
                              'isVisible':false,
                              'element':document.getElementById(id),
                              'dropdown':null,
                              'highlighted':null};

        __AutoComplete[id]['element'].setAttribute('autocomplete', 'off');
        __AutoComplete[id]['element'].onkeydown = function(e) {if (!e) e = window.event; return AutoComplete_KeyDown(this.getAttribute('id'), e);}
        __AutoComplete[id]['element'].onkeyup = function(e) {if (!e) e = window.event; return AutoComplete_KeyUp(this.getAttribute('id'), e);}
        // The function call on the next line was changed by Andrew Grieve April 2008
        __AutoComplete[id]['element'].onkeypress = function(e) {if (!e) e = window.event; return AutoComplete_KeyPress(this.getAttribute('id'), e);}
        __AutoComplete[id]['element'].onclick = function(e)
        {
            if( __SLI_customisations[ __SLI_ApplicationName ][ 'IE6OnFocus' ] )
            {
                __AutoComplete[id]['element'].focus();
            }
            if (!e) e = window.event; e.cancelBubble = true; e.returnValue = false;
        }



        // Hides the dropdowns when document clicked
        var docClick = function()
        {
            if( __SLI_customisations[ __SLI_ApplicationName ][ 'ValidSearchBoxes' ] )
            {
               for(var i=0; i < __SLI_validSearchBoxes.length; i++)
               {
                   if(document.getElementById(__SLI_validSearchBoxes[i]))
                   {
                       AutoComplete_HideDropdown(__SLI_validSearchBoxes[i]);
                   }
               }
            }
            else
            {
                for (id in __AutoComplete)
                {
                   AutoComplete_HideDropdown(id);
                }
            }
        }

        if (document.addEventListener) {
            document.addEventListener('click', docClick, false);
        } else if (document.attachEvent) {
            document.attachEvent('onclick', docClick, false);
        }


        // Max number of items shown at once
        if (arguments[2] != null) {
            __AutoComplete[id]['maxitems'] = arguments[2];
            __AutoComplete[id]['firstItemShowing'] = 0;
            __AutoComplete[id]['lastItemShowing'] = arguments[2] - 1;
        }

        AutoComplete_CreateDropdown(id);

        // Prevent select dropdowns showing thru
        if (isIE) {
            iframe = document.createElement('iframe');
            __AutoComplete[id]['iframe'] = iframe;
                iframe.id = id +'_iframe';
                iframe.style.position = 'absolute';
                iframe.style.top = '0';
                iframe.style.left = '0';
                iframe.style.width = '0px';
                iframe.style.height = '0px';
                iframe.style.zIndex = '98';
                iframe.style.visibility = 'hidden';
                
                if(location.protocol == "https:")
                {
                   iframe.src = 'https://assets.resultspage.com/autosuggest/blank.html';
                }
                
                if( __SLI_customisations[ __SLI_ApplicationName ][ 'IE6SelectBox' ] )
                {
                  iframe.style.width = __SLI_width  + __SLI_customisations[ __SLI_ApplicationName ][ 'IE6SelectBoxPadding'];
                }

            if( __SLI_customisations[ __SLI_ApplicationName ][ 'IframeAlignment' ] )
            {
                document.body.insertBefore( iframe );
            }
            else
            {
                __AutoComplete[id]['element'].parentNode.insertBefore( iframe, __AutoComplete[id]['element'] );
            }
        }
    }

    /**
    * Creates the dropdown layer
    *
    * @param string id The form elements id. Used to identify the correct dropdown.
    */
    function AutoComplete_CreateDropdown(id)
    {
        var theSearchbox = __AutoComplete[id]['element'];
        var theDropDown;
        var left_top = AutoComplete_getPos( theSearchbox );
        var left  = left_top[0];
        var top   = left_top[1] + theSearchbox.offsetHeight;
        var width = theSearchbox.offsetWidth;

        if ( width < __SLI_customisations[ __SLI_ApplicationName ][ 'DropListMinWidth' ] )
        {
            width = __SLI_customisations[ __SLI_ApplicationName ][ 'DropListMinWidth' ];
        }

        theDropDown = document.createElement('div');
        theDropDown.className = 'autocomplete'; // Don't use setAttribute()


        if(__SLI_customisations[ __SLI_ApplicationName ][ 'Alignment' ] == true && document.body)
        {
            theDropDown.style.position = 'absolute';
            document.body.insertBefore(theDropDown, document.body.nextSibling);
            
            // Position it
            theDropDown.style.visibility = 'hidden';
            theDropDown.style.left       = left + 'px';
            theDropDown.style.top        = top + 'px';
            theDropDown.style.width      = width + 'px';
            theDropDown.style.zIndex     = '99999';
        }
        else if(__SLI_customisations[ __SLI_ApplicationName ][ 'Alignment' ] == "offsetrelative" && document.body)
        {
          theSearchbox.parentNode.insertBefore(theDropDown, theSearchbox);
          // Position it
          if(sli_getStyle(theSearchbox.offsetParent, 'position') != "absolute")
          {
            theSearchbox.offsetParent.style.position = 'relative';
          }
          theDropDown.style.position = 'absolute';
          theDropDown.style.left = (theSearchbox.offsetLeft) + 'px';
          theDropDown.style.top = (theSearchbox.offsetTop + theSearchbox.offsetHeight) + 'px';
          theDropDown.style.width = (theSearchbox.clientWidth) + 'px';
          theDropDown.style.visibility = 'hidden';
          theDropDown.style.zIndex     = '99999999';
        }
        else
        {
            theSearchbox.parentNode.insertBefore(theDropDown, theSearchbox);
            // Position it
            theDropDown.style.visibility = 'hidden';
            theDropDown.style.left       = left + 'px';
            theDropDown.style.top        = top + 'px';
            theDropDown.style.width      = width + 'px';
            theDropDown.style.zIndex     = '99999';
        }
        

        __AutoComplete[id]['dropdown'] = theDropDown;
        __SLI_width = width;
    }

    function /* array [ left, top ] */ AutoComplete_getPos( obj )
    {
        var curleft = curtop = 0;
        var sli_flag = 0;

        if (obj.offsetParent)
        {
           do
           {
              if ( __SLI_customisations[ __SLI_ApplicationName ][ 'AlignmentBorderBug' ] )
              {         
                
                if(sli_flag == 1)
                {
                    var clientTop = (obj.offsetHeight - obj.clientHeight) / 2;
                    curtop += clientTop;

                    var clientLeft = (obj.offsetWidth - obj.clientWidth) / 2;
                    curleft += clientLeft;
                }
                sli_flag = 1;
              }
           
              curleft += obj.offsetLeft;
              curtop += obj.offsetTop;
           }
           while (obj = obj.offsetParent);
        }
        return [curleft,curtop];
    }

    /**
    * Shows the dropdown layer
    *
    * @param string id The form elements id. Used to identify the correct dropdown.
    */
    function AutoComplete_ShowDropdown(id)
    {

        AutoComplete_HideAll();



        var value = __AutoComplete[id]['element'].value;
        var toDisplay = new Array();
        var newDiv    = null;
        var text      = null;
        var numItems  = __AutoComplete[id]['dropdown'].childNodes.length;

        __AutoComplete_mouseMoved=false;
        // SLI Code Modification - Start - Andrew Grieve April 08
        // Trim the textbox so that if is starts with a space then the feature will still work
        //value = value.replace(/^\s+|\s+$/g,"");
        value = value.replace(/^\s+/g,"");

        if(value.length == "")
        {
            // If Textbox length is nothing (after the trim) then don't show dropdown.
            return;
        }
        // SLI Code Modification - End

        // Remove all child nodes from dropdown
        while (__AutoComplete[id]['dropdown'].childNodes.length > 0) {
            __AutoComplete[id]['dropdown'].removeChild(__AutoComplete[id]['dropdown'].childNodes[0]);
        }


        var count=0;
        // Go thru data searching for matches
        for (i=0; i<__AutoComplete[id]['data'].length; ++i)
        {
            // SLI Code Modification - Start - Andrew Grieve April 08 - Added lower casing
            if (__AutoComplete[id]['data'][i].substr(0, value.length).toLowerCase() == value.toLowerCase())
            {
                // SLI Code Modification - End
                toDisplay[toDisplay.length] = __AutoComplete[id]['data'][i];
                count++;
                /* how many to display? */
                if(count == __SLI_customisations['AutoSuggest']['MaxListItems'] ) /* Code inserted to keep list to a maximum of 10 values (was 20 or 30) */
                {
                    break;
                }
            }
        }

        // No matches?
        if (toDisplay.length == 0) {
            AutoComplete_HideDropdown(id);
            return;
        }



        // Add data to the dropdown layer
        for (i=0; i<toDisplay.length; ++i) {
            newDiv = document.createElement('div');
            newDiv.className = 'autocomplete_item'; // Don't use setAttribute()
            newDiv.setAttribute('id', 'autocomplete_item_' + i);
            newDiv.setAttribute('index', i);
            newDiv.style.zIndex = '99999';

             // Scrollbars are on display ?
            if (toDisplay.length > __AutoComplete[id]['maxitems'] && navigator.userAgent.indexOf('MSIE') == -1) {
                newDiv.style.width = __AutoComplete[id]['element'].offsetWidth - 22 + 'px';
            }

            newDiv.onmouseover =
        function()
        {
            if( __AutoComplete_mouseMoved )
                AutoComplete_HighlightItem(__AutoComplete[id]['element'].getAttribute('id'), this.getAttribute('index'));
        };

            newDiv.onclick     =    function()
                                    {
                                    	  __SLI_asug_used_flag = true;
                                                                           
                                        AutoComplete_SetValue(__AutoComplete[id]['element'].getAttribute('id'));
                                        AutoComplete_HideDropdown(__AutoComplete[id]['element'].getAttribute('id'));
                                        AutoComplete_submitForm(id);
                                    }



            text   = document.createTextNode(toDisplay[i]);
            newDiv.appendChild(text);
            newDiv.title='Search for ' + toDisplay[i];

            /* ellipsis for IE only */
            if( isIE )
            {
                newDiv.style.textOverflow = 'ellipsis';
                newDiv.style.width = '100%';
                newDiv.style.whiteSpace = 'nowrap';
                newDiv.style.overflow = 'hidden';

            }
            __AutoComplete[id]['dropdown'].appendChild(newDiv);
        }
        /*
         * append DIV containing footer branding...
         */
        if(__SLI_customisations['AutoSuggest']['ShowBrandingFooter'])
        {
            i = toDisplay.length;
            newDiv = document.createElement('div');
            newDiv.className = 'autocomplete_footer'; // Don't use setAttribute()
            newDiv.setAttribute('id', 'autocomplete_item_' + i);
            newDiv.setAttribute('index', i);
            newDiv.style.zIndex = '99999';
            newDiv.innerHTML = '<a href="http://www.sli-systems.com/powered-by.php" title="' +
                                __SLI_customisations[ __SLI_ApplicationName ][ 'BrandingFooterTitleTooltip' ] +
                                '"><img class="autocomplete_footer_branding" src="'+__AutoCompleteBranding.src+'" /></a>';

            __AutoComplete[id]['dropdown'].appendChild(newDiv);
        }


        // Too many items?
        if (toDisplay.length > __AutoComplete[id]['maxitems']) {
            __AutoComplete[id]['dropdown'].style.height = (__AutoComplete[id]['maxitems'] * 15) + 2 + 'px';

        } else {
            __AutoComplete[id]['dropdown'].style.height = '';
        }


        /**
        * Set left/top in case of document movement/scroll/window resize etc
        */
        if(__SLI_customisations[ __SLI_ApplicationName ][ 'Alignment' ] == "true" || __SLI_customisations[ __SLI_ApplicationName ][ 'Alignment' ] == "false")
        {
            var left_top = AutoComplete_getPos( __AutoComplete[id]['element'] );
            __AutoComplete[id]['dropdown'].style.left = left_top[0];
            __AutoComplete[id]['dropdown'].style.top  = left_top[1] + __AutoComplete[id]['element'].offsetHeight;
        }


        // Show the iframe for IE
        if (isIE) {
            
            if(!__SLI_customisations[ __SLI_ApplicationName ][ 'Alignment' ] == true)
            {
               __AutoComplete[id]['iframe'].style.width  = __AutoComplete[id]['dropdown'].offsetWidth;
            }
            
            
            __AutoComplete[id]['iframe'].style.top    = __AutoComplete[id]['dropdown'].style.top;
            __AutoComplete[id]['iframe'].style.left   = __AutoComplete[id]['dropdown'].style.left;
            __AutoComplete[id]['iframe'].style.height = __AutoComplete[id]['dropdown'].offsetHeight;

            __AutoComplete[id]['iframe'].style.visibility = 'visible';
        }

    e =  __AutoComplete[id]['dropdown'];

    e.onmousemove =
        function()
        {
            if(!__AutoComplete_mouseMoved){__AutoComplete_mouseMoved=true;}
            this.onmousemove = null;
        }

        // Show dropdown
        if (!__AutoComplete[id]['isVisible']) {
            __AutoComplete[id]['dropdown'].style.visibility = 'visible';
            __AutoComplete[id]['isVisible'] = true;
        }


        // If now showing less items than before, reset the highlighted value
        if (__AutoComplete[id]['dropdown'].childNodes.length != numItems) {
            __AutoComplete[id]['highlighted'] = null;
        }
    }



    /**
    * Hides the dropdown layer
    *
    * @param string id The form elements id. Used to identify the correct dropdown.
    */
    function AutoComplete_HideDropdown(id)
    {
        if (__AutoComplete[id]['iframe'])
        {
            __AutoComplete[id]['iframe'].style.visibility = 'hidden';
        }
        
        if (__AutoComplete[id]['dropdown'])
        {
            __AutoComplete[id]['dropdown'].style.visibility = 'hidden';
        }

        __AutoComplete[id]['highlighted'] = null;
        __AutoComplete[id]['isVisible']   = false;
    }


    /**
    * Hides all dropdowns
    */
    function AutoComplete_HideAll()
    {
         if( __SLI_customisations[ __SLI_ApplicationName ][ 'ValidSearchBoxes' ] )
         {
               for(var i=0; i < __SLI_validSearchBoxes.length; i++)
               {
                   if(document.getElementById(__SLI_validSearchBoxes[i]))
                   {
                       AutoComplete_HideDropdown(__SLI_validSearchBoxes[i]);
                   }
               }
         }
         else
         {
                for (id in __AutoComplete)
                {
                   AutoComplete_HideDropdown(id);
                }
         }
    }


    /**
    * Highlights a specific item
    *
    * @param string id    The form elements id. Used to identify the correct dropdown.
    * @param int    index The index of the element in the dropdown to highlight
    */
    function AutoComplete_HighlightItem(id, index) // mouseover, index is the list element index, zero-based
    {
        if (__AutoComplete[id]['dropdown'].childNodes[index]) {
            for (var i=0; i<__AutoComplete[id]['dropdown'].childNodes.length; ++i) {
                if (__AutoComplete[id]['dropdown'].childNodes[i].className == 'autocomplete_item_highlighted') {
                    __AutoComplete[id]['dropdown'].childNodes[i].className = 'autocomplete_item';
                }
            }

            __AutoComplete[id]['dropdown'].childNodes[index].className = 'autocomplete_item_highlighted';
            __AutoComplete[id]['highlighted'] = index;

            //also see below...
            //__AutoComplete[id]['element'].value = __AutoComplete[id]['dropdown'].childNodes[index].innerHTML;
            //AutoComplete_SetValue(id);
        }
    }


    /**
    * Highlights the menu item with the given index
    *
    * @param string id    The form elements id. Used to identify the correct dropdown.
    * @param int    index The index of the element in the dropdown to highlight
    */
    function AutoComplete_Highlight(id, index) // keyboard up/down - index is the direction of travel, 1==down,-1=up
    {
        var childNodes = __AutoComplete[id]['dropdown'].childNodes;
        if(childNodes.length)
        {
	        var lastItem = ( ( childNodes[ childNodes.length - 1 ].className != 'autocomplete_footer' ) ? childNodes.length - 1 : childNodes.length - 2 );

            // Out of bounds checking
            //if (index == 1 && __AutoComplete[id]['highlighted'] == __AutoComplete[id]['dropdown'].childNodes.length - 1) {
            if (index == 1 && __AutoComplete[id]['highlighted'] == lastItem ) {
                childNodes[__AutoComplete[id]['highlighted']].className = 'autocomplete_item';
                __AutoComplete[id]['highlighted'] = null;

            } else if (index == -1 && __AutoComplete[id]['highlighted'] == 0) {
                childNodes[0].className = 'autocomplete_item';
                __AutoComplete[id]['highlighted'] = lastItem;
                index = 0;//hack!
            }

            // Nothing highlighted at the moment
            if (__AutoComplete[id]['highlighted'] == null) {

                childNodes[0].className = 'autocomplete_item_highlighted';
                __AutoComplete[id]['highlighted'] = 0;
                newIndex = 0;
                
            } else {

                if (childNodes[__AutoComplete[id]['highlighted']]) {
                
                    childNodes[__AutoComplete[id]['highlighted']].className = 'autocomplete_item';
                }

                var newIndex = parseInt( __AutoComplete[id]['highlighted'] ) + parseInt(index);

                if (childNodes[newIndex]) {

                    childNodes[newIndex].className = 'autocomplete_item_highlighted';

                    __AutoComplete[id]['highlighted'] = newIndex;
                }
            }

            //populate textbox with currently highlighted term...
            //__AutoComplete[id]['element'].value = __AutoComplete[id]['dropdown'].childNodes[newIndex].innerHTML;
            AutoComplete_SetValue(id);
        }
    }


    /**
    * Sets the input to a given value
    *
    * @param string id    The form elements id. Used to identify the correct dropdown.
    */
    function AutoComplete_SetValue(id)
    {
        __AutoComplete[id]['element'].value = __AutoComplete[id]['dropdown'].childNodes[__AutoComplete[id]['highlighted']].innerHTML.replace(/&amp;/, "&");
    }


    /**
    * Checks if the dropdown needs scrolling
    *
    * @param string id    The form elements id. Used to identify the correct dropdown.
    */
    function AutoComplete_ScrollCheck(id)
    {
        // Scroll down, or wrapping around from scroll up
        if (__AutoComplete[id]['highlighted'] > __AutoComplete[id]['lastItemShowing']) {
            __AutoComplete[id]['firstItemShowing'] = __AutoComplete[id]['highlighted'] - (__AutoComplete[id]['maxitems'] - 1);
            __AutoComplete[id]['lastItemShowing']  = __AutoComplete[id]['highlighted'];
        }

        // Scroll up, or wrapping around from scroll down
        if (__AutoComplete[id]['highlighted'] < __AutoComplete[id]['firstItemShowing']) {
            __AutoComplete[id]['firstItemShowing'] = __AutoComplete[id]['highlighted'];
            __AutoComplete[id]['lastItemShowing']  = __AutoComplete[id]['highlighted'] + (__AutoComplete[id]['maxitems'] - 1);
        }

        __AutoComplete[id]['dropdown'].scrollTop = __AutoComplete[id]['firstItemShowing'] * 15;
    }


    /**
    * Function which handles the keypress event
    *
    * @param string id    The form elements id. Used to identify the correct dropdown.
    */
    function AutoComplete_KeyDown(id, e)
    {
        var result = true;

       var event;
       event = e;
       if(!event) event = window.event;

        var keyCode = event.keyCode;

        switch (keyCode) {

            // Return/Enter
            case 13:
                if (__AutoComplete[id]['highlighted'] != null) {
                    AutoComplete_SetValue(id);
                    AutoComplete_HideDropdown(id);
					
                    __SLI_asug_used_flag = true;
					
                    if( e = __AutoComplete[id]['element'].form['asug'] )
                    {
                        
                        e.disabled=false;
                        e.value = __AutoComplete[id]['asug'];
                    }

                }

                result = AutoComplete_submitForm(id);

                break;

            // Escape
            case 27:
                AutoComplete_HideDropdown(id);
                event.returnValue = false;
                event.cancelBubble = true;
                break;

            // Up arrow
            case 38:
                if (!__AutoComplete[id]['isVisible']) {
                    AutoComplete_ShowDropdown(id);
                }

                AutoComplete_Highlight(id, -1);
                AutoComplete_ScrollCheck(id, -1);
                
                if( e = __AutoComplete[id]['element'].form['asug'] )
                {
                   e.disabled=false;
                   e.value = __AutoComplete[id]['asug'];
                }

                                
                result = false;
                break;

            // Tab
            case 9:
                if (__AutoComplete[id]['isVisible']) {
                    AutoComplete_HideDropdown(id);
                }
                return;

            // Down arrow
            case 40:

                if (!__AutoComplete[id]['isVisible']) {
                    AutoComplete_ShowDropdown(id);
                }

                AutoComplete_Highlight(id, 1);
                //AutoComplete_ScrollCheck(id, 1);

                if( e = __AutoComplete[id]['element'].form['asug'] )
                {
                   e.disabled=false;
                   e.value = __AutoComplete[id]['asug'];
                }

                result = false;
                break;
        }
        return result;
    }


    /**
    * Function which handles the keyup event
    *
    * @param string id    The form elements id. Used to identify the correct dropdown.
    */
    function AutoComplete_KeyUp(id, e)
    {
       var event;
       event = e;
       if(!event) event = window.event;

        var keyCode = event.keyCode;

        switch (keyCode) {
            case 13:
                event.returnValue = false;
                event.cancelBubble = true;
                
                break;

            case 27:
                AutoComplete_HideDropdown(id);
                event.returnValue = false;
                event.cancelBubble = true;
                break;

            case 38:
            case 40:
                return false;
                break;

            default:
                AutoComplete_ShowDropdown(id);
                
                __AutoComplete[id]['asug']=__AutoComplete[id]['element'].value;

                if( e = __AutoComplete[id]['element'].form['asug'] )
                {
                   e.disabled=true;
                   e.value = "";
                }  
                
                break;
        }
    }

    /**
    * Function which handles the keypress event
    * This function added April 2008 by Andrew Grieve
    *
    * @param string id    The form elements id. Used to identify the correct dropdown.
    */

    // SLI Code Modification - Start - Andrew Grieve April 08
    function AutoComplete_KeyPress(id, e)
    {
        var event = e;
        if(!event) event = window.event;
        var keyCode = event.keyCode;

        if (keyCode == 13 && isGecko || isOpera)
        {
            return false;
        }
        
        if( __SLI_customisations[ __SLI_ApplicationName ][ 'TargetURL' ] )
        {
            if (keyCode == 13 && isIE)
            {
                return false;
            }
        }
        
    }
    // SLI Code Modification - End

    /**
    * Returns whether the dropdown is visible
    *
    * @param string id    The form elements id. Used to identify the correct dropdown.
    */
    function AutoComplete_isVisible(id)
    {
        return __AutoComplete[id]['dropdown'].style.visibility == 'visible';
    }

    function AutoComplete_submitForm(id)
    {
        var e, f, result=true;
        if( f = __AutoComplete[id]['element'].form )
        {
            if( __AutoComplete[id]['element'].value != '' )
            {
            	if(__SLI_asug_used_flag == true)
            	{
                   if( e = f['asug'])
                   {
                      e.value = __AutoComplete[id]['asug'];
                      e.disabled=false;
                   }
                }
                
                if( __SLI_customisations[ __SLI_ApplicationName ][ 'TargetURL' ] )
                {
                	asugvar = "";
                	if(__SLI_asug_used_flag == true)
                	{
                	  asugvar = '&asug=' + __AutoComplete[id]['asug'];
                  	}
                    
                    sliRegex = /resultsdemo\.com/;
                    if(sliRegExArray = sliRegex.exec(document.domain))
                    {
                    	sliRegex = /^http:\/\/(.*)\//;
                    	sliTargetDomain = sliRegex.exec(__SLI_customisations[__SLI_ApplicationName ][ 'TargetURL' ]);
                    	__SLI_customisations[__SLI_ApplicationName ][ 'TargetURL' ] = __SLI_customisations[__SLI_ApplicationName ][ 'TargetURL' ].replace(sliTargetDomain[1], document.domain);
                    }
                    
                	document.location.href = __SLI_customisations[__SLI_ApplicationName ][ 'TargetURL' ] + __AutoComplete[id]['element'].value + asugvar;
                }
                else
                {
                	f.submit();
                }
                
                AutoComplete_HideAll();
            }
            else
                result = false;
        }
        return result;
    }
    
    // get the style that will be applied by the browser, including stylesheets
    function sli_getStyle(el,styleProp)
    {
      if (el.currentStyle)
        var y = el.currentStyle[styleProp];
      else if (window.getComputedStyle)
        var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
      return y;
    }

    // register with onLoad(er...
    _sli_init.push( AutoComplete_init );
    
    function sli_addEvent(obj, evType, fn) {
    	if (obj.addEventListener) {
    		obj.addEventListener(evType, fn, false);
    		return true;
    	} else if (obj.attachEvent) {
    		var r = obj.attachEvent("on" + evType, fn);
    		return r;
    	} else {
    		return false;
    	}
    }
    
    function sli_load()
    {
    	sli_addEvent(window, 'load', sli_init);
    }
