/* Popular phrases - SMITHBROTHERS - 13:54:17, Tue Feb 9, 2010 */
var asPhrases=new Array ('saddle pads','spurs','boots','wormer','bell boots','saddles','spur straps','halters','barrel saddles','bits','headstalls','chaps','reins','blankets','hay bag','belts','cinch','saddle blankets','shipping boots','vest','stirrups','rope halter','roping dummy','hats','correction bit','ropes','ariat','helmet','saddle rack','dewormer','hobbles','skid boots','show headstall','barrel reins','clippers','jackets','bosal','ladies boots','sheet','breastcollar','hackamore','turnout blanket','splint boots','barrel racing saddles','professional choice boots','rope bag','quirt','classic equine boots','ariat boots','roping reins','show shirts','hay net','horse boots','tack','mayatex blankets','noseband','justin boots','martingale','fly mask','hobby horse','trailer accessories','bridles','horse blankets','cooler','open range blankets','calf ropes','tie down','caps','classic equine saddle pad','myler bits','jeans','mens boots','monogrammed halters','lead rope','pads','smb','polo wraps','back cinch','sleazy','bucket','saddle cover','down jacket','german martingale','show saddles','garment bag','surcingle','mecate','fly sheet','professional choice saddle pad','roping saddles','tie down strap','chinks','rowels','saddle bags','ranch rope','ladies spurs','show halters','double j headstall','charmayne james saddle pad','bumper spurs','professionals choice','kids boots','bareback pad','custom spurs','impact gel saddle pads','windmill','slinky','stable sheet','gag bit','hood','ariat showbaby','trailer','classic equine','girth','martin saddle','zebra','mayatex','halters and lead ropes','pulling collar','resistol hats','tail bag','snaffle bit','cosequin','barrel racing reins','hat can','martin','one ear headstall','pop up barrels','esp saddle pads','saddle carrier','goat dummy','probaby boots','caveson','shirts','leg wraps','sherry cervi bits','customize your saddle','barrel','show pants','smb elite value pack','big d','waterproof sheet','ariat probaby','boots for horses','mecate reins','sport boots','sharon camarillo','headstalls with crystals','cowboy headstall','tiedown','sleazy sleepwear','troxel helmet','wool pad','camo','winter blankets','snaffle','saddlesmith saddles','tender touch bit','rope halter with lead','piggin strings','western hat','myler','mayatex saddle blanket','billet','blankets and sheets','show tops','mules','bag','wahl','curb chain','bridle bag','tail wrap','cowboy hat','oxford shirt','romal reins','flank cinch','rope can','nylon sheet','breakaway rope','down vest','blocker tie','knife','chap bag','farrier chaps','lead','supplements','stable blanket','fenders','side pull','turnout sheet','knotted barrel reins','western chaps','show bridle','double saddle rack','horn wraps','billy cook barrel saddle','perfect bit','mtg','summit jacket','felt saddle pad','smart cinch','dummy','stall drapes','polo','mayatex san juan blanket','barrel pads','cactus barrel saddle','tony lama boots','ladies shirts','charmayne james saddles','classic equine bell boots','jr ropes','tie down roping game','mohair cinch','feeder','justin','impact gel','brushes','pole bending','rubber boots','reinsman bit','flag','roping spurs','lycra','hay bale bag','ivermectin','goat tying','hobby horse chaps','grooming tote','kids rope','headstall with cross','draw reins','oxford','poles','pants','shipping','star','goat string','western shirts','classic ropes','rawhide headstall','msm','cowboy magic','big d stable sheets','personalized halters','horse wormer','first aid kit','tucker','pro equine','showmanship','running martingale','fly','western saddle pads','show chaps','blueberry','shin guards','ariat latigo boots','split reins','show clothes','over and under whip','smx pad','lunge line','over under','pink boots','bale bag','goat','riding helmet','ranch saddle','5 star','cooler blanket','heart concho headstall','reining saddle','twill oxford','reinsman pad','horse pads','trailer tie','turnout','overreach boots','barrel racing breastcollars','belly band','oster clippers','roping stirrups','half wonder bit','black headstall','justin equine boots','waterproof blanket','browband headstall','double j breastcollar','gloves','pro equine nylon sheet','allen bach','buckaroo spurs','weatherbeeta','custom rope cans','thinline','silver','vaquero','smb elite boots','chain bit','showbaby square toe','braided nylon quirt','leather reins','saddle stand','nettles stirrups','braided reins','showbaby','mens','straps','tank','v headstall','twisted x boots','double j','rhino wug','show of faith','magnet','show of faith headstall','latigo','vetrolin','rope headset tiedown','chin strap','lyte now','front boots','justin gypsy','chain mouth bit','safeguard','vetrap','harness leather','belt buckles','leather halter','twisted x','vaquero headstall','roper reins','glucosamine','no turn bell boots','oster','davis bell','sidepull','sweet six','roper boots','kids hats','trailer accessory bag','stampede string','roller bit','shoes','slobber bar','clipper blades','quick release','bucket straps','tory headstalls','carry all collection','wool saddle pads','ladies down jacket','wade saddle','cotton lead rope','neck rope','pink','equitation spurs','green camo','show blankets','slobber','calf roping dummy','martha josey bit','anderson bean','mens shirts','blanket liner','neoprene cinch','barrel stirrups','roping gloves','wahl clipper blades','muck cart','spanish lace','flex barrel','million dollar','mullen bit','mountain horse rocky ridge winter jacket','hat rack','head ropes','cross ties','cinch strap','elite boots','corner feeder','full cheek snaffle bit','big d blanket','custom saddle','soft touch cinch','casting tape','rope nose tie down','bogs','designer sheets','canvas duck blanket','wraps','thrush','oster kit','charmayne james bits','western belts','1849','smith brothers saddle pad','barrel covers','smb 3','ladies down vest','cactus saddle pad','muck bucket cart','sweet six bit','hackamore bit','braided barrel racing rein','goostree','classic nv4','cinchas','custom halter','tiedown holder','big d nylon sheet','spurs and spur straps','sensorflex cinch','winter turnout blanket','show of faith collection','rubber bit guards','fluid action ha','saddle pads with stirrups','2 ear headstall','rope headstall','classic esp','boot bag','training fork','dally wrap','curb bit','training halter','stran smith ropes','air ride pad','bailey hats','dancing arrows navajo blanket','neck sweat','mens down jacket','casa zia','fenbendazole','show blouses','waterproof boots','silver headstall','poly calf rope','bonnie','open range supreme turnout','batwing chaps','mohair','weaver','saddle pad liner','cervi bit','ssg','youth spurs','american saddlery','neck cover','slobber straps','billy cook saddle','magnetic number pins','blanket rack','headin rope','nylon breastcollar','5 star wool saddle pads','barn boots','justin george strait','knob spurs','poly rope','sponge','daily wormer','bottle','longhorn','no slip saddle pads','rope halter yearling','ball','embroidery','laces','rope hackamore','reinsman little s','pro equine ultra sport boots','timer','waterproof','mountain horse','gel saddle pads','barrel racing','callaway ropes','belt wrangler','slone','marlene mcrae','bob avila spurs','charmayne james','pink saddle blanket','kathys','felt pad','bandage wraps','show','pink show shirt','three tier saddle rack','box pads','spur pins','impact gel pads','open range turnout','weaver smart cinch','headsetter','cushion','elite','sport horse boots','d ring','long latigo','flowers','sizing a saddle','flower essence','c bit','stacey westfall','mens fleece','blue streak gloves','charmayne','open range','knives','california pleasure','romal','slip on','flag carrier','felt hats','nylon roping reins','window screen','riser pad','gear bags','quarter horse blanket','wade','calf strings','circle y headstall','winter jackets','fast stop','justin bell boots','horseshoes','side pull rope halter','james','protective boots','hoof','nylon halter','rubber reins','moneymaker rope','splint','cactus','calf roping saddles','pole bending bases','black pad','shim pad','horse trailers','stampede','leather curb strap','loomis gag bit','brindle','a knotted','bob avila snaffle','hoof black','hand warmers','fold it','boots showbaby','wool saddle','speed burner','x series','show curb','ladies ariat boots','smb elite','fork','gypsy','tangerine','training bit','chicago screws','youth spur straps','futurity headstall','canvas horse blanket','fatbaby boots','saddle cart','aluminum stirrups','saddlebags','training surcingle','million dollar bit','mane tamer','martin breastcollar','big d sheets','hobby horse hat','tekno crepe','contour saddle pads','lime reins','beginner rope','calf roping dvd','wrangler','blocker','bucket hook','tyler magnus','mens buckaroo boots','d-ring snaffle bit','wrangler fly mask','12 saddle','pop up','justin fly mask','trail saddle','nose band','horn bags','turtle','spur tie down','saddle strings','legacy','muck bucket','ladies antique spurs','combo boots','wonder bit','orthosport','stirrup hobbles','spanish lace blanket','western show shirt','contour impact gel pads','legacy boots','diamond wool','show spurs','roper','ariat terrain','esp pad','pro tech','pad liner','show reins','pink halter','whistler rope','twisted wire bit','barrel racing spurs','mayatex riverland blanket','show bits','liniment','ported chain bit','valance','co-flex bandage','old timer','palm leaf','horse sleazy','1000 denier','kelly kaminski','chink chaps','uptite poultice','5star','small blankets','headset','bell stirrups','tom thumb bit','tie strap','pole bases','pink saddle pad','down','barrel racing headstall','knee boots','repair','classic equine legacy system','legacy system','clip','todd slone saddle pads','salt block holder','back support','transition bit','heated bucket','showmanship top','cones','children boots','bucking rolls','troxel','chill chaser','airflex','kids','western boots','crepe soled boots','biotin','camo hay bale bag','basic spur','ladies gypsy','gt4','ladies antique star spur','jerkline','pulley draw reins','stall','western show','pulling comb','combo','mens work boots','berry concho','saddles ties','long shank snaffle bit','leather chinks','spur strap floral','riverland','100% wool pad','turquoise headstall','slicker','dally','blanket bar','circle y saddles','reining spurs','george strait boots','naughty nighties','reiner saddles','davis boots','old timer headstall','fast wrap','myler snaffle bits','chief blanket','ladies belts','western spurs','hug blanket','probaby','cotton twill oxford shirt','anthelcide','billy cook roping saddle','cross headstall','boot covers','classic gold','trophy halter','kids stirrups','vaquero roping reins','purple boots','pink sheet','mohair girth','hyaluronic acid','texas star','aisle','ariat quickdraw','orange blanket','rawhide bridle','6 5 8 hat','wool pad smith brothers','zipper ii blanket','lunge','quick change headstall','braided leather reins','mane','skid','all around saddle','cactus reins','rock grinder','backpack','combo roping saddle','wool blanket','ladies saddles','support boots','kids rope bags','soft rope','stable bandage','cinch guard','avila','smx air ride','grand hoof','justin pad','detangler','bucket heater','spur hangers','classic equine spurs','safe guard','chill','feed storage','cotton hay net','schutz headstall','yearling halter','hoodie','nylon tack','troxel western helmet','plaid','lead with popper','barrel cinch','horse sheets','bosal hanger','neck','weatherbeeta blanket','leather splint boots','first aid','cashel trail saddle','mayatex pads','rope can covers','chain','sleepwear','draw bit','dvd\'s','joint supplement','circle y barrel saddle','floral headstall','nylon reins','western pads','left handed','bull','classic equine legacy','window art','horn','combination bit','port bit','arco','stable fresh','professional\'s choice elite','horn saver','roper outerwear','non slip saddle pad','mens waterproof barn boot','1.87 ivermectin','open range turnout blanket','combo bit','door caddy','goat string can','ariat showbaby square toe','navajo','fortiflex','straw cowboy hats','fly spray','5 star cinch','goat tying string','smb elite value','5 star saddle pad','leather headstall','open range stable sheet','tie ring','shank snaffle','professional\'s choice horse boots','quickdraw','bay apache','show slinky','goat ties','western girth','blouse','custom horse blankets','quest','show jacket','latch','summer sheet','12 lead','deo','horse shave','nighties','harness headstalls','rope caveson','barrel timers','twisted gag bit','neoprene boots','pyrantel','0432','magnetic sheets','triple e','purple','stirrup accessories','tyler magnus bits','western legends pad','smith brother barrel saddle','vet wrap','tom balding','plaid sheet','martha josey reins','quick bit','ladies spur straps','teal','easy on halter','professional choice bell boots','string','joint combo','polka dot sheet','stool','smx cinch','stall fork','box','combination boots','concho belt','training reins','feed scoop','endure','simple boot','scoop','tendon boots','hair on breastcollar','tunic','smb bell boots','thumb','feed and hay bags','wide tree saddle','ultimate rope','roper ladies sport mule','bio fit','revolution ropes','pistol','tie down holder','josey bit','purple saddle pads','francois gauthier','polka dot blanket','5-star','mountain horse jacket','western helmet','turquoise reins','tory','fast back','front horse boots','professional choice cinch','open range supreme','cactus saddlery','wax reins','water loops','roping supplies','jewelry','orange saddle blanket','healthy coat','rolls','tunic show top','purple turnout blanket','smart','jiffy jack','men horseshoes','classic equine girth','san saba','roughout fenders','ladies justin boots','steer head','gypsy cowgirl boots','low port bit','trailer ties','stable fork','calming','nettles','quest gel','ladies mules','spotted crossover','slot ear headstall','heritage crepe','buck','fleece jacket','off billet','outback trading','cotton sheet','double ear silver headstall','black belt','grand ha synergy','shank bits','roper breastcollar','equitation chaps','chunks','wahl stable pro','training bosal','gel saddle blankets','twisted wire snaffle','twill','easyboot','equine boots','1 saddle pad','trainer spurs','classic equine pad','five star pad','blue bridles','cutting spurs','pink patron rope','classic equine cinch','hobble straps','blanket number pin','triple e custom halters','work pad','leather roping reins','magnetic bell boots','half wonder','headstalls star concho','organizer','bridle headstall','show tack','smith brothers calf rope','tucker endurance saddle','hair on pad','ice boots','bumper','sand','toklat girths','hollis bits','tory bridle','fender leathers','sheet dot','round skirt','bridles with nose band','felt','navajo saddle blankets','striker','open range sheet','aluminum roping stirrups','rhino','sharon camarillo saddle pad','carry all','buckaroo boots','black breastcollar','justin aqha boots','oak and acorn barrel saddle','hyalun','hay bale','western legend','soft touch','carry-all collection','grand flex','furazone','odor no more','stall blanket','open range 680','mounting','magnetic hock boots','outback','star headstall','black training bit','panacur','rolling hay bag','contour pedic pad','bale','blevins buckle','over n under','protective vest','reinsman blanket','headstall with stars','professional\'s choice boots','cactus roping saddle','training rope lead','pro equine super sling boots','knee','gypsy boot','wells 5 star pads','classic equine esp','tough-1','lil dude stirrups','show saddle blankets','electrolytes','silver belly hat','base','western cinch','open range supreme heavyweight turnout blanket','adjustable reins','heart bridle','all around spurs','felt liner','ty tuff','justin turnout blanket','jim warner','pro tech bell boots','cutter collection','ostrich saddle','stran smith','right handed ropes','zipper ii pad','poker spurs','rawhide tiedown holder','western mules','matching tack','classic equine soft touch cinch','corta','ropin rein','continuex','jim warner hackamore','riding boots','pretzel bit','barrel girth','faith','one-ear headstall','fur','biofit','cowboy decor','lace up ropers','one ear','twitch','pro equine fly sheet','rawhide bosal','tack hanger','pvc','left','little looper rope bag','french cuffs','overlay halter','ladies','pink barrel reins','sport boot covers','hot shot','buckaroo','braided rope halter','barrel racing timer','black tail','calm and cool','braided barrel knot reins','black show bit','hind boots','rawhide braided nosebands','justin blanket','quick change','breastcollar tugs','smarty pants','mane growth','turquoise sheet','clinton anderson','horse trailer accessories','reinsman rookie bit','portable saddle rack','loomis bit','sport mule','tekno','classic legacy','yellow rope','montrose','pvc cinch','ladies western shirts','rolling hay bale bag','leather reins with knots','blanket hook','two tone turnout','over','cashel saddle','weapon rope','berry cross','turquoise tack','brown boots','roper sandals','carry-all','toklat cinch','horn knot','pro tech boots','classic equine pro tech boots','california','myler snaffle','bub tate','barrel racing stirrups','night latch','sensorflex pad','joe beaver','kyle','calf roping ropes','chunk boots','bailey harrison hat','classic equine no-turn dl boots','pool','kids justins','cowperson breastcollar','brazil','smith brothers 100% wool pad','net bag','smith brothers open range nylon sheet','smx','the proven rush','tucson','tom dorrance','ramrod double weave blanket','pop barrels','back','open front blanket','pink helmet','concho browband headstall','mayatex san juan','cactus pad','poker design black spurs','zebra spur straps','manure','herman oak','red pants','westfall rope halter','rollin ropin tuffy','loomis shank','twentyx','team roping saddles','worlds greatest goat','tuff','barrel tack','horse first aid kit','trail accessories','white label','paisley passion','badlands breastcollar','feed cart','canvas','vac\'s','pvc shock pad','western slinkies','hug stable blanket','carson','pro','saddle case','black reins','martha','professional choice girth','black','printed sleazy','spur leathers','bailey harrison','padded saddle pads','basket stamped spur','red show pants','twisted dog bone','cowboy decor hair on hide','saddle repair','tendon support boots','ladies 3-in-1 jacket','circle y halter','gel cushion','clover spur','cactus saddlery headstall','high plains','kathy\'s lead','headstals','teal halter','pro equine 3 4 neck cover','biofit pad','todd slone','caution sign','waterloop','long shank bit','thrush buster','ustrc','ice blue','velvet trim top','nocona rhinestone','smith brothers pad','swat','tooled roper breastcollar','mini horse tack','stifle ice boot','blue show shirts','lime green bell boots','smith brother turnout','medium oil','horse ties','outback trading sweet jeans jacket','roper athletic','button down shirts','mounted saddle pad rack','thumb bit','sure grip saddle seat cover','weaver saddle pad','carry','custom saddle carrier','cotton','ice wrap','off strap','pro equine mesh fly sheet','retractable barrels','jean jacket','snap belt','low','tassel','hot','professional\'s choice air ride orthosport pad','super 14','ballistic overreach boots','braided rein 5 8 3 plait','troxel dakota','shirt sizing','troxel cheyenne','z3','open range shipping boots','basket pulling collar','rawhide quirt','ranger','rawhide tiedown','thermometer','sport helmet','cross nose band','classic girth','solid sheet','floral','brown hat','hitch lock','headstalls scalloped','wrangler apache belt','big d magnum','standard saddle bag','surcingle reins','pro header','suede','cashel mask','block','training a heeling horse','x3-1928','silver bullet','custom breastcollars','cross necklace','light oil','medium brush','colt correction bit','ky rotary bits','feather headstall','justin men\'s','classic pad','braided roping reins','ladies anderson bean boots','mens ariat cobalt xr','felt saddle blankets','wither','beetle','co flex','calf collar','stable','pvc contour pad','boredom breaker','rowel headstall','justin ropers','hair on belt','handi grip sponge','star breastcollar','crystal earrings','belvin buckles','open range horse blanket','leather tie down','working bridle','horse nippers','heaves','black one ear headstall','barrel racing belt buckles','trevor','suede saddle pad','touch','storage bag','leather saddle strings','long sleeve slinky tops','cantle','jd yates','the perfect pattern','ropee moneymaker heeling','saddle seat pads','hair on spur straps','classic roping gloves','left hand heel','scalloped','green lead ropes','toklat','classic equine no turn bell boots','heal rope','heart spurs','lower back support','waffle','copper snaffle bits','ostrich belt','heeler ropes','foundation','trailer jacks','rope double diamond','million','magic','cream','classic bag','popper','big d turnout','scraper','white roping rein','lock','tendon wraps','ladies cotton twill oxford shirts','circle y breastcollar','staysound','shaped roper breastcollar','red tack','moore maker knives','smith brothers carry-alls','pull on boot','nylon tail bag','pull on bell boots','closed','square snaffle bit','pro tector glove','nu','justin rope bag','tyler','motes','custom bit','bridles with cross','tooled belts','lined gloves','iron silk','rowel belt','poly nylon','night','miracle groom','specials','belvin','midweight blankets','cutback saddle pad','poly roping rein','black vest','francois','barrel racer breastcollar','hollis gag','no turn','rubber stirrup','hobby horse low rider pant','pink and brown halter','cotton leg wraps','ranch roper','pulling','gullet 7 w','rawhide rope','pink stable blanket','pink horse boots','riding socks','classic equine knee boot','classic equine support boots','pocket saddle pad','rowel concho','justin caps','neighlox','crepe','collared shirts','leather bell boot','ladies 3 in 1 jacket','longhorn belt','kodiak','green spot','leave in conditioner','pair spurs','iodine','sure','cricket','nfr dvd','velcro rope keeper','moisturizer','straw','citation','roper lines','tooled headstall','ladies ariat cobalt xr pro','royal blue','long roping reins','headstall with brass','justin children\'s gypsy cowgirl boots','usa','poly cotton sheet','carryalls','black green','red halters','western saddle pad bag','close contact saddle pad','cognac ostrich','small gear bag','saddle fit','pink stable sheets','rolled reins','size 11','impact pad','vegas tunic top','george strait ladies','cool back','high withers','custom rope','luke jones','pink and black','bay','pocket halter','saddle blanket 30 x 30','weaver girths','saddle horn bags','chaparrel','big d stable blanket','ladies boots red','bridle leather spur straps','satin cooler','spoon','sherri','rust','crusader fly mask','acorn oak','cowperson nickel cross','sunset','initial spurs','contoured wool saddle pads','rally','calm coat','men\'s roper','headstall bag','simple minds rollin ropin tuffy','gussets','big d turnout blanket','sorrel spray','bio pad','rapid rain','justin chukka','hampton lead','surgical scrubs','brindle hair','max flex','chocolate chaps','green saddle','chew','adjustable halter','vitamin e and selenium','red eye','snaffle port','whitener','cactus xplosion rope','tub','performance shirt','smith brothers ropes','pro equine sport','deo lotion','open range turnout sheet','big d nylon hood','mirage tank','western turtle stable blanket','touch up spray','reinsman mississippi','blade wash','ration plus','raised pad','saddle set','white poly','antacid','black and white saddle pad','cactus noseband','classic equine biofit saddle pad','10.25','southwest','ortho sport','blanket storage','star racer','flex hook','b calm','off','traditions west','comfort snaffle','replacement stirrup','mb 04','justin remuda','black split reins','george','supersweat','dot spur','wrangler skid boot','cotton shirt','bigeloil','pink star saddle','lime pad','high wither pad','wheat germ oil','coral saddle blanket','sussex','ranger star','ladies crepe boots','pink wrap','handozer','crepe sole square toe','designed rope cans','net scrunchie','body','coral','freedom','orange polo wrap','black show shirts','trail shoes','simple','trail reins','pastern boots','b12','smith brother show top','mohair blanket','size 14 boots','ladies anderson bean','show snaffle','sore','leather bundle','natural fly spray','martin noseband','grip','royal blue halter','teal boots','horse ear plugs','royal','mad dog','original head rope','headin','horse masks','cactus back cinch','black ariat boots','show vest','clipmaster blades','dy no turn','shaped steer roper','performance roper','deluxe rope bag','simple horse boots','cool boot','lamina','o s','1.87%','slotted conchos','classic equine saddle','pro shipping boots','wine','proven stone','big d bag','inlay','paste','duane latimer','nylon camo halter','cowtown','solocomb','western star','burgundy headstall','rear saddle bags','lifted bit','cricket bit','slick and easy','bean','barrel knee guards','tea tree oil','high tree saddles','stitches reins','congress','orange cones','saddle under pads','corner plates','knotted headstalls','black rope reins','pocket pro','nylon lunge','suede chaps','hot pink halter','basic turnout fly sheet','record','pink cinch','smith pad','rattler inverter','supply bag','d l reiner','ez trap','seven bit','classic equine square pad','d&l reiner','western riding boots','purple belt','ruffstock','pink hats','leather quirt','panic snap','western hat straw','cotton quilts','blue belt','hobby hors','select i','horse show numbers','uv','orthopedic','hanging feeders','saddle blanket pins','bound edge','u gard','classic equine contour','black bosal','beaver','foam pads','arm band','bach','black leather reins','applicator mitt','pro equine hind boots','hyaluronic','seven','pressure relief pocket saddle pad by diamond wool','deo-lotion','twisted sweet iron','lift','proven','wheat germ','ladies buckaroo','pink rope halter','groom boots','khaki shirts','natural reins','super sling boots','confidence plus','rope split reins','jiffy','wide bits','oneear headstalls','felt smart cinch','smarty','folding','roper bling mule','flat roper rein','custome made chaps','mirage','carolina vest','acculytes','classic equine rope bags','pro heeler','welly socks','work glove','mad dog 3','ariat taos','classic pro','stress','classic splint boots','rope powder','card concho belt','aluminum cart','jelly scrubber','ariat square toe','horse health','ladies bling bling chunks','black show pants','dl','plastic barrels','black ropers','touch plus bit','tech boots','red sheet','star dee','cottonwood','thermal pro hoodie','relaxher','cross pendant','wmd','pastel','mx-4','bob feist');
/* $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);
    }