All the functions are in a separate JS file linked to this page; can also be found here