 promises          = require '../../utils/promises'
 clone             = require '../../utils/clone'
 GenericService    = require './generic_service'
+
+FB_EVENTS = ["auth.authResponseChanged", "auth.statusChange", "auth.login", "auth.logout", "comment.create", "comment.remove", "edge.create", "edge.remove", "message.send", "xfbml.render"]
 
 class FacebookService extends GenericService
   name : 'facebook'

  performRequest: (request,callback,errback)=>

    path = request.path
    uiAction = /^ui\./.test(path)

    fbErrback = (msg, res)->
      res.time = new Date()
      errback(res)

    fbCallback = @fbRequestCallback(request, {uiAction, path}, callback, errback)

    if path == 'fql.query'
      FB.api({ method: 'fql.query', query: request.params.query },fbCallback)

    else if uiAction
      params = clone(request.params)
      params.method = path.replace(/^ui\./, '')

      @showIframe()
      trackParams = { ui_request_id: utils?.uuid?() || (new Date()).getTime() }

      , 100

    else
      FB.api path, request.method, request.params, fbCallback(request, {isUICall:false, path}, callback, fbErrback)


  showIframe : ->
