/* Popular phrases - AUTOPARTS - 12:6:48, Sat Mar 20, 2010 */
var asPhrases=new Array ('autocraft batteries','auto repair manuals','diagnostic','battery','brake pads','rotors','codes','spark plugs','fuel pump','struts','wheel bearings','battery charger','check engine light','changing brake pads','jack','autocraft silver batteries','oxygen sensor','how to replace fuel filter','air filters','carburetor','transmission','water pump','changing spark plugs','belts','radiator replacement','marine batteries','wiper blades','clutch','paint','window visors','trailer hitch','ball joints','replacing a starter','muffler','catalytic converter','alternator replacement','cabin air filter','strut replacement','headlight restoration','car covers','serpentine belt','vacuum pump','code reader','water pump replacement','fuel filter','floor jack','shocks and struts','shocks','antenna','window motor','replacing wheel bearings','distributor','replacing headlight bulbs','ignition coil','power steering pump','autocraft titanium','lawn and garden battery','headlights','spark plug wires','power steering','exhaust','flasher','manuals','oil filter wrench','clay bar','transmission fluid','windshield washer nozzle','jack stands','brake bleeder','thermostat replacement','egr valve','belt tensioner','application for employment','bleeding brakes','air compressor','hitches','seat covers','oil pump','thermostat','lift blocks','valve cover gasket','running boards','vinyl paint','oil pan','wiper motor','fuel line','abs speed sensor','calipers','universal joint','wheel cylinder','trailer wiring','radiator','wheel bearing hub','leaf springs','fog lights','cv axle','coil springs','tire chains','distribution centers','egr','transmission cooler','obd','brake shoes','u joints','flywheel','pitman arm','transmission control module','windshield repair','fuel pressure regulator','tonneau cover','cruise control','timing belt','washer pump','bed liner','window switch','transmission parts','warranty','lower ball joints','rack and pinion','brake drums','crankshaft position sensor','tachometer','horn','brake bleed','front wheel bearing','transmission filter kit','deep cycle battery','window tint','heater hose','heater control valve','coil','electrical','brake lines','hub bearing assembly','torque wrench','plug wires','monster truck promotion','repair manuals','floor mats','hoses','golf cart battery','sensor','power brake booster','head gasket','parts prices','coolant temperature sensor','solenoid','transmission solenoid','thrush mufflers','ignition switch','radiator flush','troubleshooting','bumpers','electric fuel pump','muffler tips','brass freeze plugs','camshaft position sensor','window regulator','steering wheel covers','pipes','intake manifold','speed sensor','carb cleaner','abs sensor','power steering fluid','synthetic motor oil','filters','relay','abs','modulator valve','tire inflator','tie rod','wiper refills','throttle body','brake rotors','map sensor','window','battery tester','gauges','converter','spacers','grease gun','shifter cable','manifold studs','fender flares','replacement horn','pulley','primer','starter relay','bearings','brake booster','cv shaft','trailer lights','cylinder head','knock sensor','differential cover','ac','hood release cable','tension pulley','fuel pressure tester','12 volt heater','antifreeze coolant','tie rod ends','3 4 heater hose','o2 sensor','monster jam','driving lights','motor mounts','h7','4wd','optima','bed rails','headlight assembly','lights','blower motor','gaskets','transmission flush','cd players','auto seat covers','axle','bug guards','ventshade','schumacher','diagnostic computer','oil pressure switch','headers','heater','brake bleeding tool','real estate','grinder','brake hardware','compression tester','gps','crankshaft','head gasket replacement','wiper arm','flush','wiper linkage','brake bleeder tool','gift card','brake controller','bra','battery maintainer','car ramps','check engine light on','tow hitch','speedometer cable','oil pan gasket','fuses','brake light switch','clear coat','condenser','crankshaft kit','hei','lift support','emissions','tint','ramps','actron','bleeder screw','seafoam','leather steering wheel cover','plastic repair','door handle','credit card','headlight switch','weatherstripping','coolant tank','roof racks','bosch wiper blades','cooler','battery jump starter','fuse block','fan','mounts','brake hose','mobil1','hr','hood pins','degreaser','catalytic','egr pressure sensor','dielectric','splash guards','wiper switch','wheel spacers','bulbs','bars leak','fuel pressure gauge','lift kits','silicone','serpentine belt tool','9bs','backup camera','tie rod replacement','eagle one','camshaft','wiper transmission','blower','books','a c clutch','hypertech','z-max','master cylinder','buffer','u1-3','body mounts','jump starter','window lift motor','coolant level sensor','stabilizer','hoist','1159','glass cleaner','3657','motors','wheels','cv axle assembly','e8235','2791','ac flush','fiamm horn','center support bearing','replace fan motor','clutch disc','parking brake cable','truck rails','tune up kit','optima battery','intake','fuel line repair','flowmaster','horn wiring','bed mat','stabilizer link','steering wheel','rear bumper','silver battery','ceo','fan blade','slave cylinder','pcv','lift','computer','torque','mobil','transmission lines','dipstick','timing gear','sending unit','grill guards','hub bearing','temp sensor','undercoating','window regulator replacement','control module','jb weld','header gaskets','door hinge pin','hose clamp','cbe33z','carb install','coil spring-front','auto body products','se4020','shock strut replacement','autocraft marine','alternator rectifier','etching primer','carb gasket','sprayer','nissan','radiator leak','taillight lens','license plate bracket','led bulbs','auto oil','tire gauge','dent repair','timing chain','detailing','radio','scanner','cargo net','steering','wheel hub','sylvania 9006','smog pump','terminal','bushing','starter switch','weather stripping','air shocks','transmission mount','chassis','ignition module','headliner','light kits','brush guard','accessories','r6034','tester','towing mirrors','12n94b1','trans cooler','flashlight','champion spark plugs','titanium','maintainer','maintenance','fleet services','nad 698','axle nut tool','o-2 sensor','diff','maxlife atf','diagnostic check','e8016s','brake module','caliber','foundation','repair scratches','turn signal flasher','castrol','haynes','speedometer','fan clutch','quick strut','window film','spark plug repair kit','replacing inner tie rods','gear lube','motorcraft spark plugs','oil stop leak','module','ignition cylinder','scratch','carburetor rebuild kit','fuel treatment','tire plug','bearing puller','speed bleeder','seat belts','headlight bulbs','ecu','rack','dent repair kit','slide hammer','alternator bracket','10la2','dupli-color','sa4','r3054z','cs96','9845','yr6lde','replace hood release cable','accell','brake caliper bracket','mig wire','bed liner kits','plenum','tow lights','license plate','cv boot replacement','steering rack','truck bed mat','starter solenoid','brake bleeding pump','fluid reservoir','trailer brake control','control arm bushings','code check','winch','timing set','washer nozzle','steering box','injector cleaner','check engine','regulator','brake parts','intake gasket','brake pump','battery installation','monster truck','seat heater','brake bleeder screw','bleeding','transmission sensor','6-1052','how to change cabin air filter','30w oil','power valve','engine control computer','cooling fan','coolant','disc brake piston tool','tire pump','work light','tubing bender','phone number','coolant temp sensor','speakers','lighter','starter shims','royal purple','gas cap','battery cable','air bags','exhaust clamps','wiper refils','belt dressing','water wetter','steering column','locking gas cap','monster truck jam','timing light','caliper tool','ignition lock cylinder','body filler','piston rings','6al','ballast resistor','torsion bar','careers','ignition wires','grand opening','mike marolt','1068','ds1047','hub tool','teal paint','how to install wiper blades','engine sensor','leather protectant','monroe struts','map','clutch cycling switch','bleeder','transmission pan','sand paper','glass polish','locking lug nuts','harmonic balancer','inner tie rod','torque converter','fuel gauge','oil pressure gauge','fluid pump','wheel bearing assembly','3-630','gear oil','scissor jack','atv','oil drain plug','transmission hose','reservoir','tire valve','computer installation','ngk 3923','3m headlight restoration','computer replacement','rain-x wiper blades','reamer','5660','air grease gun','fuel door','kyb','air pressure gauge','tail pipe','water pump gasket','neutral safety switch','hid','16cl-b','brake tool kit','12v plug','steps','tow strap','lens','headlight covers','51r2','bondo','door lock actuator','front-end cover','manifold bolts','temperature sensor','video','clay','socket','34-1','wax','abs wheel speed sensor','charger','inverter','36mm socket','fin','rotary brush','g7399','coolant reservoir replacement','real estate contacts','seat trim','flange kit','patch kit','4418','steering wheel removal','oil dip stick','gm manuals','water outlet','parts cleaner','valvoline','castrol motor oil','rear wheel bearing','exhaust bandage','e3','ar3933','door pins','piston tool','lower ball joint replacement','western','tool sets','k&n filters','pistons','actuator','airaid','18-4391','egr1589','6404','tire foot pump','16-b','powersports battery','ups','door panel retainer','poly','fuel strap','fuel check valve','how to replace oxygen sensor','clock spring','exhaust hanger','crank','ignition','rocker arm','radio removal tool','engine oil pan','trip','idler arm','cigarette lighter','flaring tool','off road lights','power steering return hose','lucas','puerto rico','door window','obd code reader','axle shaft assembly','wheel bearing hub assembly','welding','chrome polish','spindle nut','pulley puller','lug wrench','door hinge','exhaust wrap','r134','disc brake pads','brake bleed pump','s8063','cruise switch','starter mounting bolts','4092','abs control module','exhaust manifold bolts','spectre','knobs','replace steering pump','hella lights','filler','battery booster cables','shift kit','clutch master cylinder','mothers','radiator sealer','nozzle','idle control valve','community','radiator drain plug','spotlight','warn hubs','colored wax','pushrods','h13','3157','engine computer','egr1586','vehicle speed sensor','9008 bulb','ar6029','880 bulb','computer scan','10w-30','purple power cleaner','master cylinder replacement','defroster hose','shock bushing','dodge parts','upper radiator hose','9006','air hose','thrush','4lbs battery','cargo mats','idle air control','spark plug wire retainer','clutch fork','how to replace rotors','e8335','h11','lifters','center link','u-joint','5lbs','trouble light','mi','replace low beam','e3500m','625-100','magnaflow exhaust','2915','hd shocks','32mm','pinion seal replacement','head replacement','33-2288','replace turn signal switch','antenna adapter','rods','pcv valve hose','bearing packer','denso','choke cable','transfer case motor','chocks','wiper bushing','glue','atm fuse','havoline oil','cv axle replacement','hone','wt3000z','flasher replacement','h7 bulb','obd 2','battery box','aa3980','pressure plate','st-10rs','tl-13rk','tl-21rk','7084','indian head','inline fuel filter replacement','autocraft u1-3','change spark plug wires','surface prep','injector o ring','replace window motor','lens repair kit','how to install struts','bellows','65','window assembly','trunk motor','vacuum cap','torx set','carb spacer','bed','electric fan','marine','power antenna','clutch set','solar','seatbelt','head gasket set','duplicolor','paint stripper','bactrack','drive axle','86-1','sway bar kit','5887','replacement transmission','wax remover','brake sensor','14-c','741-824','2803','ngk 2202','gm16b','owning a store','rear','u joint tool','pedal sets','lateral link','cold cranking amps','towing kit','dex','tank','smoke','diagnostic scanners','creeper','seats','latitude','dimmer switch','egr valve replacement','door hinge pin replacement','transmission rebuild','techron','jumper cables','zmax','dwell meter','tube flaring','78-2','how much oil','radiator drain','wheel caps','se-1052','1274','1486','24mm socket','u1-1','bosch fuel pump','back up switch','body trim','tail light bulbs','air intake cleaner','24-5','rear main seal','75-3','reese hitch','darren jackson','washer fluid reservoir','14bs','fan relay','9298','fuel hose','ec3297','vacuum modulator','o2','truck running boards','track bar replacement','mx699','5599','33-2340','spot putty','50-n18l-a2','20-6244','33-2299','tie','shift linkage','40r','bench seat console','vinyl','rubber bed mat','driveshaft','obd-ii','egr solenoid','air compressor clutch','blue devil','handle','interior door handle','sander','screw extractor','trans filter','wheel cleaner','14la2 battery','tubing','wp-9126','d465','tube nut','permatex silicone','74-8309','8851','engine oil primer','ignition switch actuator','sensor replacement','bulk hose','oil rings','water neck','type f','ear plugs','trailer lock','egr parts','fiamm','fuel sensor','lug','jackson','alt','bottle jack','rain-x','compression','fix a flat','wd 40','css635','egr1291','flex wrench','torch red paint','ar3934','carburetor kit holley','motorcraft oil','camera','oil filler cap','helper springs','starter drive','cv joint replacement','pitman arm puller','gas spring','camber kit','engine oil cooler','engine heater','indicator lights','aa30','parts washer','washer-fluid reservoir','scan','headlight adjustment','snow','solvent','obdii','dimmer switch replacement','octane booster','20-8748','rain x latitude','differential bearing kit','washer fluid sensor','spray glue','multi switch','backup switch','oil level sensor','xenon','block seal','gas can','permatex','mothers clay bar','blower motor relay','scan tool','fuel pressure','transmission repair','bumper repair','purge','168 bulb','gasket maker','c clamp','css78','nextar i4-bc','rocker arm clips','trim adhesive','safety','lawn battery','coil spring booster','valve spring compressor','exhaust heat wrap','leaf spring hanger','glass fuse','door bushings','tire cables','leak','front exhaust pipe','4218','77-2240','u7001','1-0134','controller','pcv elbow','westin steps','knuckle','15 amp fuse','power steering pulley','fuel switch','lowering blocks','carburetor kit','front bearing','fram air filters','wp-9017','wp-9304','castrol 5w-40','s-5','0901','gold paint','9017','16b','gc2','brake pedal pad','auto scan tool','chevy emblem','canister purge','body control module','fuel filter disconnect tool','ring compressor','crankcase filter','engine diagnostic','inner tube','bed covers','rs5115','disc brake lube','seat release handle','exhaust bracket','advance stores company','officers','vht','multi function switch','electronic spark control module','changing rotors','license plate cover','12aa','hella','e3506m','mkd 822','radiator sealant','transfer case gasket','bars','battery life','21-5149','wp','hd 1499','2292','brake hone','battery clips','trim fasteners','promise','wrinkle paint','thermometer','egr tube replacement','link kit','autolite 65','mkd 242','oil adapter','white shepherd','mass air flow meter','214-2081','22-1000','4wd indicator switch','gps accessories','5425','bed accessories','4511','4557','replacing front struts','fuel level','fuel line tool','gun','battery hold down','differential bearings','seat cushion','trailer connector','battery 65','air chuck','back up light switch','edge oil','mx856','80-90','2947','cleaning wands','crankcase valve','buying a used car','3-609','ar3932','2357','ph6010a','westin','h1','convex mirror','accel','brake kits','headlight lens replacement','battery tray','shell oil','nb610','dorman window lift motor','accel 8140','app985','punch set','replace heater control valve','air charge sensor','transportation','cv boot kit','194 bulb','safety chain','dolly','starting fluid','washer fluid','58-1','blue bulbs','air gun','a6850','wheel bearing grease','wash brush','fuel tank selector valve','sensor socket','upper intake gasket','peak','power steering pressure switch','wheel nut cover','tom tom','heater fitting','shock hanger','cc808','3510m','8228','accel ignition wires','towing brakes','e8012s','center drag link','battery acid','fuel sender','bosch spark plugs','bell','pra053','e3369m','proxy statements','synthetic brake fluid','1141','auto page','wheel nuts','tv','0w-40','42-1','taps and dies','41-948','5w30 gtx oil','battery washer anti-corrosion','9005 su','freight','shift cable bushing','mercon atf','fan clutch wrench','tpms','clutch cylinder','65-1','studs','windshield washer fluid reservoir','advertising','valve cover breather','902-303','e8424m','e8643','gear wrench stubby','b2010','high paint','e2059mn','all batteries','compressor clutch','bead sealer','how to replace battery','sta-bil','cooling fan control','dex-cool','cs829','compass thermometer','cylinder head gasket replacement','689-103','aa8a','130','sensor switch','car door panel','advance oil filters','brake pad spreader','outboard oil','coolant recovery','degree wheel','coil wire','jb','bar\'s leaks','subframe bushings','dex cool','s6075','2901','synthetic grease','x580','v5111','abs211','ec1688','ngk 2611','parking brake release cable','wedge seat cushion','trail','rethread','58-212','circuit breaker','blower switch','cfo','24f-6','r3136','shell','fix it flat','accelerator pump','air filter pods','603-109','740-736','sp493','ambient air temperature','3087','5939','7506','58-147','shovel','windshield deicer','paint remover','3689','wiper hose replacement','wiper removal','tape','denso 234-4048','78 autocraft titanium','pulstar','qh-75it','cmx699','gm22b','33-2168','coolant lines','engine smoke','universal air filter','ph6018','radius arm bracket','cc865','starter brushes','26r-3','ed hardy seat covers','tank repair','tami kozikowski','head bolt washers','battery 41','parts cross reference','ton jack','license plate screws','analyzer','cv joint boot','dorman 425-176','replacement antenna','bolt hardware','diagnostic scan','12n7-4a','fuel vapor','belt size','castrol transmission fluid','dash pot','3421','power booster','credit','end616','rust fix','the club','6216','3057','rubber plugs','33-2311','lateral arm','infrared thermometer','torque converter seal','toggle switch','havoline','engine oil cooler hose','extension cord','u1r-2','hr manager','h11b','ph4967','transmission pump','replace rear seal','cigarette','27-2','harmonic balancer puller','20-7','927-100','p3273s','12 wiper blade','camshaft synchronizer','alumaseal','water in gas tank','dexcool','motormite heater hose fitting','841','new construction','mkd 484','458','ph3306a','contact points','siphon','check engine light is on','replace oil pressure sensor','launch control','tire valve core','coil spring conversion kit','castrol edge','actron infrared thermometer','300-201','valve compressor','chisel','socket adapter','af1100','ap104','events','css983','gm1a','c135','cp9449','speed sensor wire','0-4777c','33-2304','bellows boot','tow receiver','8092','brake cap','battery switch','support group','bulb retainer','cv3134','css51','back alarm','steering pressure hose','shock bolts','rotella','champion 7034','autocraft silver 75-2','tire leak','coating','cv half joint','brake vacuum pump','trans converter','cooling fan thermostat','ch6007','signal bulb','cmx858','bungee cords','wt5066','hylomar','transmission switch','css626','css511','all about oil','anchor','amber','snow blades','compressor oil','stant fuel cap','suv tires','cutoff wheel','scan engine codes','as-600','abs wheel speed','st131','49h8','63-2565','cv replacement','car jump','740-737','s5049z','bosch injector','rivet gun','al ternator','48h6','antifreeze check','break line tools','tie rod boot','tire chain adjusters','t20','sbk-2','7401','amber fog lights','6545','bosch 4002','75-25','ra310','air door actuator','air blend door actuator','spindle socket','7145m-12','bulk heater hose','25-1','sanding block','clutch spring','880','castrol 5w30','css69','36r battery','security systems','16-240','aa16 oil filter','#65-2','clutch pedal pad','a c heater control switch','4055','16al-a2','36mm','rtv','5961','422b','bardahl','code-reader tools','replacing starter switch','color','air mass meter','remote filter mount','sylvania 9007','brian bazer','33-2296','auto tape','b&m','axle nut','bar\'s liquid copper','705k6','36r1','2-3011bf','24-9r','coolant dye','brakleen','923k6','battery filler','96-395c','1266','7912','9003 hb2','revolving light','bars leak 1109','33-2326','crc cleaner','bosch 420b','spot light','black and decker','cable tie','9140','5l-bs','33-2045','cp9190','sc-300a','7131','6263','brake paint','673','s334','trico 18-1','advance know how','wire wheel','slime','aem air filter','r42ts','solder','16a-a','butane','hitch step','strut brace','hammer','real tree seat covers','back seat','transmission change','brake piston tool','autolite 23','1933','9v','cardone power steering pump','racing headers','red neon','accel spark plugs','8199','sylvania h6054','1025k6','628','se1275a','ca3902','socket rail','741-710','cs9667','antifreeze windshield washer fluid','wp 9020','h11 bulb','hd-1499','air heater valve','ca136','clay kit','2667','headquarters address','woodruff key','rain x wax','rand','33-2366','sheepskin steering wheel cover','sylvania hid','75w90 gear oil','stp fuel','backup neutral safety switch','carburetor adapter','windshield wash','27f battery','47-1377','26r-2','1025-12','sec-100','slave','924-250','towing coupler','star driver','cp9410','slick mist','sc2960','blitz ramp','torx bit set','tw205','chrome wheel locks','sc2958','wd40','r3130','champion generator','sarah powell','speed nuts','tuff stuff','6681','wiper sizes','aircraft','#74 bulb','342','aap1','16ala2','7918','store pickup','cp7828','aaa batteries','roadside emergency','anti-freeze coolant','194 led','how to replace shocks','ca5125','418b','8611','16aa','se-4020','replace wheel bearing hub','4303','4509','control arm bumper','bosch 4504','belt t','autolite 45','7507','body protection','36r-1','rc-5000','cd','bwd switch sender','cooler fan','t bolt clamp','960k6','strut spring compressor tool','214-1105','rw307r','31a','8088','air temperature','wheel cyl kits','sx909','r4736','ru916','royal purple synthetic','5 16 brake line','10mm wrench','cp9025','heat control valve','469 bearing','aa16 filter','80 90 oil','20w50 motor oil','tire hold down','advance oil','ch6012','air flo','anti rattle spring','carrand','hp2002','css819','380k5','repair tape','37','actron cp7677','wt382p','s9871','615-277','b m shifter cable','wheel cyl','control valve','autocraft silver 65-1','rear wheel seal','replace filter','2649','css138','194 ll','945','replacing brake cable','crankcase','catch tank','ralph gonzalez','windshield washer lights','wearever gold','raleigh','2662','wear sensor','43-3881','check on job application','refill coolant','college park','350 firing order','trico neoform beam style wiper blades','holding tank','weather covers','700 cca','wheel rust remover','red top battery','torin jack','waste oil container','control','car plate frame','cleaning wheel speed sensors','car audio power wire','turnsignals','coolant system sensor','bench bleeder','baker','battery leads','auto free wheel hub','break path','brown royal','wiper blade assembly','water valve','sunbury','hvac cleaner','bosch-platinum 2 spark plug','brake accumulator','auto escape tool','carramps','fredericksburg','time rod','baking soda','air stocks','hot springs','tire pressure valve caps','tire parts','water control valve','5 w 20 motor oil','how to install side mirrors','accessory drive belt','shell rotella t','accessory switch','caliper lube','brake drum removal tool','change fan belt','brake pad pins','auto tune-up','recycled parts','fault','ring of excellence','white paint','rotor tool','1260','roadside flares','air cleaner mounting gasket','brake hose clip','reference sensor','control modern','rotor clips','by pass hose','rear catalytic converter','rhino auto ramp','clearwater fl','car engines','repair codes','torin 2 ton trolley jack','truck transmission','head seals','blast','car interior','aftermarket radiator','block cleaner','accessory belt tension pulley','car clothes rack','tire chocks','auto bumpers','automotive tool set','ramsey','replace sparkplug wires','frederick md','houston tx jobs','redtop','1 ton jack','racine wi','reset check engine light on','right rear hub assembly','how many spark plugs do i need','shut off switch','car lifter','a c air filter','wheel choke','breaker points','auto parts belts','crankcase ventilation','semi-metallic','plastic fan','brake pad grease','break fuse','fan rely','battery battery','high flow air filter','belt cleaner','price on water pump','farm truck batteries','battery post clamps','bedford in','positions','replace pads','crossfire oil filter','5157','full synthetic oil','fuel flow meter','tire products','recommended oil','high milage','dealer codes','right hub bearing','dc breakers','car part new','car cables','bosch cabin','tire spray','point gap','stuart','ski battery','piston sensor','car dent repair','archives','ba','drain brake fluid','car parts prices','rv deep cycle battery','disc brake piston installation tool','cooler flush','honda accord cabin air filter','lawn&garden battery','colored windshield wiper blades','brake tail lights','auto hoses','auto belt tensioner','how much for a fuel pump','pro gard','remy','prices for clutch','forever','deep battery','4 hid','calera al','check engine light help','wallingford ct','rear brake rotor replacement','radiator gauge','caliper pin boot','auto headlight restoration','status','top post terminal','changing a lower control arm','side airbag','red top car battery','free locked brakes','replacing emergency brake pads','advertising director','24 f battery','prices for spark plug wires','scribe','fuel economy gauge','side can tap','battery service','frontage','brake service kit','automobile jack','weather proof','tire tread depth','auxiliary emission control','prorate','herndon');
/* $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);
    }