I am sending an object that i generated within a class from the server as a result of web service call.

it is returning with __type and it's other attributes from server.

I want to add some function to this object to call from everywhere easly in my files.
How can i achieve this?
Thanks...