sample of object oriented javascript