move cdr_stats_js.html code to js file