    
    
    // --------------------------------------------------------
    // Geographical Result class
    // --------------------------------------------------------
    
    
    function CSuburbResult()
    {
        var suburb;
        var postcode;
        var suburbId;
        var postcodeId;
        var regionId;
        var regionCode;
    }
    
    function CStreetResult()
    {
        var streetName;
        var streetType;
    }
    
    CSuburbResult.prototype.InitFrom$String = function( aValues )
    {
        var aProp = aValues.split("$");
        this.suburb = aProp[0];
        this.postcode = aProp[1];
        this.suburbId = aProp[2];
        this.postcodeId = aProp[3]
        this.regionId = aProp[4]
        this.regionCode = aProp[5];
    }
    
    CStreetResult.prototype.InitFrom$String = function( aValues )
    {
        var aProp = aValues.split("$");
        this.streetName = aProp[0];
        this.streetType = aProp[1];
    }
    
    
    // retrieve the current page name being displayed
    function GetCurrentPageAddress()
    {
        var aPaths = window.location.href.split("/");
        return aPaths[aPaths.length - 1].toLowerCase();
    }
    
    // display search results in a drop down list
    function DisplayStreetSearchResults( aGeoResults , suggestTextbox )
    {
        var aDisplayList = [];
        for(var iCount=0; iCount<aGeoResults.length; iCount++)
        {
            aDisplayList.push(FormatStreetSearchResults(aGeoResults[iCount]));
        }
        // now display that list
        suggestTextbox.showSuggestions(aDisplayList);
    }
    
    // display search results in a drop down list
    function DisplaySuburbSearchResults( aGeoResults , suggestTextbox )
    {
        var aDisplayList = [];
        for(var iCount=0; iCount<aGeoResults.length; iCount++)
        {
            aDisplayList.push(FormatSuburbSearchResults(aGeoResults[iCount]));
        }
        // now display that list
        suggestTextbox.showSuggestions(aDisplayList);
    }
    
    function HideSearchResults(suggestTextbox)
    {
        if( suggestTextbox.isDropDownVisible() == true )
        {
            suggestTextbox.hideSuggestions();
        }
    }
    function FormatStreetSearchResults( GeoResult )
    {
        return GeoResult.streetName + ' {' + GeoResult.streetType + '}';
    }

    function FormatSuburbSearchResults( GeoResult )
    {
        if( GeoResult.suburb == "" ) return GeoResult.postcode + ' {' + GeoResult.regionCode + '}';
         
        return GeoResult.suburb + ' ' + GeoResult.postcode + ' {' + GeoResult.regionCode + '}';
    }
    
    // Pareses the array (returned via the callback) into an array of CgeoResult objects
    function ParseSuburbSearchArray( aResults )
    {
        var results = [];
        
        for( var iCount=0; iCount<(aResults.length - 1); iCount++ )    // NB we'll have one more element then we need, hence while we loop till (aResults.length - 1)
        {
            var gr = new CSuburbResult();
            gr.InitFrom$String(aResults[iCount]);
            results.push(gr);
        }
        
        return results;
    }
    
    // Pareses the array (returned via the callback) into an array of CgeoResult objects
    function ParseStreetSearchArray( aResults )
    {
        var results = [];
        
        for( var iCount=0; iCount<(aResults.length - 1); iCount++ )    // NB we'll have one more element then we need, hence while we loop till (aResults.length - 1)
        {
            var gr = new CStreetResult();
            gr.InitFrom$String(aResults[iCount]);
            results.push(gr);
        }
        
        return results;
    }
    
    /*// Pareses the array (returned via the callback) into an array of CgeoResult objects
    function ParseGeoSearchArray( aResults )
    {
        var results = [];
        
        for( var iCount=0; iCount<(aResults.length - 1); iCount++ )    // NB we'll have one more element then we need, hence while we loop till (aResults.length - 1)
        {
            var gr = new CGeoResult();
            gr.InitFrom$String(aResults[iCount]);
            results.push(gr);
        }
        
        return results;
    }*/
    
    
    
    /**
     * Provides suggestions for state names (USA).
     * @class
     * @scope public
     */
    /*function StateSuggestions() {
        this.states = [
            "Alabama", "Alaska", "Arizona", "Arkansas",
            "California", "Colorado", "Connecticut",
            "Delaware", "Florida", "Georgia", "Hawaii",
            "Idaho", "Illinois", "Indiana", "Iowa",
            "Kansas", "Kentucky", "Louisiana",
            "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", 
            "Mississippi", "Missouri", "Montana",
            "Nebraska", "Nevada", "New Hampshire", "New Mexico", "New York",
            "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", 
            "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota",
            "Tennessee", "Texas", "Utah", "Vermont", "Virginia", 
            "Washington", "West Virginia", "Wisconsin", "Wyoming"  
        ];
    }*/
    
    function GeographicalLookup()
    {
    
    }

    /**
     * Request suggestions for the given autosuggest control. 
     * @scope protected
     * @param oAutoSuggestControl The autosuggest control to provide suggestions for.
     */
    /*StateSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl ,
                                                              bTypeAhead ) {
        var aSuggestions = [];
        var sTextboxValue = oAutoSuggestControl.textbox.value;
        
        if (sTextboxValue.length > 0){
        
            //search for matching states
            for (var iCount=0; iCount < this.states.length; iCount++) { 
                if (this.states[i].indexOf(sTextboxValue) == 0) {
                    aSuggestions.push(this.states[iCount]);
                } 
            }
        }

        //provide suggestions to the control
        oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
    };*/
    
    GeographicalLookup.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/,
                                                              bTypeAhead /*:boolean*/) {

        
    };