/* Popular phrases - MARCOPROMOTIONAL - 13:9:26, Thu Mar 11, 2010 */
__SLI_ClientDefaults =
[
	['TextBoxIDCustom', ['w', 'w2', 'sli_search_3'] ],
    ['TargetURL', 'http://search.marcopromotionalproducts.com/search?w=']
];
var asPhrases=new Array ('pens','all','folder','padfolio','luggage tag','neck wallet','notepad','ribbons','mugs','lanyard','coffee mugs','keychain','umbrella','table cover','flash drive','writing pads','notebook','registration envelopes','magnet','badge holder','stress ball','pencil','portfolio','click pens','pizza cutter','blanket','name badge holders','tote bags','calculator','messenger bag','badge case','plastic bag','travel mugs','water bottles','badge organizer','pedometer','hand sanitizer','organizer','hse-6-c','key chain','envelope','badge insert','buttons','certificate','note pads','flashlight','usb','jackets','plastic envelopes','cups','ruler','candy','tape measure','stickers','bic clic','custom lanyard','journal','bags','mints','hat','drawstring','plaque','lip balm','seattle pen','ballpoint pen','mouse pads','pins','drawstring backpacks','clip','highlighter','binder','banner','wristbands','usb flash drive','koozie','sweatshirt','tote','bic pens','usb people','light pens','leather padfolio','woven lanyards','pink','ribbon colors','badges','lunch tote','flash lights','magnetic badge holders','zippered padfolio','mouse','name badge ribbons','t shirts','post it note pads','calendar','golf','napkins','frisbee','aluminum water bottle','scratch pad','first aid kit','wrist bands','letter opener','hand sanitizer pens','hse-6-na','tshirts','bic clic stic','foam badge holder','jar opener','hs-6slh','mardi gras pen','bic','post it note','awards','pill box','coffee travel mugs','plastic cups','plaque kit','name badge inserts','stress shapes','clock','business card holder','lapel pins','mousepad','poncho','sunscreen','luggage id tags','bracelet','drawstring bags','shopping bag','stadium cup','javalina pen','hse-6acl','white barrel','matches','sunglass','curvy ballpoint pen','sticky notes','polo shirt','hse-6-nc','key rings','wi-512','name tag','table runner','key light','tent card holders','table','hse','badge ribbons','horizontal ribbons','pens and pencils','roller ball pen','value click pen','id convention tote','magnet clip','grocery tote bags','t-shirt','fan','hs-6-nc','shipping','vinyl envelope','paper bags','raptor','zipper tote','sponsor ribbon','celebration','ticket stock','thumb drive','wi512','fun ribbons','baseball cap','a-6avl-we','laptop sleeve','breakaway','ly-703','business card magnet','memory stick','ice scraper','bag clips','key tags','translucent snap portfolio','retractable badge holders','balloon','grocery tote','double zipper neck wallet','lanyard with badge','sport string bag','insulated bags','display','journal books','tb-800','wi 512','name badge paper','advertising magnets','duffel bag','kitchen','bottle opener','adhesive name tags','windsor','gifts','golf balls','ribbon organizer','golf towel','computer','sport bottle','certificate paper','drawstring sport pack','a-6avl','lobo pen','carabiner','mechanical pencil','lighter','wp-500','speaker','mardi gras','planner','briefcase','translucent pens','keynote business tote','foam badge organizer','boxes','insert stock','beach ball','krypton pen','hsd-5','bookmark','pet','polo','od738','dw13b','wi07jc','instant plaque kit','mirror','fleece','50 year member','luggage tag laminating pouch','caps','giveaways','dy-601','sticky pad','luggage','hse-6-pc','chair','host ribbon','flash drive 1gb','lanyard 3 4','hs','bank','hse-9','big thunder','zip bags','first aid','non woven grocery bags','pads','badge wallets','vinyl portfolios','presentation folders','free','drinkware','sorbet','manicure set','neck wallet badge holder','swing tote','calendar magnet','tb-22b','wi-504','wi-01c','wp-501','post it','wi-07','wi-564-tt','gusseted pocket tote','plastic water bottle','hand fans','mint cards','wine opener','holder','messenger','dog','hs-6-pc','toothbrush toothpaste','office','hs-5-c','flyer','nail file','leather bag','wi631','the big chill cooler','water','ambassador ribbon','table tents','metal pens','photo frame','tbe-54b','blue ink pens','10 x 13 envelopes','beach','lanyard holder','wi-28pl','rain gear','wp-77p','vip','expandable conference folder','wi-07c','nwe 504','canvas tote','fleece blanket','can koozies','magnifier','pencil case','tb-02a-ny','windsor reflections writing pad','element','hse6c','hse-6-p','sanitizer spray','pocket screwdrivers','float','massager','throw','electronics','spooner mug','non woven grocery tote','nc-f','nc-r','envelope box','files','ax-3-c','hse-5-na','reusable bags','collapsible koozie','hsk 6-c','ly-13w','256mb flash drives','non woven bags','dw602','northwest','nylon drawstring backpack','hsj-6-pc','ga734','die cut handle bag','hs-5-nc','hs-5-pc','blue pen','erasers','rme','hse-3-p','hse-5','hst','embossed padfolio','hse-3','nw 20l','new products','hsed-6-nc','hsb-6-nc','leather','hsb-6-c','table tent card holders','twist pen','sport bag','inserts','badge board','raptor pen','sanitizer','magnetic name badges','chap stick','name badge','gel','clipboard','manicure','chocolate','silicone bracelets','slotted','clip name badge holder','rainbow neck wallet','exhibitor','wi-2pz','stapler','globe','vinyl folders','star','vienna pen and pencil','wi-615','adhesive labels','highlighter pen combo','nc-brb','clear folder','carnival tote bag','nwe-701','wp-49','metal water bottle','goofy pens','bic clic stick','digital picture frame','pin name badge holders','bamboo','spring water bottles','certified','flag pin','plastic pens','budget','pb-01b','32 oz water bottles','towels','galaxy','led key chains','timer','translucent writing pad','cooler','dy-501','gel pens','jotters','coasters','celebration tote','clip board','pf04a','bellini','computer bags','paper weight','correspondence folders','zipper tote bag','wired pen','javelina pens','transport','can cooler','auto','tb-45b','500-g badge holder','wi-564 sr','memo clip','destiny journal','bulldog clip','notebook with pen','spring water','pink ribbon','vest','pink tote bag','route 66','wi-513','meridian','wi','solis','conference staff','large tote bags','ga-71','lotion','pocket knife','golf umbrella','foam holder','expand a board','laser inserts','tbe-704','a-6li','wine','cotton sheeting','grocery bag','reusable grocery tote','translucent horizontal envelope with velcro closure','crayons','vinyl clipboard padfolio','document bag','curvy','marco water bottle sport portfolio','paper mouse pad','window pen','tool pen','laser lights','paper tote bags','beach umbrella','sport pack carryall small','ly-99-w','seiko label printer','custom woven lanyard','tri-band','message pen','wi-19','lamis tote','certificate frame','of-802','chip clip','board ribbons','badge holder with clip','drive','baseball','highligher pen','stainless and tumbler','tissue','grocery','post-it','wipes','wi-722','albany pen','glossy presentation folder','full color pens','orbital key ring','picture frame','swoosh brief','pink pens','bandaid','tb-57','linen certificate frame and folder','a-7li','presenter','bbq','sunblock','magnet picture frame','hand','flash drive 2gb','tb531','digital buttons','incline tote','plays well with others','sun','munch it clip','can coozy','business card','picture','stainless steel water bottle','ribbon case','certificate folder','pill','badge stock','pizza','worlds best pizza cutter','marco dual print badges cord set','printed buttons','grip it luggage','adjustable lanyard','dw-703','backpack tote','speaker ribbon','credit card','post-it value','eco-friendly','cell phone holder','mee-702','convention bags','coin','keychain light','envelope openers','new member','wi-614','piccolo mini tote','pf-520','nylon totes','pf-87cl','tb-02a','wi-564-sr','domain mug','nw500','cotton totes','sharpie marker','desk clock','10','wp-67','sport pack carryall','pf-81','aw-48','nametag inserts','document','cooking','pocket notebooks','mu-03a','natural','lunch bag','tent cards','zipper bags','wi-519','pad holders','sewing kit','a6avl','laminating pouches','stainless steel tumblers','krypton','tabs','director','tb-31p','past president','key chain lights','rme-32-bl','full color','zipper','brite loop frosted shopper','mini tote','media','pf87','vi-5t','can strain-it','portfolio bag','a-tent-we','delegate packet','hi-604','candy bars','magnifying ruler','wp-512','computer cleaners','phone','poly portfolios','conference committee','magnetic bookmark','stress','travel','business magnet','tbe12a','envelope pocket','medical','javelin','keynote','fo22','dw-524','stain remover pen','stock ribbons','student','alligator clip','secretary ribbon','3 ring binders','cat','corporate apparel','stylus','paper gift bags','spatula','dwe-724','large pens','wp-l67p','correspondence','event tickets','brite liner','uniball pens','tb613','blank badge stock','tickets','totebags','yo yo','translucent envelope','recycled notebook','lunch','vinyl name badge','pen and pad','tbe-700','ribbon holder','badge cord combo pouch','tb-803','paw print bag','nylon drawstring','wb-05b','signs','towelettes','office supplies','spicy poblano pen','blank insert stock','envelope pocket packet','scissors','cube notepad','duffle bags','aw-34n-pr','golf tee','closeout pens','shaped magnet','recycled pens','baloons','beach bag','chain','stadium seats','bic stic','usb hub','lunch cooler','microfiber','nw-pthatt','cosmetic bag','polypro filefolio','keychain lanyard','javelina','candle','wi-602','backpack','business card luggage tags','wi-07e','usb pen','tyvek wristbands','business card pocket magnifier','zippered neck wallet','polaris','non-woven tote','gf-502','wp501','bottle opener key chain','6','mini bag','2 pocket','wb-06b','tyvek wrist band','tb-721','black lanyards','ballot boxes','lip','promo tote','toys','wall calendars','golf balls and tees','pf-04a','a-6bdr','seattle','first time attendee','wp-93','gym bag','chapter member','badgeholder','gt-600','wi-542','tli-ls','bullet','cutter','adhesive clips','wi 19','ga71','wood','bic media clic','pf-518','wi-741','clear luggage tags','tees','javalina','ready to wear badge','tee shirts','lamis','stain remover','bead chain','tb-804','sticky name badges','translucent portfolio','medium grocery tote','pullover sweater','wp-9','welcome','3 button','tent holders','sweet slinger','plain laser insert','cotton bags','sign holders','set','h1-exhibitor','tb-614','conference bags','bk02a','white mug','color spine recycled notebook with matching pen','magic','screwdriver','soccer','paw','pully pals','lanyard pens','sponsor','vi-5t-bl','title inserts','tb-613','orbit','wi-32b','trendsetter vertifolio','can lids','wi-01t','wi-33b','we-714','partner','budget lunch bag','color spine recycled notebook','tri highlighters','top loading badge holders','wp 93','insulated cooler bag','br706','can','certificate holders','wi-554-tt','posted notes','participant','swivel desk clock','spice spoon','bronze sponsor','crossover tote','transport it tote','tinted badge holders','tb 29of dome sort','papermate','tbpo','tb67','statesider','tb31p','wp606','tbe704','wi519','wi19','cell','wp7','pb','bic tri','compact mirror','sport pack small','travel wallet','sharpie','wp-711cl','blank laser insert stock','tb515','wheel bag','badge lanyard','preassembled badges','twister mug','bellini tote','plastic hand fan','bk508','panelist','software','statesider pen','stainless water bottle','caravan pen','wheel','book mark','tbe-546cl','wi-610','wp-543','star ribbons','badge ready','spiral note book','carabiner flashlight','tb55','place cards','tiger','tri pen','council member','thermometer','cappuccino pen','wi-507','certificate plaques','plastic keychain','colored badge holders','coffee tumbler','clip on badges','check fraud','wi-623bcl','paper mate pens','portable electronics case','president\'s club','printed laser inserts','second place ribbon','compact umbrella','security','cushion','pet kit','smart label','president ribbon','plastic pouch','tb-514','wi-670','pen with sticky notes','weather','wi554','wall street','technology','bic adhesive notepad','tb-503','budget boat bag','pad folio','wi-809cl','prince','weather station','spray pen sanitizer','whistle','talking stress reliever','paper mate tri edge','planning committee','snap it up tote','bic magnet','promotional gift bags','seat cushions','pf-519','small paper bags','bic solis','treasurer ribbon','brief','pen notepad','pf-506','black mugs','we-503m','click','penlight','clean cut aluminum bottle','snuggie','containers','tb614','clip 6','top zippered neck wallet','badge pin','wi-14cr','corporate pen','wp-541','baby grand tote','special guest','twist','show me the money','wi-607','windsor reflections','tb 713','tb52b','poly envelopes','pbe-602','seaside beach tote','caddy bag','state board','tote bags plastic','pique polo','catch-all tote','papermate sport retractable pen','security ribbon','secretary treasurer','sign wave pad','clipboard folder','corporate member','second vice president','tb-561','bic velocity','scale','pf-71wsd','tb-52bsd','book of post it note','bic business card magnet','preprinted name badge','wi-611bt','color block tote','tbe-619','computer backpack','citation','providence pen','cocktail','closeouts','cardboard','supervisor','stitched organizer tote','pf-87sd','wp-702','bic wide','bic pen roller','course director','bic wide body pen','scholarship','catch all','serve','wi-674','sugar free mints','badge cards','tb-612','silver ribbons','tb-63','contour','shoulder bag','combo pen','poblano pen','writing','christmas','tb-541','policy','pr-4 keyboard calendar','stainless water bott le','christmas ornaments','woven bags','slp pro','wi-570','wi-59bsd','stinger','bk-503','bic ice','picnic blanket','we-22b','treasure chest','california','senator','press','wi-627','tbe-705','peel','blank avery compatible insert stock','breath mint','pf-509','wall street padfolio','wide body','bic brite liner','tb-501','pf-521cl','pacifica pen','bic round stic ice','pf-703','trade show badge caddy','post it flag pen','pen knife','wi738','chalet','wi-616w','wi-19ce','sideloading','wi-749','chaperone','plush blankets','tb-46b','wi-608','color insert stock','bored member','photographer','princess','mastermind','scripto','wi710sd','basting brush','tb-527','padova pen','wp-64jr','pac','curvy ballpoint','packaging tape','wi658','pf-09asd','spin','palmiro','bic message','tb 531','ceo','tb 51bsd','clip on name badges','the curve mug','bk-705','wp-704','travel tumbler','tb625','tb519','bic pro gel','tb-24b','sporty portfolio','perforated paper','steel blue','tb-60b','bk609','bic note pad','wp-11','trustee','writing pens','metallic pen','pf701','clear name tags','clear plastic bag','wi-655','tb612','chair elect','ceramic','wp-fnj','wp-602','plush dog','post-it pen','blue gel ink','wp601','wp-601','bic board room pen','marco haul-it-all tote','wp-603','bk-703','convention ribbons','bu 600','conference co-chair','tennessee','wi-54b','wi-58bsd','wp 705','border badge holders','bic z4','tb16','windsor reflections jotter','wp-23b','wi18b','barrister auto open umbrella','mee','wp63','tb16cl','wpe-709','pf 11','swoosh tote','tb510','wp16cjr','pf 71w','providence','wi705','wi-632','bk-58-24hr','tb-559','tb-59b','wi-700','tb 20b','permanent marker','tb-31psd','pre printed badges','wi-523-24hr','pf502cl','polymer','tb-31p-bkag-bk','wi-533t','wi-731','tb-620cl','tbe-715','wpe 709','tb posd','windsor jotter','tb-26b','wi-505','paw clip','pf-707','we-704','pfe-523','tb-29sd','pf-522','wb04a','butterfly','pf-11sd','blue tote','bk 04a','wp-707','tb-23b','tb-560cl','bk-87','pf 74','wi-611bw','post-it flag highlighter','tb-562-24hr','pf602','wi-743t','pacifica','wpe-532','badge card stock','pf-704','co chair','pf-701','pf-88','tbe619','wp21b','tb-tr16','badge holder note jotter','wp602','chrome','corn pen','pr-19a','tb-711','wi-608s','wi-725','tb 714','tb509','pasta','tb25b','wi-735','carbon fiber','stride mono pack','string back packs','wb-08b','wp-708','wi-634','tb518','wp-706','tbe-708','budget tote','tb602','tbe-555','br-601','wi-619','tb-516','pf703','tb-560cl-24hr','wp538','pf-602','bundle','bk-508-24hr','bk-05b','wi 569','paw print','bk 706','pivot pad','wi-611','tb 609','tb-51b','single strap shoulder bag','coleman','wi-545','sport portfolio','tb-716-nl','ly 13 r','pf-521','pb01b','pb-02b','wi-622','wp11','back to basics tote','wp-604','slp-srl','wi-564cl-we','lm-clipa-che','lye-509','presentation boards','wi 58b','white pen','cotton','carnival bag','t-be-710','wp-517','wi-565','pac contributor','blank ticket stock','tv-511','mag-lites','ly-110-r-cc','bk519','bk87','pr35a','me504','transparent bar badge holders','ly98w','pin-clip','two tone','bk400','wi533','spin doctor','mb702','printed neck wallets','beechies gum','pf-74','me-600','wp523','wi03a','wp-521sd','ly-94sd','pr-16a','bic round stick','coordinator','beechies','bic stick pen','pb-509','six pack cooler','tb09a','bk505','spin doctor writing pads','wi-533s','silicone','pf 521','we-505w','we-505','pbe 602','bk-604','medium calendar magnet','hse-3-na','tb560','widebody','wi564tt','tb 557','wi24','hse 5 pc','wi-59b','wp-539','pf-601','cool','pb-508','hs-e','bk-700cl','hse-6acl-nc','hsj6pc','task force chair','pf-606','tb-706cl','hsj 6 pc','hsse6p','bi-fold neck wallet','hse-3c','hst-6-pc','hse6p','bk-609','hst-6-c','wi40b','magellan','tb-600','wp-701cl','hse 6 nc','candidate','wp-24b','bk-01a','wi-649','wi 564 sr','bee guard','wi-58b','bk-504','bk-608','wi-61b','tbe-540','wi-563','tb-626','wi-654','slp-2rl','pfe 523','hsed-6','wp503','bic solis retractable','tb47b','lm-95s','bk-511','bk-610','tb24b','h1-2742','past national president','tb 26b','carry all meeting bag','hsse-6-p','badge rack','sticky name tags','marco polyester badge pocket','cotton drawstring bag','hse-5-pc','wi-513s','pa04b','b-32ex','tb-60zsd','wi-609gt','loop strap','pf-14b','pf522','technical chair ribbon','wi-308','pf-09a-bkgy-bk','pfe-517','mee 605','h2','pf-02a','translucent badge','hs-6pc','hsb-6-pc','pr-42b','wi 54b','bic neon pencil closeout','wi533w','sport shirt','we-505m','pf186','tb 18a','wi-716cl','wi505','bk606cl','tb541','lye-509-r','bk-701','wi-717cl','triband pen','mu10a','bic wi-19','pf15b','hs-nw5','wifcg','wi-503','hsed-5-pc','wi-12b','hssd-6p','bic-clic-stic','moderator ribbon','hssd-5-nc','tb561','hse6-c','campaign tote','business messenger','bu2','wi 542','bk-606','mentor','legislator','mini cubicle clip','wi-17b','wi-13b','tb185','ly-102-r','tb-53b','pr-46','back to basics','tb-604','wp-530','hs-3','pf 506','hampton portfolio','triedge','pbe 601','co-host','wi-647t','samba','hsse-6','luna','tb-185','hs6m','hst-6','hse-3-nc','wie-719','travel mug envy','poly pro flat tote','wi-62b','pb 08','widebody message','wi607','wi-07t-24hr','bk-519','wp-542','ly-102-r-cc','committee h1','tb67ex','wi-703','bke-518','wi-626','due-501','pf-88sd','data card holder','small poly pro flat tote','poly tote','wi-668','marker board','pb508','tb 562 24','tb-532','tbe-624','wi-701','wi-702','wi-676','hse-3-pc','wp603','wp-523','wi-669','champion','brown grocery bag','pf519','wi-624','hse-3-m','h1 vip','wi628','mini zip lock','hs-6nc','tb-pvt-rd-rd','wi653','tb514','h1-host','slinger','ly 126at','pf','wpe-537','medium poly pro tote w gusset','wi-16gl','ly99','translucent organizing pouch','ly13w','h1 blank','tbe 501','tb-540','wi612','two color ink pens','ly-600','post value','paramount tote','wie-626','h1-2443','wp-516','cardboard jotter','cardboard pivot pad','h1-diamond','transport display box','wi717cl','pf88','luggage scale','bistro','wp527','thumbprint tumbler','single strap','wi-07c-24hr','wi-06a','pr-06a','badge ticket','tv-605','haul it all','dw-02b','tb600','wi01t','dw-22','wi-712','dw 13b','wi-34b','wi-18b','hsd-6c','marco side','wi545','medium poly pro','tb-605','side accent tote','chairperson','wp-700','pen with eraser','dw601','hs-6-p','board member vertical ribbons','holiday ornaments','pr-13a','ly-99-r-24hr','weekender','tb-523','bk05b','sicily','ly 501','poly tote bag','wi-637','bk350','tb-29-24hr','be happy','wi 08a','wi-630','tb525l','tb500','bic ultra thin','band-aid','tv-601','ly-509','wi-506','windjammer','wie-568','paper mate breeze gel pen','press ribbons','wi-618','tb 509','bk-02a','pf506','wi-68','dwe615','tb-55sd','we-607m','mini jotter','hse-acl','tb 09a','somebody','wi608s','wi56b','local arrangements','titles','tb-pvtsd','tb-552','casual day briefcase','bk-605','wi50b','bke-517','sponsor vertical ribbon','due-604','tbe-545','wi 564','h-1 exhibitor','tbe-623','hs-6m','wi-503-24hr','wi-606','stack-a-ribbon','president and ceo','pf 87','wi-544','wi-66b','wi-67','large piccolo tote','tb-57sd','hs-5pc','h1-880','ly-94','wie','transpire deluxe tote','trouble maker','the answer is no','wee-700','tb-524','tv-608','br','coordinator ribbon','stitched organizer','wi 603','wi-552','campaign cotton tote','wi-533y','classic cotton 6 oz convention tote','h2-custom','pf74','lm-mag','bk58','press and stick','we-25bsd');
/* $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);
    }