jquery plugin for templates