Added rate event javascript code.