a smart javascript context menus