cleaned up a bit but can't get javascript code to fire