setting template up, put javascript calls into document.ready function