Note that __proto__ may not be available in JavaScript versions other than that in Mozilla. An alternative, but less optimal version of extend(), which should work everywhere, is:
function extend(child, super)
{
for (var property in super.prototype) {
if (typeof child.prototype[property] == "undefined")
child.prototype[property] = super.prototype[property];
}
return child;
}