change if statement for javascript in template.xml