 encodeQueryComponent = (value) ->
     encodeURIComponent(value).replace(/%20/g, '+').replace /%2C/g, ','
 
-generateQuery = (specs, resource) ->
+generateQuery = (specs, resource, originalUrl) ->
     query = ''
     queryParts = []
 

        return 'address'
    null

generateUrl = (specs) ->
    protocol = 'http://'
    subDomain = languageIdMap[specs.language.id]
    resource = getResource(specs)

    if resource = 'address'
        addQuery 'radius', specs.radius

    originalUrl = originalUrl.replace /\/rdr\/?/, ''
    queryParts.push '_rdr=' + encodeURIComponent(originalUrl)
    if queryParts.length == 0
        return ''
    '?' + queryParts.join('&')
