Adding more complex javascript definitions