// create a 'namespace' for the class
var global = this;
global.dummy = new function() {

    // create a reference to the 'module' so we can get to it from method
    // scopes (where 'this' points to the class)
    var dummy = this; 

    // a function private to the module, can be used inside the other functions
    // but not from the outside
    var foo = function() {
    };

    // since it's defined as this.Dummy inside something we instantiate as
    // window.dummy (this -> window outside functions) it's available as
    // dummy.Dummy from outside the 'module'
    this.Dummy = function() {
    };

    this.Dummy.prototype.initialize = function(arg1, arg2) {
        // this should be called explicitly (can also be called implicitly
        // from the constructor but in that case you have to check whether
        // the args are available, as it will also be called on subclassing
        // then (!!!))
        
        // if this would be defined inside the constructor, it would be shared
        // among 'subclasses'
        this.foo = [];

        // static method (this you can use without having to instantiate the
        // 'class')
        this.bar = function() {
            alert(arg1 + ' - ' + arg2);
        }
    };

    this.Dummy.prototype.foo = function() {
        // some function
    };

}(); // note that the namespace is instantiated immediately

// instantiate the 'class' from outside the 'module'
var d = new dummy.Dummy();

// call the initialize
d.initialize('foo', 'bar');

// 'subclass' the 'class' from outside the 
function DummySub() {
};

DummySub.prototype = new dummy.Dummy;

