javascript application controller