/* Popular phrases - DHCCARE - 21:28:54, Fri Jan 27, 2012 */
__SLI_ClientDefaults =
[
    ['TargetURL', 'http://skincare.dhccare.com/search?w=' ]

];
var asPhrases=new Array ('velvet skin coat','deep cleansing oil','q10','eye bright','k178','makeup','soap','3940','olive oil','300','3941','cleansing oil','velvet skin coat makeup primer','eye cream','lip','special sets','sets','kbbe','lip cream','knar','olive oil cleanser','mascara','mild lotion','3192','primer','eyelash tonic','1','eye','93','acne','71','facial scrub','rewards store','mild soap','moisturizer','178','coq10 products','toner','lipstick','q10 cream','olive oil moisturer','mini products','shampoo','concealer','q10 base makeup','foundation make-up','acerola','cleanser','ceramide cream','3690','olive soap','13','mnm','104','178 velvet skin','550','velvet','lip products','scrub','foundation','398','3913','aha','hair care products','concentrated eye cream','vitamin c','olive leaf cream','oil','extra nighttime moisture','antiox c','coenzyme q10 cream','hand cream','egf cream','makeup remover','extra concentrate','q10 lotion','d13','makeup base','mini','mask','66b','rose beauty eye zone','blush','sunscreen products','ceramide','mineral mask','wrinkle essence','lip moisturizer','moisture care lipstick','969','eye shadow','mec','kqcr','oil cleanser','velvet skin','velvet skin coat duo','72','q10 milk','sac','3958','deep cleansing olive oil','neck products','neck','kdcm','z1','403','cotton pads','wrinkle filler','travel sets','body care','lipstick colors','eye makeup remover','3896','powder','3191','eye treatment essence peptides','q10 moisture care color base','z300','q10 eye cream','3190','sunscreen','vitamin c products','hair','liquid foundation','samples','soap case','pore','tourmaline pack','head oil','silky cotton pads','olive','blotting paper','rosacea','nighttime moisturizer','retino a essence','q10 products','98','3913 black','bps','skin softener','vitamin c essence','2','base makeup beige','714','olive oil swabs','serum','11','coq10','salicylic face milk','pure soap','301','3047','swabs','rich moisture','salicylic','dark circles','acne spot therapy','clarifying pore cover base','d14','hair oil','aha cream','mrm','76','hand','retinol','renewing aha cream','199','src','egf','rose beauty eye zone treatment','bcb','base makeup moisture care','water base moisture','mascara perfect pro double protection','rose','eyelash','brush','white milk','3689','moisture care liquid foundation','olive leaf','soothing lotion','after bath hair treatment emulsion','washing powder','moisture care color base','3652','acerola gel','534','lotion','age spot treatment','tol','mature skin products','face milk','292','eye liner','toner for mature skin','3915','alpha arbutin products','platinum silver nanocolloid products','nuance hair wax','face wash','men\'s products','mec eye cream','k2075','white soap 3-pack','kglo','olive leaf milk','kpsn','eye bright gel','rich and moisturizing treatment','198','white sunscreen','kwst','balancing lotion','wrinkle','white soap','ksas','eye wrinkle stick','cleansing foam','make off sheet','eye care','115','eyebrow perfect pro pencil','collagen products','neck cream','daytime moisturizers','acne products','concealer dark circles','milk','coenzyme q10 lotion','715','eyeliner','3020','makeup primer','775','eyebrow','platinum silver nanocolloid cream','eye off shade','collagen','body cleansing sheets','hand soap','ftbs','remover','after bath hair treatment oil','pore minimizer','357','spf','451','conditioner','ffcc','lip color','m21','neck treatment essence peptides','eye zone treatment','hair care','q10 moisture care liquid foundation natural ocher 02','pore cover base','d25','dark spot treatment','dhc rewards store','192','lip liner','eyebrow pencil','peptides','retino','coenzyme q10 milk','3905','extra concentrate collagen','q10 concealer','eye shadow colors','lip balm','ceramide milk','acerola cream','26','hair emulsion','arbutin','after bath hair treatment','makeup remover sheets','age spots','hair wax','970','3897','z550','102','3021','298','44','coenzyme q10','tourmaline','dark spots','olive hand cream','bhr','exfoliate','8','z5','eye shadow palette','olive oil soap','natural radiance set','600','coq10 cream','shipping','3917','natural ocher 02','3950','eye mask','cotton','3904','facial brush','velvet coat','352','k2074','charcoal shower gel','mild touch cleansing oil','emollient balm','3002','3122','hair conditioner','color base','coq10 lotion','face color palette','3860','cleansing milk','coenzyme q10 gel','690','make off sheet refill','3707','732','men','aha products','klve','z192','bgt','d26','lash','aha hand revitalizer','retino-a','z2146','679','eye zone','3189','soap tray','acne spot treatment','vitamin e','fftp','lotions toners','hand care','311','3908','q10 soap','spot treatment','3098','neck firming','acerola lotion','3','fmtp','192 olive soap','white cream','ceramide quick','platinum silver nanocolloid milky essence','z2144','kbea','even skin tone','arbutin white milk','aha body silker','mens face cream','eyebrow perfect pro powder','aha renewal','189','coenzyme q10 eye cream','269','aging skin','puff','804','183','cleansing sheets','sweetpea','pads','olive essentials set','brightening products','scalp cleansing shampoo','lash tonic','brown rice','tocophero e cream','neck peptides','594','refill','make up remover','nanocolloid cream','mild lotion 2','q10 base makeup beige','hair treatment','food','bar soap','cleansing','q10 neck cream','pressed powder','74','68','170','169','q10 facial film soap','travel size','olive corn body scrub and polish','white lotion','z2','eyeliner perfect pro pencil','body scrub','silver','deep cleansing','773','body cream','187','silky cotton','767','ffbb','flds','highlighter','sun damaged skin','11 make off sheet','shampoo refill','coq10 eye cream','sheet','anti aging','kffqa','3187','769','deep cleansing oil 300','kfsd','fwwg','extra','3001','eye strips','pk04','bbs','hand soap refill','coq10 face milk','803','eye stick','sensitive skin','white stick','176','cotton swabs','velvet skin coat primer','base','wrinkle essence serum','q10 moisture care liquid foundation','270','body moisture','washing puff','white','nanocolloid','3907','body silker','salicylic acne toner','skincare sets','179','73','arbutin products','makeup powder','eye brow','puffy eye','nighttime','toasted pasta','leave in hair treatment','mist','wrinkle stick','olive soap bar','296','after bath','firming','acerola extract','alpha arbutin milk','3107','olive leaf lotion','268','soap sheets','rose beauty','eye cream care','q10 foundation','organic','coq10 complete care set','17','lush lips','skin coat','make up','salicylic set','lip gloss','mens moisturizer','revitalizing moisture strips','cuticle','eye shadow moon','facial film soap','peptide products','q10 gel','hair treatment emulsion','vitamin c white stick','face powder','makeup concealer','771','body soap','hyaluronic acid','2001','platinum silver nanocolloid','399','daily moisturizer','night cream','eyelash care','moisture lotion','pure soap large','alpha-arbutin white products','brightener','rice','green tea shower gel','hand revitalizer','3954','3955','corn olive oil scrub','3894','ffml','foundation moisture','deep cleaning oil','intensive moisture','combination skin','discoloration','revitalizing moisture strips eyes','platinum silver nanocolloid set','oil blotting paper','291','dhc deep cleansing oil','silver nanocolloidal cream','eyebrow perfect pro holder','fcpp','3951','olive oil products','lip care','velvet skin products','base primer','197','silver nanocolloid','olive oil cream','foaming face cleanser','alpha arbutin white cream','3898','172','coenzyme','ceramide body lotions','ingredients in your products','moist conditioner','cleaning oil','mascara tubes','spot therapy','669','brow','neck strips','acerola sets','3895','eye and lip makeup remover','q10 water mist','770','#550','188','quinoa bowl','oily skin products','olive corn','#mnm','moisture care','eye brow pencil','essence','3100','deep','neck treatment peptides','olive soap mini','arbutin white cream','dry','q10 liquid foundation','after bath hair emulsion','293','olive leaf set','mild','bright','alpha','eye brightener','platinum','bpc','firming cream','acerola products','cleansing sets','salicylic spot therapy','mature skin','dark circles under eyes','q10 base make up','275','q10 base','3861','dry skin products','perfume','905','sensitive','shower gel','touch up trio','3103','q10 face powder','5','772','ingredients','eye care products','640','olive oil face moisturizer','baby','177','lip liner pro','coq10 moisturizers','beauty products','apricot scrub','mild soap 4 piece set','dark eye circles','alpha-arbutin white cream','alpha arbutin','fine line','q 10 cream','3091','color corrector','mini\'s','platinum silver','undereye circles','brown spots','fmhs','dhc ceramide','kfbrb','eye peptides','soap refill','cream','lip color perfect pro creme','eye gel','eye lash tonic','mild body shampoo','liquid makeup','sun','eye lash','make-up','c','haircare','eye wrinkle','salt scrub','imperial green tea shower gel','eye concealer','lip color perfect pro palette','rich moisture lotion','velvet skin duo','wrinkle fighter','soap set','acerola essentials set','body','pore refining','light smooth shampoo','moisturizing clear soap','3095','gel moisturizer','kmsc','a-arbutin white cream','moisture lipstick','gentle cleansing','salicylic acne wash','palette','skin sets','kqgl','77','olive leaf extract','night','double cleanse duo','olive set','774','kqfm','moisturizer with sunscreen','make off','tighten','ffqa','day cream','soap dish','matte primer','olive oil makeup remover','product sets','charcoal','scar','deep cleansing oil set','pacific rim salt scrub','acne set','travel soap','2001e','silker','tuna and pasta','567','eyebrow perfect pro','mild cleansing oil','neck treatment','oil swabs','181 soap tray','compact','99','oil moisturizer','wn12','powder cleanser','coq10 milk','#2','nuance','olive oil set','squalane','vitamin c moisturizer','scrub face wash for men','body shampoo','redness','a arbutin cream','q10 cream 550','3097','emulsion','deep wrinkles','q10 makeup','body cleansing sheet powder','alpha-arbutin white lotion','hand lotion','q10 color base','aging skincare','drink','beauty basics set','#13 lip cream','tol soothing lotion','mini moisturizers','ceramide body cream','mascara perfect pro','circles','scalp oil','hair treatment oil','white arbutin','bha','397','q10 eye','3087','mini deep cleansing oil','beauty essentials set','night time moisturizer','a arbutin white mask','alpha arbutin white powder','balm','antiox','mrm moisturizer','water','paper','smooth','transparent powder','line filler','skin brightener','spritz','wipes','eye makeup','mouth','white mask','coenzyme q10 hand cream','wrinkle filler 311','100','gluten free','768','firming neck cream','moisturizer with spf','bath soap','coq10 hand cream','spot','neck care','base makeup moisture care liquid foundation','blotting','pasta','oil remover','madras lentils','pore cleansing masks','gel','alpha hydroxy','face mask','skin','foam cleanser','product samples','after bath hair','dhc coenzyme q10','perfect pro powder','#66b','protein gel','rose beauty eye','creamy coverage','salicylic acne set','cleans','tonic','moisture care lip gloss','#2 mild soap','face cleanser','body lotion','q10 set','moisture care liquid lipcolor','wildflower','gift sets','oil skin','green tea','full coverage foundation','body wash','ocher 3','olive milk','mini q10 cream','q10 powder','569','salicylic acid set','extract','body oil','cleansing products','614','light moisture','lightening','concentrate','mild lotion ii','silky','rich and moisturizing hair treatment','3102','hair products','face cleanser olive oil','eye off-shade','skin scrub','acne wash','extra night time moisturizer','under eye care','sun cream','3906','eyebrow powder','natural ocher','ve','mild soap set','skin care','dhc eye bright','wrinkle fill','cleansing powder','foaming hand soap','kffs','coq10 gel','seaweed concentrate','day moisture','combination skin moisturizer','hydrating ceramide body cream','kaes','case','film soap','mild lotion toner','acerola 100','vitamin','body wipes','moist color base','q10 body gel','eye pencil','#178','eye products','accentuate','strips','ginger sauce','tote bag','clarifying','olive cleansing oil','touch up','q 10','vitamin e cream','eye concentrate','3088','eye off','spray','olive cream','pure soap case','scalp','q10 moisturizer','moisture care color','alpha-arbutin','deep oil cleanser','quinoa','spot-treat','white powder','antibacterial hand soap','olive-corn body scrub','q10 moisture care foundation','clementine','dhc velvet skin coat','matte cream','dark eyes','wt01','aloe','wax','moisture spray','light and smooth conditioner','aha hand','body shampoo refill','special','facial','facial soap','smoothe skin','q 10 base makeup','moisture care foundation','acid','q 10 milk','treatment essence','clear soap','fragrance free moisturizer','dry skin moisturizer','lip color perfect pro long last','concentrated cream','lip creme','acne treatment','corn scrub','charcoal shower','lift','moisturizer for dry skin','dhc eye cream','lcp05','hydrating ceramide','coq10 cleansing sheets','face cream','arbutin milk','moon','eye retouch','milk cream','sugar','moisturizing cream','liquid moisturizer','less hair','make up sunscreen','eye treatment','eb03','for men','skin tightening','salicylic acid','dry skin','olive leaf products','three beans','face powder yellow','uv','beige','treatment essence peptides','acne care','neck treatment essence','eye moisture','water mist','face','mild oil','oil free','dhc cleanser','eyeliner perfect pro powder','olive corn body scrub','summer tote bag','oily skin','makeup puff g','body cleansing','pore cover','eye liner powder','lip wrinkles','dhc after bath hair treatment emulsion','mens care','skin lotion','q10 facial film','beans','antibacterial','shine','oil makeup remover','face primer','skin brush','shrink pores','anti aging moisturizer','ur cream','cleansing soap','freckles','eye liner perfect pro','dhc coenzyme q10 milk','eye wrinkle cream','makeup highlighter','milk cleanser','men\'s acne','mist toners','face men','face velvet','olive oil eye cream','lip treatment','sulfur','eye and lip','olive swabs','skin primer','duo','mascara perfect pro double protection black','recipes','moon shadow','582','alpha-arbutin white powder','body sunscreen milk','mini olive oil','q lotion','bestselling beauty essentials set','men products','#969','film strips','eye brown','rose treatment','olive leaf oil','rd01','foam','eyeliner pencil','lactic','alpha arbutin cream','lip plump','face pads','body sheets','after','#72','milky','olive moisturizer','daily','181','olive essentials','salicylic milk','glowing results skincare set','sodium hyaluronate','velvet touch','olive oil body scrub','olive essentials mini','fill','acne fighter','skin smoother','z550 mini','creams with peptide','aging eyes','coq10 concealer','fbrb','deep cleansing wash','vitamin c creams','tone','q10 mist','timeless beauty set','face oil','eyeliner holder','couscous','pacific rim','powder puff','liner','ebp03','blemished skin','cucumber','bangkok beans','olive oil lip','germinated brown rice','diet','skin firming','deep cleanser','face serum','liquid','pk05','brown sugar','eyebrow perfect','cleanser puff','sand copper','buff','head shampoo','extra nighttime','eye color','under makeup moisturizer','olive corn scrub','butter','filler','eye essence','dhc facial scrub','body scrub polish','q10 mask','matte','rich','pencil','fade cream','mild body shampoo refill','oil soap','neck essence','hyaluronic','face brightener','lentils','moisture care pressed powder','dhc coenzyme q10 cream','q','oil paper','eyebrow brush','rose eye','olive-corn scrub','3108','q10 toner','271','leaf','ffgs','ebp01','moisture care liquid','olive essentials mini set','matrixyl','581','wrinkle cream','reduce pores','placental','bath','blemish','off shade','three beans with sweetcorn','moisturizing soap','light and smooth','shaving cream','amino acid','acne therapy','retouch q10','spray mist','milky silver nanocolloid','pore base','organic brown rice bowl','balance','water lotion','make off refill','face color','double protection mascara','liquid lipcolor','vitamin c stick','nanocolloid set','facial cleansing','water moisture','lip color perfect pro','grape seed oil','no shine','hydrating makeup remover','moisture treatment','tocophero','cleansing cloths','uv protection','q10 body soap','face exfoliator','apricot base makeup','coenzyme cream','lip palette','age sets','deluxe cosmetic pad','mild soap mini','lemon','retino a pack','antioxidant','use points','mini soap','body bar soap','eye offshade','soy','olive products','platinum silver lotion','cleansing oil mini','lemony dill seasoning','comments','sunflower oil','coq10 moisture care color base','pk03','neck creme','soft touch cleansing oil','hair deep condition','clarifying pore cover','stick','coq10 soap','rd10','q10 pressed powder','quinoa recipe','under eye','softener','makeup puff','skin softener toner','oily','3100 or35','moisture strip neck','dhc minis','sc10','compact powder','#178 velvet skin coat','a-arbutin','soy sauce','639','klls','alpha-arbutin products','color','pk61','color correction','care color base','mild l','dry hands','shea butter','lush','mild cleansing lotion','spotlight','84','skin spots','q10 hand cream','mild touch','velvet cream','body sunscreen','acne spot','corn','lipcolor','apricot primer','el01','ceramide lotion','loyalty discount','591','q10 mini','apricot','olive hand','perfect pro','olive oil lotion','reduce eye puffiness','nutrient rich eye strips','glowing results','heavy moisturizer','treatment','all q10 products','customer number','hibiscus','brightening concealer','lip lines','velvet duo','face moisturizer','q10 face milk','hemp','silk','deep cleansing mini','eye treatment essence','moisture strips eye','concentrate collagen','puffiness','face powder pink','dhc cream','essence c','velvet primer','q10 moist color base','face toner','skin milk','coq10 mini','sa01','pacific','white wine garlic','alpha arbutin white lotion','neck serum','863','uv moisturizer','perfect pro eye','dhc ceramide cream','olive lotion','man','paper mask','arbutin white lotion','moisture base','perfect pro holder','moisture care liquid lip color','makeup sheet','herb spice medley','under $5','moisture care lip color','dhc q','eye palette','prime','cleansing brush','mild lotion mini','head','dhc silky cotton','mild body','after bath treatment oil','dhc q10 cream','q10 cleanser','antioxidant serum','remove wrinkles','chest neck','cream for men','lip case','coenzyme eye','customer favorite','eye shade','lips and lashes','tuna','lip and lashes set','white toner','retinol cream','q10 neck','waterproof','applicators','velvet skin coat cream','salicylic acid face milk','dhc q10','vitamin e stick','vial','decollete','oil wash','deep cleaning','powder blush','coq10 mist','coenzyme q','timeless','coenzyme q10 water mist','conditioning','lightweight moisturizer','makeup moisturizer','calming cucumber','sun damage','olive oil scrub','bestselling beauty essentials','older skin','coverage','lipstick case','natural radiance','q10 moisture care pressed','rs08','skin cream','olive oil hand cream','shadow','eye treatment peptides','blotting lotion','career','skin silker','product lines','olive oil hand lotion','nano','make-up cleansing cloths','platinum silver nanocolloid milky','renewing cream','pink','tocophero e','egf product','white spf','platinum set','clear skin','el02','adult acne','171','even tone','olive cleanser','ebp02','shimmer','571','after bath hair oil','oil mini','moisture color base','sebum','tray','mild cleanser cream','acne s','oily skin set','deep oil','deep olive oil cleanser','after bath emulsion','mild toner','q10 primer','dhc white','coat','after bath treatment','alpha-arbutin white','dhc lip color','skin care spf','c powder','olive oil toner','3 bean','so','eb04','cosmetics','dhc platinum','c stick','q10 moisture care color base apricot','q10 cleansing sheets','q10 line','dhc olive','mature skin soap','eb02','face wipes','salicylic toner','coenzyme q 10','uva','face film','platinum silver nanocolloid lotion','calming','complexion','fresh face set','cell','q10 moisture care','skin cleansing','eye moon','toning mist','moisturizer for oily skin','elp02','khaki eye shadow','q10 facial','clog','eye essence peptides','oil makeup','shades of eye shadow','beauty','corn polish','coq10 foundation','skin bright','olive body soap','olive oil body cream','sc01','alcohol free','moisturize concentrated eye cream','moisturing vitamin e','s wrinkle essence','coq10 color base','celestial shades','#403 extra concentrate','cleansing duo','coq10 cleanser','olive face oil','olive polish','shower sheets','olive oil hair','awards','olive oil bar soap','coq10 film','shea hair conditioner','3 soaps','sulphur','olive bar','#732 q10 body soap','organic olive oil','3863','olive oil polish','alpha special set','care sets','e v olive oil','salicylic spot','corn cob','sensative skin','skin clearer','corn oil','shade','skin cleansing brush','mild skin lotion','coq10 cream mini','s velvet skin coat','make-up apricot','18mea','eye powder','coq10 powder','s olive leaf extract','olive leaf body scrub','moisturizing stick','environ','skin gel','coq10 face powder','acne help','makeup puff #905','severe acne','all soaps','signature','wrinkles around mouth','eye area','camelot','skin puff','alpha milk','after hair','olive head oil');
/* $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);
    }
