Updates to template and js

made the template support options
Added social functions to script
Created update routine fro AJAX process