 # construct a list of valid URN's and pass to callback function
 get_valid_reff = (urn, callback = null) ->
   console.log('get_valid_reff')
-  request_url = "#{cts_cite_collection_driver_config['cts_endpoint']}?#{$.param(
-    request: 'GetValidReff'
-    urn: urn
-  )}"
-  console.log(request_url)
-  $.ajax request_url,
-    type: 'GET'
-    dataType: 'xml'
-    crossDomain: true
-    error: (jqXHR, textStatus, errorThrown) ->
-      console.log "AJAX Error: #{textStatus}"
-    success: (data) ->
-      console.log(data)
-      valid_urns = get_valid_reff_xml_to_urn_list($($(data)[0]).children('contents')[0])
-      console.log valid_urns.length
-      callback() if callback?
-
+  # WHERE URN STARTS WITH '#{urn}'
+  fusion_tables_query "SELECT URN FROM #{cts_cite_collection_driver_config['cts_endpoint']} WHERE URN STARTS WITH '#{urn}'", (fusion_tables_result) ->
+    valid_urns = (urn[0] for urn in fusion_tables_result.rows)
+    # console.log(valid_urns)
+    callback() if callback?
+  
 check_table_access = (table_id, callback) ->
   # test table access
   if get_cookie 'access_token'

        error: (jqXHR, textStatus, errorThrown) ->
          console.log "AJAX Error: #{textStatus}"
        success: (data) ->
          console.log data
          if callback?
            callback(data)


        # $('.container > h1').after $('<div>').attr('class','alert alert-error').attr('id','collection_access_error').append('You do not have permission to access this collection.')
        # disable_collection_form()
      success: (data) ->
        # console.log data
      complete: (jqXHR, textStatus) ->
        callback() if callback?

