/*ccokie fns*/
function createCookie(name,value,days){
try{
var expires="";
if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}
document.cookie=name+"="+value+expires+"; path=/";
}catch (ex){}
}
function readCookie(name){
try{
var nameEQ=name+"=";
var ca=document.cookie.split(';');
for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){return c.substring(nameEQ.length,c.length);}}
return null;
}catch (ex){}
}
function eraseCookie(name){
try{createCookie(name,"",-1);}catch (ex){}
}
/*end cookie fns*/
function StateSuggestions(){
var stri=readCookie("RecentSearch");
if(stri==null){stri="";}
this.states=stri.split('$');
}
/*Request suggestions for the given autosuggest control. @scope protected, @param oAutoSuggestControl. The autosuggest control to provide suggestions for. */
StateSuggestions.prototype.requestSuggestions=function(oAutoSuggestControl,bTypeAhead,bFilter){
var aSuggestions=[];
var sTextboxValue=oAutoSuggestControl.textbox.value;
if(sTextboxValue.length>0 && bFilter==1){
    var sTextboxValueLC=sTextboxValue.toLowerCase();
    for(var i=0;i<this.states.length;i++){var sStateLC=this.states[i].toLowerCase();if(sStateLC.indexOf(sTextboxValueLC)==0){aSuggestions.push(sTextboxValue+this.states[i].substring(sTextboxValue.length));}}
}
if(bFilter==0){for(var i=0;i<this.states.length;i++){aSuggestions.push(this.states[i]);}}
oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
};