AJAX Suggest and Autocomplete crtLink = ("-", "_"); crtLink = (0, - 4); // update the keyword's value = unescape((, )); } /* function that removes the style from all suggestions*/ function deselectAll() { for(i=0; i | AJAX Suggest and Autocomplete crtLink - _ crtLink 0 - 4 update the keyword s value unescape function that removes the style from all suggestions function deselectAll for i 0 i suggestions i var oCrtTr tr i function that handles the mouse entering over a suggestion s area event function handleOnMouseOver oTr desel ectAl l highlightrow position 2 function that handles the mouse exiting a suggestion s area event function handleOnMouseOut oTr position -1 function that escapes a string function encode uri if encodeURlComponent return encodeURlComponent uri if escape return escape uri function that hides the layer containing the suggestions function hideSuggestions var oScroll scroll hidden function that selects a range in the text object passed as parameter function selectRange oText start length check to see if in IE or FF if IE var oRange character start character length - 180 Chapter 6 el se FF if start length oText .focus function that autocompletes the typed keyword function autocompleteKeyword retrieve the keyword object var oKeyword keyword reset the position of the selected suggestion position 0 deselect all suggestions desel ectAl l highlight the selected suggestion trO .className hi ghlightrow update the keyword s value with the suggestion updateKeywordValue trO apply the type-ahead style selectRange oKeyword set the autocompleted word to the keyword s value autocompletedKeyword function that displays an error .