/* Popular phrases - MARCOPROMOTIONAL - 9:59:32, Wed Feb 8, 2012 */
__SLI_ClientDefaults =
[
	['TextBoxIDCustom', ['w', 'w2', 'sli_search_3'] ],
    ['TargetURL', 'http://search.marcopromotionalproducts.com/search?w=']
];
var asPhrases=new Array ('bic sticky notes','budget stik','budget clik','pens','neck wallet','lanyard','water bottles','ribbons','padfolio','luggage tag','bags','flash drive','notebook','coffee mugs','mugs','tote bags','badge holder','usb flash drive','portfolio','name badge holders','magnet','table runner','folder','notepad','igripper','recycled bags','usb','plastic bag','messenger bag','calendar','flashlight','pencil','of-1100','buttons','plastic envelopes','cups','tumbler','registration envelopes','umbrella','promotional items','note pads','badge ribbons','stress ball','hs-6slh','hse-6-c','gripper','name badge inserts 3 x 4','bic clic','table cover','collapsible water bottle','tote','wall calendars','a-6li','vinyl folders','travel','business card holder','mouse pads','key chain','lunch bag','retractable badge holders','name badge organizer','tbe-704','badge organizer','sunglasses','scratch pad','imprinted lanyards','first aid kit','letter opener','double wall tumbler','beach','pocket calendar','ceramic mugs','tb-800','hse-6-nc','backpack','stickers','wristbands','post it note','folding chair','planner','badge insert','badges','phone','calenders','name badge','vinyl envelope','highlighter','banner','pins','javalina pen','grocery tote','3x4 name badge holders','zippered padfolio','ruler','pads','hat','insert stock','business card','name badge inserts','folding umbrella','cotton lanyard','cell phone holder','magnetic name badge holders','bic','badge stock','name badge ribbons','travel mugs','duffel','journals with pens','board member ribbons','beach bag','custom badge ribbons','vie-5t','tape measure','document bag','chair','pedometer','calculator','tb-804','pad folio','non-woven bags','envelope','drawstring backpacks','lapel pins','usb drive','foam badge organizer','laser','binder','nw-500','post it pads','ly-704-r','awards','3 sided pens','bags nylon','lunch','a-6li-we','stainless steel tumblers','silicone wristbands','a-6avl-we','badge reels','frosted bags','bookmark','bottles','coffee tumbler','leather padfolio','crayons','stadium cup','reusable grocery bags','the dolphin briefcase','mousepad','wallet','two pocket folders','koozie','writing pads','spiral notebooks','h1','dw-1067','computer bags','business card magnet','acrylic tumbler','breakaway lanyards','od-830','mints','card holder','nw-27-pr','hse-6c','acrylic double wall tumbler','clip','usb pen','nike','towels','notebook and pen','notebook with pen','ice cream helmets','hse','foam badge holder tray','badge clips','zipper tote','golf','gifts','pocket folders','insulated lunch bags','nw-01a-bl-bk','tb-844','hs-6-c','beach ball','junior padfolio','coasters','ly-13-w','wi-07c','led flashlights','wrist bands','retractable pens','led lights','recycled badge holder','je-69','name labels','mardi gras pen','ticket stock','note book','custom lanyard','clock','pen highlighter','bic pens','tbe-700','balloon','pf-11','die cut handle bag','tbe-840','custom ribbons','ly-704','metal pens','wi-504','alpha name badge dividers','lip balm','cooler','gold sponsor ribbons','2 pocket folders','adhesive roll labels','flags','avery 5392','wi-1023','director chair','tb-55','elastic neck cord','tb-1019','translucent portfolio','cups with lids','hse-6-pc','lunch cooler','coloring book','of-610','cinch','drawstring','frames','blank laser insert stock','tablecloth','pb-501','calendar magnet','nw-27','award plaque','fun ribbons','translucent folder','bulldog clip','journal','thumb drive','dw-25','tb-1045','goofy pens','earbuds','stress relievers','popcorn','flash','frosted shopper','canvas bags','hse-6','key rings','registration','mirror','sticky','nametag paper','swanky pen','bk-1006','stainless steel mugs','laptop','ribbon holder','glasses','tb-482','pb-07','luggage tag loops','nw-nw5-pr','hand sanitizer','500-g','speaker ribbon','tv-199','a-10ts','drawstring bags','tbe 1003','a-6avl','nw-14b-pr','messenger tote','paper bags','blanket','engraved pens','bags with pockets','rm-bc','coordinator','award winner','plastic pens','monte cristo pen','pink pens','tyvek wristbands','badge lanyard','apparel','badge case organizer','hse-6acl-nc-bk','mini bag','magnifier','t shirts','golf tee','magnetic name badges','tb-712','jackets','hs-3-c','lead pencils','dy-600','monitor','a-8li','golf towel','keychain','sport bag','blank name badges','mouse','adhesive badges','top-loading deluxe vinyl badge holders','tb-813','bic clic stic','blank badge insert stock','microfiber cloth','curvy ballpoint','dw-1013','wi-1024','fleece','wp-93','bk-515','nw-1001','flyer','tb-847','first aid','badge case','display','tb-1032','tb-31p','food','basketball','polyester bags','tbe-709cl','nw-1100','baseball helmet ice cream bowls','table tent holders','dw-1068','nw1003','frisbee','trade show','phone holder','wi-564-tt','tent signs','canvas tote bag','dart pen','ballot boxes','hs-6-nc','javelina','rm-1002','jar opener','light pens','vinyl card holder','od-1012','stress','sticky notes','bic round stic','of-1003','wi-564-sr','pf-09a','alumni ribbon','we-509c','back scratcher','napkins','buttermints','ly-w-13','gel pens','tv-41b','pf-79','grocery bag','rm-fbh-2','step ahead messenger','vertical ribbons','host ribbon','nc-1001','trade show displays','duffle bags','rainbow neck wallet','of-1058','screen cleaners','stapler','the world \'s best pizza cutter','non woven grocery tote','new member ribbon','pbe-602','uptown tote','fan','hsed-6-na','sport pack','tbe-710','banner stand','pbe-1002','free','letter slitter','rme-32','wi-823','4 x 6 badge holders','pen with light','od-731','tbe-710cl','voting delegate ribbons','bk-400','value grocery tote','wp-94vl','foldaway','of-601n','jotters','od-827','pb-03b','nail file','tbe 840','pb-502','tbe-837','sparkle','me-503n','translucent snap portfolio','bic clic gold','nc-r-srg','wpe-1004','wi-613','excursion saddle bag','we-1070w','od-1021','car magnets','orbit','clip on strap','wp-1026','je-74','food storage','ly-110','power clip','badge software','vie-g4-bl','dual print badge cord set','me 804','sun protection kit','rotate usb flash drive','dy-825','bic wide body','rubik','tb-822cl','ax','dy-807','dy-827','metallic business card holders','613','foam badge tray','bk-812','t-shirts','plastic cups','badge wallets','wi-1015','ly-13-r','4 x 6','javalina','of-1002','certificate','printed poly pro tote','ribbon box','badge holder trays','can cooler','drinkware','cotton totes','luggage','tb-845','large tote bags','tote bags with zipper','kitchen','string bags','wp-1013','chocolate','spooner mug','tools','zipper pouch','ipad','pocket planners','youth t shirt','hoodie','products','alarm clock','dy-03a','hs-pth','hse-6acl','nwe-505','mechanical pencil','credit card hand sanitizer','hsed-6','badge tray','large totes','calander','celebration tote','pf-1000','draw string bags','award ribbons','nw-nw5','wp-9','vanity bag','certificate holders','metal water bottles','swing tote','magnet clip','fleece blanket','adjustable lanyard','exhibitor ribbon','essential portfolio','pie','soup bowl','dw-703','tbe-54b','wi-1043','badge board','a-5li','lamis','badge paper','baseball','polo shirt','promo tote','pet','tb-562','presentation folders','briefcase','post it cube','wi-512','sponsor ribbon','duffel bag','nc-rb','latitudes foldaway shopper','hsr-6-na','document','laser insert stock','javelin','dw-1045','ribbon fun pack','wp-67','rm-1003','nw-pthatt','keyboard calendar','laptop sleeve','dw-737','recycled','1 2 lanyard','note cubes','zip lock bags','plastic portfolios','pens and pencils','light','bic ice','brochure holder','honoree ribbon','tb-613','tickets','fold','ga-1100','aw-34n-bl','aw-701','beverage wrench','hs','pb 501','die cut bags','aluminum bottle','can lids','ly-126','knife','laminated recycles shopper','gift bags','port authority','cotton canvas tote','1032','visor','ice cream','tb-607','badge display','message pen','black folders','hsj','black tote bag','pf-08a','nc-r-cc','wp-l67p','hs-5-c','memo board','ax-6-c','boat tote','ly-110-w','ribbon organizer','of-712','pb-503','eclipse','blank presentation folder','dy-1000','impulse backpack','mountain bottle','blank portfolio','sweat shirts','h1-blankstock','value sport pack','post it note holders','usher','lanyard display','bic tri','of-35a','coffee sleeves','h1-speaker','kraft','playing cards','tb-1047','zipper bags','puzzle','candy','screwdriver','nw 500','bracelet','sling bag','piggy bank','clear envelope','rm-1000','sticker roll','economy cotton sheeting tote natural','reel','stainless steel water bottle','travel neck wallet','vie-01a-bl','shirt','wpe-608','laminate','tb-1009','wi-538','ofe-518','tote with zipper','wi-07e','wi-07jc','hse-5-na','wp-1002','wine bags','luggage identifier','bk 1006','credit card','a-7li','airy zip tote','business portfolio','zebra','hssd-6-pc','nc-1000','tbe-827','blossom','ga-23b','poster presenter','retractable lanyard','wi-1001','pf-81-bk-bk','ap-7li','pf-121','mag lites','wi-631t','wi-831','of-1005','ap-8li','conference committee','closed back table throw','non woven neck wallet','badge box','badgecase organizer','zipper document bag','hse-8-na','mobile phone holder','snap portfolio','hse-6-p','labels','staff ribbon','double bulldog clip lanyard','nametags','hssd-6-na','dy-601','hsed','food container','insulated','ipad case','nc-f-srg','stainless steel bottle','vienna','kit','aluminum water bottle','ribbon colors','dy-12b','presenter ribbons','platinum','year ribbon','pillbox','tbe-609','medium economy tote','wi-824','shot glass','large frosted bags','cell phone','tbe-1021','gf 831','paper','giveaways','wp-805','tv-809','swivel usb','gt-1012','toiletry','carnival tote bag','tb-22b','globe','name','tb-51b','tb-46b','hse-3-nc','credit card flash','id tags','wie-661','weekender duffel','gel','we-713c','we-1059m','hsk-6-pc','pencil pouch','led','cd holder','ribbon titles','agenda badge holders','bu-1005','urban tote','ceramic','vertical badge ribbon','6-avl-we','in stock badge ribbons','badge tags','wi-629','balls','translucent snap portfolio printed','dw-1061','children','bk-20b','of-41','paper clips','leather binder','tent','3x4 badge holder','sponsor','baseball cap','eco owl','laptop case','name tag','hs-6-pc','linen certificate holders','bottle opener','vixen','color changing cups','oven mitt','lotion','certificate folder','wp-518','nominee ribbon','bic click stick','bk-810','we-712w','we-712m','luminesque','3 x 4 badge holders','dy-hold','non woven neck wallet id holder','roll','rm bb','stinger pen','dishwasher safe','crossbody bag','dw-02a','h1 staff','wi 07c','samba','contemporary cotton tote','tbe-1015','tb 503','ga-614','bic business card magnet','wi-03a','plaque','wi-514','wi-19','vinyl correspondence folder','ly-500','ap-6li-we','hse-6-na','full color','vie-01a-pr','nwe-504','ceramic tumbler','pb 04b','dual carry tote','tent cards','recycled tote bags','tb-614','table tents','table top display','tb-1044','break away lanyards','conference bags','vie-1000-pr','beach mat','v2-custom','nw-08b','key tags','non-woven economy tote bag','poly envelopes','dwe-725','pen and pad','border badge holders','budget lunch bag','round neck cord with clip','antimicrobial telephone pad','printed badge holders','dw-602','round buttons','dy-500','pb-01b','ga-827','h1 custom','recycled cotton expo tote','a-6avl-cr','custom badge inserts','process blue','nwe','clear tote','top loading deluxe vinyl badge holders','cooler seat','custom totes','ipad covers','pill box','500-g badge holder','tumbler with straw','credit card magnifier','file folders','wp-1001','a-5li-we','award frame','magnifying ruler','insulated tote','post-its','car','clip board','thermos','foam badge holder','1 lanyard','wine','thermo tote','pin clip badge holders','velcro','tokens','tb-1034','inserts','dw-1033','ly-1001','sling','committee ribbons','dwe-1028','a-tent-we','od-10b','alligator clip','corkscrew','hse-3-c','stadium cushions','tee shirts','dw-10a','lunch tote','hs-6-p','vie-01a','seat cushions','we-714','java sleeve','polycanvas neck wallet','drive','wb-1000','organizer','laptop bag','wi-20g','lanyard ly-1003','plastic wristbands','tb-22b-cd','usb hub','writing tablet','certificate frame','staff','tshirts','sports','dress shirts','repositionable keyboard calendar','bag holder','bk-1004','tattoo','flat neck cord with snap hook','colored ink pens','plastic bead chain','vie-1001','neck cord holder','wi-564','tbe-836','papermate','tbe-1007','gt-600','tli-ls','wi-647','neck cord badge holders','nc','top-loading','rm-bc145','wi-554-we','wi-502','neck wallet id holder','pf','mobile phone','acrylic','women\'s shirts','wi-603','can coozy','printer','nc 1001','ready to wear badge','barrister','bk 800','ambassador ribbon','hsse','post it','spatula','dw-71','insulated cooler bag','easel','sport bottle','foldable water bottle','perforated badge paper','hsk-6-c','tb-439','bk-1010','sticky book','credit card flash drive','of-804','picture frame','name badge case','bk-58','nc-r-dsh','of-814','economy retractor','bk-804','lye-600-w','zipper tote bag','padboard','pen wrap','fo-22','port','3 x 4 inserts','stratford','binoculars','pizza','economy tote','sun visor','name badge pin','non-woven lunch cooler','wp-503','tbe 704','shipping','bk-350','lanyard bundles','wp-704','nwe-801','vertical badge holders','collapsible water','santa fe','cups and mug','laminating pouches','lanyard organizer','laser pen','non woven','tbe-1012','dog','badge holder lanyard','tb 800','canopy','computer','ga-1036','santa fe aluminum bottle','seattle pen','wi 512','eco friendly','sharpie','budget stik pen','hse-6-m','barcode keychain','id holder','leatherette','adjustable badge holders','od-1003','legal pads','nike golf','1039','fold away tote','1004','computer sleeve','ga-895','dw-1018','id card','board president','photo album','mesh beach tote','click pens','1018','roller ball','gramercy','coffe','1021','wp-712','bk-1002','810','blank inserts','ga-900cl','visitor','fd-14','clear bags','energy cord','hse-6-c all-purpose badge holder','coffee','chip clip','alphabetical cards','plastic cards','pf-18b','laminated tote','hsse-6-pc','messenger','clear folder','photo frame','hse-5-c','pen set','hsr','tb-57','plastic drawstring','canvas tote','handle bag','velcro closure translucent portfolio','note','chap stick','wp-1005','wi-1036','foam','computer case','printed lanyards','hsj-6-c','emery boards','white folders','wb-05b','white paper bags','wi-547','plastic tote bags','me-1003','hsk-6-na','fold up bag','slotted badge holders','mini flashlight','rainbow','ultrafit table cover','ax-5-c','health care','conference chair ribbon','welcome','carry bag','badge cords','opener','cinch bag','cutting board','jr padfolio','folio','ofe-519','a6avlwe','mini stapler','paper envelopes','name badge stock','zip drives','bic sticky note pad','highlighter pen combo','medical','mardi gras','weekly planners','badge rack','keyboard cleaner','lmcosche','staple remover','primo pen','advantage','float','non woven economy tote bag','id wallet','white lanyard','wi-659','blossom pen highlighter','a','ly-107','ga-813','double bulldog','ga-15a-std','dw-06b','poly pure water bottle','swanky','we-1011m','tb-po','flashdrives','the big chill cooler','clear pens','adhesive name badges','trainer ribbon','ae-5-p','sun spiral jr notebook','business card case','insulated bags','aw-33n','platinum sponsor','carabiner','ink pen','ribbon case','watch','diamond sponsor','name badge 3 x 4','quick ship','blank ribbon','event staff ribbon','tb-pvt-bk','badge ribbon trainer','mini pens','certificate paper','ly-104','gym bag','name badge board','economy polyester lanyard','of-830','small tote bags','flexible key tag','hs-6-na','mini footballs','badge holder attachment','baby grand','tbe 700','of-704','folding bag','wide body message pen','poncho','ap-6li','double snap hook','hse-8','wp-77p','tb847','cube notepad','me-704','golf balls','pocket packet','sling backpack','wi-825','clip badge holders','aw-ez','ofe-716','keynote','wp-539','security','dy-828','wrist','neck badges','conference folders','wave water bottle','health promotions','mobile','shopping tote','judge ribbon','laundry bag','teacher ribbon','luggage tag with pen','display case','stress star','ga-892','raptor','nw-20l','pin badge holders','multi color pen','of-1026','blank avery compatible insert stock 3 x 4','carnival bag','bk-45b','neo pen','tb-714','mardi','plastic box','apple','hanes tagless','metro enviro-shopper','guest','dy-1002','we-1018','we-711c','brochure','velocity usb','supporter','round neck cord with double snap hook','bundle','boomerang','nurse','custom badge holders','correspondence folders','silicone','safety','badge pin','pin name badge holders','dw-1008','grill','wave bag','double zipper neck wallet','card stock','pink','budget tote bag','rack','pf-04a','tb-64','goofy','shoe horn','free shipping','of-836','leather','portable bag stand','tb-515','annabelle','sewing','eco tote','ga-888','jerzees','od 731','badge colored','nc-1000-bk','utensil','color changing','closed back table cover 6','505','wpe-16cjr-pr','new member','scoop sport pack','font','computer mirror','ly-126-pr','collapsible can cooler','planning committee','widebody','gf-814','travel pouch','h1 speaker','non-woven tote','memo clip','dwe-615','tb-pvt-ny','ornaments','fo-22-hs','presenter','pf-704','tv-10a','transport it tote','frosted note cube','bandana','laminate luggage tag','hse-5','wp-21b','we-1011w','dw-851','wi-570','tabletop','printed ribbons','triumph sport pack','assorted fun ribbons','tabletop display','hs-5-nc','classic sports bag','malibu','committee','h1-host','ga-1081','od-721','pf-71','padfolio handle','nylon','od-739','guide','3x4 name tag holders','vertical badge','jumbo promo tote','ga-771','dw-1055','horizontal ribbons','translucent badge holders','fusion pen','translucent pens','envelope box','rl-dc','insulated lunch tote','archer pen','two tone tote','nametag stock','od-609','crew neck shirts','15 x 20 shopping bag','speaker badge ribbon','h1-boardofdirectors','hs-5-pc','wi-35b','4gb usb','mug with spoon','memo pad','wi-513','dental care','attendee ribbon','dry board','pen pencil set','aw-600','name tent holder','digital photo frame','uniball','instant plaque kit','arctic chill','ga-19b','head phones','shipping containers','laundry','laminated bag','draw string','a-3li','bk 515','wp-1024','fridge magnet','lint stick','nc-fb','tb-1035','frisbe','wi-841','tb-717-nl','religious tote','sun screen','gt-511','golf umbrella','10 x 13','hostess ribbon','9 x 12 envelope','small plastic bags','wide body','nw-02','screen','nc-brb','nw-602','vie-1000-bl','certificate plaques','exhibitor','flashlight pen','providence pen','recycled lanyards','nail','technology','dw-803','tb-543','wood plaques','deluxe slotted badge','of-702','health','wp-1019','wi-519','name badge with lanyard','color coded name badge holders','dw-1042','expandable','brush','breakaway','vice president ribbon','ice','bic grip roller','pushy pen','paper cubes','urban zip tote','tbe-705','ae','gae-736','dy-820','folding tote bag','registration boxes','ap-5li','non-woven die cut handle bag','euro totes','ga-601','dy-1024','hssd-6-c','desk calendar','hot dog','vase','hse 6 c','pocket buddy','clip on badges','ode-1005','finalist ribbon','polypropylene bag','vie 1001','bike bottle','church fans','of-704-pr-1','bamboo','curvy','nw-01a','dw-11b','grocery','plaque kit','title cards','od-04b','wave mug','wi 844','velocity flash drive','beauty items','wi 629','tent card stock','transit messenger','water bottle sport portfolio','beauty','string backpacks','bk-808','vie-03a-bl','latex','4 ribbons','vie-5t-bl','hssd','vie-1001-bl','envelope pocket packet','h2-2969','eco bags','raffle box','bic grip','wi-615','nylon tote bag','student','hsb','chain','zip bag','slip in title','nw-20l-bl','blank table tent','gildan t-shirt','non woven tote','alpha tabs','open back table cover','garment bag','tb 847','linen folder','vip','rm 1001','v2 custom','paper mate breeze','vi-3tt-pr','gift pens','of-40a','of-833','dw-1039','dw-1052','dwe-1009','sanitizer spray','goofy highlighter','nw-14b-bl','of-39m','thunder','latitude','bk-87','personalized items','nike polo','retractable key','desk calenders','ly 703','gt-711','card case','eco','515','deluxe grocery shopper','non-woven grocery tote medium','seat','410-g','retractor banner','non-woven insulated lunch tote','classic javalina','white badge inserts','we-43h','acrylic coffee mugs','roll up blanket','we-43c','we-1013','small economy tote','metal','windjammer','wi 1015','bk505','wi-844','element','fill and chill','ae-6-nc','blank instant laser badge stock','economy cotton sheeting tote','twister mug','baby grand expo tote','first time attendee ribbon','montego pen','fly swatter','cord lanyard','helmet','rain','press ribbons','of-42','badge attachments','wi-33b','gae-607','color changing stadium cup','of500n','hst-5-pc','cotton canvas','sharpener','party animal','non-woven convention tote','neck strap','badge laminate','blazer pen','1 2 cotton lanyard','od-740','combo','fiesta pen','pink pencils','lip','cardboard box','badgeholders','long sleeve shirt port authority','economic force brief','auto open umbrella','safety giveaways','5 8 cotton lanyard','bu-1001','h1 funpack','frosted die cut','dy-pbb','neck lanyard','collapsible cup','pbe-1001','pb-508','swoosh','wi-12b','wi-801','pf-88','of-801','bandages','dwe-614','bag chairs','black tote','debossed','pf-519cl','portfolio bag','dy1022','tbe 701','click stick','tb-1039','badge sheet','pb-02b','ofe-719','pen box','adhesive backed badge','pb 509','trustee','tb-58b','odyssey tumbler','construction','pocket name badge holders','pad holders','of-522-25','wi1034','poly pro tote','tb-541','wi-805','on the road','pen knife','card stock paper','pf-516','od-810cl','of-805','pet water','pf-504','pf-701','pedicure','split ring lanyard','thermal tote','center court duffel','paramount','translucent','power play','barbeque','black barrel','blanket bags','tb-98','tt','bella','tb-717-cd','prospect','cotton canvas bag','car wash kit','tbe-708','wi 19','sun spiral notebook','tbe-843','charging','wi-1012','plastic die-cut handle bags','tin box','pet products','post it pen','pre-printed badge holders','button down shirts','we-1054','leather badges','net','pb 07','life member ribbons','click pen translucent','wi-741','sorbet pen','wi-609','ly-810','nike apparel','wi-609gt','ofe-611','wi-611gp','tbe-1027','student ribbon','ofe 517','wi-605-24hr','natural organic cotton sheeting economy tote','wp-802cl','notecube','bi fold neck wallet','cup with straw','clean and sweep','metro tote bag','pf81','oversized','bronze sponsor','poly pro riviera tote','document envelope','paper clip flashdrive','marketplace shopper','wi 538','new attendee','blank ticket','hse-5-nc','pf-600','hst-6','polypro','clear badges','wi-1033','wi-639','h1-2802','color accent tote','badge caddy','stic pens','board of trustee','pac','convertible','purse holder','wie-724','widebody message pen','pre printed badge holder','shield backpack ii','wi-533w','wheel','cardboard','we-1065m','hall of fame ribbon','carabiner light','hs-3c','we-1042w','hssd-5','wi-605','orbit retractable pen','hs-3-na','sarasota pen','task force','stick on calendar','corn plastic','hs-3','water bottle pocket','neo','wi-1049','on the road backpack','packet envelopes','wi-660','wp-16cjr','laser stock','travel gifts','stainless steel water','title badge','pastor','pf-04','ode-1006','bk 804','ofe-608-25','dw-504','life in motion','household','canister wet wipes','wi 521','bic widebody','ly1002','naos ballpoint','steno pad','student leader','chapter president ribbon','plastic metal pens','tbe-1030','carnival','of-513-25','business partner','tb-1020','wi-22tr','wp-530','bk813','presentation remote','thermal bags','wie-626','wp-1000','dw-832','delegate packet','colored handle tote','credit','h1-4400','wp 1000','wi-609b','travel coff cup','snap folder','we-1001m','lunch sack','shipping totes','wi23ts','samba pen','panelist ribbon','hinge flash drive','name inserts','carry all','tb-1005','wi-608s','built','we-712','non woven backpack','regional director','dw-525','wpe-16c','safety glasses','personal travel kit','tb-23b','wi 554 tt','trainee','polyester','bic pivo','cooler backpack','wrench','heartland','treasurer ribbon','drawstring packs','double bulldog lanyard','pbe-600','camp shirt','hs-3-m','colored name badge holders','secretary treasurer','nw-02a-pr','partner','we-1039','trustee ribbon','badge with clip','nike dri-fit','fbh-2','co-chair','bulb','card reader','planning','partner ribbon','od-517','tri stick','clear name badge holders','candidate','overnight sensation slingpack','bk-814','storage cases','tb-41b','hst-6-nc','phone charger','winner','helix eco','hst-6-c','perla lunch cooler','nw-703','palmiro pen','convention wallet','survivor','stampers','hsed-6-pc','square tote','ax-2-p','prize wheel','portable ribbon organizer','od-615','tb-707','pivo','we-807','certified','bk-01a','water bottle with straw','program chairman','pf 504','tb 1039','padded backpacks','tb-716-cd','tb 813','table captain ribbon','slip titles','dw 849','badge holder cord','mee-501','neck pouch','fashionable pen','historian','moderator badges','tired feet','od-521','wi-1046','official something','dw 537','badge cards','wie-737','blank neck wallet','wi 07','committe','nantucket tote','president\'s club','palm','od-06b','paper mate element','tb-626','nw-20-bl','honorary chair','dw 605','fold away','wpe','translucent barrel pens','citation','pique polo','we-1039c','hse-3-p','avery insert','polyclean','we1041c','non woven shopper','wi 34b','leather jotter','dw-1022','large duffel bag','a-95s','wrap','shopper','lotus','wi 658','tbe 1006','table throw 6','foam name badge','bk-707','br-700','bic brite liner','laser engraving','perla','tb-711','od-836','od-743','od-807','of-700','of-714','od-559','od-554','of-1013','od-611','sunscreen bottles','nickel','leather notebook','top loading clip badges','bic ecolutions','tb833','of-1028','customized shirt','session chair','od-544','me-601','od-1018','chapter member','dy-800','of811','tv1016','collapsible cooler','du-806','laughing pen','stainless and tumbler','hsr-6-pc','patron','plastic tumbler','wp-540','leather pen','slick sweep computer brush','celebration bag','audio visual','program','br 703','bic solis','hsr-6-c','life','wpe-1003','we-1010w','color flap translucent portfolio','sun kits','supervisor','clergy ribbon','state representative','soft loop handle bag small','flat bag','wi-1021','striped tote','name badge set','certificate seals','h1-board','fd-601','wave pen','stitched organizer tote','hi-732','dot to dot','translucent writer','spin doctor','neckcord','non woven tote bag','water bottle straps','spouse','badge holder with magnet','bk 505n','wp-24b','waterman','ly 501','wi-32','bic atlantis stic','corporate pens','hs-5','terra tote','tbe-70','dart pen w grip','co chair','printed laser insert stock','past chairman','wall','nw 01a','wall street padfolio','nw-20pr','beacon tote','tbe-627','swivel','cardboard journal','tb-549','workshop stool','bullet','double sided','wie-820cl','wie-721','supervisor ribbon','wp-1006','pressure gauges','hanging','cutter and buck tumbler','we-1045m-c','two tone bags','wie-529','snap closure translucent portfolio','advisory board','ly-98-w-srg','spill proof','non-woven neck wallet','select','dw-746','pf-74','we-505','chaperone','tb-12a','program committee ribbon','window pen','dw-854cl','wp-100','m500fc','steering committee','dy808','district','newington','box organizer','slip-in title cards','astro pen','double handle document caddy','companion portfolio','seminar','triad','surge','corporate member','swoosh tote','dy-818','wp-1008','wi-100','dy809','awe-501','wi-543','printed tote','hsse-6-nc','fitted table covers','charter member','bic stic pen','microwavable','hi-707','over the sink strainer','wp 77p','pixie pen','we-1004w','local president','associate ribbon','wi 613','steering','past state president','wi-700','wi-641','wi-39b','two zipper neck wallet','pf-500cl','a77we','badge cord set','nw-03a-pr','leader','national','spicy cap action','od 834','tv-811cl','wi-572','br-601','dw-817cl','neoprene lanyard','budget document','bd-500','wp-531','roadster','dw-01b','nw5','lm-87','bk-607','tb-509','steel tumblers','nw-03a','bk 04a','hsk-6','ae-6-pc','h1-facilitator','wi-627','sign wave','northwest zippered','cargo box','dip','pf-500','dw 707','recycled bag clip','axt','table ten','pf-02acl','shoulder','nw-08','here to serve','balm','hi-600','senior clippy','chapter staff ribbon','scented pencil','contributor ribbon','lunar convention tote','conference coordinator','nitro','show','pf520cl','leader ribbon','spirit cup','dw-842cl','dy-806','packet folders','assistant director','council chair','paper mate sport','the world\'s best pizza cutter','play','trendsetter','phat pen','administrative assistant','third place');
/* $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);
    }
