cleaned up the javascript a little.