/* Popular phrases - BEAUTYBRIDGE - 21:32:33, Tue Feb 9, 2010 */
var asPhrases=new Array ('on sale','new arrivals','dermalogica','babor','free samples','tweezerman tweezer','youngblood','md formulations','modelco','gift ideas','exuviance','too faced','dermablend concealer','primer','jane iredale liquid foundation','priori','jack black','gift for her','illuminare','jaqua','cor silver soap','full coverage foundation','pixi','murad','nail polish','sula','jane iredale','ralph lauren safari','pca skin','returns','botanicals candle','kiss me mascara','lip stain','peter thomas roth','concealer','retinol advanced','lippmann','candles','burberry the beat','spf lip','dermablend','vera wang','pop ribbon gloss','vanilla','colorescience','womens fragrances','pop beauty','sun protection','zirh shave gel','burberry summer','glominerals','lippmann collection','anthony logistics','paula dorf','issey miyake','true cosmetics','strivectin sd','lacoste love of pink','rosacea','prada infusion d iris','eye liner','face mask','true','rilastil','evian','dermablend quick fix','rosacea treatments','true makeup','teeth whitening','scar','bust firming','carolina herrera after shave','lip plumper','brush','pca','primal elements','anthony','ralph lauren polo black gift set','waterproof mascara','kit','youngblood mineral foundation','babor fluid','scar treatment','sample kits','ultra rich cream','sheer','sprayology sleepease','whish','sothys','neova','pixi velvet rouge','bare minerals','tweezerman nail','climate control','calvin klein euphoria','armani acqua di gio','makeup kits','too faced shadow insurance','face cream','collin acne','bioelements','ralph lauren romance gift set','ahava','line tamer','armani diamonds','sothys eyeliner','colorescience refill','mascara','cade','g.m collin','trial size','baxter of california','foundation','age spots','liptini','eternity','id minerals','bioelements power concealer','glitter','skinmedica exfoliant','juara','hyperpigmentation','fragrance free','colorescience eye','glominerals pressed base','wild to mild','polo double black gift set','sothys makeup','eyeliner','tinted moisturizer','citrus verbena','glo minerals','liquid eyeliner','lip balm','sweet spot','currant','l occitane','murad lip','soy candles','colorescience prismatic','tweezerman slant','gm collin mask','palette','ahava bath salts','hylexin','pca skin eyexcellence','joey new york','carolina herrera body lotion','gel blush','thebalm','mineral foundation','glycolic acid','kinerase','youngblood liquid mineral foundation','bronzer','mist','archipelago botanicals','bioelements moisture x10','joey new york foundation','murad pomegranate','neoceuticals shampoo','md','diesel fuel for life gift set','nail','colorescience sunforgettable','evian mineral water spray','cade youth concentrate','moom','tweezermate','neova therapy','too faced brow envy kit','l\'occitane frangipani','exuviance eye','babor phytoactive','leonor greyl conditioner','deoderant','eye cream wrinkle','valentine','frangipani','coverblend powder','nuxe aroma-vaillance','phytomer','glominerals concealer','sale','mineral makeup','new west','zirh scrub','supersmile','sunforgettable','pore filler','diesel fuel for life','cellulite','lotil','true foundation','tweezerman scissors','caswell-massey','flawless beauty primer','thebalm timebalm','euphoria','covet','acne complex','l occitane after shave','deborah lippman','michael kors island','true moisturizer','dkny apple','i am king','puractive cream','june jacobs papaya','eye color','id','dermalogica body','egyptian musk','sandalwood candles','coverblend','angel by thierry mugler','vivid blue','vitamin c','two faced','retinol','neostrata','pixi cheek','lip crayons','fake bake bronzer','peter thomas roth lips','shaving','l\'occitane almond','get fresh spa','myrtle','cream eyeshadow','tweezerman pedro','ralph lauren romance','revita','euphoria shower gel','bare minerals makeup','advanced biogen','zirh best seller kit','folding lash comb','eyebrow pencil','stain','white eyeliner','l occitane vanilla','ahava soap','pop','cashmere mist','makeup sponge','blush','graftcyte','leg and body cover','bath pebbles','mineral lipstick','blinc mascara','polo double black','antiseptic','glo','colorescience blush','lemon','body wash','amatokin','l\'occitane','clean warm cotton','clean start','eyebrow mascara','pixi eye bright liner','true lip shine','diesel after shave balm','glospa','tweezerman nipper','puffy eyes','ti-silc sheer spf 45','chocolate soleil','brow envy','tattoo','peter thomas','perfect glo','tattoo cover','l\'occitane eye cream','second skin','miso pretty','zinc oxide','body lotion','blender','kabuki','borghese','eyelash growth','verbena','skinceuticals','redness reducing','memories','joey','diesel','l\'occitane shea butter hand cream','baxter','facial mist','beautyblender','brow','ultra rich shower cream','complex cu3','sean john','eyebrow','lash','paula dorf brows','lip plump','blackberry vanilla','ka2008w1','idol armani','l\'occitane grape','kaplanmd','exuviance skin lightener','rose water','joey calm and correcting','blue mascara','tweezerman no-slip skin care tool','skin caring foundation','archipelago lip butter','chrome azzaro','diaper','pure pressed base','restoring rich cream','true cosmetics nightlight trio','thebalm to the rescue','transforming mineral mist','pressed base','travel','self tanning lotion','wax','paula dorf brushes','babor foundation','hand cream','colorescience line tamer','dry oil body spray','colorescience foundation','youngblood loose mineral foundation','strivectin','modelco beauty fix','cherry blossom','compact','jane iredale powder','l\'occitane body cream','night cream','peter thomas roth age defense','sula champagne','ahava mud soap','baby','l\'occitane hand','shampoo','jaqua candle','microdermabrasion','stick foundation','mugler','freckles','foundation compact','modelco lash brow','physicians formula','colorescience face freshener','foundation samples','colorescience face paint','modelco remover','soy algae body oil lemongrass','fine lines','fraxel','illuminare fantastic finish foundation concealer','mont blanc presence','glow powder','sothys eye cream','tweezerman set','hair loss','thalassothys','diesel shower gel','l\'occitane set','exuviance body wash','l\'occitane conditioner','loccitane hand cream','gift for teens','gommage','coverblend concealer','fan brush','armani emporio','too faced beauty balm','brush bag','dermalogica cleanser','honey lemon','mens cologne','shea butter verbena','tantowel','smoothing gel','ingrown hairs','coffret','she','babor nail remover','aromachologie repairing shampoo','jane iredale eye shadow','visible lifting concentrate','sugar scrub','bubble bath','mens skincare','loccitane soap','usher for women','l\'occitane foot','skin prep scrub','hamadi','makeup case','bunny too faced','tweezers','acqua di gio','colorescience brush','brightener','dead sea salt','coola','l\'occitane lavender','almond milk','phaze 7 protecting hydrator spf 25','brow gel','brow definer','neova retinol me','puracne oxygen gel','multivitamin power recovery masque','phytomer toner','anti-aging','gucci by gucci','ahava hand cream','l occitane hand','archipelago botanicals soap','age smart antioxidant hydramist','babor hy-oil','psoriasis','dkny be delicious','bulgari','nia','vitamin a','june jacobs','zegna colonia','chroma 2','babor eye cream','tommy hilfiger','cosmetic bags','jennifer lopez live luxe','fragrance','too faced candy lips','lovely sarah jessica parker','eye wrinkle','dermablend foundation','the wait is over','nuxe teint prodigieux','beauty blender','face','peel','archipelago botanicals lotion','gm collin bio-organique','lip liner','hair growth','stella mccartney','total cohesion','harmonizing gel cleanser','stretch mark','bar soap','peptide','wrinkle filler','faith hill','l\'occitane mist','kiss me','oil','twilight','orange','healthy hair mask','oily hair','vanilla orchid','bioelements lip','sampler','too faced natural eye kit','dkny','benefit','murad wrinkle reducer','borghese kit','joey new york lip gloss','hydroptimale gel','dermablend setting powder','dkny men','souffle marin','exuviance skin brightening gel','l occitane shea butter hand cream','mineral bronzer','rear repair','tweezerman pedicure','exuviance peel','red light','ahava lotion','sula paint and peel','rilastil mascara','dermalogica hydramist','string of pearls','bionic eye cream','diffuser','dermalogica intensive moisture balance','body mist','euphoria body lotion','ultra sheer','salt scrub','exuviance vespera bionic serum','body shimmer','sexual','peter thomas roth aha','pca toner','tom ford black orchid','babor oil','eye mask','archipelago botanicals hand cream','june jacobs shampoo','bvlgari pour homme','verbena soap','l\'occitan','cheek stain','brow powder','ahava face','exuviance professional','dkny red delicious','vera wang for men','calvin klein eternity','lovely','hydra matt fluid','essential oil','ingrown','soins soleil cellu-guard','active cream','stella gift set','burberry weekend','babor mild cleanser','spirit','paula dorf sweep away','get fresh body lotion','bioelements complexion','colorescience primer','caswell massey lip balm','too faced mascara','highlighter','chicken cutlets','pore','murad kit','murad acne','cream eye shadow','lip gloss ring','velvet concentrate','murad spa','lineup','body polish','babor men','giorgio armani','z-silc','dermalogica toner','aha 20','tired legs','stella','shea cocoa butter aloe','bioelements sleepwear','bioelements breakout control','loccitane lavend','dr michelle copeland microdermabrasion','tommy bahama signature','incense','loccitane cherry','hyaluronic acid','nuxe cream','babor argan cream','joey pure pore foundation','brush for bronzers','foot care','leg','amor amor','pixi lip blush','jane iredale mascara','fat kiss','rose eau des 4 reines','resurgence','paula dorf eye primer','tomato','bath soak','carolina herrera shower gel','camouflage brush','dental','travel puff','eye candy','royal blue','youngblood rice powder','olive oil loccitane','murad clarifying','lippman','tantowel on the glow','collin eye contour','mineral highlighter','dkny set delicious','eshave','escada','sula perfume','paula dorf foundation','gm collin toner','pure pores finishing powder','empty compact','cactus cloth','eshave sweetheart','eye believe','phytomer eau marine','l\'occitane lotion','burberry','collagen','lippman polish','murad mattifier','neostrata acne spot treatment gel','emporio','cor soap','dermalogica medibac clearing mattifier','lip products','jane iredale blush','white effect','too faced pink leopard','ralph lauren polo','paula dorf perfect primer','soap on a rope','lumedia facial brightener','protection mineral foundation compact','anthony sport','too faced bronzer','too faced glamour to go','cream blush','lift defense foundation','polish','almond soap','dark circle concealer','dna','lotion plus','ultra smoothing lotion','benzoyl peroxide gel','spf powder','loccitane body lotion','paula dorf perfect glo','murad acne complex kit','zegna after shave balm','pina colada','bonne mere','nuxe','immortelle','is clinical','enzyme cleanser','212','true blush','pumpkin','travel bag','ralph','l occitane lotion','get fresh sugar scrub','eyelash comb','crystal','body scrubs exfoliants','eyebrow wax','firming','brush set','more brow','hydramucine optimal gel','ti silc sheer','murad acne spot treatment','gm collin collagen','snow','gloloose base','rosie jane','dermablend wrinkle fix','heaven on earth','neoceuticals','babor eye','loccitane vanilla','apple','neostrata bionic face cream','foot fetish','pixi brush','shea vanilla','lip drink','borghese lip','gm collin cleansing','unwrinkle','native collagen gel','lucky chick','borghese eye shadow','lip gloss set','pressed powder','daily microfoliant','makeup brush case','murad moisture rich cleanser','sensiderm gel','nuxe mask','eye gel','murad face defense','nuxe eye cream','loccitane bonne mere soap','eau des baux stick deodorant','pen','murad sleep reform','lippmann fashion','murad active radiance serum','modelco gloss','bioelements cleanser','murad oil','murad t-zone','baborganic','true protective mineral','natural mineral','too faced natural eye','babor white effect intensive concentrate','too faced brush','egg cream','false lashes','nail stencil','noncomedogenic','dermalogica total eye care','olive daily face cleanser','babor tonic','phytomer homme','nail pen','dermalogica super rich repair','idole d\'armani','organic make up','ceramide','true restoring rich cream','hand lotion','usher','ed hardy hearts and daggers','eye brow gel','prada infusion','matte eye shadow','celazome','erase those lines','cradle cap','puractive','armani diamonds gift set','under eye cream','spray','cleansing milk','sunscreen sample','smooth indulgence concealer','creme de la copper','brown sugar','babor cleanser','quick-fix concealer','too faced shadow','hair repair','eye makeup remover','glo minerals bronzer','md moms','neova antioxidant serum','alien','colorescience lip polish','chap stick','mom and baby','baux','colorescience bronzer','lip gloss palette','enzyme peel','ck free','biotin shampoo','multivitamin capsule','colorescience take out','day bright','blinc kiss me mascara','colorescience refill foundation','ds laboratories','nailtini','whitening cream','mineral kits','babor mask','reve de miel','lip brush','positano','kitty glitter','code','gel liner','g.m collin hydramucine optimal gel','liptini lip stain','phytomer cleansing milk','mania','sugar lotion','neck cream','prada','sothys serum','ralph lauren notorious','sothys nails','paula dorf magic stick','too faced eye shadow insurance','colorescience line tamer skin brightener','rejuvenating complex','toenail clipper','jaqua weekend bag','protective illuminating concealer','paula dorf concealer','absolute moisture','tummy rub','medibac clearing wash','lip lights','auburn mascara','murad hydrating toner','dark spots','fashion tape','too faced lip injection','issey','cellex c','dermalogica shampoo','jennifer lopez deseo men','face peel','dermalogica skin smoothing','a.g.e total defence','rehab','luster','challenge','fade fast','derm renewal gel','true color','get fresh lemongrass lavender','g m collin','deep wrinkle treatments','glominerals powder','retractable brush','gentle cream exfoliant','long lasting lip stick','babor sunscreen','vixen','seacreation','jane iredale disappear','sun spots','neova copper peptide mask','citrus','too faced sun bunny','tan towels','dkny delicious','lip butter','nuxe etincelante','coverage','verbena hand soap','sharpener','colorescience f.a.c.e trial','modelco powerstick duo concealer','murad set','ahava body lotion','sensiderm','glominerals honey medium','h50 therapy cream','soothing','rose lotion','neova copper moisture mask','hyaluronic','retractable lip brush','frankincense','amatokin intense skin-rejuvenating serum','suncanny foundation','regenerate','babor pure mask','too faced powder','priori advanced aha','paraben free','dermalogica face brush','multivitamin','combination skin','sothys mascara','hide and heal','dermalogica age smart antioxidant hydramist','pca skin phaze 13 pigment gel','clean','neova mask','get fresh apricot chamomile','true concealer','phytomer doux visage','cellex','liquid hand soap','visible lifting cream','dermalogica climate control','for men','airbrush','eye brightener','gloves','razor','alpha hydroxy','rose velvet','dr michelle','g.m collin lip plumping complex','borghese gel delicato','david yurman','shower cream','talcum powder','sun bunny','ds laboratories spectral.dnc-l','ylang ylang','true essential soothing tonic','pixi parfum','dorf','camouflage makeup','apple of the cheek','bioelements natural','ethereal','vera wang gift set','almond shower','almond foaming bath','treating lotion','bioelements decongestant cleanser','organic skincare','hand cream bouquet','self tan','ck','puff','matte perfection','poreless','balance','zirh ikon','neostrata serum','caswell massey gardenia','makeup brush sets','sothys eau thermale spa exfoliating facial scrub','blackhead remover','amazing base','armani code for women sheer','calvin klein','kinerase photofacials','nutrithys','fig','urban detox','babor mimical control','boticario de havana','beauty to go','pigment bar','shea hand cream','borghese mineral sheer foundation','l\'occitane shine mask','anthony deodorant','blemish treatment','l\'occitane ylang ylang','african american','cleansing','all','pop beauty polish','lip moisturizer','ahava gifts','juara go on the glow kit','anti-dandruff','yu-be lip therapy','lavender gift sets','yu be lip','pencil','vera wang truly pink','june jacobs citrus body balm','sothys face cream','delicious night','ceramic nail file','green eyes','polo after shave balm','sea silk oil-free moisturizer','cucumber body splash','armani code deodorant stick','eyelash curler refills','cucumber','dkny night','ck be','derm renewal cream','oily face','scentao','greenbriar','pom mist','jane iredale liquid','rocawear','jack black post shaving cooling gel','olive oil','magic mitt','purifying deodorant','cream dry skin','chroma 5','make up remover','cedar','tricomin solution follicle therapy spray','glitter nail','l\'occitane cade','to faced','ermenegildo zegna','youth','shades','t-zone','sothys immuniscience creme','neostrata hq','sothys immuniscience fluid','phytoactive','glospa lip conditioner','box of chocolates','essenza di zegna','pixi tint conceal','waterproof lip pencil','youngblood loose mineral','dandruff','special cleansing gel','hy001','eyebrow color','blotting','matte nail polish','l\'occitane shea butter ultra rich shampoo','too faced kit','ultra rich eye balm','cuticle oil','too faced tricks of the trade','verbena leaf soap','caswell-massey freesia','sothys sparkling eye pencil','wine and grape seed','the golden branch','sunkiss','foot odor','slant tweezer','lamb','anti-fatigue eye contour gel','armani code sheer','prada tendre','shooting star','bioelements moisturizer','soy body facial','tricks of the trade','dermalogica age smart','cake eyeliner','michael kors leg shine','dermalogica samples','polo black','two faced mascara','parfum mens','priori facial cleanser','toothbrush','burberry summer for women','moisturizer spf','too faced first base','scented candles','depilatory','hair inhibitor','armani code for women','after dark','nutriderm','burberry brit for women','pump up the jam','g.m collin visible lifting cream','true essential pore and complexion refiner','tweezerman baby','pep up gel','bioelements quick refiner','bioelements lutein indoor protective day creme','bagno di vita','l\'occitane honey','polo ralph lauren balm','sothys secrets','masque hydrating','sebum','pixi illuminating tint and conceal','armani code after shave','neostrata high potency cream aha 20','pca wash','skin smoothing cream','bioelements crucial moisture','karin herzog additional day','dry body oil','bvlgari aqva','eye stain','qualities of nail polish','lunar dust','envy','coconut vanilla','too-faced','don\'t tell mama','dermalogica skin resurfacing cleanser','too faced the jewelry box pink diamond edition','long lasting makeup','neova purifying facial cleanser','dreaming','rose soap','butterfly kiss','recovery serum','dusting powder','l\'occitane vanilla caress','compact mirrors','blue polo set','borghese mud','whatever lola wants','roller ball','california in a compact','gucci pour homme ii','lacoste inspiration','l occitane shaving cream','mineral hand cream','oil free matte block','strivectin eye','lippmann base coat','shea body butter','pop beauty conceal and correct','sothys normalizing','armani diamonds for men','borghese delicato','loccitane lip','huile de palme','babor phytoactive base','collag','bioelements post shave serum','gucci envy me','hydracontinue','archipelago body wash','lavender perfume','christmas','sprayology cold and flu relief','too faced lash injection','azzaro after shave balm','best of l\'occitane','z silc spf 30','voglia face mask','skinmedica vitamin c','miss','skinmedica lip','pop beauty lip lust','almond talc','lil dipper','l\'occitane face cream','gm collin sensiderm','sleep','coffee','cover up','neova body therapy','omnia','dermalogica eye cream','sothys noctuelle','anthony peppermint','valerian','di gio','caswell massey elixir of love','jane iredale absence','peter roth','oxygen puractive+ cream','moisturizing mascara','omnilux clear u','men soap','elixir','reed diffuser','armani diamonds for women','cherry','glospa sugar body polish','gloeye','soleil','celebration','l\'occitane shea hand cream','verbena hand lotion','rose 4 reines eau de toilette','rescue me foot cream','pigment discourager','g.m collin eye cream','dermablend shades','oil free foundation','multivitamin power','hugo','pencil sharpener','glospa body firming lotion citrus lavender','sothys concealer','bella','joey new york collagen boosting lip gloss duo','sebo care','peach','essential','gloss','sothys lotion','ogenage','eyebrow kits','anthony soap','ralph lauren blue','holiday','copeland sun','babor eau de toilette','one step cleansing bar','20% shea hand cream','astringent','chromawhite','sprayology party relief','attitude extreme','jordana','cherry blossom solid perfume','dermalogica soothing eye make-up remover','obsession body lotion','vera wang bouquet','sun screen','quick cover','dermalogica candle','orange flower water','pink potion','shaving gel','l occitane oil','propolis','dr babor','loccitane candle','sun tanning','lavender citrus','kinerase lip treatment','lacoste essential','copper','baby phat','babor lipstick','prada iris','medical makeup','l\'occitane shea butter','acne sulfur','100 pure','l\'occitane lavender hand wash','organic deodorant','grapefruit fragrance','mineral radiance','nail buffer','party relief','tns essential serum','thierry mugler','bio organique','colorescience sunforgettable shimmer','sothys total cohesion','glowing skin','rockstar','body powder puff','perfect primer','perfecting serum','undereye circles','l\'occitane aromachologie','dermalogica power rich','true cleanser','quick refiner','yes no maybe','jack black clear solution skin purifying set','sothys oxyliance','concentre energetique','lip 20','hamadi ginger soymilk hair wash','gardenia lotion','pca skin brightening therapy with truetone','dermalogica night','ahava time line personal age defying program','omnilux','glominerals lip','socialite','tooth powder','exuviance evening restorative','rilastil intensive','oat salt','citrus body balm','dermalogica booster','wicked game','mink','foot soak','rouge','circus','ahava shower gel','mattifying gel','joey cinnamen lipstick','foundation lift','pit boss','verbena lotion','skin primer','bioelements instant emollient','cystic acne','baby eyes','milk soap','oat lotion','borghese fango active mud for face and body','boots','staniac','m.d','l\'occitane hand lotion','slim','pigment lightening','neostrata face cream','brown mascara','keloid','lime soap','pink leopard','kiss','babor for men','cleansing water for face','piedi vitale','pink champagne','just kissed','pomade','neostrata lotion','grow hair','sothys hydroptimale thi3 hydrating serum','gm collin lipo','archipelago sugar vanilla','skinmedica uplifting eye serum','sothys night','biotin','neon lid','modelco lash brow growth stimulator','ahava men','dermalogica buffing cloth','alphaderma ce','redness diffusing serum','pass the butter','loccitane olive','hugo boss','all products','caswell massey honeysuckle','bvlgari omnia crystalline','porsche','anti aging serum','shea butter verbena soap','dandrene','glolash','murad renewing cleansing cream','marine','babor hy','doctor babor','gradual tanning','viterol','mineral brushes','babor eye brow designer','l occitane olive','eshave after shave cream','anthony logistics continuous moisture eye cream','peter thomas roth glycolic acid 10% hydrating gel','anthony logistics vitamin c serum','thinning hair','in the wild','jaqua buttercream','bio hydrating','bronzing gel','murad lotion','neostrata oily acne prone protocol','ginger','mineral gel scrub','goji','refinity','eye makeup','sothys gommage','eye shadow base','crema saponetta','honey almond shea lip balm','number 6','resveratrol','tighter skin','sothys blush','sun products','nail primer','babor skinovage oxygen energizing cream','sothy\'s homme','enzyme','calvin klein the one','globrush','ahava mud exfoliator','water','lip set','clay','eye shadow brush','lash enhancer','glo minerals blush','french manicure','comedogenic','sothys radiance gloss','anthony after shave','l occitane immortelle very precious eye serum','body odor','moisture masque','dopp','crease brush','facial peel','borghese spa perfume','babor skinovage oxygen','moom express pre waxed strips for face and bikini','nuxe oil','selection','bioelements trial size','pixi eye','clay cleanser','eyelash glue','golden branch candle','l occitane soap','sagging skin','disco light','lil angel','l occitane almond apple velvet concentrate','moist intense cream','magic stick','dermalogica masque','volumizing shampoo','jaqua pink potion','cream eyeliner','artemisia shampoo','sothys softening emulsion','babor acne','dermalogica conditioning body wash','pedro','dermalogica skin hydrating booster','ahava spf 50','finishing brush','eye pencil','lip polish','genie','lip serum','karin herzog mild scrub','nuxe toner','ahava products','jaqua chai','sink','suncare','babor travel','powerful','cheek color','neroli','jack black pit boss','clearskin','black lipstick','total camouflage','polo explorer','mens gucci','botanical brush cleaner','pep up pen','dermablend remover','pure lash','pop day to play','jaqua scrub','sets for men','refill colorescience pressed compact','wheat protein','perfetta lip pencil','paula dorf aura','floating candles','klgs391','spectral dnc l','aftersun','magnetic','enhancer','buffer','wash','steppin out','woody','babor cleansing gel','gm collin puractive','olive','murad age reform essentials kit','babor combination','duo','dermalogica deodorant','babor sensational eyes','eau marine','l\'occitane olive soap','dermalogica travel kit','dermalogica hydrating','h e bronzer','l\'occitane grape shower oil','additives','facial scissors','furfuryladenine','antioxidant spray','pollution','t zone','mineral mascara','c','babor promotion energy fluid','l occitane rose','glow in the dark','nose','glo eye shadow trio','jewelry box','babor basic care','gel skin clear gel','discoloration','verbena travel','glominerals glogloss','prevents','genie colore','aloe','4 reines','prevent scar','lip and cheek tint','anthony ingrown','quintessence','too faced snow bunny','true mascara','onyx','orly nail','nuxe huile','too faced juicy jewels','too faced lip plumper','recovery complex','special camouflage','clay pomade','callus','ultra smoothing cream','colorescience sunforgettable full body shaker spf 30','nuxe masque','armani after shave','ultra daytime smoothing cream','insurance','l\'occitane peach','jane iredale primer','ginger shampoo','be still','body mask','bkamins','anti cellulite','acne tea tree oil','babor derma cellular','neostrata oily skin solution','deliskin','gel candles','skin cream','green nail polish','gm collin sun veil','anthony shampoo','anthony rescue','too faced base','natural deodorant','soft cream peeling','cabanaboy','l\'occitane olive radiance cream','hugs kisses','nuxe eye','bha','neostrata shampoo','too faced lipstick','acne masks','dermabrasion','long lash','george','massage stones','dnc','l occitane creame ultra riche body','tns night eye repair','peony','fantastic finish','dermalogica body wash','nuxe huile prodigieuse multi-usage dry oil 100 ml','too faced absolutely flawless','hq','colorescience second skin','balance refill','chroma 2 true beige','sean john unforgivable black','primer lemon','dermalogica post-shave balm','minerals in the mist','md form','papaya purifying enzyme masque','ahava for men','oil blot','vessels','talika brow lipocils','pixie eyeliner','skinovage mimical control','metabolism','lymph','true toner','seboregulator','anti shine','face tan','l occitane immortelle brightening toner','roth','blueberry','babor body line thermal refreshing shower gel','babor white effect enzyme cleanser','algae','sothys collagen','babor pure clear cover stick','single lashes','babor basic care lipid balancing cream','jack black shave','basic care moisturizing','powder eyeliner','creatine','babor hsr platinum cell reactivating eye cream','babor selection ultimate concentrate','babor hsr platinum cell reactivating cream rich','babor hsr lifting foam mask','babor skinovage selection ultimate care cream','babor hsr platinum cell reactivating cream','creme fraiche','anticellulit','anti-cellulite','result','eshave after shave cream white tea','l occitane aromachologie repairing','true bronzer','baby wash','anthony toner pads','cellex-c sensitive skin serum 2 step kit','jane iredale tinted moisturizer','badger shaving brush','firming serum','gm collin lipo fitness serum','lip kits too faced','pumice peel','makeup for oily skin','solar butter','cover cream','feu d\'orange massage oil','anti perspirant','l\'occitane white tea','babor q10 cream','md formulations lip balm','kneipp rheumabath','homme','kneipp citrus','phytomer ogenage','babor organic','cura c','cellex c oil free moisturizer','age hands','cellex-c betaplex new complexion cream','cellex-c clear complexion complex','cellex-c betaplex gentle cleansing milk','cellex-c betaplex clear complexion mask','cellex-c anti-aging kit','cellex-c betaplex fresh complexion mist','cellex-c betaplex smooth skin complex','cellex-c betaplex line smoother','cellex-c fresh complexion foaming gel','cellex-c betaplex gentle foaming cleanser','cellex-c hydra 5 b-complex','cellex-c speed peel facial gel','cellex-c advanced-c eye firming cream','cellex-c body smoothing lotion','cellex-c skin hydration complex','cellex-c advanced-c eye toning gel','g.m collin sensiderm','cellex-c advanced-c skin toning mask','cellex-c fade away gel','cellex-c eye contour cream','cellex-c seline-e cream','cellex-c g.l.a eye balm','sothys secrets intensive lip care','cellex-c eye contour gel','cellex-c under-eye toning gel','ahava salt','cellex-c hydra hand cream spf 15','cellex-c sea silk oil-free moisturizer','cellex-c eye contour cream plus','cellex-c skin firming cream plus','sothys men','spectral dnc-l','true beauty','babor gold','phytomer whiteclat2 whitening spot corrector serum','l\'occitane cinnamon orange','june jacobs candle','supple skin oil','anti-aging moisturizer','gel cheek stain','b kamins maple','june jacobs serum','an9047','skin hydrating booster','june jacobs pore purifying toner','ahava spf','june jacobs papaya body balm','titanium','caswell-massey lip balm','june jacobs mandarin moisture masque','june jacobs redness diffusing serum','june jacobs intensive age defying hydrating serum','raspberry recovery','june jacobs brightening moisturizer','june jacobs age defying copper complex','glospa body butter','ti-tan','borghese creme','phytomer whiteclat2 whitening day cream spf 10','baxter aha','bridge','provence','b kamins skin lightening','borghese tonico minerale stimulating tonic','colorescience achromatherapy gem spritzers 4 oz','l\'occitane lavender pillow mist','shine control','eye pencil green','eye brush','ba-2003','phaze 13 pigment gel','too faced wrinkle injection','volumizing','paula dorf enhancer','borghese body lotion','neova calming green tea serum','bikini wax','ahava after sun rehydrating balm','dermalogica extreme c','show stoppers','borghese cura c','g.m collin treating lotion','orange lipstick','paula dorf bronze glimmer','optical illusion','jack black lube','bath powder puff','june','sothys hydra nourishing body lotion','sothys radiance tightening bust serum','sothys marula massage oil','murad skin perfecting','l\'occitane lavender lotion','loccitane shower cream','lucky chick scrub','sothys shampoo','sothys shower gel','sothys energizing shower gel','sothys delicious scrub','sothys massage elixir','aha cream','paste','sothys total resculpting serum','glopressed','equavie','look','cooling','ahava body scrub','borghese cleanser','woman ralph lauren','colorescience bronzer brush','jetsetter','babor perfect combination purifier gel','june jacobs pore purifying mud masque','fungus','ur','prada for men','soft soap','sensitive skin shaving','certified organic','anthony 32','coverup','n-6 furfuryladenine','oil free sunblock','salt scrub souffle','ahava kits','achromatherapy','l\'occitane olive express eye treatment','medium tan','age maitrise','mature skin makeup','rose body milk','ahava exfoliator','glycolic eye cream','l air du temps','babor phytoactive reactivating','super smile','salicylic','dermalogica climate control lip treatment','too faced foundation','spray sunscreen','lipo-fitness serum','phytoaromatic gommage','soy salt','treating oil','oxygen puractive+ mask','luminance concentrate','dermalogica oil control lotion','sheer tint','tonific','glycolic toner','leaf soap','c6 peptide intensive treatment','contour des yeux prodigieux','glospa bath whip','bota','20% vitamin c cream','too faced eye mascara','stephanotis','borghese apricotta lip pencil','paula dorf eye enhancer','sothys renewal system','b kamins moisturizer','ahava purifying mud mask','beard lube','sheer lustre day moisture','q 10','babor hsr','eau des 4 reines','l occitane shea butter ultra rich body cream','accept','black nail polish','no paraben','knock your socks off','tns hydrating masque','golden goddess','acny','mineral primer','formula 405','oil free sunscreen','iredale absence','mimosa jasmine violet sugar scrub','ctsm','pressed mineral blush','overnight clearing gel dermalogica','lip shine','shadow green eyes','back acne','jack black lip','goddess clutch','true spf','modelco blush','murad night','skin c','paula dorf mascara fan brush','gwp','viz 1000','babor blush','popbegocl','phytomer hydracontinue moisture','whiting teeth','b kamins lactic','01as200k5','no animal testing','dermalogica shave','semi-permanent eyebrow','multivitamin hand and nail treatment','control','babor stop hair loss','fast application pad','l\'occitane precious cream','crystal peel','stencil','double copper','eye brow pencil','talika eyebrow','l occitane conditioner','bye bye blues','modelco brush','cover skin','bispaco','acne moisturizer','bronze glo','moisturizing body sugar','strips','japanese','pink blush','prime','buttocks','lip liner joey of new york','tensor gel','sunprotection','age conceal','strivectinsd','roth blemish','starry eyed','polyhydroxy','cream eye liner','pixibrowlift','pieyecose','popbemismey','aroma','skinmedica acne toner','strivectin hs','cream foundation','bath bar','balm springs','bellini','hydro flavon','nutrient replacement cream','angle brush','sothys scrub','ziikgiset','lip enhancer','glamour gloss','babor wrinkle','anelprlo','bicacl','babolithlibu','babolithcole','ultrarich body cream','bachglgel','luchmijavihy','cajoclcosp','molibulipre','trueaccents','cacowaeaudeb','modili','knmoofbalagi','hewashglove','getfrlobena3','zehetubtea','toofashve','popbeapofch','toofafiba','haecopactogo','ahsibefagise','licofolopesl','anlohecogrki','twbrsogrkit','adse2kitbyce','eyeserum','bapuclcost','padopeilfore','riinboem','conowthshb','mioomita','luchpepesa','lardimi','drmicoreretr','lllbygwstgis','glglliptr','jaireyegl','bachcosa','baesqustred','popbeglst','glglgel','coreme','luchmawhorde','anlobokit','hyaluronic acid eye','blackthorn','cadarosisc','swlafatebag','eye pink','bubble my gum','electric pre-shave','sotuflgel','cayetrco','maple treatment','ca17alsttrse','lidish','cabevapaenla','lidili','paula dorf eye pencil','colorless','ahbosocasygr','amenitybalm','bioelements calmitude','time line','ahdedu','ahpujoygiset','ultracalming','bohycrfima','cofi','ahava3xcharm','gm collin skin clear gel 0.5oz','gm collin retinol advanced','timebalm concealer','sothys softening body gel','twfahasc','jujalipkit','glominerals loose','bosashmitr','iredale brushes','dermalogica conditioning body','dermalogica medibac clearing s','bristle','trcotrcoarri','dermalogica age smart dynamic','color treated hair','murad gel','dermal clay cleanser','body wrap','gm collin age total defence','hydramucine cream mask','glglpodu');
/* $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);
    }