Javascript enhancement