Moved JavaScript Code to a separate file.