Fixed jquery position and placed scripts in template