javascript template model