Added js function to main page.