Updated with jquery auto refresh function

Consolidated the javascript block and added jQuery refresh function
setTimeout