
/**
 * Provides suggestions for state names (USA).
 * @class
 * @scope public
 */
function StateSuggestions(aaSugestionType) {
	
	switch (aaSugestionType) {
		case "Town":
	    this.states = [
       "Aberdeenshire","Anglesey","Angus","Antrim",
"Argyllshire","Armagh","Ayrshire","Banffshire","Bedfordshire",
"Berkshire","Berwickshire","Brecknockshire","Buckinghamshire",
"Buteshire","Caernarfonshire","Caithness","Cambridgeshire",
"Cardiganshire","Carmarthenshire","Cheshire","Clackmannanshire",
"Cornwall","Cromartyshire","Cumberland","Denbighshire","Derbyshire",
"Devon","Dorset","Down","Dumfriesshire","Dunbartonshire",
"Durham","East Lothian","Essex","Fermanagh","Fife",
"Flintshire","Glamorgan","Gloucestershire","Hampshire",
"Herefordshire","Hertfordshire","Huntingdonshire",
"Inverness-shire","Kent","Kincardineshire",
"Kinross","Kirkcudbrightshire","Lanarkshire",
"Lancashire","Leicestershire","Lincolnshire",
"Londonderry","Merioneth","Middlesex",
"Midlothian","Monmouthshire","Montgomeryshire",
"Morayshire","Nairnshire","Norfolk","Northamptonshire",
"Northumberland","Nottinghamshire","Orkney","Oxfordshire",
"Pembrokeshire","Peeblesshire","Perthshire","Radnorshire",
"Renfrewshire","Ross-shire","Roxburghshire","Rutland",
"Selkirkshire","Shetland","Shropshire","Somerset",
"Staffordshire","Stirlingshire","Suffolk",
"Surrey","Sussex","Sutherland","Tyrone","Warwickshire",
"West Lothian","Westmorland","Wigtownshire","Wiltshire",
"Worcestershire","Yorkshire"
   		 ];
		break	
		case "Mobile":
		this.states = [
        "077", "078", "079"
   		];	
		break
		case "Phone":
		this.states = [
        "011", "020"
   		];	
		 break
		default:
		this.states = [
        "01/01/1990", "10/01/1990","20/01/1990", "30/01/1990"
		];
		break
	}
}
/**
 * Request suggestions for the given autosuggest control. 
 * @scope protected
 * @param oAutoSuggestControl The autosuggest control to provide suggestions for.
 */
StateSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/) {
    var aSuggestions = [];
    var sTextboxValue = oAutoSuggestControl.textbox.value;
    
    if (sTextboxValue.length > 0){
    
        //search for matching states
        for (var i=0; i < this.states.length; i++) { 
            if (this.states[i].indexOf(sTextboxValue) == 0) {
                aSuggestions.push(this.states[i]);
            } 
        }
    }

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