Initial add.  Factored out all JavaScript code into external .js file.