window.deriveClass = function(d, a) { d.prototype = {}; for (var i in a.prototype) { d.prototype[i] = a.prototype[i]; d.prototype.baseClass = a; }};

function Animal(param1)
{
  log('Animal ctor params: ' + param1);
  this.param1 = param1;
}
Animal.prototype.getClass = function() { return 'Animal'; }

window.deriveClass(Dog, Animal);

function Dog(param1, param2)
{
  log('Dog ctor params: ' + param1 + ', ' + param2);
  this.baseClass.call(this, param1);
  this.param2 = param2;
}

Dog.prototype.getClass = function() { return 'Dog'; }

logClear();
var a = new Animal(1);
var d = new Dog(1, 2);

log('a.getClass()=' + a.getClass() + '');
log('d.getClass()=' + d.getClass() + '');
log('d.param1=' + d.param1 + ' d.param2=' + d.param2);