implementation of inheritance in javascript by es5