unify the rating functions in the proper template
add the rate.js file