moved js functions back to product template