/* Popular phrases - PERUVIANCONNECTION - 8:24:46, Wed Feb 8, 2012 */
__SLI_ClientDefaults =
[
    ['ShowBrandingFooter', false ],
    ['MaxListItems', 10],
    ['Alignment', true ]

];
var asPhrases=new Array ('tunic','leggings','dresses','cotton turtlenecks','vest','alpaca','belts','robe','nightgown','skirt','hats','samoan tee','spring','cardigan','scarf','mens','alpaca coats','slip','mila dress','ravello tunic dress','shawl','milano dress','cotton tunics','sweater','kaffe fassett','sweater dress','alpaca sweaters','tank','turtlenecks','sale','pima cotton','shrug','primavera sheath','tops','victorian blouse','fassett','jacket','leather jacket','jackie twill pants','vitelli dress','kaffe','soffice tunic','adriatico','roma tank','henley','leather','earrings','bianca tunic','crochet','lace','poncho','linnea','coba dress','linnea dress','scarves','ruana','yarn','legwarmers','wrap','burnout tunic','adriatico dress','cords','pima','tank dress','sullivan shirt dress','decades coat','spring collection','arcata boatneck','silk dress','jeans','vicuna','bias drape top','pima drape cardigan','layering tee','al fresco pinafore','ravello','melange tank dress','mezzanotte dress','vignoni suede jacket','silk','refined jersey tee','gloves','impressionist jacket','bias pima skirt','mila cardigan','tee','tank tops','lucca dress','camila top','cape','kashmiri cardigan','tribal tie waist dress','bag','sojourner dress','mandala','gossamer wool shawl','palermo cardigan','alanya robe','archangel','millma','bellagio','t-neck','julieta jacket','boemo','avery long cardigan','extreme t-neck','sera sheath dress','santorini blouse','berber cardigan','seafoam','coat','spring dresses','coastal cardigan','skinny jeans','taormina sundress','black dress','tuscan rose slip dress','motorcycle pants','rainforest dress','beaded','alpaca cardigan','motorcycle','blanket','lauren zip cuff pants','lilypond','cotton','silk slip','batala dress','tosca leather jacket','decades','izumi tank dress','t neck','kuba vest','purse','long tank','milanese cardigan','heathcliff','al fresco','mila','bohemian','cotton skirts','boemo tank dress','giardino top','morning mist scarf','soffice','taormina','pima cardigan','sojourner','arcata','bracelet','handbags','white dress','long lean tank','burnout','pavo real necklace','sienna denim dress','cotton dress','grand hotel dress','bolero','waterlily tunic','paradiso dress','bluebell earrings','sash','suede jacket','suede','jersey tee','isabel','ironwork print tee','necklace','minimalist dolman top','mandala cardigan','sorrento tunic','colette nightgown','desert stripe cardigan','scrunchable leggings','spring sweaters','lhasa mesh skirt','samoan','twill pants','museo','pants','pencil cords','grove street','sweater coat','cocktail dress','panaji skirt','garbo','grove','astrid','francesca jacket','vignoni','dolce vita sundress','calais skirt','cowl','white lauren zip cuff pants','alpaca scarf','tampico','cropped leggings','minidress','olive','berber','batala','isabelle top','navajo lace cardigan','extreme','milano','kalimatan','long skirts','lace skirt','capri','silk cami','watercolor','coconut grove dress','cotton tops','lacemaker dress','crayon stripe shrug','laotian','jean jacket','cypress dress','alpaca tunic','petal soft tee','crayon','firenze top','yucay','scoop neck top','wyatt','boheme top','anya top','ventana top','primavera','coba','dolman','sleepwear','lawn party skirt','sundress','cutaway','swan skirt','pima drape vest','boot cut cords','suits','kimono','navy','barda cardigan','sorata','tights','purple','t-shirt','bunting top','white','tribal tie','denim dress','origami kimono','vin santo dress','navajo','elsa tee','cotton sweaters','camila','pima drape','swan lake skirt','serafina','sullivan shirt-dress','art glass earrings','art knits','lilypond cardigan','francesca','lotus pond','bollywood','vista','wool jacket','milanese','mens alpaca','lace top','kuba','cecily blouse','rosebud top','minimalist','plumage sweater','bergama zip cardigan','paradiso','gia top','lilias','capelet','brass cobblestone cuff','santa croce lace tunic','hakkaido','tulle skirt','haute highland dress','earth sky bracelet','lilias dress','beret','amazonas','lotus','gossamer shawl','kensington','bexley tunic','kurta','ventana','pullover','hoodie','archangel dress','pendant','crochet cardigan','mercer','oyster bay skirt','lauren','sale dresses','boa','shirt dress','dolman top','chinchero vest','t-shirt dress','sumatra top','avebury','throw','vitelli','tambo','bias skirt','mens sweaters','tribal','jewelry','dragon','paola denim trench coat','chelsea jean jacket','horn','extreme t neck','portobello road tunic','huancayo skirt','asolo bag','warm','glass','casbah','white blouse','vista jacket','kashmiri','tunic tops','full slip','santiago','leather skirt','museo skirt','nagisa cardigan','tunic dresses','bianca','ironwork','avery','knitting needles','shearling','turtleneck tops','mahogany leggings','calais','jackie','izumi','denim','battu dress','bias pima','wedding dresses','nolita','sizing','taos cardigan','village gate','teahouse dress','undyed alpaca','barda','alpaca boa','sweetwater','alpaca pile coat','pencil skirt','hakkaido pullover','panaji','fur','florabella','primavera dress','flower','bergama','meadowflower dress','griffin','acorn earrings','tuscan rose','rib t-shirt','lavender dress','san miguel','fresco','teahouse','wool sweater','lucca','peabody','ottoman textile skirt','tweed','garbo sheath','cherry bark skirt','wool skirt','tosca','long dresses','viscose','luna','silk camisole','san miguel boatneck','sale items','roma','brushstroke','bias','tam','amethyst','lucia tank','leather metro bag','rosewater dress','mohair scarf','metro bag','blouse','drape cardigan','mandala beaded necklace','sienna','leather 2 buckle belt','motocross jacket','camisole','haberdasher','kalimatan tank dress','layering','shirtdress','petra','long wool skirt','alpaca hoodie','shearling coat','vintage shirt dress','horn bangles','altiplano','san quirico jacket','rio','seascape','plaid dress','seahorse cardigan','siren gown','watercolor pullover','drop shoulder tunic','donwell','turquesa','la scala skirt','sun dress','serafina tank dress','clutch','pima cotton layering tees','jackie twill','stepping stone','copper','braxton','cabled kurta','wood bead bracelet','atwood','marble print skirt','polo dress','byzantium','mezzanotte','santa croce','narrow horn bangle','timberland trench','poppy','leather satchel','painted roses dress','glitterati bracelet','pemberly','links','pima vest','alabaster','bonita lace blouse','winter coats','inti collar','rimini','sophia','grand hotel','lacemaker','rum raisin','medallion necklace','eden cardigan','11 1042','checkerboard lace tunic','raffia tote','clip','denim jacket','milanes cardigan','san mateo','hermione tunic','bonnie plaid blouse','metropolis pullover','pima sweater','rimini tunic','lace blouse','impressionist','toscana tunic dress','beaded dress','moonstone','alhambra skirt','fur boa','tea rose top','malvinas','bossa nova skirt','nairobi','pearl cluster necklace','flint jackie twill pant','aymara textile tote','pima cotton tops','giardino','seascape tank dress','oyster bay','turtleneck dress','pima cotton skirt','bartlett shrug','playa hat','tee shirts','pima cotton lycra extreme t','wyeth','stardust hoops','pencil jeans','sera','lace pullover','sleep','bailey sweater dress','cable','heathcliff jacket','twilight','aymara','nairobi tank dress','tribal tie dress','maragona shrug','black','zip cuff capris','mesa','kalimatan dress','santorini','rainforest','black sweater','bonnie plaid','afternoon lace top','plaid','alpaca skirt','blue streak shawl','teahouse floral dress','chicory','drop shoulder links tunic','lace cardigan','lace dress','spring skirts','tallgrass','madura','origami','fedora','anya','pima tee','cropped sweater','navajo lace','sorrento','ikebana dress','melange tank','delaney','jubilee clutch','wool shawl','lovebird','catania top','bengal','san marco dress','aquamarine','striped tank','valentine','delaney coat','sullivan','kuba dress','trench coat','pima cotton cardigan','forsyte','silk full slip','jersey tank','solstice cardigan','lucia','poppy dress','etna','julieta','block lace tunic','dolce','sagebrush dress','solstice','haiku skirt','blue glass bracelet','lamarsa','baby alpaca','pima dress','taormina dress','mohair','portobello','rosevine skirt','short skirt','lana','silk top','raffia belt','talara sash','pima cotton long sleeve tee','pj\'s','indigo cardigan','black alpaca','glitterati','float away tee','isabel blouse','mantilla','pima skirt','scala skirt','brunella','teal','natural horn bangle','velvet','rose','oversized','wyeth hat','marble cropped leggings','jackie pants','wind chime earrings','stardust','braxton pants','nagisa','sophia henley','spring jewelry','high plains henley','portofino sundress','amina skirt','kenmare pullover','high country dress','catania','tuscan rose skirt','cord pencil skirt','pima cotton layering','lana dress','carmina dress','archangel t-shirt dress','giardino cardigan','silk san marco','tesori necklace','checkerboard','dolce vita','gran prix leather jacket','highland dress','palampor skirt','bronze age pencil skirt','tourmaline blossom earrings','jersey dress','hoops','grand','wood','refined tee','wool cardigan','haiku','raffia crochet belt','ravello tunic','plein air dress','bahia','lariat','japanese','sophia dress','caribe','kilim','tribeca earrings','amazonas short dress','ruffle','maxi coat','celeste earrings','accessories','falling leaves','palermo','stepping stone bracelet','cabin cardigan','nightshade top','cotton tights','donwell riding coat','tote','acorn','medina skirt','chalcedony','windermere','haberdasher dress','black wool beret','links cardigan','yucay alpaca pullover','popcorn','milano belt','extreme tee','bodrum','little black dress','trellis nightgown','coddington tote','rosebud','sarawak','paillette teardrop earrings','straw flower raffia clutch','sweatercoat','lamarsa dress','sequin top','mulled wine dress','t-neck dress','purple dress','long sleeve','art nouveau','favorite','blue sage','stained glass cardigan','cherry','seahorse','malt','ashbury bag','lace edge tank','baby alpaca scarf','whiteout tunic','alpaca hat','embroidery','graffiti','nazca gloves','deep plum','bonita','mixed stitch top','altiplano sundress','art','silk half slip','cami','kenmare','cotton pima turtleneck','drape','henley dress','alpaca yarn','gwyneth dress','seneca falls skirt','blanket coat','palisades tunic','casbah skirt','plaid blouse','florabella tee','rib t shirt','bodrum cardigan','pj','cloche','plum wine','santa croce lace','filament silk','cropped','forest','wrap leather belt','vignoni suede','alhambra','brass bead','nativity','bahia tunic','baby clothes','paisley','ribbed tee','mercado','crewneck t-shirt','seabreeze','black lace','akela knit dress','bead necklace','huancayo','sale earrings','100','elbow','pima tank top','sale scarves','hair','charcoal dress','long sweater dresses','tropicali','final clearance','melange jersey','10','long black cardigan','alpaca winter coat','dusty blue','retablo','mittens','minimalist dolman','carnelian','cordoba dress','sidesaddle skirt','baby alpaca coats','battu','cabled lace tunic','brass','short sleeve','expedition vest','wedding','cypress','hardware necklace','allegra pima cotton skirt','cordovan','cabled cutaway cardigan','scoop neck tee','icon coat','silk poppy field dress','afternoon lace','pink','starlet','strawflower','dietrich skirt','cuzco','blushing rose silk scarf','coastal','corazon cocktail ring','saddle','order form','ottoman textile','karabakh vest','pink silk dress','blue dress','natural','lido sun hat','agate','silk cotton dress','100% cotton','gia','sun hat','dressy','lotus sweater','gossamer','terracotta','metallic','valentina cardigan','coats and jackets','eldridge','bias drape','ikebana','wyatt dress','paola denim trench','vietri links pullover','morning','maxi','bunting','sequin','boyfriend sweater','homespun plaid skirt','short sleeve tee','midnight overcoat','black skirt','salmon','avebury cardigan','mens cardigan','motocross','spring pants','pima tank','bark','baby alpaca sweaters','charcoal','half slip','huichol beaded bracelet','malvinas skirt','sheath dress','skinny pants','ballet pink','fishtail','maremma poncho','leaf study scarf','beach','artisan','cropped pants','jubilee','sweetwater dress','celeste','rib stitch top','rosette','leaf season cardigan','ring','midnight','intimates','falling leaves dress','hotel dress','tourmaline','medina','mantilla lace scarf','kuba cardigan','spring tops','tropicali tank dress','yucay pullover','vietri links','long coat','leg warms','leather coat','swallowtail cardigan','alpaca shrug','niobe t-neck dress','cotton cardigan','lavender','alpaca jacket','formal dresses','relaxed fit','tribal cardigan','paraiso robe','indian','striped tee','rum','bexley','crochet scarf','womens belts','full length coat','alberoni necklace','cascata','aqua','ribbed','paola denim dress','hooded zip jacket','hermione','knitting yarn','vietri','mesa vest','high plains','corkscrew scarf','earth sky','nightshade','melange','chamonix','boot cords','sea glass necklace','aran','snowy','somerset','stowe','niobe','scoop neck','tweed cardigan','wool beret','ribbed t-neck','sage','vista skirt','luna necklace','wood tiki cuff','wrap skirt','snowy day','tunic short dress','lola','necklace lariat','pima cotton casbah skirt','gemini belt','pinafore','mesh','sera sheath','alanya','blue spruce','cuff','antiqued copper box','black cardigan','tribal zigzag scarf','felt hat','prairie','white skirt','ottoman skirt','pima layering tee','snowdrift','impressionist cardigan','atwood dress','campfield cardigan','blush','cecily','floataway dress','heart','sweater vest','vignoni jacket','biker jacket','turquoise','sea glass','tobacco leather miniskirt','berry','madison wide leg trouser','pyrite','sale jackets','semi-fitted dresses','tribal zigzag','playa raffia hat','teardrop','marbella','ocean tee','notte pima','crayon stripe','cobblestone','paisley pima','pima cowl','eldridge trousers','shadowplay','aubergine','amelia henley','bollywood shawl','llama','zip dress','highland','heritage lace jacket','cumulus tweed cardigan','twill','union street dress','graffiti art dress','copper box','seventh','black turtleneck dress','valentina','cargo skirt','illusionist scarf','silk shawl','clutch purses','firenze','electra','gunmetal','paraiso','talara','steel blue leggings','wood bead','toscana','nightshade plaid wool scarf','tasseled lariat','paola trench coat','timberland','mateo scarf','windowpane','plumage cardigan','azure','pomegranate','kelton','cortina','whiteout','mens vest','mock','button leggings','vase','phoebe tank','wrap sweater','gisela sweater dress','swan lake','new','summer dresses','yucatan dress','leather motocross','pima cotton shirt','summer clothes','brimfield henley','homespun plaid','manta','garbo dress','links hooded zip jacket','extreme t','espresso','la scala','bronze','slim strap tank','indigo','ribbed tee shirt','mamluk','lombard dress','gwyneth','paola dress','marcella skirt','tradeware','tendrils sweater coat','leather clutch','pembroke plaid jacket','needles','white cardigan','caucasus','twill skirt','garbo silk dress','white pants','raffia clutch','seascape tank','watercolor sweater','chainlink crewneck','corduroy','oatmeal','mercado tunic','rosewater','scoop neck 3 4 sleeve tee','marcella','madura lace pullover','garbo sheath dress','kouros','birch','rosevine','sidesaddle','men\'s coats','twilight banded shawl','plumage','paola trench','bonita blouse','zipper dress','tapa vest','turquesa bracelet','dusty lavender','horizon','eden','horizon vest','colby sweater','intarsia','fur hat','pima top','lace jacket','timeless cardigan','bonnie','plaid skirt','wyatt alpaca dress','poppy field','forsyte jacket','meadowflower','ruffled leather gloves','boyfriend','knit hat','laramie belt','kimono sweaters','rib t','brimfield henley sweater','layering tshirts','tapa','braxton cargo skirt','pima leggings','medina pima cotton skirt','paisley shawl','black mesa','fringe scarf','crosswinds cardigan','limelight','stained glass','snowy day pullover','salamanca','links hooded zip','bronze leather skirt','felted lace scarf','tulle','links tunic','denim trench coat','peplum','pemberly coat','teardrop earrings','mallory dress','bricole','leather metro','seville dress','linen pants','black wyatt dress','santiago jacket','whitechapel','union','brown cardigan','metro','corkscrew','kaleidoscope','corduroy pants','hood','sienna brocade cardigan','riding coat','crosswinds','chalcedony pendant','links stitch','bellagio dress','sienna brocade','gisela','waverly sweater coat','maxi skirt','alpaca sweater coat','handknit','merino wool','earth','clematis sundress','crew','clematis scarf','madonna','lends sweater coat','spring tunics','sardegna','grove street minidress','kalimatan knit jacket','waterlily','boyfriend cardigan','graffiti dress','viennese bag','lycra','faunal','red mesa','cable knit','brimfield','chesterfield','tivoli jacket','windowpane scarf','boheme','skipping stone necklace','double-wrap','tunic shirts','scoopneck top','gabrielle cropped jacket','chloe','cutaway cardigan','little street dress','vintage formal dresses','rock candy','cumulus','siren dress','suede skirt','luggage','ottoman','courchevel','romany','illusionist','knitting needles gift set','petra jacket','straw hat','long tops','long sweater','thigh highs','electra cardigan','genoa lace dress','windermere robe','overcoat','starflower','borealis minidress','metropolis','san marco','peabody coat','plein air','catania pima cotton top','spring line','pima cotton cowl top','skirt and top','talisman','henley sweater','lombard','cuzco skirt','street dress','sabado cardigan','alpaca beret','men\'s jacket','stowe cardigan','bartlett','siren','marble tank','kelton dress','starflower cardigan','strawflower skirt','wool blanket','borealis','black lana dress','mimosa','pima cotton henley','charisse cowl top','grey cardigan','empire dress','cordoba','shearling car coat','tallgrass skirt','byzantine','leaf season','vista jacket and skirt','poncho tunic','astrid dress','boyfriend coat','teahouse floral','tuscan','black swan','palisades','cavalry','sale coats','keyhole','silk tiered','pima cotton t','black tee','horizon alpaca vest','savile jacket','raffia market tote','paxton','mini dress','vietri pullover','melange jersey tank','fiorentina gown','long slip','village gate cardigan','recoleta jacket','red mesa vest','yucatan','sequin shorts','faunal scarf','madison','faunal print scarf','coin','helios','funnelneck','italian','blue tee','pisac market tunic','bosporus skirt','bossa','portrait cowl','cargo','dimas','cabled cutaway','waffle','pomegranate henley','lace shawl','rose taupe','long','grand bazaar dress','medina pullover','innsbrook','shadowplay zip dress','flare','anastasia','suri alpaca','black lace top','mens alpaca vests','bittersweet','cutout','paola denim','milano leather belt','heritage','night wear','ornaments','pembroke','tampico kimono','sullana rug','ombre','men\'s cardigan sweaters','navidad','mulled wine','alpaca tee','mulled','all','allegra top','kashmiri wool shawl','new in','snow','paola denim coat','banded crochet cuff','clematis wool scarf','ruffle tunic','fair isle dress','pima scrunchable leggings','tea','cortina poncho','amazonas dress','kensington pullover','grand bazaar minidress','bohemian dress','50\'s dresses','yucatan tank dress','touring coat','paxton t neck','tangled web necklace','wool scarf','nazca fingerless gloves','chesterfield coat','scrunch neck','portofino','silk blouse','timberland trench coat','etna dress','mallory','north star earring','lampas','evening bag','crayon shrug','coin bracelet','bailey sweater-dress','sullivan dress','espinar','filigree pendant','stepped cowlneck','fiorentina','heritage lace','paxton turtleneck','leggiings','tee dress','sky ward earrings','bossa nova','nolita jean jacket','ombre paisley wool shawl','sabado','fingerless','turtleneck tee','amelia','wool gauze paisley scarf','all skirts','pointelle sweater','excursion','notte cardigan','sorata cardigan','links hooded','donegal vest','alpaca tam','alhambra earrings','rose hat','crochet pattern','blue jean','deep teal','waverly','rio grande poncho','country','cabled tights','striped dress','nazca','ponchos and ruanas','tambo cardigan','glacier','pemberly maxi coat','royal blue','wool decades coat','zip capri','magnolia bloom','wildflower','kalimatan pima cotton dress','velvet jacket','chinchero','twill pencil skirt','le mans','bosporus','bailey','suri','long sleeve shirt','hooded zip','boiled wool','andaman','crystal','niobe dress','stella','hiram bingham','cotton vest','mateo','oversized aran tunic','leather obi sash','chocolate stripe throw','somerset capelet','felted scarf','aubergine mallory dress','san mateo wrap','ruffle skirt','astrid minidress','tobacco leather skirt','cargo pants','alpaca leggings','tompkins','market tote','san miguel boatneck sweater','sea glass earrings','cranberry','cowl neck top','cayenne','touring','cat','tiger sweater','corduroy pencil skirt','stretch jeans','ruffle gloves','vine belt','grey top','sweater skirts','capri leggings','mamluk cardigan','pima shirts','circle','huichol','boxy sweaters','alpaca fur boa','gunmetal clutch','holiday','labradorite','nightshade plaid scarf','black earrings','shadowplay zip','foldover leather clutch','corset belt','fingerless mittens','seneca','pucara sweater coat','india','portrait cowl top','madder red','wild meadow dress','foldover','mosaic','a line skirt','pima scoop neck tee','canvas jacket','pima cotton extreme t neck','sirena','chic chintz ruffled scarf','whitechapel skirt','candlelight necklace','pucara sweatercoat','boatneck top','green skirt','cotton tees','road tunic','vicuna coat','riding jacket','meadow dress','nolita jacket','softside cardigan','san mateo wrap cardigan','bonita lace','patina','pisac tunic','snowflake beret','undershirt','tiger','white turtleneck','amina baby alpaca','t-dress','boho striped hoodie','size 22','wide leather tassel belt','cropped jeans','beaded clutch','sage shawl','meadow flower dress','leaf cardigan','mendoza drape','high country','amina','black turtleneck','snowdrift nightgown','fringe skirt','bingham','rio grande knit poncho','softside cowl neck','long sleeve top','robe women\'s','navy sweater dress','chevron lace cardigan','black leather','men\'s pullover','rio grande','party dresses','filament silk camisole','union street','red plaid','starlet earrings','lucinda','pima cotton rib','navidad pullover','button cuff','tweed legwarmers','campfield','nazca alpaca hat','bricole necklace','lounge','teal rippled','alpaca plaid scarf','fuchsia','soraya','alpaca turtleneck','black lace skirt','capes and ruanas','alamosa zip cardigan','andaman cardigan','leather hats','alpaca cap','snowflake','sarawak cardigan','chamonix cardigan','baby llama throw','baby alpaca blanket','bronze cross','nazca hat','coconut shell bracelets','tobacco skirt','black niobe','azure cardigan','chainlink','scalloped gloves','black hat','crimson','circle buckle belt','men polo','womens robes','cutout brass disk earrings','spruce waverly','scraf','calf length dresses','pj pants','sakiori scarf','slim pants','coins of the realm','camelot','blue grey','carpet','silk velvet','colonial cross','bronze age','carryall','copper jeans','bonnie blouse','tendrils sweater','crinkle scarf','specials','pima cotton lace','snap cuff','turquoise sweater','check','sage scarf','men\'s wear','bedford gloves','brick espresso scarf','limelight earrings','seneca falls','chintz ruffled scarf','bootcut corduroy','baby alpaca felted lace scarf','silk long sleeve','boucle shrug','boho hoodie','bambara cardigan','chiffon blouse','lariat belt','chandelier','100% pima','crewneck top','san miguel sweater','sienna rose tunic','sirena twill','carved gourd','boatneck sweater','black leather obi belt','pima rib t neck','teal rippled silk scarf','bailey-sweater dress','shard','chapeau','sale tops','cable knit sweater','black pencil jeans','charm','moss green','topanga','afternoon top','pima t-shirt','chrysanthemum','autumn scarf','cabled alpaca kurta','candlelight','sakiori','amethyst earrings','portobello road','purple skirt','blue streak','silk knit','tissue layer','sea blossom tunic','long knit vest','ankle length coats','short sleeve jacket','men\'s sweater vest','long sleeve cotton tee','mens overcoat','100% pima cotton','cloud soft royal alpaca robe','pima cotton cami','pochette','magnolia necklace','berenson','boho striped','sale scarf','madura pima lace pullover','catamarca pima cotton jacket','berenson minidress','seventh cavalry','black alpaca skirt','cavalry coat','cabled lace','cotton leggings','parchment','balinese orb earrings','tissue layered pants','peacock earrings','bloom','croce','peruvian jewelry','paprika','bartlett alpaca shrug','sunburst','manger','ceramic bracelet','tradeware shard earrings','byzantine cardigan','long sleeve pima cotton','pima cotton rib t shirt','sale leather jacket','babydoll dress','mendoza jacket','bolinas skirt','bolinas','pima cotton layering t','measurements','madison wide-leg trousers','bailey dress','seeds','pompom','crewneck pima cotton','lampas sweater-coat','snowy day sweater','short sleeve cardigan','sage silk','cotton skirt and top','trumpet','pima jersey','miguel vest','cutwork vine belt','shadow','pima cotton firenze','catania pima','t necks cotton','sequin jacket','black calais','cotton black dresses','primavera skirt','size 20','coco pearl','cabbage rose skirt','cable dress','tendrils coat','minaudiere','baroque','tivoli','sale pants','seafoam smocked scarf','pima cotton atwood dress','leaf necklace','bloomwood','snowy sweater','tradeware shard pendant','lace wrap','chinchero chumpi belt','changed','tissue cotton','silver strand','cowl tee','sterling','cuff bracelet','chevron bag','bloomwood skirt','chumpi belt','long alpaca coat','scarf shawl','perfect coat','cotton bag','country dress','cabbage rose','pima cotton dolman top','lakes','art sweaters','pewter paladium clutch','pima belt','cream cardigan','a line dresses','cotton polo','maldonado alpaca scarf','black tank dress','silk degas','shelf bra','copper necklace','crewneck t-shirts','print','sage hand-dyed silk scarf','chancay vase','san miguel pima boatneck','tank tunic','cotton paisley','playa','crewneck t','cotton voile','artist','basketweave belt','beachcomber','size 2','baby alpaca sweater dresses','straw handbag','pima cotton red mesa vest','square','sunila skirt','custom','straight','mali tunic','black skirt suit','macrame','chatham pima cotton','prix','bolinas pima cotton skirt','milano jacket','pull on pants','chicory navajo lace cardigan','surplus','copper tank','berry necklace','black silk','corsican rose','sale kimono','silk degas dress','manouba skirt','ceremonial cloth','cabbage skirt','cropped stencil cardigan','corsican dress','bolinas v neck top','pima tencel cardigan','leather hobo bag','manouba','starflower filigree earrings','coral reef earrings','cyclades sundress','black and white dress','cotton tencel cardigan','carambola','mimosa pencil','czech orchard','pointelle dress','paraiso robe and shorts','cinnabar stripe','avant-garde','black summer cardigan','courier','pekoe pima','monterey cardigan','beach dresses','slate raffia market tote','cotton shrug','maharani','lattice','pima acacia','chatham dress','black pima dress','perfect','pima robe','chroma','pima coat','milagro hand','peach blossom earrings','cardigan copper','simply silk dresses','cinnabar','brass hoops','peach blossom','copper carambola earrings','pima cotton lauren','copper sweater','cyclades dress','mother of pearl tiled bangle','porcelain bracelets','black lucia dress','blush cardigan','long tank dress','brass chainlink earrings','abacus','summer storm','chintz coat','copper scarf','pacifica scarf','brown beaded leaf','leather hoop','business','black and brown','bolinas pima cotton','malawi','peony bag','pima and lycra jersey leggings','brass and hematite earrings','mandarin','salmon tank','blue necklace','pima cotton cedar island dress','sarawak sweater','contoured leather belt','summer storm cardigan','treasure','pleated scarf','trapeze','carob','alpaca sweater cardigan','spa robe','all long skirts','cotton cardigan blue','soft leather belt','santa fe tank tunic','blue lace','stitchery tank top','bolinas top','soft pima cotton cardigan','alpaca ruana','crochet lace','softside cowl dress','cableknit sweater dress','studded leather','ceylon crocheted belt','santa fe tunic','soft focus t-neck','soft focus','boro cardigan','pima cotton terry spa robe','blue summer dress','meteor','pima cotton shawl','black tempest dress','suri coat','chinchero chumpi','pima amanda gown','caucasus cardigan','pima cowlneck','sicra bag','brown wool jacket','copper cluster earrings','pima silk','smoky','brown earrings','marmaris','sweater wool cardigan','black tee shirts','pima cotton t necks','arabesque robe','black alpaca sweater','button-tab cardigan','peony handbag','alpaca beauregard cardigan','tencel cami','bexley v neck','6% lycra','size s sweaters','pitumarca cardigan','mod tee','chroma cardigan','bexley v-neck top','bay','block lace cardigan','alpaca mini dress','boro','sunburst earrings','charisse sweater','baby alpaca woodland','beaded leaf bracelet','sizing s','bexley top','a-line skirt','bexley v-neck','sardis','baby alpaca woodland jacket','capistrano pima cotton dress','bas','terry spa robe','silk victorian blouse','bexley v neck top','melange links','chinchorro','bark lace banded cardigan','corset skirt','scoop neck sweater','soft focus t neck','siam scarf');
/* $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);
    }
