Common javascript for all view views