added javascript helper to find current layer context