Got the javascript function working!!!!