Javascript plugin to create complex interactions