Model.Foo = function() {
// private stuff
var a, b;
// method which accesses the variable `a`
this.func = function() {
window.alert(a);
};
// public properties
this.attr1 = '';
this.attr2 = '';
};
Model.Foo.prototype = {
func1 : function() { /* ... */},
func2 : function() { /* ... */}
//,other prototype functions
};