modify rating function & show average rating

- delete save function
- use update function to replace save function
- implement average algorithm
- implement a function to update item.rate to store average value
remove space

remove tab-space only
delete unused function

remove "document.getElementById("testing").innerHTML=title;"
delete comment

delete comment
add all rate values of an item

- add all rate values of an item
- modify update function
- save the object when it is not in the database
- update it when it is in the database