/* Popular phrases - NEXT - 22:56:48, Thu Sep 2, 2010 */
__SLI_ClientDefaults =
[
    ['ShowBrandingFooter', false ],
    ['IE6SelectBox', true],
    ['IframeAlignment', true]
];
var asPhrases=new Array ('dresses','maxi dress','curtains','rugs','wallpaper','wellies','cushions','cardigan','boots','slippers','maternity','leggings','bags','jeans','school uniform','trainers','lighting','suits','mirror','shoes','shorts','coats','hoody','blinds','converse','photo frames','throws','tunic','wedding','joggers','shirts','bikini','skirts','linen trousers','trousers','vest','bedding','heavenly soles','school shoes','waistcoat','trench coat','clocks','baby','black trousers','hunter wellies','womens coats','socks','tights','curtain poles','peppa pig','sofa bed','dressing table','chairs','gilet','linen trousers female','skinny jeans','maternity wear','handbags','jackets','tops','wardrobes','luggage','brogue','desk','black dress','jumper','coats and jackets','superdry','watches','lamps','school bags','towels','sleepsuits','bra','leather jacket','sofa','duvet covers','draining board','swimwear','shelves','hunter','wedding shoes','plimsoles','mens suits','dressing gown','sideboard','petite','picture frames','childrens bedding','womens suits','opus oak','storage','lipsy','sandals','pictures','womens dresses','mugs','school trousers','pyjamas','maxi dresss','me to you','jeggings','shower curtain','womens trousers','teal','denim jacket','belts','ladies coats','kettle','superdry women','fleece','shoe storage','adidas','slim fit suit','tatty teddy','fitted sheet','hats','wellington boots','headboards','black shoes','bean bag','newborn','tv unit','flip flops','blouses','suitcase','white shirt','wedges','kickers','bridal','clogs','shrug','womens shirts','ladies suits','maxi','dining table','dinner sets','changing bag','childrens branded bedding','table runner','sports bra','sofabed','womens cardigans','fireplace','coffee table','opus','tankini','wall art','toilet seat','roman blind','schoolwear','poppy','womens jeans','sleeping bag','pumps','unisex baby','laundry basket','sizes','t shirts','pillows','check shirt','plimsolls','mens trainers','day bed','womens shorts','ladies dresses','vase','spanx','perfume','snow boots','toilet roll holder','wedding dresses','eyelet curtains','black cardigan','bath mat','frames','butterfly','tracksuit','door mat','voile','duvet','console table','strapless bra','nike','mattress','blazer','lunch bag','denim skirt','childrens curtains','tables','mens shorts','workwear','womens maxi dresses','womens tops','maxi skirt','ladies shorts','white linen trousers','runners','table cloth','black skirt','opus mango','superdry men','baby sleepsuits','microwave','toy story','petite jeans','bin','duvet sets','womens jackets','womens hoodies','lace dress','bridesmaid dresses','flowers','bolero','denim shorts','petite maxi dress','parka','basket','cords','plum','polo shirt','converse all star','womens shoes','armchair','dungarees','knickers','fur','sunglasses','ladies jackets','purse','womens black trousers','bathroom cabinets','little chickie','camel','single beds','laptop','wallpaper samples','jewellery box','rucksack','teal curtains','gillet','black jeans','sheets','cropped trousers','stools','tea towels','school skirts','swimming costumes','silver shoes','mens linen trousers','bridal shoes','roller blind','backpack','loafers','high waist jeans','silver sandals','kids beds','ballet','womens boots','lipsy dress','ladies cardigan','ceiling lights','bedstead','ladies boots','scarf','wallet','digger','cambridge oak','bunk beds','aviator jacket','animal print','corset','bread bin','leggins','clutch bag','fitted bed sheets','jogging bottoms','necklace','dresses 12-14','faux fur','pencil skirt','womens workwear','nursery','ironing board','grey trousers','ugg boots','ladies trousers','black leggings','raincoat','jack lily and joe','mens shirts','ladies tops','beanbag','linen','beachwear','table lamps','lace','bikini\'s','cake stand','dining chairs','storage furniture','glasses','wall clocks','floor lamp','wide fitting shoes','boyfriend jeans','telephones','ties','boxers','nike trainers','storage baskets','grey suit','denim leggings','paint','tv stand','ladies jeans','knitwear','school shirts','tibet rug','black boots','mens vests','black top','table mats','shelf','star wars','ankle boots','maternity jeans','bathroom','adidas trainers','bootcut jeans','leather','red curtains','vests three pack','military','mac','purple','cord trousers','gloves','tie backs','ladies shoes','large rugs','court shoes','maternity bra','ottoman','lingerie','voile curtains','ladies black trousers','swimsuit','mirrored furniture','mens sandals','artificial flowers','towel rail','wellingtons','ladies shirts','school shorts','bodysuits','bathroom mirror','bridesmaid shoes','wall lights','duffle coat','evening dresses','womens trainers','slipper boots','teal rug','pushchairs','union jack','school socks','long sleeved tops','utility trousers','chinos','ivory shoes','pink','timberland boots','dresses 14 16','red','opus mango furniture','fire','mens jeans','runner rugs','kitten heels','hello kitty','tunic dress','pink curtains','plus size','lamp shades','cape','valance','trunk','satchel','footstool','leather sofa','school wear','petite trousers','christening dress','military jacket','red shoes','basque','maternity trousers','playsuit','doormat','mens shoes','cupcake','mens cardigans','sweaters','black curtains','cargo trousers','ladies linen trousers','mens slippers','womens skirts','body warmer','canvas pictures','wide fit boots','nest of tables','womens slippers','waterproof jacket','ziggy and friends','green','cutlery','kaftan','cufflinks','mobile phones','navy cardigan','placemats','knitted dress','black bag','sofas and chairs','pillow cases','hudson','wine glasses','wide leg trousers','mens waistcoats','wonderbra','baby coats','fleece sleepsuit','wide leg jeans','black skinny jeans','trunki','media unit','corner sofa','bookcase','green curtains','green rug','womens leggings','teal cushions','ed hardy','wall paper','bedside table','plum curtains','stripe top','messenger bag','green cushions','bed throws','plates','ladies hoodies','school','bridesmaid','slip','side tables','saucepans','petite dresses','nursery bedding','hooks','pencil pleat curtains','polka dot','biker boots','mens hoodies','new baby','black jacket','jewellery','dobby smock dress','grey cardigan','tilson','grey boots','cream dress','womens linen trousers','mattress protector','canvas','ladies watches','kylie bedding','double bed','cream shoes','cami','sparkle rug','prams','kitchen accessories','womens tunic','moses baskets','robe','womens jumpers','wedge shoes','long cardigan','addidas','gracie','trouser suit','tuxedo','leather bag','ben 10','lace up boots','ladies slippers','laundry','heavenly shoes','black trainers','black linen trousers','plus fit','camera','mario','toaster','cycle shorts','black suit','toys','miss n','vans','hooded','purple coat','baby tights','firetrap','white top','baby changing bag','mink','linen shorts','black shirt','ladies mac','electric fires','linen trousers male','heart','make up','culottes','bracelet','red rug','slim fit mens shirts','slim fit shirt','brown boots','timberland','shoe boots','waterfall cardigan','cabin bed','swim shorts','sonic','rain mac','rain coat','camisole','white vest','holdall','trainer socks','lined curtains','mens watch','ipod','khaki','jeggins','sports bag','squirrel','christening','football','junior bedset','black coat','machine washable suit','high sleeper','long skirt','military shirt','matress','fleece jacket','cropped jeans','ballerina shoes','across the body bag','single fitted sheet','curtain tie backs','high waist trousers','single mattress','toilet brush','tv','cargo','hoover','red cushion','light shades','skinny trousers','faux leather','plus fit jeans','mens flip flops','diesel','sportswear','candles','dvd','grey joggers','vest tops','opus oak ii','little puppy','roxy','ladies pyjamas','drainer','furniture','multiway bra','hooded shirt','maternity swimsuit','quilted jacket','pinafore','phones','womens vest','bathroom blinds','bed sheets','wedding clothes','signature','womens coats and jackets','junior duvet','fridge','wedge boots','cots','white t shirt','voile panel','waist coat','ladies swimwear','chiltern','owl','bathroom accessories','mens socks','grandad top','coat hooks','ugg','satchel bag','womens t shirts','bed sets','suit cases','childrens furniture','kilt','tall women','storage boxes','tweed','maternity pyjamas','plain dye bedding','grey tights','tankini swimwear','kitchen storage','black vest','iron','jewellery plaque','white trousers','valencia','girl\'s shoes','tshirts','school pumps','ornaments','dinosaur','miss sixty','navy trousers','bar stools','spongebob','womens joggers','ladies trainers','boot cut jeans','kids curtains','snood','wall stickers','back to school','high waist','sara','pramsuit','flat shoes','white socks','mens joggers','next','heels','trench','opus oak furniture','ipod dock','pashmina','plum bedding','high chairs','kylie','tall','ladies skirts','super king bedding','red cardigan','emily ruffles','converse trainers','aviator','pans','joggers bottoms','grey dress','light pull','maternity dress','photoframes','fur gilet','espadrilles','smock dress','mesh dress','oslo','black sandals','ladies purse','jumper dress','bedside lamps','hydrangea','shirt and tie sets','chino trousers','in the night garden','converse shoes','reebok easytone','scarves','mango furniture','cusions','sara light','berghaus','mens boots','fly','grey shoes','wellie boots','floral dress','gold shoes','opus black gloss','denim dress','girl\'s coats','mango','pram shoes','leather dress','nike joggers','bra\'s','sweatshirt','superdry jacket','maternity tops','tab top curtains','blue curtains','super king','table linen','tweed jacket','lacoste trainers','black','petite coats','underwear','t-shirts','ladies sandals','thongs','scoop neck vest','venetian blinds','prom dresses','kitten heel shoes','square pillow','hudson furniture','hunter socks','adidas hoody','delamere','chandelier','laundry bin','coasters','cookers','childrens storage','towel storage','feather','place mats','short sleeve shirt','stripe','tableware','jackets or raincoats','car seat','drawers','hi tops','camel jacket','ladies leggings','tutu','knee high boots','pillowcase','pink rug','treggings','mens black trousers','cat','peppa','teal bedding','cambridge','grey jeans','ballerina','cutlery set','nightie','storage jars','fragrance','levis','candle holders','memo board','towel bale','denim shirt','bathroom furniture','womens wellies','wool rugs','bunting','pink bedding','tank top','corner tv unit','crop tops','aspen','cream cardigan','made to order','helly hansen','suede boots','love','mens dressing gown','scales','ladies tunics','ladies wellies','womens white shirt','wide fitting ladies shoes','office furniture','cable dress','socks five pack','pink dress','linen dress','womens pyjamas','hold ups','desert boots','camel coat','ladies t shirts','leopard print','tie','leather trousers','pink top','purple cushion','dining sets','slim fit','school tights','tilson oak','mens sunglasses','grey','childrens lighting','futon','kettle and toaster','black court shoes','sarong','just pink','butterfly lights','black patent shoes','console','love seat','gracie furniture','ladies jumpers','art','over the knee boots','red poppy','highchair','wrap','gold sandals','cot beds','animal','kitchen','womens waistcoats','door handles','womens leather jackets','next card','hand bags','mens jumpers','peep toe shoes','single duvet covers','vacuum cleaner','animal print dress','school jumpers','poppy curtains','childrens rugs','t-shirt','school cardigan','body','samples','mens jackets','ultimo','cups and mugs','ladies joggers','black pumps','womens sandals','red coat','combat trousers','womens black shoes','ladies trouser suits','mens white shirts','roll neck','womens bags','xxxxl','white leggings','tailoring','canisters','ladies white shirt','grey tunic','black shorts','clog boots','black tights','navy dress','military coat','long sleeve t shirt','mens bags','flat sheet','cubic','high waisted shorts','military dress','flat boots','longline cardigan','purple rug','floral','adidas originals','brown trousers','wide fit','pjamas','womens checked shirts','bathroom storage','black socks','lacoste','cropped cardigan','floating shelves','dyson','cropped','school coats','canvas pumps','womans coats','faux fur throw','2 pack bras','cargo shorts','mens underwear','big sister','adidas bag','hampshire','bedroom','cargo pants','grey skirt','dressing table mirror','hooded top','wall mirrors','tall dresses','black ladies shoes','headband','grey leggings','floral top','mens t shirts','pink jumper','poles','golf','baby bodysuits','grey socks','dip hem sweater','mens belts','gladiator sandals','baby sleeping bag','slim fit trousers','bedroom furniture','black flat shoes','trend chairs','camel trousers','xxxl','zip hoody','wide leg','poloshirt','blue dress','jewellery necklaces rings bracelets earrings','allium','leather top','leopard','ballerina pumps','replay','bath sheet','check','pink cardigan','mens trousers','spot','border','pink shirt','purple shoes','patent shoes','joseph joseph','tea coffee sugar','bathmat','monkey','long boots','white slim fit shirt','jewellery holder','white bra','longline','black pencil skirt','grandad','tallboy','matress protector','tan boots','freya','womens swimwear','navy joggers','purple bedding','navy','ladies bags','hand towels','lace top','fly boots','cropped linen trousers','washing basket','non wired bra','netbook','bedsets','high rise jeans','purple curtains','velvet','white curtains','me to you bedding','dkny','womens trouser suits','salt and pepper','harbour furniture','black maxi dress','waterproof','suit jacket','michigan mango','brown shoes','luggage sets','black tunic','easytone','breadbin','grey bag','control leggings','addidas trainers','dresses 6-8','sandles','glass jar','fly london','womens clothes','bibs','ladies leather jackets','cream top','black trousers petite','brown leggings','little sister','ipod touch','lego','leather skirt','slim fit jeans','peep toe','camel dress','womens brogues','chest of drawers','pink shoes','hoody tops','black ballerina','sequin','womens socks','aubergine','skinny','single duvet','school blazer','pintuck tunic','mink curtains','mens black shoes','petite suits','maternity lingerie','denim','leather shorts','mats','flare jeans','knee high socks','ladies workwear','follow your dreams','padded bra','tan shoes','opus black','kitchen bin','frock and frill','wii','black cushions','shawl','egyptian cotton','gracie bed','cd storage','camouflage','rose','tan','metz chair','lantern','green bedding','red bedding','navy curtains','tapered trousers','television','long dress','fur boots','slim leg jeans','pink cushion','sat nav','gift sets','trilby','opus white','chest','bath towels','black denim leggings','black jumper','high waisted skinny jeans','nursery curtains','mens black suit','lace skirt','bow','owl t shirt','work boots','black rug','plum cushions','red kettle','natural rugs','tunic tops','tops 14','purple dress','maternity leggings','boat neck top','dig dig digger','k swiss','mens pumps','hooded coat','mens coats','boarders','underwired bikini','bathroom scales','cd','silver curtains','pajamas','square pillow cases','dobby','womens skinny jeans','plants','baby bouncer','black plimsolls','ladies jewellery','womens blouses','childrens wardrobe','asics','cot mattress','ladies vest','mens boxers','pendant light','puma','red dress','cot bumper','forever unique','makeup','diesel jeans','slouch jeans','nike hoody','all star','lunch','bootcut trousers','fur bag','denim skirts women','brown suit','sports socks','rugby shirt','green top','silver','bowl','grey school tights','double mattress','mink rug','vintage','circa','cable','dinner plates','xxxxxl','cube','malvern','rocket dog','vera wang','maxi cardigan','ray ban','set','cream','smock','poppy rug','white dress','natural cushions','winter boots','grey jumper','sleepbag','duvet king','colorado','polo','over the knee socks','plum rug','box','teal throw','kickers shoes','ladies maxi dresses','petite leggings','bedspread','office chair','pump bag','photo','bulbs','boat shoes','italia suit','duffle','chiltern furniture','prams and pushchairs','westport','gas fires','reebok','penguin','coffee maker','adidas joggers','java','canvas prints','ladies cord trousers','ladies coats and jackets','curtain pole kit','stripe shirt','ladies waistcoat','satin','linen blend trousers','oak furniture','mens ties','briefs','stamford','black joggers','bathroom mats','camel skirt','black school shoes','womans trousers','cropped leggings','32f','swimsuit ladies','dimmer switch','ivory bag','blue','black skinny trousers','womans dresses','white cardigan','orange','ruffle dress','bed valance','mug sets','cabin bag','hair straighteners','monster','annalina','storage stool','womens lace','skirt suit','biker jeans','wedge sandals','crazy daisy','petite linen trousers','v neck jumper','baby vests','fit and flare coat','high tops','brown','ps3','football bedding','gold','soleil sucre','tote bag','folk print tunic','black boot cut trousers','lace jacket','diamante','hallway','retro sofa','cabinets','blowfish','velvet jacket','pack','reward chart','sheepskin','tilson mango','chuggington','navy tights','montana','ruffle','cargo jeans','francesca','ditsy','power balance','nursery furniture','shower caddy','book case','shirt dress','combats','isabella','toulouse','spring meadow','cuff links','mens chinos','lampshades','zip through','head board','womens knitwear','maternity coat','fire bowl','football curtains','teapot','cake tins','changing mat','sonoma','32e','football shorts','sleeptight mattress','trinny','snuggle seat','harbour','womens watch','control','green shoes','slouchy dress','cups','oak','tencel','converse boots','firebowl','floral maxi dress','oversized stripe top','black ankle boots','mongolian cushions','feather bag','dualit','blue top','hilfiger','pixie boots','ladies belts','waterfall','womens sportswear','jean joggers','jersey dress','mens white linen trousers','mink shoes','womens black jeans','green lamp','home sweet home','childrens desk','mens combats','newborn shoes','top gear','cord skirt','brown skirt','ladies brogues','bookends','superdry hoody','navy military dress','hat stand','batman','footless tights','junior bed','faux leather dress','buggies','32dd','metal beds','t shirt pack','school blouses','black gloss furniture','corner desk','sun glasses','silk curtains','glass shelf','next the fragrance','linen cropped','ladies dressing gowns','table and chairs','t bar shoes','silver bag','casual trousers','small sofa','lace blouse','bay window curtain pole','mules','clutch','mens short sleeve shirt','alarm clock','leather handbags','ellie bed','mens polo shirts','perfume gift sets','knife block','pants','hooded check shirt','hair','slim jeans','leather gloves','garda','mens wallets','phil and teds','lace t shirt','gel bra','white gloss','mens pyjamas','aftershave','cream blouse','fabric chairs','bed runner','towelling robe','rock and republic','vest pack','tailored trousers','memory foam mattress','tailored suits','khaki trousers','double duvet sets','fruit bowl','green coat','childrens shelves','navy skirt','over door hooks','green throw','dc','collage photo frame','cd unit','navy suit','utility','check trousers','cashmere','suspenders','roman','ski','mens black shirt','garda sofa','grey top','long tops','black gloss','womans jeans','recycling','black bedding','ladies check shirt','tube skirt','fine sparkle rug','tent','navy leggings','blue maxi dress','smock detail top','brown dress','occasion dresses','hold backs','tops 16','womens grey trousers','double headboards','ladies blouses','pack tops','ab circle pro','ivory','skinny tie','double duvet','paisley dress','corner','jars','wedding bags','shade','roma','black heels','mini skirt','white bedding','washable suit','caterpillar','baby monitor','superman','womans hoodies','bustier','plum lamp','tall maxi dress','merrell','cuffed jeans','pink tunic','collage frame','cake','puma trainers','linen shirt','long sleeve shirt','black wedges','car','blue shirt','flat sandals','sequin top','petite maxi','chelsea boots','navy top','orchid','carrot','offers','green wallpaper','print top','bed in a bag','football socks','bed guard','tibet','ziggy','teddies','calvin klein','rug grip','braces','hunter boots','retro leaves','brown jacket','corset top','door hooks','plate sets','digital photo frame','glass dining table','shirt and tie','single sheets','nx sport','shinto','scala','black clutch bag','bedstead single','pots and pans','cot bed bedding','levi jeans','lace shirt','womens mac','hungry caterpillar','mens leather jackets','black lace','womans jackets','blanket box','peppa pig coat','little brother','padded bikini','black and white dress','loose fit jeans','platform shoes','baby bag','chloe bed','amelia','round table','chopping board','potty','grey grandad tunic','mamas and papas','childrens mattress','beauty','daybed','accessories','corner pleat valance','romper','pink shelves','black handbag','winter coats','pink coat','next perfume','biker jacket','wide shoes','womens black tops','home accessories','pintuck detail top','rabbit','sister','jewellery word plaque','artificial plants','cot sheets','portable dvd player','jeans style trousers','bathroom shelves','halterneck','cream microwave','satin trousers','trapper hat','apple','digital camera','leotard','michigan oak','travel systems','floor lights','ladies socks','bathroom bins','st tropez','retro','school polo shirts','childrens table and chairs','light bulbs','34e','dip hem cardigan','white shorts','words','ladies knickers','womens belts','telephone table','cocktail dress','tailored fit suit','36g','long john','waterfall coat','oxford mattress','faux silk curtains','coffe table','floral print tunic','womens cords','sequin bag','eyelet','travel cot','tee shirts','rugby shorts','black and white','womans shorts','camping','fur throw','hair dryer','school pinafore','reebok trainers','black jeggings','red top','arizona','wedding suit','womens t-shirts','peacoat','womens converse','teal lamp','rings','v neck','womens white trousers','storage units','wood flooring','curtain samples','twigs','sweat top','black bootcut trousers','riding boots','black shrug','dobby dress','3 pack tops','mantle clock','control briefs','womens black boots','zebra','cream kettle','black blouse','glass table','occasion','sienna','mink boots','ribbed cardigan','bread','white blouse','jack daniels','printed tunic','italia shoes','opus furniture','chloe','radio','jacquard','boot fit jeans','oak sideboard','treadmill','jcb','black lace dress','black ruffled insert dress','womans shirts','lipsy shoes','long sleeve dress','canterbury','cropped joggers','running','skate trainers','corner shelves','white shoes','extending table','womens dressing gowns','berber rugs','ladies black dress','patent','maclaren','hyper space','freya bra','mirrored table','dream','cap','brown curtains','biker','dressses','34g','plum throw','dryer','brown cardigan','summer tops','butterfly clock','cardi','women long sleeve tops','red lamp','tan bag','duckboard','quilt','round rugs','womens tights','printer','knives','camel shoes','ladies knitwear','baby cardigan','taffeta','single headboards','white fitted sheet','mens bootcut jeans','hanging basket','black tie','petite tops','jumbo bale','womens black dress','three quarter','pussybow blouse','tuscany','red jacket','womans suits','string lights','animal print maxi dress','children\'s beds','leggings set','womens blazer','womens bikinis','bedside cabinet','layered','mens cargo trousers','silk','black t shirt','strapless','xbox 360','arm chair','plum bathroom','knitted boots','ladies black jeans','frying pan','extendible curtain pole','baby hats','casual tops','hairband','metz','knee socks','womens camel','cards','briefcase','pink volume tunic','single matress','high sleeper bed','divan','padded jacket','formal shirts','play mat','butterfly curtains','door stop','pots','mink trousers','longline tops','kswiss','polka','maternity tankini','mobile','bouncer','shower','pan set','silver bedding','slendertone','embroidered top','faux fur gilet','red throw','leather boots','fairisle','womens black jacket','floral print maxi dress','ruffle cushion','white polo shirt','poncho','pearl','office','brown floral print dress','hampton','firetrap maxi dress','check skirt','cotbed','non padded bra','ladies black jackets','white','camcorder','damask','sandels','size 22','moleskin jacket','black towels','nintendo','topper','floral skirt','trolley case','christening shoes','womens hats','white wardrobes','tweed skirt','ladies grey trousers','casual jackets','ladies wear','corner unit','grey jacket','poppy wallpaper','girl\'s tights','italia','monaco','sink','paisley','denim jeggings','ladder tunic','natural poppy','womens fleece','skull','nigella lawson','buzz','full circle','pink hoody','pedal bin','ladies white tops','mens swim shorts','black cropped trousers','stroller','boyfriend','wall shelves','cream curtains','blue cardigan','womens knickers','bath rack','brown bag','womens black cardigan','le creuset','dish drainer','cosmetics','grey skinny jeans','occasion shoes','super king duvet','floral tunic','baby bath','halterneck top','velour','pewter shoes','teal towels','black plimsoles','ladies handbags','ladies black boots','grey coat','baby dresses','i am 1','black throw','bunk','soda glasses','black floral tunic','ponte','wall plaques','silver jewellery','one shoulder dress','piggy bank','wii fit','childrens wallpaper','paradise','baby toys','quinny','electric fireplace','ghd','womens handbags','swim','grey shirt','memory foam','bangle','pink and grey','ladies black tops','corsage','basic linen blend trousers','womens pumps','boot cut trousers','white trainers','hepburn','mens slim fit suit','oak shelves','leather chairs','safety gate','womens denim shorts','duwop','sheepskin rug','gifts','belted jeans','womens tshirt','nike air max','mens adidas','newborn tights','bench','bow top','bunny','michigan','gym bag','pink throw','russell','new arrivals','star wars t shirt','white desk','mens brown shoes','mac coat','emily','union jack cushion','black blazer','mens nike trainers','petite jackets','bedside','maternity tights','linen skirt','mens black jeans','brother','womens white tops','chino shorts','chatres','bootcut','plus','light switch','lace boots','flare','polka dot curtains','childrens bedroom','pink fitted sheet','chickie','apron','kitchen scales','womans workwear','bed scarf','green cardigan','womens loafers','sophie conran','red bag','cream lace dress','fila','dsi','black wallpaper','toilet roll','cream bag','red vase','black leggins','utensils','born in 2010','bow tie','tea dress','ladies tights','pillow protector','housewife pillowcase','skechers','petite skinny jeans','tulip','womens parka','bed covers','jogging','black furniture','camel cardigan','women','small sideboard','jewellry box','man bag','ladies thongs','brogue shoes','white tshirt','womens cropped trousers','rib waist jeans','cravat','nike shorts','capri','purple shirt','screen','liquorice','black leather jacket','twisted jeans','mauve','utility shorts','brown rugs','ladies bootcut jeans','womens vest tops','star','beanie','womens gilet','nails','black wide leg trousers','purple top','ladies pumps','grey school trousers','petite skirts','snow','weights','stripe towel','plain dye','dress 18','oslo chair','ladies swimming costume','tea','school dress','brown top','baseball jacket','bed linen','platform','thong pack','long black skirt','modular','opus sideboard','womans cardigans','childrens throws','pink blouse','wing collar shirt','push chairs','32g','portmeirion','cuff trousers','crinkle vest','party dress','iphone','chocolate','pleated skirt','fur coat','sliding wardrobe','black peep toe','cuff hem jeans','high heels','samsung','sculpture','bombe chest','black school trousers','womans boots','bath','ladder sweater','childrens chairs');
/* $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);
    }