Move the javascript in a js file and add ajaxy links