cleaned up php code
eliminated unnecessary overhead for add.php
added a file for all common javascript functions
added functions to common.js and removed them in the code