added Javascript function to calculate percentage tip