/* Popular phrases - BEAUTYBRIDGE - 22:1:2, Fri Jan 27, 2012 */
var asPhrases=new Array ('on sale','gift for her','lippmann','new arrivals','gift ideas','dermablend','too faced','nuxe','kit','exuviance','dermalogica','glucan','borghese','glominerals','sothys','pixi','makeup','dermablend cover creme','strivectin','kneipp','gm collin bota peptide','pca','rilastil','colorescience','md formulations','jane iredale','primer','ahava hand','joey new york','shave gel','concealer','idebenone','too faced shadow insurance','true','ahava mineral shower gel','glominerals concealer','nail polish','archipelago botanicals soap','go smile','limited edition','l occitane','babor mask','free samples','beautyblender','priori','supersmile','lip stain','beta-glucan','caswell','archipelago botanicals lotion','colorescience sunforgettable','bliss','youngblood','fekkai','dermalogica acne','tweezerman tweezer','leonor greyl','tweezerman','murad','revitalash','mineral foundation','oil','loccitane','ahava foot cream','hcg','toner','enzyme','colorscience','hair removal','brow brush','sothys men','dry skin','eyelash growth','glamour to go','dermalogica hydramist','dermalogica daily microfoliant','paddywax','camouflage','illuminare','soap','i','moisturizer','bare escentuals kit','borghese eye','powder brush','delegandboco2','lippmann collection','neostrata','june jacobs','chocolate soleil','acne','hydroptimale','mens talc','salicylic','nail','cellex-c','cellex','jack black','neova','padotoca','rilastil daily care toner','diesel','aha peel','luminous olive','illuminator','gm collin vitamin c','neostrata skin smoothing cream','philosophy','bronzy babe','true mascara','eye gel','gm collin','bioelements','leonor greyl eclat','leonor greyl masque','yoli','jane iredale blush','spf 30','paula dorf total camouflage','pop beauty','thebalm','revaleskin','212','psoriasis','candles','sugar lotion','brbatolipgl','babor pure','pomegranate','lip injection','skin medica','beard lube','eye base and concealer','true concealer brush','jane iredale starter kit','youngblood pressed powder','lactic acid','palette','returns','modelco','ingrown hairs','youngblood mineral powder','neova ti-silc','sothys anti-ageing cream grade 4','buttercream frosting','color science','birthday','self tanning lotion','sothys anti-ageing cream grade 2','freckles','diet','archipelago mango','sothys gommage','mineral make up','too faced eyeshadow','bremenn','too faced foundation','gift for teens','jane iredale eyeshadow','sale','alien','bohynafima','aha','boticario de havana','comataboxkit','emu oil','lippmann candy shop','call me irresponsible','coffeeberry','hand indulgences','glominerals body bronzer','deodorant stick','sothys night cream','alpha hydroxy','peter thomas roth','brow pencil','cream blush','shampoo for men','babor','pixi lip stain','june jacobs shampoo','sagging skin','eyebrow brush','lifting cream','knspheba','i.d foundation','decollet cream','skin care','ti-silc sheer','babor ampoules','bvlgari','paula dorf brow tint','mist','dermalogica multivitamin power firm','illuminare makeup','mascara','talika','occitane','murad acne aging','scar','tuscany','zit stick','hot mama blush','foot file','bioclin','lemongrass','pop beauty eye magnet','loccitane vanilla','progression','filler','moisturizer spf','lip fixation','hamadi','caswell massey talc','popbeeyecl','coverblend','l\'occitane rose','susanne lang','nuxe night cream','jane iredale mascara','too faced snow bunny bronzer','microdermabrasion','eyebrow powder','oops','organic shea butter','june jacobs citrus','tns ceramide treatment cream','nuxe huile prodigieuse','spf makeup','liptini','pca skin','kneipp body wash','cheek tint','baxter of california','collin','jane iredale liquid foundation','vera wang','airglow','ampoules','clean veil','pressed mineral foundation','shell','dream tint medium light','dr hunter\'s hand creme','borghese blush','pop beauty clutch smokey eye','murad t-zone pore refining gel','phytoactive reactivating','shea butter','pca silk balm','mama mio','face powder','tan','mens gift sets','soap on a rope','archipelago sugar lotion','eye cream','sothys mask','eye','pore refiner','unscented','pop life','lippmann nail polish','verdon','get this party started','cheek lip','clean summer linen','creme fraiche','get party','eye shadow base','kneipp almond blossom oil','aura of patchouli','murad pomegranate','viva la juicy','colorescience lip','usher for women','burberry the beat','samples','make up sponge','matte perfection','escape','oil free','fluidsplash 3 in 1 foundation','too faced brow envy','gm collin sensiderm cream','mild peeling','hair oil','neocutis','solid perfume','get fresh','phytomer','anthony','jane iredale liquid minerals','makeup sponge','pigmentation','l\'occitane cherry','skin light','sosulipcarod','chemical peel','fake bake','gucci by gucci pour homme','make up brushes','concealer brush','jane iredale eye gloss','violet','false lashes','bonjour','jane iredale lip crayon','dermablend setting powder','anti aging foundation','brow powder','decocrspf30','foundation brush','complex c','too faced chocolate soleil bronzing powder','guess','innocent','babor toner','nefertiti','facial peel','eyeliner','apres','tinted moisturizer','lip fusion','powder blush','michelle','borghese lipstick','collagen','lipgloss','facial masks','firming','skin smoothing cream','baby','ahava bar soap','pishchgel','hair pomade','mishap tape','borghese active mud','dermablend setting','glglba','dermalogica clean start','yomibaco','blinc','doctor babor','oat milk lotion','advanced biogen intensive repair','evian spray','grapefruit','blushing bride','fragrance free','dermablend cover cream','l\'occitane green tea','body tan','retinol','thierry mugler','set','elixir','cosusallclr','wax','too faced natural eye','eyebrow gel','lavender oil','nuxe lip balm','fiber mascara','super shape','marc jacobs','its a 10','jane iredale lip','eyeshadow primer','burberry touch for men','brow finishing gel','juicy','face brush','lip liner','fango','hand','michael kors','borghese tonic','kneipp arnica','caramel','thebalm shadylady palette','sothys post depilatory softening care','babor wrinkle filler','jack black conditioner','bath and shower gel','gm collin eye','dr hunter','evian','bar soap','physicians formula','lip fusion xl','jonewyococom','cleansing milk','flora','face regenerating serum','desminfo1','babor basic care','kaplanmd','hamadi shea spray','color','too face brow kit','colorescience bronzer','perfect combination concentrate','sothys hydroptimale','t3','anthony balm','eye lash growth','foundation for mature skin','black mascara','eyelid primer','thebalm hot mama','bathshower1','gm collin sensiderm','grapefruit body wash','benzoyl peroxide','true cover','murad primer','skin care tools','copeland','peroxide','leonor','youngblood brush','joey line up','pink sugar','omnilux','eye firming','boost','volumizing shampoo','tricomin','nail scissors','lycon spa ingrown-x-it solution','babor ultra performance lip colour','calyx','english lavender','lily of the valley','skin care sets','rocawear','pomade','babor body','minty','baulpenaco','glowfusion','jairpulispf1','rosie jane','bath oil','purematte','beige fluid makeup','whitening','eye balm','hormonal acne','gm collin oxygen puractive mild cleansing gel','paula dorf total','birthmark','blkimeey','puff','toofabrbl','kneipp orange and linden','get fresh body butter','borghese brush','babor neck cream','dna','dye','nuxe creme fraiche','fig','trsolipco','sebaceous','daisy','dream palette','medicated hand cream','jane iredale spray','eye brightener','padoeyepr','fungus','jane iredale magic mitt','fun','whitening cream','jane iredale lip pencil','boticario','hydramucine treating lotion','babor eyeliner','revaleskin eye','ahava purifying mud mask','elf','shave gel women','kneipp lavender herbal bath','skin moisturizer','kneipp bath','lip lights','colorescience not too deep','t3 hair dryer','clean skin','he','pure bliss bath','powder eyeliner','twsltw2','escada ocean lounge','boucheron','maxi definition lip liner','giorgio armani','bath','colloidal','nuxe firming','caswell massey patchouli','oily scalp','trcocapoblr','puffiness','flocked sponge','nutriderm cream','dermablend leg and body cover creme spf 15','glgloilibas','ahava mineral body lotion','kneipp almond blossom','verbena shower cream','foot bath','too faced lip','aha gel','caswell-massey #6','almond cold cream soap','empty compact','pads','jasmine kneipp','borghese everyday getaway bag','kneipp products','ck be','tns recovery','bamadelipli','babor shower gel','pro active','basusoeyesh','babor eye shadow','super soft duo blush','jhl','phytomer eye','lipfusion xl','lilac talc powder','brightening primer','foundation compact','jane iredale longest lash mascara black ice','bamafo','babor age conceal','rock princess','true kit','weekend','concealing spot treatment','bapefifo1','gucci flora','drmicoagskfo','jane iredale black liquid eyeliner','dermud','ahava mineral lotion','made in usa','babor direct beauty fluid','co2009h1','lashlight','babor ultra shine lip gloss','jane iredale powder','lip plumper tinted lip gloss','borghese concealer','mineral eyeshadow','men bronzer','nina ricci','jack black moisturizer','guest soap','moonglow','gift with purchase','murad spray','nail tips','hair inhibitor','special cleansing gel','sothys homme','sarah smile','acne and anti aging','mini nailtini','dead sea mud','washcloth','getfrmeofbub','thebalm trio','butter cream','eye liner pencil','l\'occitane room spray','babor skinovage','bioelements shave','lash growth','number 6','bota peptide 5 concentrate','ultimate foam mask','babor eyeshadow','touch of pink','baulpelipco','deliskin','jane iredale eye liner','beyond matte','babor mango flip','herrera','ergothioneine','retinol advanced','demalogica','dermablend leg and body tattoo primer','polo for men eau de toilette spray','dermalogica clean start hit the spot','lshbuliso','sothys hydra matt fluid','paula dorf eyelash curler','babor eye base','obsession gift sets','jane iredale loose mineral','visible lifting cream','natural mineral kit','sothys pore refiner system complexion perfector','nuxe 3 roses','foaming bath gel','skin caring foundation','bvlgari pour femme','kneippbodywash','jockey club soap','greyl','be delicious fresh blossom','eye gel mask','jane iredale purepressed base refill','drop dead red','morning mint hand creme','paula dorf eye lite','too faced foundation powder','lip balm spf','sunforgettable all clear','cosmetic sponge','mama mio oil','bionic','sothys blush','babor lip repair','badger shaving brush','colorescience suncanny','lip crayons','glglshtr','sothys soothing lotion','stick deodorant for men','oil free matte block','fresh body butter black currant','face tan','jane iredale base','fango brillante brightening mud mask for face and body','ocean','tanning glove','terry','babor lip','phyto stem','eye highlighter','jonewyosecoa','hypoallergenic','pixi kits','talika eyebrow lipocils','amazing grace','gm collin aquamucine cream','silver scente','neostrata renewal','neova cleanser','nutrient toner','hair care','home perfume','caswell massey verbena','talika eye patches','climate control','curaforte moisture intensifier','botanico eye compresses','trsalipsh','beverly hills','brush roll in black','sundance','phytomer oligopur blemish target gel','skin hydration','b kamins vegetable cleanser','murad supplements','true religion','shower','kyoto','glominerals kit','flower water','lip stick','jabllimavico','jane iredale pencil sharpener','gel moisturizer','gloss','delegandbota','bvlgari black','pixi tinted moisturizer','eye tightener','honeysuckle lotion','exuviance age reverse bioactiv wash','lipiad','mopoduofo','in your dreams','colorescience all even','gucci pour homme ii','pca toning','sothys clearness milk','glow powder','cosuflifo1','wood','loccitane men','phyto stem cell serum','trcotrcoarri','red ribbon','erase','pumice peel','skin peel','feet','hand sanitizer','2 faced','babor seacreation','ultra comforting serum','oil free primer','paraben free makeup','eye bags','bags under eyes','hydrator plus','jane iredale satin refill','harajuku lovers sunshine cuties','true cosmetics the kit','ex8724','pump soap','nastupconala','algae','puracne','mineral sun','sensitive skin','almond aloe','bulgari pour homme','borghese bagno di vita','pixi energy blush','ahava mask','true mineral mist','value sets','gold lip gloss','sothys acne','trcoincorish','myrtle','shaping neck care','kneipp evening primrose body oil','pixilipline','dermalogica kit','pigment bar','cakleuforwoe1','too faced eye shadow','eye pencil','touch cream blush','talika lash extender','priori smoothing eye serum','knthspbasa1o','ahmimacadeal','lacoste challenge','padoeyelipe','blackberry vanilla','sothys nutritive comfort cream','bath powder','too faced glamour dust','sunscreen wipes','rodriguez','lunar dust sunset','gold eyeshadow','lightening','body bronzer','babor kit','plum eye shadow','glitter eyeliner','overnight clearing gel','scar cover','forget you','zirh restore','yoli1','summer verbena','michelle copeland','verbena shower gel','revitalizing booster concentrate','paula dorf lip liner','recovery serum','caffeine','jane iredale lip liner','tommy bahama','oil free mascara','bronzer for men','ahava body trio smooth sensations gift set','rsvp','sienna sunset','aromachologie relaxing bath shower gel','too faced magic','beautyblender ultimate make up sponge applicator','moom organic hair removal kit with lavender','aroma','drakkar','tuberose','replenix retinol plus smoothing serum 3x','cotton candy','foot spray','oily skin solution','orange blossom','pressed foundation','jairpubaspf2','mimical','iredale brushes','beauty fix','purepressed base','bioelements calmitude','filemate','smokeless red','bath and body gift set','too faced glitter','ge2009s1','toofaexcoine','attitude','under eye cover','phytoactive','men with oily skin','twpotw1','borghese bath','najabrliedla','toe nail clippers','lavender fragrance','acid','rilastil suncare','piiltico','get fresh bubble bath','sothys secrets','strivectin neck','true skin tint','ilulalldayfo','borghese splendore brightening body glow','face scrub','moisturizing body wash','gardenia perfume','gm collin puracne oxygen gel','peel off mask','base coat','bahama mama','babor intensive repair','control','divine','primed and poreless','jonewyolili1','pixi eye shadow','babor aroma massage bath balancing','lotion plus','borghese crema intensiva','positano','dragon ice','body firming','eye depuff','oat salt','diamonds','jonewyosmgle','angel eyes','nirvanesque','neova complex','neova day therapy','long lasting lip gloss','globrow collection','exuviance soothing toning lotion','metallic eyeliner','pixie pin-ups','vitamin k cream','ur','powder papers','dermal clay cleanser','pixi-flawless beauty stick in a warm tone','fast application pad','concealer spf','azelaic','brow color','waterproof eyeshadow','black soap','glglco','loccitane lip gloss','snap-8','matte blush','rilastil aqua','glominerals base','nuxe etincelante','pismeyewa','lash wand','sothys eye serum','sothys oxyliance mask','hand was and lotion set','matte lip','grade 3','italy','elasticity','too faced flawless','mark','toofafoli','mimosa','depilatory','thick hair','malachite','hand wash and lotion set','larrea divaricata','bishmawicaan','angel men','babor derma refiner','litolipgl','colorescience optical illusions colore corrector pen','padobrti','jane iredale eyeliner pencil','bronzer powder','10','get fresh spa grapefruit','absolutely','pure clear cover stick','cream shadow','kneipp grape seed oil','age total','padoeyeco','butter cream frosting','l\'occitane aromachologie','ahava cleansing cream','usformeneaud1','kalip20moths','sugar scrub','fog rolling in','cleansing bar','l\'occitane cade','thebalm powder','true cosmetics restoring rich cream','face pack','toofalipoflu','metro menerals','bohycrfima','gardenia body lotion','azzaro stick','hsr lifting','true hydrating','anthony spirit','too faced collection','lovey dovey','sulfur','kneipp evening primrose intensive balm','homme exfoliating scrub','t zone','chrome azzaro after shave balm','dirt bag','callus shaver','shea soap','pack','jonewyoinchc','toofagaglch','taeyex','too faced romantic eye palette','nail whitener','jane iredale liquid mineral warm silk','snake','clarifying lotion','dermalogica cloth','black ice','jairciuneyec','exuviance serum','shower cream','eye shadow palette','individual false lashes','bath products','pixiglosskit','i\'m not innocent','lunar dust','refining peel-off mask','jane iredal','waterproof makeup','coforekit','murad age-diffusing serum','retinoids','jairputreyes8','pop beauty primer','sunforgettable spf 30','c serum','coletmebecl','baeyebrpe','noncomedogenic','l\'occitane sun','menerals','colippowa1','oily','mochti','sensiderm gel','colipshglspf','gla','piroliptr','shea butter magic eye balm','babor joghurt mask','trcrblco','eye detox contour gel','bitrsi1oz','finishing spray','mioobotuc','beta','modelco shimmer','pixinailpolish','rose shampoo','citrus body balm','hand mask','evmiwasptrtr','gloprotective','no more drama','anthony toner pads','lip enhancement','diamonds and pearls','bronze belle','monsieur','electric shave','adskticrbyce','sothys lip pencil','coconut lotion','sun spots','pop beauty eye cake','bacllipco','rosy','toofalain','coach legacy','total cohesion firming','herbal eye','saponetta','safari for men','mom baby balm','ahava skin replenisher','lip of luxury','starfruit','comibamospf4','who-cc-415','twsqsnhatr','sothys morning cleanser','normalizing beauty milk','pure mask','tricomin shampoo','mood swing lip gloss','l\'occitane repairing','ahava travel kit','eye spf','lactic','sothys face wash','decollete','jane iredale circle','toofamilain','illuminare eye concealer','sula lasting love','exuviance rejuvenating','too faced diamond','jane iredale sharpener','perfectly clear','borghese primale pink lipstick','dermalogica mattifier','paula dorf mascara fan brush','glominerals globlush','zirh cyrus','arbosoymison','babor oxygen','face cream pha 10','babor perfumes','babor mango','dark circles eye','zap and hide','babor direct beauty','boviflfospf1','most popular','nick','sensitive','soy body facial','primer spf','lipplump','grape seed oil','enormous lash','infusion d\'iris homme','hydrogen peroxide','bopomimilopo','bvlgari omnia crystalline','l\'occitane calanques','lash comb','h e minerals','bikini wax','foot brush','morning cream','l occitane aromachologie relaxing pillow mist','babor collagen booster fluid','velvet cleansing water','purepressed','sothys fluid perfect','aquamucine','ahava oil','romantic eye','french soap','too faced borderline','kenneth cole rsvp','scar concealer','jaqua lip gloss','copeland spf 40','jonewyocoboc1','too','face luminizer','riz','spf 30 oil free fragrance free','ultra rich face scrub','youngblood ultimate concealer','dandruff shampoo','dermalogica stress relief','bump','colorescience illuminating serum','l\'occitane shower gel','gommage exfoliant','gray','blue eyes','youngblood coral lipsticks','sun diffusing protector','equalizer','detrfo','ahava dry oil','shampoo conditioner','he minerals','unforgivable','pixi nail polish','kneipp wildflower','occitane apple','too faced beauty balm','flora by gucci','crushed mineral blush','no no','dynamic skin recovery','l\'occitane soothing','shady glow','dermalogica age','baby wipes spf','night reform','sunrise','murad toner','too faced eye','hugo boss after shave','ch','dermalogica spf','paula dorf eyeshadow','body hydrating cream','desosepo','post chemical peel','l occitane verbena harvest citrus verbena summer fragrance','cat eyes','mom and baby','pop beauty in liner','babor q 10','glometallic smoky eye kit','sothys clarte confort','jane iredale warm silk','dermalogica intensive','furfuryladenine','retractable','davidoff cool water','babor foundation powder','white lipstick','l\'occitane hand wash','blue mascara','dermalogica clean start bedtime for breakouts','ultra rich shower cream','almond supple skin oil','sula shadow','ultra rich body cream','sula paint','exfoliating mask','blending sponge','sothys foaming cleansing cream','babor calming sensitive mask','dermalogica body','lava gloss','frizzy','kirefieyecr','believe','bronzer sundance','ultra rich cream','dirty','ahava mineral','pca spf','glominerals eye base brush','light','cacueyepajof','borghese botanico eye compresses','waking','babor khanya','youth revealing complex','comfortably clean','dermalogica clearing skin wash','kohl','true protective illuminating concealer','true essential firming tech cream','true harmonizing gel cleanser','true essential pore and complexion refiner','mosquito repellent','too faced lip gloss','faux lashes','15bs150v6','oro','chisel powder brush','herzog','l\'occitane hand soap','june jacobs conditioner','cheek color','pop beauty pin-up pop','l\'occitane milk soap','supple skin oil','shimmer body lotion','self tanner for face','bioelements recovery serum','selection ultimate foam mask','lifting eye cream','eyebrow wax','trprilco','maxi eyeliner','sothys neck','lily lotus','tools','cosumiposunp','murad clarifying body spray','aqva pour homme','dermalogica shampoo','protein shampoo','rilastil aqua optimale','glitter mascara','dermalogica deodorant','roth','sothy\'s neck shaping cream','dermalogica night bright','quick fix natural','metallic eyeshadow','colorescience all clear','crystalescience','nuxe teint','babor baborganic','eyeshadow brush','memories of new york','wash off','jonewyocobol','alcohol-free','cleaner','exfoliator cream','toning lotion','l occitane verbena soap','divine eyes','gentle','menopause','cool fix','derma refiner','l\'occitane oil','cosusrobaall','too faced eye kits','south','borghese fluido protettivo advanced spa lift for eyes','herbal eye concealer','yomirisepo','pixi nail','facial spider vein formula','aha cleanser','dermalogica medibac','double','eshave white tea','pop beauty tan popper','auburn','toofaamfaoic','yolipsh','bio organique','tummy tuck','liner brush','matt bronzer','frosted lipstick','dermalogica clear start','jane iredale sarah','steppes','true lip','too faced brightening blush','too faced mini pink leopard bronzer','glominerals brush cleaner','pop beauty lid neon','phaze 13','glolip stick','baxter eye','newport mariner\'s hand cream','too faced lip insurance','jane iredale base refill','activator','izod','scented body lotion','seborrheic dermatitis','cognac lipstick','perfecting day cream murad','kitty lipstick','janson beckett alphaderma ce','tonus b12','double chin','smart mouth lip shine','jane iredale mystikol pencil box','relief','babor body line thermal refreshing shower gel','jack black supreme cream','too faced eye liner','kinerase lip treatment','pedro fina','power c peel','babor eye brow designer','jane iredale just kissed','toofaglgl','menthol','divine cream','ruban d\'orange','l\'occitane vetyver','chroma 2','facial firming','romance always yours','rosemary bath oil','chemistry cream blush','calming','bosustma','phytomer nutricontinue','camouflage brush','vodka','lip balm sothys','l occitane almond oil','liquif','pop beauty lip smoothie','natural foundation','immortelle precious cream','jane iredale multi-colour for lips','glomineral glodeluxe travel kit','seatonic','l occitane rose 4 reines','sothys pore','spruce','too faced lockdown','glospa green tea','perfection lip wax kit','true protective shadow primer','radiance revealing complex','hot pot','neon','body mask','double lightening serum','gloloose','men shampoo','did i shave my legs for this','verbena harvest','verbena foaming bath','eye lite','silver soap','neutralizing coverup','visage','lime body lotion','expert','too faced lashlight','hilfiger','chemist male','cellex men','l occitane lavender','blue eye drops','dermalogica special cleansing','grape shower oil','intense lightening complex','vitamin e oil','15% glycol acid','hydra','creamy','fuze','legal sunburn','soothing','souffle','snow','oligoforce','feminine hygiene','phytoactive base','paula dorf perfect illusion','clean cloth','apricot flower','sebum','winter','sagging creams','verbena shower','l\'occitane baby','phytomer initial','booties','phytomer oligoforce','oligopur purifying','sculpt','omnia amethyste','jane iredale spf','london','amor amor','sula shea butter balm','permanent makeup','babor masque','azzaro chrome sport icy','thebalm stainiac','effervescent','biogen cellular','gentle face buff','shave brush stand','intensive night cream','olive body oil','radiant','body glisten','popbecatey','age reverse','jairpospf30','just walk away renee','toofacali','too faced the jewelry box pink diamond edition','fivve','l occitane hand','pixi lip gloss','vaginal','vanilla soap','l eau d issey pour homme shower gel','neutralizer exuviance','prada shower gel','anti wrinkle makeup','illumifill','socks','tooth','eye glow creme','evening primrose','essential firming lip complex','anti itch','jack black face buff','pixi lid and line','water blush','clean simply soap','freesia talc','tono','jane iredale bronzer','lip color with spf','poppy','clearskin','babor age conceal foundation','bootcamp for tummies','l\'occitane neroli','sugarplum','babor makeup','phytomer lift contour','tfivve','melissa','toofanaeyeki','acne pads','too face primed and poreless skin smoothing face primer','revoma','cell renewing microfoliant','after dark','ultimate brush','babor bronzer','padoeyecogl','aha enhanced lotion','get fresh bath salts','crush my grapes lip gloss','chrome sport','cylinder');
/* $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);
    }
