// var show=false; var listArray=new Array( decodeURIComponent('Magellan%20eXplorist%20610') ); var modelListObj = { "list" : [ {"markerImage":null, "titles":'Magellan eXplorist 610', "Urls":"/s/Magellan-610-GPS-review-manual/id/23730bh150/t/1-2/" } ]}; var output=''; var suggestArr = listArray; var activeSuggest = null; //hide list function hideList() { $("targetDiv").hide(); if (activeSuggest != null) { setValue(activeSuggest); } } function overColor(n) { $("item"+n).addClassName("itemOverColor"); activeSuggest = n; } function outColor(n) { activeSuggest = null; $("item"+n).removeClassName("itemOverColor"); } //method fires event on each keyup event and call getData() function getSuggest(keyEvent) { keyEvent = (keyEvent) ? keyEvent: window.event; input = (keyEvent.target) ? keyEvent.target : keyEvent.srcElement; if (keyEvent.type == "keyup") { if (input.value) { getData(input.value); } else { showList(); } } } //set selected value in the search field. function setValue(n) { document.search.q.value=suggestArr[n]; //$("targetDiv").hide(); window.location.href ="/s/"+encodeURIComponent(suggestArr[n]); } //get data form list that matches the user search. function getData(query) { output=''; var toShowOff = false; suggestArr = new Array(); var listLength =listArray.length; // To remove extra spaces and convert to lowercase. query = query.toLowerCase().replace(/^\s+|\s+$/g,'').replace(/\s+/g,' '); listArray.sort(); output+='

My Recent Searches:

'; output+='
    '; // queryTokens = query.split(" "); // for(var q=0;q
  • '+suggestArr[k]+'
'; output+=''; if(toShowOff == false) { $("targetDiv").innerHTML=''; $("targetDiv").removeClassName("visibleList"); } else { $("targetDiv").addClassName("visibleList"); $("targetDiv").innerHTML=output; } } // show complete list on focus. function showList() { output=''; var listLength =listArray.length; if(listLength > 0) { output+='

My Recent Searches:

'; output+='
    '; listArray.sort(); for(var i=0;i
  • '+listArray[i]+'
'; } output+=''; //$("targetDiv").style.width='226px'; $("targetDiv").addClassName("visibleList"); $("targetDiv").innerHTML=output; $("targetDiv").show(); //show=true; } } /* function hideSearch(e) { x=e.pageX; y=e.pageY; if (!((x<596 && x>825)&&(y<324 && y>460))) { if (show==true) setTimeout('hideList()',150); } }*/ function setSuggestSize() { //$("targetDiv").style.left='685px'; /* changed to FIX Bug #1684*/ //$("targetDiv").style.top='38px'; //$("targetDiv").style.width='248px'; } // this part is for setting the correct login status to use in headerNew.jsp var gUsername = 'null';