/* Popular phrases - SPIRITHALLOWEEN - 14:34:49, Thu Sep 2, 2010 */
__SLI_ClientDefaults =
[
    ['ShowBrandingFooter', false ],
    ['MaxListItems', 15],
    ['Alignment', true ],
    ['TextBoxIDCustom', ['ctl00__SearchBlock__tbx_search'] ]
];
var asPhrases=new Array ('lady gaga','alice in wonderland','mad hatter','shoes','vampire costumes','star wars','wigs','teen costumes','pirate','zombie','tween costumes','jersey shore','clown','sailor','vampire','freddy krueger','lady gaga costume','witch','batman','superhero','mad hatter costume','michael myers','alice in wonderland costume','indian costumes','amy brown','nurse','predator','gypsy','avatar','chucky','masks','gloves','crayon','joker','werewolf','fairy','toy story','indian','zombie baby','snooki','fog machine','snow white','harley quinn','couple costumes','harry potter','queen of hearts','star wars costumes','contacts','alice','spider','geisha','medusa','pirate costume','mario','gaga','witch costumes','greek goddess','gangster','pocahontas costume','ninja','michael jackson','scarecrow','zombie costumes','strawberry shortcake','skeleton','ghostbusters','ghost','bee','dorothy','jason','cleopatra','crayon costume','kick-ass','weapons','princess peach','toy story costumes','boots','fairy costumes','chucky costume','cat','wizard of oz','devil costumes','devil','clown costumes','justin bieber','buzz lightyear','corset','iron man','wings','playboy costumes','red riding hood','christmas inflatable','medusa costumes','marie antoinette','mermaid','alice in wonderland theme costumes','flapper','cookie monster','sailor costume','frankenstein','princess','gypsy costume','vampire fangs','minnie mouse','cheerleader costume','spiderman','couple\'s costume','fangs','plus size womens costumes','amy brown fairy','wonder woman','cop','princess leia','ninja turtle','avatar costumes','peacock','coffin','tinkerbell','ladybug','goddess','harlequin','angel','predator costume','woody','tombstones','cat costume','tutu','guns','police','freddy','genie costumes','cheshire cat','harry potter costumes','little red riding hood','tween','scary costumes','slipknot','wednesday addams costume','nun','belle','halo','poison ivy','wizard of oz costumes','blood','queen of hearts costume','army','bride','batgirl','bee costume','couples','jason voorhees','robin hood','power ranger','cowgirl','referee','wrestling','sesame street','cinderella','punk rock costumes','light up costumes','fence','playboy','dog costumes','candelabra','zombie makeup','robin','viking','werewolf costume','hannah montana costumes','kiss','skull','darth vader','big bird','funny halloween costumes','m&m costume','pinhead','burlesque','saloon','musketeer','blonde wigs','peter pan','amy brown fairy costumes','ninja costumes','candy corn witch','wolf','firefighter','nurse costumes','hippie costume','general grievous','transformers','go go costume','elmo','rainbow brite','skeleton costume','alien','butterfly','star wars costumes for kids','taylor swift','lady bug','reversible costumes','nightmare before christmas','alice in wonderland kids costume','genie','raggedy ann','bat','jester','katy perry','gangster costumes','pin up','mafia','super hero','rocky horror picture show','yoshi','goldilocks','lights','transformer costume','cowgirl costume','cheerleader','teens','french maid','mario costumes','catwoman','animated props','red queen','lion','prisoner costume','dallas cowboy cheerleader','jessica rabbit','dinosaur','girl\'s costumes','candyland','superman','goddess costumes','joker costume','top gun','maid','angel costume','baseball','pebbles','pumpkin','yo gabba gabba','disney','cowboy','maternity costumes','hippie','strawberry shortcake costume','spongebob','princess costumes','saloon costume','saw','mario bros','betty boop','goth','police women','wolverine','marine costume','tinkerbell costumes','fairy wings','marilyn monroe','batman costume','barbie','southern belle','star trek','doctor','jonah hex','scream','pinup','corpse bride','wizards of waverly place','hellraiser','minnie mouse costume','hit-girl','animal','tattoo sleeves','mad hatter tween','army costumes','twilight','wicked of oz','scooby doo','mermaid costumes','wolf costume','pink ladies','pumpkin costume','flapper costumes','grim reaper','jem','hats','dead bride','black light','bunny','reaper','leprechaun','mobster','greek costumes','teenage mutant ninja turtles','flintstones costumes','pokemon','ghost costume','friday the 13th','bumble bee','hannah montana','elvira','ladybug costume','butterfly costume','rock star','gothic','80s','donnie darko','gone with the wind','peacock costume','luigi','carrie costume','gangster mafia costumes','candles','cauldron','beyonce','group halloween costumes','gothic ballerina','strobe light','jessie toy story','warrior','baby costumes','bert and ernie','shrek','penguin','sesame street costumes','freddy krueger costume','fog','halloween','kat von d','toga','egyptian costumes','little red riding hood costume','harajuku costume','belle from beauty and the beast','dorothy costumes','childrens halloween costumes','grease','leatherface','baby','kimono','referee costume','predator mask','scary halloween masks','teeth','green lantern','crow','tree','theatrical quality costumes','wonder woman costume','voice changer','indiana jones costume','funny costumes','monkey','swat','coupons','woody costume','power ranger costume','straight jacket','medusa headpiece','bonnie and clyde','prisoner','baseball costumes','vampire teeth','kickass','nightmare on elm street','greek','elvis','pink wig','rock','inflatable','snow white costume','banana','candy','jasmine','halo 3 weapons','sally','witch hat','hannibal lecter costume','captain america','alien vs predator','scarecrow costume','lady gaga wig','voodoo','racing costume','demonica','red wig','uncle charlie','tin man','cowboy costume','barbie and ken','bo peep','super woman','disney costume','military costumes','harley quinn costume','caveman costumes','window cling','beer','wench','supergirl','master chief','mummy','v for vendetta','cape','stockings','snake','kids costumes','gorilla','animatronic','crayola crayon','cinderella costume','native american indian','eskimo','sword','addams family','pregnancy costumes','boba fett','street fighter','jem costume','cop costumes for women','harajuku','care bear','nerd','school','crayola','evil clown','leggings','rag doll','flinstones','doctor costume','race car costume','sock monkey','sally nightmare before christmas','spartan','jack skellington','mardi gras','roman','scream costumes','darth maul','popeye','bumble bee costume','candy land','spell book','slipknot masks','beetlejuice','ghost rider','makeup','dorothy wizard of oz','skull mask','black robe','jessie','mickey mouse','cat ears and tail','airblown inflatable','video game costumes','watchmen','sleeping beauty','firefighter costume','elmo costumes','robin costume','wizard','tattoo','renaissance','toddler halloween costumes','funny','playboy bunny','eye contacts','top hat','sonic','the last airbender','queen','leg avenue','spider costume','sweeney todd','leprechaun costumes','athena','doll costumes','dinosaur costume','honey bee','gangsta costumes','props','80s costumes','knife','chinese costume','police officer','rag doll costume','iron man 2','gladiator costume','storm trooper','women pirate','iron man costume','grim reaper costume','race car driver','britney spears','dog','princess tiana','clown mask','belly dancer','convict','rock n roll','baseball player','zorro','indiana jones','halloween store','glasses','bride of frankenstein','clash of the titans','cigarette','cruella de ville','teletubbies','mustache','peach','plus size','unicorn','wednesday costume','mulan','ears','phantom of the opera','300','yoda','geisha costumes','tim burton','poison ivy costume','fortune teller','broom','spider web','chun li','viking costumes','zombie prom queen','cat ears costume','witch broom','thomas the train','thing 1 and thing 2','silk spectre','dark fairy costumes','halloween costumes','pimp','my little pony','girl\'s vampire costumes','hulk','cat woman','irish','petticoat skirts','cat ears','little bo peep','navy','scene setters','pilot','beer maid','cute teen costumes','mary jane','tights','victorian gown','kiss band','cherry','hellboy','strawberry','jail','tiger costume','school costumes','waldo','maid costume','mortal combat','blow up costumes','blue wig','prince of persia','popeye and olive oil','robyn da hood','eyelashes','kitty cat costume','animated witch','witch prop','dora the explorer','waitress','sesame street tween','spartan costume','fake blood','girlscout','giant spider','shark','flash','robot','abby cadabby','scary clown','baby lion costume','liquid latex','sock monkey costume','boxer','wolfman','women costumes','priest','miss piggy','mental patient','bakugan','cow','leia','black cat costumes','blueberry costume','tween alice in wonderland','cat women','kiss rock','daphne','monster bride green','chainsaw','greek goddess child costume','maternity','kitty ears','skittles','dj lance','jason animatronic','demon','monkey costume','hatter','military','twister','incredibles','bottle labels','old man costume','native american','german','black wig','mad scientist','bettie page','day of the dead','animated halloween decorations','princess jasmine','hands','pet costumes','munsters','rat','jedi','miss voorhees','biker','tombstone lifter','latex','hitgirl','poodle skirt','halloween decor','dead prom queen','banana costume','football','santa','syringe','ring leader','go go boots','smurf','infant halloween costume','katara','junior costumes','m and m','blueberry muffin','tinker bell','psycho','jester costumes','headless horseman','nurse costume for women','head','rocker costumes','angel wings','scary masks','michael myers animatronic','luke skywalker costume','unhappily ever after','cavewoman','optimus prime','insane clown posse','playboy bunny costume','sailor teen costume','in goth we trust','morticia adams','white mask','fairy costumes for kids','scream mask','gorilla costume','application','black widow','scary','bollywood','edward scissorhands','tiana','alex russo costume','doll','fireman','dead cheer leader costume','striped tights','vampire slayer','bubble fogger','malice in wonderland','bald cap','candy corn','brady bunch','knight','candy costumes','petticoat','french maid costume','70\'s costumes','gnome','halo 3','tiger woods','rocking granny','harem','mad hatter tween costume','christmas costumes','juniors','vampiress','elf','harry potter women costumes','green','scooby doo costumes','lederhosen','elf ears','rey mysterio mask','elvis costume','disco costume','grease costumes','charlie brown','alice and wonderland','rising from the grave','bride costume','pumpkin mask','circus','eve','medusa wig','gladiator','decorations','justin bieber wig','egyptian','dog the bounty hunter','hangover','bunny costumes','teen vampire costumes','red riding hood costume','little mermaid','blue fairy','elvira costume','pregnant costumes','chewbacca','naruto','dracula','zombie princess','hovering ghost','miley cyrus costume','spidergirl','wicked witch','light up','chucky doll','womens plus','miss krueger','scrappy doo','ariel','toddler costumes','ben 10','pirate hat','axe','prosthetics','cd','mobsta','egyptian princess','turtle','toga costumes','border patrol','necklace','catwoman costume','zombie hunter','fangs teeth','lion costume','donkey kong','marie antoinette costume','marie','webcaster gun','vampirina','guitar costume','purple witch costume','hotdog','god of war','tween vampire','cad bane','wendy','alien costume','olive oyl','micheal jackson costumes','lantern','tiger','austin powers','rocky horror','thigh highs','disney princess','wig cap','animal costumes','dorthy wizard of oz','michael myers mask','military women costumes','evil queen','rocker','phantom','beer costume','strobe','asian costumes','inflatable costumes','lady luck','black tutu','warrior princess','midnight fairy','lord of the rings','maleficent','fiona','freddy kruger glove','scars','blues clues','goggles','raven','bunny ears','bride of darkness','lilah','dora','50\'s costumes','texas chainsaw massacre','edward cullen costume','baby prop','fire','mirror','bam bam','mrs lovett','punk','kitty','icp','boxer costume','football costumes','striped stockings','the situation','detective','muscle','magician','panda','snoopy','high school musical','medieval costumes','pocahontas','white boots','butcher','music','pippi longstocking','inmate','black cat','bruno','tiffany costume','graveyard','jason mask','barbie costume','jail costumes','ring master','leg warmers','white gloves','can can','ninja warrior costume','fake wounds','eminem','grave digger','adam and eve costume','masquerade','little miss muffet','peter griffin','fogger','mad hatter wig','belly buster','pink ladies jacket','marine','masquerade mask','book','zombie baby prop','adams family','m&m','rabbit','gothic rag doll costume','lab coat','halo 3 spartan','masquerade costumes','armor','flintstones','pauly d','jango fett','helmet','teen titans','skeleton mask','devil horns','candy corn costume','witch with cauldron','mens costumes','buzz','bumblebee','jigsaw','darth vader costume','mr potato head','western','mad hatter hat','clown props','tinkerbell wings','mexican','daisy duck','gretchen','simpsons','witch decor','catsuit','soldier costumes','beauty and the beast','john cena','disco','scary halloween decorations','pixie costumes','aurora','socks','zombie cheerleader','toddler pirate','fraggle rock','mother nature','sonic costumes','batman and robin','race','tom and jerry','chains','carrie','mike myers','wilma and betty costumes','king','camouflage','french kiss','nox arcana','spy costumes','cherry pie costume','egypt','firewoman','jasmine costumes','muppets','kids zombie costumes','punk costumes','kids alice in wonderland','go go dancer','fred flinestone','wwe','pirate skirt','gears of war','dresses','beard','hockey costumes','gumby','hockey','horror costumes','kids scary costumes','employment','pinup costume','kermit the frog','angel devil','nem oh','brain','halo costume','racer','reno 911','morticia addams costume','moulin rouge','prom queen','monster bride','baterina','pimp costume','scary halloween costumes','alligator','sheep','spirit gum','plaid skirt','half angel half devil','skull costumes','alice in wonderland mad hatter','purple wig','tiara','fuming rotter','roller derby','curious george','nautical doll','gene simmons','voodoo vixen','foot pad','aang','crown','bounty hunter','columbia','annie','bee keeper','prince','make up','skirts','avatar the last airbender','foot pad activator','family guy','velma','sponge bob','rainbow','scarlett ohara','queen of hearts wig','demonica animated prop','unhappily everafter','golf','rainbow bright','kandy korn witch','sponge babe','hula skirt','glinda','hours','haunted house decorations','tarzan and jane','raggedy ann costume','myers','strawberry shortcake and friends costume','leopard costumes','new 2010','hot dog','peace costume','pig','boot covers','cloak','pumkin','anita waxin','bones','80s punk rock','toilet','musketeer costume','cat in the hat','arabian princess','kangaroo','peanut','jason costumes','lady luck costume','fishnet stockings','cane','dead lift zombie','70s costume','caveman','olive oil','choker','pregnant nun','mario and luigi','tin woman','dead cheerleader costume','mini mouse','strait jacket','little bo peep child','saloon madame','harley','torch','jolly green giant','glow in the dark','creepy caretaker','black wings','baby halloween costumes','gypsy princess tween','senorita costumes','kiss costume','mexican costume','womens viking costume','sickle','ghost bride','disco ball','statue of liberty','gothic lolita','witch doctor','robe','ostrich','sushi','broomstick','nfl','american gothic','hannibal','costumes for couples','wheres waldo','john lennon','buddy the elf','jacket','moving props','fishnet','oktoberfest','blacklight','asian princess','horror','alex russo','wonderland','south park','kratos','space','car hop','child vampire','goth faries','asian','taxi','flamingo','rapper','burlesque baby','hugh hefner','piglet','astronaut','red shoes','golfer','phone number','madhatter costume','terminator','clown shoes','wednesday','jeannie','hooded cloak','world of warcraft','spanish princess','shower curtain','hocus pocus witch costumes','witch cauldron','women devil','glow in the dark paint','fire fighter costume','dead','sumo wrestler','foofa','blank mask','black cape','eyeballs','han solo','resurrection mary','monopoly','bumble bee tween costume','hair color','skeleton decoration','bride and groom','rapunzel','misfits','face paint','toddler','ken doll','mad hatter tea party','pennywise clown','hawaii','clown decorations','miley cyrus','cop costumes','mouse','police costume','vest','goosebumps','john smith','poison princess','moustache','lobster','super why','mommy to be costumes','cheap halloween costumes','polar princess','freddy krueger child costume','halloween props','pokemon trainer','eve costume','happy tree friends','guardian of the grave','ganster','princess belle','alice tween costume','light show','madonna costume','pikachu','thriller','jack sparrow','beer wench costume','wild west','sweeny todd','monster','hanging heads','pet','littlest pet shop','dorthy','reversible','ghostly gal','lady gaga dress','sorceress','amy brown i like to bite','black dress','jersey','wilma','yogi bear','dead fairy','beast','krueger','sheriff','tween prisoner','mad about you','elephant costume','zombie doctor','smoke machine','sesame','death eater','captain spaulding','bird','major trouble','window posters','devils rejects','matrix','wonderwoman','storm trooper costume','ghostbusters costume','zombie bride','dreamgirl','jesus','jewlery','groom','hair spray paint','tween goth','miss wonderland','joker makeup','jumpsuit','plus size halloween costume','skunk','werewolf mask','stewie','skull prop','m and m teen','headless','wounds','goldilocks tween costume','captain morgan','outlaw','orange jumpsuit','staff','handcuffs','micheal myers','bloomers','wicked rabbit','twister costume','platform shoes','fish','dark angel','michael','gi joe','x men costume','freddy krueger mask','mist maker','bear costume','sailor hat','clone trooper','motorcycle','tim burtons alice in wonderland','kimono costumes','sign','hockey mask','scarface','walking stick','beatles','candle holders','kids angel costumes','rising reaper','dreadlocks','games','gilligans island','mini mouse costume','outdoor decorations','plus size petticoat','lily munster','officer','carver the clown','kids vampire','70s','sunglasses','doctor and nurse','moss','prom','air force','cave women','pocahottie','karate kid','web','chicken','indian headdress','bar maid','angle','evil jester','i love lucy','ups costume','school uniform','yeti','ella mental','mens pirate','dirty','leopard','dead groom','bat women','samantha','cabaret','ozzy','scientist','amy winehouse','trick or treat bags','thomas','ryu','sports costumes','kardashian','toad','rambo','taco','love spell witch','rainbow bright costume','infant','infant costumes','lighted costume','ufc costume for kids','speed racer','i dream of jeannie','floating ghost','barbarian','japanese','pee wee herman','train','womens halloween costumes','three amigos','plus size pirate','punk rocker','wet t-shirt','jetsons','caged beast','gory','indian princess','old man','glow sticks','pac man','taj my hall','cha cha dancer','samurai','handy manny','grievous','cowardly lion','glinda the good witch','bride of chucky','tina turner','lifesize','gogo boots','undertaker','gypsy princess','halloween mask','harry potter robes','domo','voorhees','demon of war','obama mask','witch shoes','boa','final fantasy','sharpay','incredible hulk','trenchcoat','six flags','snake eyes','lenticular','gothic maid','elephant','hermione costume','glowing eyes','heels','homer simpson','haunted house kit','couples halloween costumes','batman the dark knight','toddler princess','latex masks','plus size womens','tween queen of hearts','xena','evil','headless man','pink','luminaries','the addams family costumes','zorro women','freddy glove','gorilla mask','giraffe','reel f x','prince charming','mrs claus','red dress','bacon and eggs','thigh high boots','airbender','white queen','sale','gothic vampire woman','amish','food','long white gloves','false eyelashes','war machine','scarecrow mask','black shoes','wednesday adams','viking princess','star trek next generation','goth for kids','sports','bp','miss mouse tween costume','bubble fog machine','scythe','betty rubble','female gladiator','fingerless gloves','cute','starwars','body bag','burger king','teen mad hatter','aladdin','claws','skeleton sweetie','bella','door decorations','ape','bamm bamm','gemmy','white russian','jesus costume','bavarian','race car','afro wigs','fog accessory','talking skulls','dead princess','dorothy shoes','pizza','door mat','fantasy butterfly','nerd costume','lurching vampire','cigar','hairspray','plus size costumes','zombie decorations','punk princess','cowboy hat','mushroom alice','daphne wig','mad hatter child','bobble head','elf costumes','skeleton gloves','nymph','cute tween costumes','charm school','body','goth costumes','percy','all costumes','christmas','spirit','hogwarts','crystal ball','flamenco dancer','violent j','big bad wolf','carnival','music cd','big foot','archway','oz','50s','zebra','pirate boots','led','irish costumes','warlock','fraggle','lucky lady','animated clown','tootsie roll','brown wig','captain','purple','eskimo cutie','biker costume','black gloves','black boots','star wars child','pumpkin princess','hanging','hustler','perseus','stormtrooper','smurfette','ups','garter','barbie doll','adolf hitler costume','michael myers costume','voldemort','spider queen','green lantern ring','progressive','leatherface costume','school witch','glenda','goatee','redneck','spanish dancer','bodysuit','t rex','bathroom','mr incredible','pinocchio','ballerina costume','kids gangster costume','foofa costume','costumes','bone collector','switch witch','lady','owl','hair extensions','napoleon dynamite','basketball costumes','naughty nem oh','senorita','fog machine timer','vampire wig','sally jupiter','fog juice','santa claus','wand','romeo of the night','bob marley','midevil','leopard ears','pinhead costume','edward','padme','flying monkey','theatrical quality','toxic zombie','cars','minnie','seven dwarfs','droopers','trophy wife','pirate wench','arm warmers','miss muffet','baby bop costume','nascar','mechanic','devil costume horns','gabba gabba','southern belle dress','bonehead','german costumes','nascar costumes','devil in da hood','super sperm','x-men','barney','flame','hearts','puppy','pregnant','jack and sally','elvis wig','pink petticoat','killer clown','nintendo','blood spray','elektra','peep','hippie wig','grover','teen lady bug','white cat ears','bloody','miss freddy krueger','long black wig','frog','tween gangster','horns','flapper dress','kids cop','dark knight costume','kitty costumes','playboy gangster','killer','neytiri','webcaster','harajuku wig','vulture','zombie mask','fake scars','taco costume','tommy gun','roman goddess','slipknot halloween costumes','satan','rabbit ears','plus size witch','nails','dorothy tween','child witch','bow and arrow','badge','life size jason','scrabble','sassy sally','ghost rider mask','lamb','tights and leggings','drink','bob','dinosaur train','zombie skate punk','librarian','golf costume','uncle sam','spazm','french','ewok','crazy','edward cullen','super women costume','pie','jail bird','aphrodite','mrs santa clause','marge simpson','ivy','werewolf gloves','usher','insane clown posse mask','mile high club','lumberjack','vampire bite','cher','hannah montana wig','soldier','cantina','queen of the nile','shot glasses','reaper of souls','cirque','barrel','plus','dancer','leather','eyes','the godfather','wolf ears','bat woman','mario brothers','captain hook','panther','russian','warrior goddess','jawa','princess fiona','rosetta','test tubes','hazmat','bugs','white rabbit','lip rings','cow costume','scary scarecrow mask','machete','humor','bat costume','motocross','pink poodle','pirates of the caribbean','bubble machine','satyr','woman vampire','flower','ruffle shorts','fairy princess','showgirl','jailbird','wolf mask','kids star wars','pink crayon','animated jason','cheetah','i love lucy wig','gas mask','slappy','here comes trouble','half masks','bags','horror masks','batman mask','1960','ghostface','emo','triceratops','poop','black crow','black','gravestones','goth witch','backyardigans','white petticoat','clive barker','chess','bag of bones','roman warrior','jason vorhees','teen sailor','herman munster','angel of music','thunder','lil monkey','brain mold','gingerbread','hip witch','lil bo peep','table cloth','snickers','rex','kids','crawling zombie','ken','cha cha','kermit','lucille ball','heartbreaker','ghost busters','ironman','adapter','tooth fairy','dr evil','bunting','romeo','cigarette holder','rebel fairy','women clown','michael myers clown mask','pirate hottie teen costume','window decorations','smooth criminal','banshee costume','feather','wizard wanda','nascar driver','lil lion','teen vampire','gunslinger','night watch','hood','lightsaber','cougar','flasher','gypsy crystal ball','pokey','stitch','quinn','the gloved one','snow white teen costume','alex','catarina','space costumes','mens plus size','white tights','lil monster','trick r treat','ghost in the attic','bunny cuffs','peasant','lightning','gonzo','evil fairy','guy fawkes','ketchup','spiderweb','afro','nutcracker','wolf feet','poodle','cruella devil wig','mod','aquaman','shirts','lizard','shocker','native','female ninja costume','pictures','queen of broken hearts','tween elmo','belt','morticia','cocoon','fingers','pink princess','jungle','hair','lifesize animated','saw costume','wall covering','cocoon man','baby angel','black witch costume','womens nerd costume','lion ears','gabriella','orange','baby blossom','gangster moll','pirate cutie costume','purple fairy costume','gothic vampire','rasta','flower child','csi','witch accessories','casket','family costumes','venom costume','luau','airblown','werewolves','flame lights','sherlock holmes','red contacts','vampire makeup','carmen miranda','captain rex','assassin','princess and the frog','toy story 3','womens pirate costumes','tina the target','body parts','corpse','kids mad hatter costume','cemetery','queen of hearts teen costume','rocking vampire','dino','king tut','tavern wench','deer','donald duck','black spiderman','ups driver','poker','girl\'s witch costumes','executioner','wraith','whip','harujuku','dj lance rock','old lady costume','tea party','hulk hogan','vampire collar','1920','magenta','storybook alice','dark knight','dalmation','hair bows','black bird','zorro mask','dark fairy','alice costume','dry ice','minotaur','gaga wig','teenage mutant turtles costume','red queen wig','goblet','wonder pets','glam rock','hercules','discount','halloween music','woman pirate','crawling','portrait','grave','country','card','mouse costume','red cape','cop cutie','socket','joker mask','mega man','puppet master','laser','plug and socket','rosie the riveter','mental','chucky\'s bride','clark kent','vampire dress','shaggy 2 dope','glow in the dark skeleton','door','zoro','pink power ranger','flying ghost','bob wig','rope lights','judy jetson','chucky child costume','beach','gothic rag doll','dreads','tween vampire costumes','glenda the good witch','i like to bite','vendetta','brian','scar makeup','lucy','green fairy','sugar daddy','star bright','candy bags','mascot','jello molds','rhinestone cowgirl','dementor','bumble bee wings','sasquatch','spy','string lights','geisha wigs','red boots','twix','xmen','cobwebs','dora wig','ragdoll','roman costumes','muscle man','microphone','hooded cape','pom poms','beauty queen','c3po','women vampire','hanging reaper','baroness','garden of eve','black skirt','amy brown costumes','dragon fly','beaver costume','pink cat ears','plo koon','goat','saw mask','crime scene tape','swamp monster','magical miss','toto','50s costume','jesse','paint','kilt','amelia earhart','stripper','bubble','camo','candy corn tween','spanish moss','pilgrim','lucy and ricky ricardo','toddler clown','ghetto','table runner','queen of hearts child costume','scary teeth','ursula','lost dog','marvel','window','winx','grinch','catwomen','mens devil costume','butcher knife','uncle fester','alice in wonderland alice','fountain','bullet wound','mexico','short skirt','veggie tales','kids wigs','pacifier','marilyn monroe wig','gecko','ghost face','blue butterfly','kurt cobain');
/* $Revision: 6883 $
 *
 */

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';
          if ( theSearchbox.clientWidth < __SLI_customisations[ __SLI_ApplicationName ][ 'DropListMinWidth' ] )
          {
            theDropDown.style.width = __SLI_customisations[ __SLI_ApplicationName ][ 'DropListMinWidth' ];
          }
          else
          {
            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=' + escape(__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' ] + escape(__AutoComplete[id]['element'].value) + asugvar;
          }
          else
          {
            if(f.onsubmit)
            {
              if(f.onsubmit() !== false)
              {
                f.submit();
              }
            }
            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);
    }