/* Popular phrases - BEAUTYBRIDGE - 21:54:59, Fri Nov 20, 2009 */
var asPhrases=new Array ('on sale','new arrivals','free samples','shea butter','gift ideas','dermablend','jane iredale','returns','rilastil','md formulations','lip stain','pop beauty','sula','bare minerals','sothys','strivectin','exuviance','concealer','eye serum','mascara','babor','jane iredale liquid foundation','glominerals','coverblend','murad','spf','hand cream','tom ford','mineral foundation','armani code','baxter of california','borghese','freesia','neostrata','gift for him','illuminare','vitamin c','beautyblender','dermablend concealer','youngblood','nuxe','tommy bahama','acne cleansers','sponge','lippmann collection','camouflage cream','line tamer','lip drink','leg makeup','priori','too faced','bare escentuals','colorescience','ahava','gm collin','anthony','eye brightener','liptini','hylexin','babor scentao','youngblood mineral foundation','lippmann','brush','lipstick','loccitane','eyelash curler','dry body oil','pressed powder','blinc','paula dorf','bvlgari','true cosmetics','azzaro','jaqua','jane iredale mascara','glominerals pressed base','joey new york','pixi','miso pretty','sandalwood','crucial moisture','badger brush','neostrata ultra daytime smoothing cream spf 15','tweezerman','just kissed','lippman','kneipp','puffy eyes','caswell massey sandalwood','full coverage foundation','glowing skin','eye primer','sensiderm gel','ed hardy','youngblood eye shadows','armani mania','eye cream','g.m collin','dermablend cover creme','travel kit','pixi eye bright','dark spots','june jacobs','age smart antioxidant hydramist','thebalm','l occitane try me shea gift set','md','acne kit','dermalogica','jack black','joey new york pure pores foundation','primer','shea','vanilla','samples','angel','paddywax','mirror','ruby red slippers','almond soap','hugo boss','lip gloss ring','milk concentrate','nail','glo minerals','soap','modelco','collin','too faced kabuki','coconut and papaya','honey','sothys lipstick','mint','priori serum','age spots','daily microfoliant','eternity','lash injection','glo','lip plumper','pca skin pigment control trial system sensitive skin','joey new york line up','nuxe serum','dark circles','make up brush sets','gel blush','ceramide','complex cu3','thymes','happy birthday','caswell massey honeysuckle','paula dorf brows','makeup stick','bvlgari omnia crystalline','paint peel','cor','revitalash','lilac','ed hardy perfume','cashmere mist','joey new york foundation','glycolic acid','wrinkle filler','carolina herrera','dermablend quick fix ivory','lacoste','kiss me mascara','shaving stand','jean paul','cinnamon','porsche','deodorant','neova','borghese set','il bacio','viva la juicy','anti aging serum','manicure set','dermalogica microfoliant','delicious','shave oil','rose','eczema','oat salt','shea butter verbena soap','babor moist intense cream','dandrene','ahava serum','milk','pca eye','glolash','fashion tape','murad renewing cleansing cream','jessica simpson','dermalogica travel size','l\'occitane green tea soap','fixing spray','marine','collagen filler','polo double black','cade','makeup','shampoo','nail polish','glo camouflage','joey','foot cream','jane','massage','foundation','shave cream','peel','eyebrow','hydramist','dermablend quick fix concealer','shaving soap','babor hy','sunscreen','olive oil','joey line up','nuxe mask','multi active toner','babor doctor','special cleansing gel','gradual tanning','empty compact','hydroptimale gel','viterol','hydra matt fluid','chloe','giorgio armani idole','prada iris','glominerals lip','sunscreen face','mineral brushes','babor eye brow designer','glycolic','paula dorf sheer','men soap','peppermint','polo','zegna colonia','juara','perfume','lumedia facial brightener','liquid soap','l occitane olive','gucci by gucci','l\'occitane olive','lip plump','nuxe huile prodigieuse','eshave after shave cream','anthony logistics continuous moisture eye cream','peter thomas roth glycolic acid 10% hydrating gel','murad age spot and pigment lightening gel','anthony logistics vitamin c serum','l\'occitane immortelle eye balm','prada','pca','cherry blossom','obsession','dermablend setting powder','baxter','leg and body','gentle cream exfoliant','too faced lip gloss','anthony logistics','thinning hair','babor make up','ralph lauren','lip gloss','gucci','makeup bags','organic products','modelco airbrush','two faced','translucent','coats','dermalogica oil control','micro dermabrasion','lip primer','spectral dnc','armani after shave lotion','babor night cream','mineral','body wash','almond milk concentrate','be delicious','mama mio','md formulations facial cleanser','sweet cherry','paula dorf transformer','omnilux','blush','dermalogica age smart antioxidant hydramist','pomegranate','verbena body lotion','hair loss','power c peel','paula dorf magic stick','glominerals concealer','new west','lip balm','babor day cream','oil free moisturizer','too faced natural eye','murad cleanser','ampoules','dermalogica barrier repair','native collagen gel','too faced bronzer','acne complex','eye contour','hydramucine optimal cream','jack black lip balm','superstar','jane iredale magic mitt','rilastil mascara','too faced brow envy','l\'occitane jasmine','pit boss','deep cleansing solution','essential oil','dermalogica multivitamin','staniac','brow envy','gm collin sensiderm cream','derm renewal cream','in the wild','trial size','talika','true','phytomer','leonor greyl palme volumateur jasmin travel set','verbena','oily skin','glospa','mineral make up','jaqua buttercream','bio hydrating','hydroquinone','too faced shadow insurance','jane iredale lip','gel delicato','bronzing gel','strivectin spf','sparkle sauce','let me be clear','nutriderm cream','neostrata face cream','cold cream soap','murad lotion','perfekt','bath soap','gm collin cleansing','yuzu','lip scrub','tweezerman pedro','active c serum','neostrata oily acne prone protocol','body scrub','conditioner','ti silc','kinerase','dermalogica hydramist','talc','shaving','dkny','ralph','damask rose','hair growth','gm collin acne kit','tom ford for men','diesel','glow minerals','md formulations cleanser','ginger','sleep','fan brush','hugo boss element','mineral gel scrub','dry skin','md skincare','goji','evening restorative','eye makeup','jaqua buttercream frosting','sothys gommage','honey lemon','sharpener','trial','eye shadow base','fat kiss','eyeliner','babor age conceal foundation','number six','crema saponetta','borghese delicato','fango delicato','borghese brush','dermalogica medibac oil control lotion','brow gel','skin renewal booster','pca skin','eye brow','skin perfecting lotion','green tea','get fresh','diesel only the brave','eye shadow','lippmann rehab','aha','stretch mark','facial brush','honey almond shea lip balm','caffeine','hand lotion','cream blush','soap on a rope','l\'occitane hand cream','number 6','dermalogica total eye care spf 15','stain','thomas roth','resveratrol','shave kits','renewal cream','tighter skin','sothys blush','dermalogica multi-active toner','sunforgettable','brow','dry oil spray','too faced pink leopard','iredale','fake bake','dead sea salt','sun products','sandalwood sampler','smokey eyes','kinerase photofacials','nail primer','bare minerals blush','phytomer eye','babor skinovage oxygen energizing cream','dr','philosophy','jaqua candle','sothy\'s homme','jack black lip trio','scar','retinol','armani','glogloss','dermablend quick fix','brush set','lucky chick','murad pomegranate','prescriptives calyx','enzyme','murad resurgence kit','l\'occitane hand lotion','highlighter','john varvatos','calvin klein the one','ds laboratories','makeup remover','eye shadow primer','globrush','liquid foundations','self tan','l\'occitane gift sets','daisy','blackberry vanilla','hand wash','bust','true foundation','tan towels','coconut','quick fix concealer','sleep mask','dermablend wrinkle fix','archipelago botanicals','shea butter shampoo','l\'occitane hand cream bouquet','ahava mud exfoliator','glitter','anthony logistics spice','babor selection ultimate care','anthony logistics for men','replenix','water','costume national','eyelash conditioner','dermablend kit','lip set','little black dress','gm collin lip plumping complex','extreme lift','opium body lotion','disco lip gloss','neutralizing coverup','nutrithys','highlighter jane iredale','clay','ahava hand cream','cellulite','cosmetic bags','eye shadow brush','atopalm','vera wang','l\'occitane shea butter hand cream','lacoste challenge','skinmedica','oatmeal soap','exfoliant','strivectin sd','lip treatment','heated eyelash curler','janson beckett alpha lipoic acid vitamin c ester dmae day cream','true powder','lash enhancer','tricomin','glo minerals blush','janson beckett','lip gloss set','gm collin bota peptide','plump your pucker','polo aftershave','too faced insurance','pop beauty eye magnet primer','french manicure','blackhead remover','comedogenic','setting powder','arch rival','suncanny','ylang ylang','ahava mineral foot cream','massage oil','sothys radiance gloss','makeup palette','complex c','medical makeup','murad clarifying cleanser','mint shampoo','vespera','lip liner','exuviance night renewal hydragel','exuviance blemish','microfoliant','anthony after shave','trust','borghese foundation','too faced brush','lumedia','gift sets','blackberry','shipping','total eye care','bar soap','paula dorf eyes','jane iredale lip plumper','pixi gel blush','drakkar','ahava cleansing cream','sensiderm cream','calvin klein euphoria','glominerals primer','ahava mineral hand cream','davidoff cool water','l occitane immortelle very precious eye serum','almond apple','natural','masque hydrating','l\'occitane almond shower oil','colorescience line tamer','body odor','tns','vitamin c cream','moisture masque','purple','graftcyte','masque','eyelash','h e','pixi flawless beauty primer','redness','tube mascara','jane iredale concealer','fig','dopp','babor men','tommy','ed hardy body lotion','bare escentuals primer','crease brush','facial peel','alphaderma ce','prada tendre','michael kors island','make-up brush','borghese spa perfume','stretch','peter thomas roth','clean','miss oops','babor pure night cream','nuxe hand','212','quickfix','dermablend smooth indulgence foundation','lip conditioner','babor skinovage oxygen','ahava body butter','eyelash serum','jack black shampoo','gloperfecting powder','moom express pre waxed strips for face and bikini','leonor greyl','nuxe oil','striae','sachet','sunblock','feu d\'orange','ahava gift sets','diesel fuel for life','youngblood concealer','1960','eye','selection','mud','strivectin-sd','l\'occitane deodorant','brow tint','glow summer bronze','true lip shine','jane iredale lipstick','leg and body cover','bioelements trial size','pixi eye','clay cleanser','calvin klein eternity','pixi tinted moisturizer','divine cream','eyelash glue','rilastil lady eye contour cream','greyl','disappear','babor perfect combination','golden branch candle','l occitane soap','babor sensational eyes fluid','mask','long lasting lip stick','sagging skin','disco light','lil angel','facial moisturizer dry skin','active light','l occitane almond apple velvet concentrate','babor cleaning','balancing toner','glominerals powder','sothys set','skinovage','babor moist intense','md moms','lotion','mens cologne','kiss me','cor silver soap','borghese splendore brightening makeup','face lotion','complex c cream','moist intense cream','neostrata gel plus aha 15','being true','brush roll','mama','travel makeup','bioelements kerafole','nuxe creme nirvanesque','egg cream','matte lipstick','babor sunscreen','l\'occitane verbena','shower oil','idole','exuviance day','copper peptide','sensational eyes','magic stick','dkny men','dermalogica masque','caswell massey dr hunter','acne scars','wrinkle injection','peeling pads','volumizing shampoo','jaqua pink potion','cream eyeliner','sothys oxyliance','l\'occitane shea butter','nuxe exfoliant','jane iredale pressed powder','peeling vegetal','escape','ogenage','coola','serum','l\'occitane cade shaving cream','get fresh spa','moisturizer','eye care','cactus cloth','too faced beauty balm','babor advanced biogen','mimical control','travel','mist','le male','artemisia shampoo','gm collin collagen','decollete','narciso rodriguez','neova retinol','bath','brush bag','tools','mattifying','lanvin','pep up gel','joey powder','sothys softening emulsion','true lipstick','pop eye cake','pixi parfum','total cohesion','cream eyeshadow','oxyliance','sothys hydra-matt fluid','pca face wash','babor acne','dermalogica daily microfoliant','dermalogica skin hydrating booster','niacinamide','l\'occitane verbena body lotion','dermalogica conditioning body wash','babor vita balance','glomineral brush','archipelago botanicals travel','colorescience mascara','caswell massey 6','pedro','fade cream','l\'eau d\'issey','jojoba','ahava spf 50','finishing brush','babor selection ultimate foam mask','filler','eye pencil','bronzer brush','lip polish','suncanny foundation','genie','body spray','lip serum','multi-active toner','karin herzog mild scrub','bacteria','veins','true religion','daily defense','sothys duo','nuxe toner','attitude extreme','chrome legend','comfort zone','ahava products','squalane','jaqua chai','true cleanser','perfume oil','sink','slim','disco lights lip gloss','true skin care','dna','suncare','get fresh lemongrass','babor travel','green eyes','shea butter verbena','powerful','cheek color','dermatix','neroli','deep wrinkle','alien','jack black pit boss','elixir of love no 1','anthony logistics glycerin cleansing bar','true lip gloss','clearskin','giorgio armani','lemongrass','whish','true eye shadow','loose powder','fragrance','scalp treatments','pop beauty eyeliner','pixi nail polish','deborah','black lipstick','egg','total camouflage','dna repair','armani attitude','moisturiser','princess','arpege','polo explorer','salicylic acid','clean fresh laundry','mens gucci','derm renewal','baux','blemish','kiton','conditioning body wash','botanical brush cleaner','pep up pen','dermablend remover','status gloss','pure lash','powder me','pop day to play','badger','jaqua scrub','sets for men','anthony soap','sweet almond','refill colorescience pressed compact','wheat protein','cucumber eye pads','verbena hand lotion','z silc plus','perfetta lip pencil','paula dorf aura','5','floating candles','klgs391','pigment lightening','hamadi','spectral dnc l','aftersun','magnetic','enhancer','buffer','wash','z-silc','babor mimical control q10','dermalogica multivitamin power firm','paula dorf powder puff','brow duet','polo after shave balm','steppin out','flowers','peter thomas roth acne spot and area treatment','peter thomas roth oxygen mist','woody','fragrance free','babor cleansing gel','babor hsr eye lifting','pixi eye zone brightener','eyeliner brush','gm collin puractive','olive','murad acne complex','lavender vinegar','murad age reform essentials kit','joey new york instant chemistry the quick once over astringent','babor combination','duo','dermalogica deodorant','l homme','fruit acids','grape','brow kit','armani diamonds','babor sensational eyes','babor for men eau de toilette','aramis gift sets','oil blotting papers','lips to die for','aging','eau marine','l\'occitane olive soap','nuxe huile prodigieuse multi-usage dry oil','dermalogica travel kit','dermalogica hydrating','h e bronzer','md formulations moisture defense antioxidant creme','l\'occitane grape shower oil','additives','facial scissors','furfuryladenine','sothys exfoliating','antioxidant spray','acne complex gm collin','pimples','priori even tones','blotting sheets','pearl','exuviance eye','cotton pad','pollution','antiseptic','t zone','pump','hair mask','mineral mascara','mango','under eye concealer','c','sula perfume','harmonizing gel cleanser','babor promotion energy fluid','babor eye','l occitane rose','glow in the dark','nose','glo eye shadow trio','jewelry box','dream tint','box of chocolates','babor basic care','lash brush','jane iredale brushes','climate control','gel skin clear gel','discoloration','desquacrem','skin tightening','verbena travel','brown mascara','cashmere mist luxe edition','glominerals glogloss','l\'occitane lip gloss','prevents','clay mask','genie colore','apricot chamomile','tommy bahama set sail','aloe','lash curler','neon','kneipp cold flu herbal bath','mint balm','erase those lines','neova r2','4 reines','babor lip','resurfacing','jack black hand','prevent scar','lip and cheek tint','donna karan cashmere','anthony deodorant','spectral rs','anthony ingrown','quintessence','too faced snow bunny','babor phytoactive','makeup kits','shimmer lotion','true mascara','babor intellizyme','onyx','gossip gloss','orly nail','verbena lotion','nuxe huile','hydramucine cleansing milk','too faced juicy jewels','too faced lip plumper','recovery complex','essenza di zegna','armani diamonds for men','special camouflage','clay pomade','exuviance skin lightener','exuviance antibacterial facial cleanser','callus','beauty fix','rose water','gm collin eye contour','ultra smoothing cream','t fivve','sothys clearness serum','silver','exuviance skin brightening gel','colorescience sunforgettable full body shaker spf 30','nuxe masque','armani after shave','skin brightening gel','ultra daytime smoothing cream','insurance','complesso intensivo','dermalogica toner','l\'occitane peach','aha 15','jane iredale primer','hair conditioner','mugler','bath and body works','ginger shampoo','pca acne control','deep wrinkle treatments','be still','body mask','bkamins','anti cellulite','acne tea tree oil','joey new york pure pores','babor derma cellular','neostrata oily skin solution','joey calm and correcting','deliskin','gel candles','smoothing gel','buttercream frosting','lash wand','lycon spa','loccitan solid perfume','skin cream','bahama mama','green nail polish','anthony action','gm collin sun veil','anthony shampoo','anthony rescue','caswell-massey talc','colorescience sun reliable spf 20 primer line tamer','brow growth','face brush','too faced base','natural deodorant','mens gift sets','soft cream peeling','cabanaboy','cuticle remover','whitening mask','lily of the valley','l\'occitane olive radiance cream','nuxe eye','colorescience sunforgettable orb spf 30','hugs kisses','bha','skin primer','puracne oxygen gel','neostrata shampoo','too faced lipstick','g.m collin hydramucine','acne masks','sensitive skin','goat milk soap','dermabrasion','long lash','george','eye wrinkle','polo gift set','after shave balm','massage stones','cashmere mist body lotion','powder foundation','illuminare fantastic finish foundation concealer','dnc','l occitane creame ultra riche body','primer trial size','dermalogica medibac','tns night eye repair','peony','fantastic finish','golden glow','babor mimical control cream','dermalogica body wash','nuxe huile prodigieuse multi-usage dry oil 100 ml','too faced absolutely flawless','hq','too faced eye shadow insurance','cellex c','borghese pelle rinnovo skin renewal polish','natural perfume','colorescience second skin','obsession after shave','baby products','balance refill','chroma 2 true beige','sean john unforgivable black','quince','l\'occitane shea','devin','primer lemon','dermalogica post-shave balm','minerals in the mist','dermalogica medibac clearing mattifier','ralph lauren polo','md form','earth element','loose mineral foundation','oxygen cream','papaya purifying enzyme masque','pencil sharpener','coverblend powder','vetyver','rock princess','grapefruit fragrance','unforgivable woman','nail stencil','ahava for men','salts','exuviance hydrating lift eye complex','oil blot','diffuser oil','vessels','blusher','aromachologie repairing shampoo','elasticity','skinovage mimical control','blue mascara','talika brow lipocils','pixie eyeliner','miss oops goblet goop','kneipp oil','colorescience trial size','metabolism','lymph','quick refiner','sea silk oil-free moisturizer','true toner','acne sulfur','seboregulator','anti shine','kneipp deep sleep','face tan','l occitane immortelle brightening toner','antioxidant hydramist','super rich repair','bioelements equalizer','power rich','bioelements decongestant cleanser','kinerase pro therapy c6 peptide','true moisturizer','pca blemish bar','bioelements instant emollient','roth','blueberry','tea tree','alpha hydroxy','flavored lip gloss','babor body line thermal refreshing shower gel','cocoa butter','z silc','babor white effect enzyme cleanser','buttercream','algae','babor white effect intensive concentrate','babor white effect cream mask','sothys collagen','babor pure mask','murad moisture rich cleanser','babor pure clear cover stick','single lashes','lavender water','babor basic care lipid balancing cream','acne care','moisturizing cream','jack black shave','tonic','mousse','enzyme cleanser','basic care moisturizing','l occitane aromachologie repairing shampoo','powder eyeliner','creatine','babor hsr platinum cell reactivating eye cream','babor selection ultimate concentrate','babor rose toning lotion','babor hsr platinum cell reactivating cream rich','babor hsr lifting foam mask','dreaming','babor skinovage selection ultimate care cream','babor hsr platinum cell reactivating cream','ceramic nail file','dermalogica shampoo','babor skinovage complex c maximum vitalizing cream','creme fraiche','anticellulit','anti-cellulite','result','capillary','glycerin','compact blush','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','dusting powder','jane iredale tinted moisturizer','kneipp juniper','bioelement kits','badger shaving brush','lip gloss palette','firming serum','elastin','gm collin lipo fitness serum','lip kits too faced','rosemary','shea butter soap','pumice peel','babor camouflage cream','makeup for oily skin','propolis','thalassothys','too faced chocolate soleil bronzing powder','mineral concealer','candy box','solar butter','cover cream','redness diffusing serum','makeup wipes','eyebrow kits','feu d\'orange massage oil','jack black beard','anti perspirant','l\'occitane white tea','milk bath','babor eye pads','apricot','babor q10 cream','md formulations lip balm','kneipp rheumabath','sunscreen gel','hydro minerali','cucumber body splash','seaweed','homme','kneipp citrus','phytomer ogenage','babor organic','cura c','cellex c oil free moisturizer','age hands','cellex-c betaplex new complexion cream','skin caring foundation','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','calvin klein obsession','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','colorescience line tamer skin brightener','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','orange','sothys men','spectral dnc-l','true beauty','lightening serum','zegna','babor gold','phytomer whiteclat2 whitening spot corrector serum','l\'occitane cinnamon orange','hair mist','hydrating cream','june jacobs candle','oligopur','supple skin oil','borghese cleanser set','anti-aging moisturizer','blemish treatment','gel cheek stain','karin herzog silhouette','b kamins maple','june jacobs serum','an9047','the best of l\'occitane','dermalogica kit','body milk','dermablend leg','skin hydrating booster','memories of kyoto','dorf','eyebrow powder','june jacobs citrus shower gel','june jacobs pore purifying toner','ahava spf','perfumed powder','june jacobs papaya body balm','titanium','olive daily face cleanser','self-tanner','caswell-massey lip balm','phytomer hydracontinue instant moisture cream','phytomer accept neutralizing cleanser','instant chemistry','june jacobs elastin','exuviance serum','eye lashe growth','retina cream','june jacobs mandarin moisture masque','baborganic','june jacobs redness diffusing serum','june jacobs citrus','june jacobs intensive age defying hydrating serum','raspberry recovery','azzaro after shave balm','june jacobs brightening moisturizer','june jacobs age defying copper complex','glospa body butter','ti-tan','eshave sweetheart','borghese creme','pina colada','phytomer whiteclat2 whitening day cream spf 10','baxter aha','nose hair','bridge','glycolic acid pads','provence','body glitter','b kamins skin lightening','borghese tonico minerale stimulating tonic','mascara brush','weight loss','brown spots','colorescience achromatherapy gem spritzers 4 oz','paula dorf perfect illusion for the eyes','hair&nail products','rush','l\'occitane lavender pillow mist','pass the butter','oxygen cocktail','leonor greyl palme oil','shine control','neova manganese','mineral kits','eye pencil green','eye brush','day bright','silkcoat balm','intelli-zyme','ba-2003','kinerase cream','gwen stefani','cream shadow','apple of the cheek','soins soleil cellu-guard','vera wang for men','biotin shampoo','raspberry','phaze 13 pigment gel','pure organic','replenix serum','too faced wrinkle injection','lemon hand lotion','replenix fortified cleanser','volumizing','paula dorf enhancer','borghese body lotion','purifying cleansing gel','bioelements sensitive skin','neova calming green tea serum','murad post acne spot lightening gel','miyake','archipelago pomegranate','bikini wax','ahava after sun rehydrating balm','dermalogica extreme c','show stoppers','borghese cura c','g.m collin treating lotion','strivectin neck','for women','orange lipstick','paula dorf bronze glimmer','optical illusion','fraxel','jack black lube','ahava time line personal age defying program','ahava shower gel','skin bleach','glospa sugar body polish','bath powder puff','june','neova set','sothys hydra nourishing body lotion','sothys radiance tightening bust serum','sothys marula massage oil','murad skin perfecting','hide and heal','royal jelly','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','murad lip','glopressed','equavie','juice','look','unforgivable for men','babor moist','cooling','bioelements lipstick','ahava body scrub','refreshing verbena','fade fast','soy body facial','borghese cleanser','woman ralph lauren','tns essential serum','loccitane vanilla','colorescience bronzer brush','copper','jetsetter','ultra sheer','babor perfect combination purifier gel','june jacobs pore purifying mud masque','fungus','glycerin bar soap','cucumber mask','ur','butterfly kiss','prada for men','soft soap','kyoto','frizz','ck deodorant','sensitive skin shaving','lip moisturizer','certified organic','acqua di','anthony 32','lavender hand cream','salt scrub','coverup','vivid blue','n-6 furfuryladenine','oil free sunblock','lipid repair','cleansing water for face','salt scrub souffle','ahava kits','achromatherapy','l\'occitane olive express eye treatment','glycolic lotion','medium tan','age maitrise','warm cotton','youngblood samples','mature skin makeup','pca wash','jack black pomade','rose body milk','ahava exfoliator','glycolic eye cream','priori eye','spots face','l air du temps','b5','babor phytoactive reactivating','super smile','aha gel','lip brush','face fitness','medicated acne gel','salicylic','exfoliating soap','sun tanning','dermalogica intensive moisture balance','exfoliating body towel','dermalogica climate control lip treatment','phytoaromatic mask','too faced foundation','spray sunscreen','hydramucine optimal gel','body mist','lipo-fitness serum','phytoaromatic gommage','exfoliating gel','loccitane lip','derm renewal gel-cream','soy salt','oxygen puracne purifying gel','treating oil','nuxe teint prodigieux','oxygen puractive+ cream','oxygen puractive+ mask','intensive exfoliating gel','visible lifting concentrate','luminance concentrate','dermalogica oil control lotion','skin brightener','lip exfoliator','sheer tint','honey almond','tonific','glycolic toner','make up kit','leaf soap','c6 peptide intensive treatment','french soap','cream eye shadow','contour des yeux prodigieux','neova body therapy','youngblood lip gloss','dermablend shades','glospa bath whip','june jacobs citrus body balm','bota','joey new york lipfit lip balm','20% vitamin c cream','electric shave','undereye circles','ultra smoothing lotion','too faced eye mascara','juniper herbal bath','pca 13','stephanotis','cuticle oil','borghese apricotta lip pencil','angelica','paula dorf eye enhancer','black pencil eyeliner','sothys renewal system','b kamins moisturizer','ahava purifying mud mask','beard lube','sheer lustre day moisture','q 10','babor hsr','eau des 4 reines','bain moussant','accept','l occitane shea butter ultra rich body cream','black nail polish','linetamer','no paraben','knock your socks off','ultra rich body cream','tns hydrating masque','golden goddess','white eyeliner','rescue me foot cream','acny','mineral primer','formula 405','oil free sunscreen','nail varnish','sothys soothing lotion','iredale absence','mimosa jasmine violet sugar scrub','skin hydrating masque','ctsm','acneplex','spot skin face','lip wax','pressed mineral blush','overnight clearing gel dermalogica','olive oil loccitane','olive shampoo','lip shine','shadow green eyes','glycolic cleanser','back acne','pomade','toenail','michael kors leg shine','jack black lip','goddess clutch','true spf','mdlash','modelco blush','murad night','cleansing foam','skin c','paula dorf mascara fan brush','gwp','viz 1000','babor blush','pure pressed','pure pressed base','popbegocl','reve de miel','phytomer hydracontinue moisture','peter roth','sensitive eye 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','emollience','l\'occitane precious cream','crystal peel','geniecolore','stone','stencil','double copper','sothys cleanser','eye brow pencil','anthony balm','talika eyebrow','l occitane conditioner','pore refiner','bye bye blues','soy milk lotion','modelco brush','make up box','cover skin','shea butter ultra rich body cream','lavender sachets','strivectin-hs','bispaco','acne moisturizer','bronze glo','moisturizing body sugar','strips','lavender linen','pink blush','japanese','dermalogica power rich','bonjour','prime','buttocks','lip liner joey of new york','tensor gel','peter thomas roth kit','stri-vectin','sunprotection','age conceal','strivectinsd','roth blemish','true protective mineral','starry eyed','polyhydroxy','cream eye liner','pixibrowlift','pieyecose','popbemismey','fundamental multi','aroma','overnight clearing gel','skinmedica acne toner','get fresh lemongrass lavender','strivectin hs','cream foundation','refreshing verbena shea butter','bath bar','balm springs','coconut lotion','archipelago mud','bellini','nutrient replacement cream','hydro flavon','angle brush','soy milk','stands','sothys scrub','two faced mascara','ziikgiset','collagen gel','lip enhancer','glamour gloss','bioelements eyeliner','gloconcealer under eye','babor wrinkle','anelprlo','bicacl','babolithlibu','babolithcole','ultrarich body cream','bachglgel','l occitane vanilla','luchmijavihy','cajoclcosp','molibulipre','trueaccents','prada iris gift set','pink leopard','cacowaeaudeb','modili','jarabufrgutr','knmoofbalagi','hewashglove','getfrlobena3','zehetubtea','toofashve','popbeapofch','toofafiba','haecopactogo','one step cleansing bar','ahsibefagise','licofolopesl','neck wrap','babor cleansing hy-ol','baby eyes','anlohecogrki','twbrsogrkit','plumeria','adse2kitbyce','phytoactive sensitive','eyeserum','kinerase pro','bioelements sensitive','bapuclcost','padopeilfore','riinboem','conowthshb','mioomita','luchpepesa','lardimi','drmicoreretr','lllbygwstgis','glglliptr','cupcake','lather shave cream','true color','jaireyegl','bachcosa','baesqustred','popbeglst','bioelements cactus','under eye cream','glglgel','coreme','luchmawhorde','anlobokit','hyaluronic acid eye','blackthorn','cadarosisc','valentines','swlafatebag','eye pink','bubble my gum','electric pre-shave','glamdi1','water proof concealer','sotuflgel','cayetrco','maple treatment','ca17alsttrse','lidish','cabevapaenla','lidili','paula dorf eye pencil','colorless','bioelements calmitude','ahbosocasygr','amenitybalm','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','shampoo bar','twfahasc','jujalipkit','glominerals loose','bosashmitr','organic make up','iredale brushes','dermalogica conditioning body','dermalogica medibac clearing s','bristle','trcotrcoarri','pop sauce','face masque','color treated hair','dermalogica age smart dynamic','murad gel','dermal clay cleanser','body wrap','sothys lip','gm collin age total defence','hydramucine cream mask','fir','glglpodu','scandalous','ahava travel','twpecast','twpeha','pro moist fluid','advanced biogen day cream','glpetrkit','moisture gel','glominerals natural light','bonne mere','face mist','promo','iredale pressed mineral powder','dr michelle','lashwand','jaqua frosting','immuniscience','body care','sable lip brush','pixi fig','true lip','warm ivory','bioelements eye','molto','green tea serum','ester c','secrets de sothys','dmae','fir honey','dermalogica skin resurfacing','dermalogica sheer tint','energizing oxygen fluid','joey invisiline','bioelements probotix','bioelements peel','bioelements body cream','monsoon','hollywood glamour','peter roth hydrating gel','ed','caswell balm','sk','spf eye cream','get fresh bath salts','joey d lip','pink concealer','body oil spray','shea butter body lotion','neostrata bionic face serum','neova night','blush mahogany','eye renewal gel','miss sixty','l\'occitane face and body balm','viterol.a','hydration spray','kissme','silicone','pale','too faced after glow','intellizyme','dermalogica sensitive','creme aux fleurs','brow stencil kit','finish','blushstick','nuxe exfoliant doux aromatique','glominerals liquid','perfumed body powder','bottle','verbena leaf soap','purifying mask','l\'occitane neroli','moisturizing lipstick','solar protection formula','peter thomas roth un-wrinkle n','puractive gel cream','borghese sheer foundation','lipfit','rose velvet','ultra sheer moisturizer','caswell-massey almond aloe','elasticizing cream','body wash lavender','striadril','l\'occitane cream gel for tired','june jacobs lip','ti creme','babor q10','glominerals mist','lip extreme','glominerals glovolumizing ma','babor hydro flavon cream','lycoplex lipstick','direct beauty fluid','borghese serum','true eyeliner','galaxy','lemongrass candle');
/* $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);
    }