dipityTripleHandlers = function()
{
  this.init = function()
  {
    map.on_marker_click.subscribe( function(e,eid) { this_obj.handle_event('map', eid); });
    flow.on_centered_pane.subscribe( function(e,eid) { this_obj.handle_event('flow', eid); });
  }

  this.handle_event = function(from, eid)
  {
    //console.log("GOT HANDLE EVENT FROM=", from, " EID=", eid);
    if (eid != curr_eid) {
      if (from == 'map') {
        flow.showEventByEid(eid);
      } else if (from == 'flow') {
        map.highlightMarker(eid);
      }
      curr_eid = eid;
    }
  }

  var curr_eid = null;

  var this_obj = this;
  this.init();
}

if (typeof(triple_view) != "undefined") {
  var triple_handlers = new dipityTripleHandlers();
}

