+1 for moving the JS-Code in a separate file.