/* Popular phrases - KARENMILLEN - 10:59:35, Sat Jan 28, 2012 */
__SLI_ClientDefaults =
[
    ['ShowBrandingFooter', false ],
    ['IE6SelectBox', true],
    ['IframeAlignment', true]
];
var asPhrases=new Array ('coats','dress','jeans','skirts','shrug','trousers','tops','belt','seaming','corset','2011','leather jacket','black dresses','boots','sale coats','sale dresses','bags','red dress','leather','iphone','purse','lace','maxi dress','sale bags','jacket','shirt','cardigan','sale','black lace dress','shoes','purple dress','dress 2011','waistcoat','handbags','lace dress','pencil dress','blazer','long dress','all coats','pony','iphone case','all leather jackets','butterfly','jumper','fur','watches','teal','sale shoes','knit dress','pencil skirt','sunglasses','sandals','black coat','knitwear','size','gilet','snake','sale tops','gloves','velvet','clutch','black trousers','tunic','white shirt','sale skirts','ipad case','lace top','jumpsuit','sale knitwear','red','knit','vest','leggings','ipad','black leather jacket','clutch bag','multi keeper tote','colour block','shorts','trench coat','blouse','sequin','cape','satchel','sales boots','ring','shift dress','tan leather jacket','pony coat','colour block dress','sale shirts','snood','scarf','parka','signature stretch satin dress','draped dress','blue coat','cm011 black','purple','pewter dress','sale purses','animal print','2011 leather','sale jumpers','swarovski shoes','flat','pink dress','black jacket','bandage','roll neck','black pencil skirts','satin dress','black boots','cable knit dress','red coat','vest top','graphic','sale jeans','tuxedo','sequin dress','leather dress','coats karen millen','faux fur','embroidered dress','trench','yellow','frill','limited edition dresses','leather skirt','blue','tailored suits','all bags','herringbone','cashmere','coral dress','fur coat','karen millen handbags','black leather biker jacket','suit','winter coat','bolero','watches sale','bodycon','stripe','black skirt','scoop','satin','peplum','mini glass print dress','black polka dot dress','black and white','pencil','wool','studded ankle boot','silk dress','purple leather jacket','slash','bracelet','pony skin coat','leather biker jacket','limited edition','summer sales','blue dress','black','sale cardigans','sequin top','spring 2011','sale tops floral print tee','black bag','military coat','classic investment coat','floral','orchid','glamorous pony coat','new','leather trousers','black pants','graphic stripe','size 16','signature dress','beautiful beaded dress','draped','signature satin dress','puppytooth','green dress','polka dot','velvet dress','signature','stone coat','investment coat','footwear','nautilus','jewellery','card holder','cable','fur trim','lace blouse','lace shirts','white tailored shirt','faux fur coat','silk','spring summer 2012','tote','dramatic applique top','all tops','red skirt','pewter','khaki','sale sunglasses','black jeans','snake print','metallic','summer 2011','white top','colourblock','black long sleeve dress','cm011 stone coat','teal dress','red sale dress','black studded bag','gift card','short dresses','biker','monochrome pencil dress','blue herringbone coat','pintuck','applique dress','folded','turtle','one shoulder','black cardigan','white waistcoat','draped pencil dress','skinny jeans','orange','black top','grey dress','tan bag','posh','pink','waist belt','work dress','roll','polka','waist coat','quilted leather jacket','jersey folded dress','graphic dress','print dress','black and white dress','draped back mini dress','skinny leg jean khaki','gladiator','strapless layered dress','champagne','black body con dress','graphic colourblock vest','shirt dress neutral','denim skirt','karen millen butterfly print dress','size 12','case','summer dress','black waistcoat','dm190 teal dress','peep','black lace','studded bag','signature court','shoe boots','silver shoes','feather','khaki dress','orange jumper','black and white shoes','butterfly print dress','signature satin','bodycon dress','necklace','sale size 14','blue knit','suede boots','polka dot dress','outerwear','black coat with fur','black lace top','posh coat','keeper','crystal','lace stripe bodycon dress','coat cm021','yellow dress','purple top','gold','long black dress','one shoulder dress','black belt','earrings','draped jersey dress','tailored','corsage','fur shrug','leopard print','061sn01501','skinny','red lace dress','multi keeper','herringbone coat','trouser suit','pleated skirt','stripe top','karen millen belts','black knit dress','black shoes','roll neck jumper','bronze dress','sale jackets','wool dress','colour block pencil dress','colour block cardigan','studded tote','bandage dresses','black blazer','cocoon','embellished','snake dress','black shirt','animal','stone knit','size 10','colour block knit dress','karen millen watches','mini dress','pink bodycon','size 3','tan','stud','patent','pintuck cute dress','bandage knit','60s','cugnasca','jewelled','glamourous pony coat','signature leather jacket','technique','draped velvet mini dress','glass print','multi keeper satchel','grey jacket','frill top','key ring','cuff','iphone bags','charcoal','merino cardigan','studded boot','cable knit','court','collection','box bag','cowl','sartorial','zip','keyring','denim','green','202fm14732','ombre','purple satin','metallic-jacquard-dress','colourful knit cardigan','red jacket','peplum dress','red shirt','fuchsia dress','karen millen mini dress with drape back','red satin dress','body con','black patent bag','grey top','ipad bag','biker jacket','metallic jacquard dress','culottes','pockety','check','folded dress','wool coat','applique','dot','blue skirt','leather coat','stripe dress','221fm00467','mini skirts','jumper dress','black shorts','bandage knit dress','lace and satin','tribal','coat with fur trim','jersey and satin','size 20','crystal clutch','knotted and twisted','black t shirt','neck','beaded necklace dress','swimwear','draped and ruched dress','sale blouses','swimsuit','draped satin maxi dress','wedge heels','skinny leg jeans','sale jewellery','drape back dress','black draped','ma','giraffe','092tn01801','black v neck','red pintuck dress','denim shirt dress','colour block bandage top','black on black','purple blouse','striped knitted cardigan','tough','button cuff jeans','strapless layer','satin flower clutch','101dl19901','utility','classic coat','sale suit','black body con skirt','colour block shift dress','pendant','layered dress','white jeans','satin and chain','knit lace','skinny leg','print','colour blocked waistcoat','t shirts','green coat','tweed','orange bag','size 4','butterfly top','feather print','monochrome','marble print','ripple stitch','black knitwear','shirt dress','ankle boots','crystal bag','jersey','knitwear dresses','long sleeve lace dress','903000057001','white jacket','squeeze lock','merino wool tunic','red top','black jumper','long','karen millen trench black coat','belted dress','blouse top','tan leather','ripple','summer','orange knit dress','statement dress','washed jean','sartorial classic herringbone','kaftan','bodycon marble print dress','block stripe knit dress','red bag','halter neck dress','karen millen card','court shoes','quilted leather','moleskin','neutral dress','grey skirt','red patent sandal','leather blazer','903000057003','marble','corset dress','new coats','trench skirt','shell','chain dress','chunky knit jumper','103dm22742','floral signature','grey multi top','butterfly dress','statement','gold dress','patent handbag','ruched','buttons','looks','903000057062','block','asymmetric dress','taupe cardigan','metallic peep toe','042pm06767','903000057061','041pm11101','sartorial herringbone','long sleeve dress','snake print top','faux pony fur','glass print dress','orange shoes','silver dress','dramatic applique','black purses','key','draped mini dress','all dresses','graphic stripe roll neck jumper','neck jumper','cap sleeve dress','leather tote','karen millen draped pencil dress black','zip cuff','knee boots','size 14','black blouse','blazer jackets','903000055568','black bodycon','block stripe','striped roll neck','sale dress summer','padded','size 24','bronze','purple jacket','ruffle','stretch dress','soft draped top','size 22','903000057135','limited edition bags','cream','30th','tailored t-shirt','red knit','knitted rib dress','karen millen lace and satin dress black','statement block dress','chandelier','black wool coat','opening','asymmetric satin dress purple','quilted bag','black jersey dress','zip dress','black disc','stretch jeans','black bandage dress','teal velvet dress','skinny trousers','karen millen purple dress','midi','black court shoes','new dresses','coral one shoulder dress','dinner shirt','butterfly print pencil dress','modern military moleskin','applique top','edgy','halter neck lace dress','monochrome dress','quilted handbag','lace stripe','satin one shoulder dress','black pony coat','903000057096','red multi knit','colourblocked cardigan','metallic bag','blue top','glamour pony','knit cape','red karen millen signature stretch satin dress','103dm21741','3 4 sleeve','black dress with sleeves','v neck dress','merino','fur trim coat','taupe','urban tweed mini dress','desert','spring dresses','platform','quilted jacket','soft draped dress','pleated purple','polo neck','posh cotton coat','stone','scoop neck','kimono','cotton','investment','metalic jacquard','903000057184','black clutch bag','lace embroidery dress','nylon shopper','lurex','signature stretch','t-shirts','071hn05034','long jersey dress','broderie','dog','011cn01023','073hn01315','studded biker boots','slash dress','lace with satin dress','stripe coat','velvet drape dress','sale ankle boots','orange purse','pony hair','lace coat','signature black trousers','30th anniversary','103dn00208','summer collection','classic investment','lace shoes','pink multi dress','cowl neck jumper','multi dress','polka dot lace','sale handbags','puppytooth skirt','roll neck dress','fabric mixed jeans','turquoise','long black jersey dress','karen millen peplum satin one shoulder dress','milano','satin short dress','coral bag','karen millen satin clutch bag','tailored shift dress','herringbone textured wool coat','multi print','crystal pyramid','karen','colour block and lace dress','zip jeans','zippy','903000057098','texture knit dress','pockety blouse','limited edition shoes','rose','blue t shirt','zip cardigan','midnight','striped colour-block dress','accessories','sheer blouse','padded parka','sequin t-shirt top','hoop earrings','lace bodycon','pony skin','knitted frill dress','903000057342','bangle','tailored knit jacket','jersey stretch dress','pin','safari','black belted dress','colour block satin dress','silk shirt','signature stretch print dress','cowl neck','103dm08871','tote bag','classic','cocoon sleeve','black sale purse','orchid shoes','black roll neck','patent sandal','urban classic','embroidered','cropped trousers','colourblock fitted tee','stained glass','fur trimmed padded coat','tailored stretch shirt','all sale','leather fur','size 34','2','strapless dress','padded jacket','patent court','sheer','modern','long white dress','multi keeper bag','check shirt','jersey skirt','bodycon panelling dress','blue shirt','folded jersey','leather biker','spring 2012','dramatic','black bodycon dress','turtle neck jumper','mamma','903000056643','clothes','wool trousers','satin bag','jacquard','stretch denim','buckle boot','red patent','folded tunic','214fm13935','lace blue top','60s coat','tweed dress','hard and soft','903000057188','urban','karen millen block stripe knitted dress','colour block shoes','black lace shoes','spring summer','knit cardigan','hood','101dm18625','shift','knit dress blue','112km19401','slash detail dress','hiking boots','red sandal','flower','lace jacket','bold colourful dress','tailored dress','crystal peep','rose print','contrast trim pencil skirt','draped waistcoat','903000056619','2011 red dresses','taupe knit','903000056758','black hand bag','t-shirt','size 38','striped cardigan','red lace','metallic block dress','swarovski bag','box','pleated','multicolour dress','pony and stud bag','black slashed dress','metallic mini dress','jacquard dress','sheer blouse sleeve sweater','lace stripe bodycon','stretch satin dress','all shoes','halter','tailored shirt','tweed coat','sale size 16','black sandal','strapless','jean belt','colourful item skirt','black and white tote bag','metallic dress','contrast trim pencil dress','ruched jacquard dress','grey knitted dress','081tm11888','snake print shoes','short pony coat','karen millen contrast trim pencil dress','block stripe knit jumper','satin skirt','collar dress','colour block stripes dress','jumper zip','sleeveless shirt','black clutch','knit rib technique','neutral','blue jacket','tribal dress','black wool trouser','103dm08471','pants','butterfly print','red cardigan','red folded strapless dress','purple heels','signature stretch dress','solid roll','60','white watch','draped jersey tunic','black lace skirt','satin long dress','black jersey fold dress','biker boots','peep toe shoes','body con panel dress','bright coloured skirt','peep toe sandals','draped bandage tee','grey cardigan','crop biker jacket','fake fur','soft feather','colour block bag','winter sale','grey multi knit','funnel','pleated top','romantic','coated tutu','cowl neck knit','pony stud','block stripe knit','scoop jumper','faux','folded technique','posh trench coat','slash detail','903000056973','lace bow blouse','gentish','9cm','faux coat','a line skirt','metallic shoes','lace back dress','tailored wool trouser','graphic blocke','dresseses','shopper','pony stud purse','chain bracelet','stud waist belt','leopard boots','011cm03649','tailored black dress','903000056754','hard and soft lace','903000057056','winter jackets','wet look','beautiful','pink top','bandage skirt','70s','ruched dress','clean stripe shirt','clean white shirt','long sleeved tops','black patent','colourblock knit cardigan','black satin bag','luggage tag','draped velvet','wool skirt','knotted','red multi','pastel','satin boots','257in03553','stretch satin','texture','column dress','sharp skinny jacket','marble dress','urban tweed','black skinny jeans','blue fur','soft draped','14','mini stud','moleskin coat','snake print envelop clutch','103dm15338','zebra pony','beaded vest top','enamel','shrug blue','halter dress','knitted rib polo neck','black handbags','blue jumper','blue cardigan','classic boots','purple orchid','karen millen bodycon jersey dress black','black macrame dress','disc','knit zip','contrast trim','black multi dress','903000056931','roll neck cable','f','pony bag','floral print wedge','stripe jumper','stripe skirt','bandage top','combat trousers','size 40','long sleeve','white skirt','high neck top','cuganasca','merino wool','back bow dress','denim jersey jean','signature stretch shirt','mini','multi pocket bag','draped column','wrap top','long sleeve knot detail dress','grecian','903000057100','solid','903000056533','khaki shirt dress','snake print dress','fluid','feminine','amazing','knit rib','green multi','long sleeve stretch print dress','snake print on stripe cardi','draped and ruched bandage tee','knit top','panelled mini tote','stretch skirt','lace up boots','silk t shirt','baby','signature bag','red strapless dress','chunky cardigans','black lace blouse','011cm00452','snake belt','peep toe','dark blue','orchid clutch','long sleeve lace dress red','lace neck','colourblock knitted dress','wool pencil skirt','size 2','115km23001','011cm01149','metallic clutch','red jumper','grey knit','zip back','103dm04201','mini satchel','cable jumper','ceramic','colour block skirt','lace up hiking','mixed stripe knit dress','thigh','wool cardigan','orange cardigan','woollen','graphic belt','black silk top','tuck','stripe knit dress','black skinny','denim coat','orange multi','modern check','bag with chain','111km25834','striped merino wool cardigan','ribbed','leather and suede','wool animal print dress','grey shirt','blue leather','ruched top','jewelled bag','biker t-shirt','texture tailoring','metallic skirt','white purse','hours','signature purse','black jumper dress','wool nylon fashion coat','stripe knit','roll neck cable knit jumper','beautiful dress','contrast dress','sale pencil dress','work bags','tailored trouser','pony coat sale','oversize bag','block belt','ombre feather print','split','red and black dress','903000056304','903000056537','texture knit','signature stripe','satin blouse','multicolour knit','stretch trousers','knitted frill','karen millen purple','suede bag','903000056830','stretch shirt','112km20052','posh satin','cute','093tm08952','red roll neck','black gloves','903000057189','093tm05706','sartorialist lace t-shirt','black pencil dress','903000056442','1','tie knot','butterfly shoes','red satin','graphic stripe court','denim jersey jeans','colour block bandage multi','fashion skirt','folded and pleated t shirt','ponyskin coat','black sequin vest','silk trim','black sleeveless top','011cm02106','black studded belt','pewter sandals','211fm11953','011cm02101','black tropical cuff','011cm03519','box clutch','blue ribbed cardigan','903000056926','dresses with sleeves','summer 2012','casual','texture print','graphic colour block dress','black and white tote','washed leather jacket','saddle','202fm12041','woolen','pencil bandage','fitted dresses','fluid dress','block knit','section ring','twisted','fashion coat','903000056815','stretch','903000057339','011cn00172','black flat boot','491gn05979','903000056787','large bags','103dm07921','snake clutch','103dm20362','orange top','deconstructed zip vest','black wool','black bandage skirt','caramel','folded pleated t-shirt','posh box bag','black investment coat','061sm00332','soft leather','tan jacket','skinny rib','biker jean','modern red dress','black silk dress','long sleeve lace top','112km13306','cotton trench coat','jane','blue lace','fitted shirt','903000057106','903000056752','biker dress','fierce','stretch roll','903000056452','903000056567','903000056751','60s dress','knit roll neck','black and striped dress','903000056339','stone t-shirt','903000056246','903000056639','charm','black trench coat','contrast','tailored jacquard jacket','903000056994','stitch detail court shoes','floral print sandal','903000056386','fabric mixing','knit pencil skirt','tonal','colourful jewel','103dm15372','103dm19101','polka dot jacquard','leather jeans','velvet suit','black skinny trouser','frill skirt bandage','silver top','lace and satin dress','sculpturalist','biker jumper','black polka','wool nylon','hoop and t bar bangle','folded red stretch dress','black white top','black tie dresses','size 6','colourblock shoes','textured stripe','903000057064','ponte roma','011cm01101','v-neck','silk tailored','p','orange belt','jeans with zips','chain','stripe court','soft skirt','silk kimono','103dm09128','long satin','bag for life','satin strappy','karen millen classic dress black','black roll neck jumper','bold colourful mamma','903000056466','knit dress multi colour','sequined shirt','lace dress khaki','knot top','903000056793','black mini dress','903000056759','903000056788','903000056628','purple knit','sequin blazer','long jersey','carved and folded','texture tailoring jacket','flattering','903000056357','grey jeans','print cardigan','camel cardigan','modern folded','knitted rib polo neck top','fierce dress','903000056925','black tote bag','ss12','leopard print top','903000057097','lace strapless','belt cardigan','903000056915','903000056240','t bar bracelet','colourblock bag','cable dress','long sleeve shirt','colourblock knit','full skirt','903000057204','903000056608','black and tan','t shirt with silk trim','hard metallic','printed t shirt','macrame dress','long f','jewelled sandal','karen millen folded stretch strapless dress','peep toe court','karen millen deconstructed soft draped zip detail black multi','t-bar','karen millen contrast fabric dress multicolour','peep toe shoe boot','satin peep shoe','903000056446','903000056516','903000056332','tailored skirt','jersey vest','white and black check coat','903000056936','karen millen posh trench coat','peplum knit','103dm09001','black and white knit dress','colour block clutch','dark','black silk','carved and folded tshirt','072hm05040','903000056807','903000056531','black heels','black karen millen dress','lace peep','crystal court','fabric block dress','903000056467','layer cardigan','bow blouse','leather and suede tote','black lace sleeved top','jeans with zip ankle','113km21701','knitwear skirt','print bag','shimmer','011cm01310','ripple stitch roll neck','903000056485','skinny belt','stripe bag','black zip pencil dress','leather trimmed','903000057101','903000057119','pencil dress with ruching','bandage knit pencil skirt','chain bag','903000057038','903000056935','beaded skirt','modern folded jersey','cross over dress','small leather','length','chain print','zip trousers','201fm06621','fabric mix dress','fabric','suede studded','498gm06172','903000056506','snake bag','903000057092','903000056391','silk printed vest','213fm14827','111km03308','folded detail','black embroided top','buckles shoes','cute fun dress','tuck in','blue wool dress','summer tops','biker trousers','cotton trench','bandage knit top','70% sales','903000056444','stripe peep','bright','black biker jacket','903000056183','black jersey','suede lazer','summer skirts','sale size 10','black zip top','bag gl221','black corsage','summer suede','shiny silky top','block shirt','soft tailored','skinny rib vest','satin frill','cupro jacket','beaded bag','colour block t shirt lime','silk lace top','suede stripe','cheeky','summer shoes','shoulder zip','contrast mac','blue satin handbag','satin halter','colour block t-shirt','supra aviator','stone leather','belted knit dress','city','blou','silk trim dress','beaded suede sandal','bow neck top');
/* $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);
    }
