
/**
 * Provides suggestions
 * @class
 * @scope public
 */
function SearchSuggestions() {
    this.suggestions = [
	"Adell", "Allenton", "Ashippun", "Beaver Dam", "Belgium", "Big Bend", "Bristol", "Brookfield", "Brownsville", "Burlington", "Burnett", "Butler", "Caledonia", "Camp Lake", "Cascade", "Cedar Grove", "Cedarburg", "Clyman", "Colgate", "Cudahy", "Darien", "Delafield", "Delavan", "Dousman", "Eagle", "East Troy", "Elkhart Lake", "Elkhorn", "Elm Grove", "Fontana", "Fort Atkinson", "Fox Lake", "Franklin", "Franksville", "Fredonia", "Genesee Depot", "Genoa City", "Germantown", "Glenbeulah", "Grafton", "Greenbush", "Greendale", "Hales Corners", "Hartford", "Hartland", "Helenville", "Hingham", "Horicon", "Hubertus", "Hustisford", "Iron Ridge", "Ixonia", "Jackson", "Jefferson", "Johnson Creek", "Juneau", "Kansasville", "Kenosha", "Kewaskum", "Kohler", "Lake Geneva", "Lake Mills", "Lannon", "Lebanon", "Lomira", "Lowell", "Lyons", "Mayville", "Menomonee Falls", "Mequon", "Merton", "Milwaukee", "Mukwonago", "Muskego", "Nashotah", "Neosho", "New Berlin", "New Munster", "Newburg", "North Prairie", "Oak Creek", "Oconomowoc", "Okauchee", "Oostburg", "Palmyra", "Pell Lake", "Pewaukee", "Pleasant Prairie", "Plymouth", "Port Washington", "Powers Lake", "Racine", "Randolph", "Random Lake", "Reeseville", "Richfield", "Rochester", "Rubicon", "Salem", "Saukville", "Sharon", "Sheboygan", "Sheboygan Falls", "Silver Lake", "Slinger", "Somers", "South Milwaukee", "Springfield", "Sturtevant", "Sullivan", "Sussex", "Theresa", "Thiensville", "Trevor", "Twin Lakes", "Union Grove", "Waldo", "Wales", "Walworth", "Waterford", "Waterloo", "Watertown", "Waukesha", "Waupun", "West Bend", "Whitewater", "Williams Bay", "Wilmot", "Woodland", "Woodworth", "Yorkville"
	/*
	"Addison", "Adell", "Alden", "Algoma", "Allouez", "Alma", "Altoona", "Amery", "Antigo", "Appleton", "Arcadia", "Arena", "Argyle", "Ashippun", "Ashland", "Ashwaubenon", "Athens", "Augusta", "Baileys Harbor", "Baldwin", "Baraboo", "Barnes", "Barron", "Bayfield", "Bayside", "Beaver Dam", "Belgium", "Bellevue", "Belmont", "Beloit", "Benton", "Berlin", "Berry", "Black Earth", "Black River Falls", "Bloomer", "Blooming Grove", "Boscobel", "Bradley", "Brighton", "Brillion", "Bristol", "Brodhead", "Brookfield", "Brooklyn", "Brown Deer", "Brule", "Buchanan", "Buffalo", "Burke", "Burlington", "Caledonia", "Cambria", "Cambridge", "Campbellsport", "Cassville", "Cedarburg", "Centerville", "Chase", "Chilton", "Chippewa Falls", "Clayton", "Cleveland", "Clinton", "Cloverland", "Columbus", "Conover", "Cottage Grove", "Cross Plains", "Cuba City", "Cudahy", "Cumberland", "Dale", "De Pere", "Deerfield", "DeForest", "Delafield", "Delavan", "Denmark", "Dewey", "Dunn", "Durand", "Eagle", "East Troy", "Eau Claire", "Edgar", "Elkhorn", "Elk Mound", "Elm Grove", "Elroy", "Empire", "Ephraim", "Evansville", "Farmington", "Fennimore", "Ferryville", "Fifield", "Fitchburg", "Fond du Lac", "Fontana", "Fox Lake", "Fox Point", "Francis Creek", "Franklin", "Fredonia", "Freedom", "Fulton", "Gays Mills", "Genesee", "Geneva", "Germantown", "Gibraltar", "Gillett", "Gilman", "Glendale", "Grafton", "Grand Chute", "Grand Rapids", "Grantsburg", "Green Bay", "Greendale", "Greenfield", "Greenville", "Hales Corners", "Hammond", "Hartford", "Hartland", "Hazelgreen", "Hewitt", "Hiles", "Hillsboro", "Hobart", "Holland", "Horicon", "Howard", "Hudson", "Hustisford", "Jackson", "Janesville", "Jefferson", "Johnson Creek", "Kaukauna", "Kendall", "Kenosha", "Kickapoo", "Kildare", "Kimberly", "La Crosse", "La Valle", "Lac du Flambeau", "Lake Geneva", "Lake Mills", "Lake Tomahawk", "Lancaster", "Ledgeview", "Liberty", "Liberty Grove", "Linn", "Lisbon", "Little Chute", "Little Wolf", "Lodi", "Luxemburg", "Madison", "Manitowish Waters", "Manitowoc", "Marinette", "Marion", "Marshall", "Marshfield", "Mason", "Mauston", "Mayville", "Mazomanie", "McFarland", "Medford", "Menasha", "Menomonee Falls", "Menomonie", "Mequon", "Merrill", "Merrimac", "Merton", "Middleton", "Milton", "Milwaukee", "Mineral Point", "Minocqua", "Minong", "Mondovi", "Monona", "Morrison", "Mosinee", "Mount Horeb", "Mount Pleasant", "Mukwonago", "Muscoda", "Muskego", "Nashotah", "Navarino", "Neillsville", "Neenah", "New Berlin", "Newbold", "Newburg", "New Glarus", "New Holstein", "New Lisbon", "New London", "New Richmond", "North Fond du Lac", "North Prairie", "Norway", "Oak Creek", "Oconomowoc", "Oconomowoc Lake", "Oconto Falls", "Omro", "Onalaska", "Oostburg", "Oregon", "Orfordville", "Oshkosh", "Ottawa", "Pacific", "Perry", "Peshtigo", "Pewaukee", "Phillips", "Plain", "Pleasant Prairie", "Pleasant Springs", "Plover", "Plymouth", "Polk", "Port Edwards", "Port Washington", "Portage", "Prairie Du Chien", "Prairie du Sac", "Prentice", "Prescott", "Princeton", "Racine", "Randolph", "Redgranite", "Reedsburgg", "Rhinelander", "Rib Mountain", "Rice Lake", "Richfield", "Richland Center", "Rio", "Ripon", "River Falls", "Roberts", "Rochester", "Rockland", "Rome", "Round Lake", "Rudolph", "St. Francis", "St. Joseph", "St. Nazianz", "Salem", "Sampson", "Sand Lake", "Saukville", "Scott", "Sevastopol", "Sharon", "Sheboygan", "Shelby", "Sheridan", "Sherry", "Sherwood", "Shorewood", "Shorewood Hills", "Shullsburg", "Silver Lake", "Sister Bay", "Somerset", "South Milwaukee", "Sparta", "Spiderlake", "Spring Green", "Springdale", "Springfield", "Spooner", "Stella", "Stevens Point", "Stephenson", "Stockton", "Stoughton", "Sturgeon Bay", "Sturtevant", "Suamico", "Sun Prairie", "Superior", "Suring", "Sussex", "Thiensville", "Three Lakes", "Tigerton", "Trego", "Trempealeau", "Trenton", "Turtle", "Turtle Lake", "Twin Lakes", "Two Rivers", "Union", "Vernon", "Verona", "Vienna", "Viroqua", "Wales", "Walworth", "Washburn", "Waterford", "Waterloo", "Wascott", "Watertown", "Waukesha", "Waunakee", "Waupaca", "Waupun", "Wausau", "Wautoma", "Wauwatosa", "Wayne", "Webster", "Wescott", "West Allis", "West Bend", "West Point", "West Salem", "Weston", "Westport", "Whitefish Bay", "Whitewater", "Whiting", "Williams Bay", "Wilson", "Wind Point", "Windsor", "Winneconne", "Wisconsin Dells", "Wisconsin Rapids", "Wrightstown", "York"
	*/
    ];
}

/**
 * Request suggestions for the given autosuggest control. 
 * @scope protected
 * @param oAutoSuggestControl The autosuggest control to provide suggestions for.
 */
SearchSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/,
                                                          bTypeAhead /*:boolean*/) {
    var aSuggestions = [];
    var sTextboxValue = oAutoSuggestControl.textbox.value;
    var lsuggest = "";
    var ltxt = "";
    
    if (sTextboxValue.length > 0){
		
		aSuggestions.push(sTextboxValue);
    
        for (var i=0; i < this.suggestions.length; i++) { 
	    lsuggest = this.suggestions[i].toLowerCase();
	    ltxt = sTextboxValue.toLowerCase();
            if (lsuggest.indexOf(ltxt) == 0) {
                aSuggestions.push(this.suggestions[i]);
            } 
        }
    }

    //provide suggestions to the control
    oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
};
