I'd like to create an object in javascript, with methods that can be called. I read a webpage on how to do this, and then produced the following simple code:

 var textplayer;

        textplayer = new Object();

        function textplayer() {
            this.getDuration = getDuration;
            function getDuration() {
                var retval;
                retval = 55;
                return (retval);
        $(document).ready(function () {
            textplayer.max = textplayer.getDuration();
It does not work. In fact, 'getDuration' is not recognized.
-- Thanks