tpl javascript moved in to individual files, home page improved