add javascript function on homepage