var Class={ extend: function(descendant, parent, parentName){ var aMatch=parent.toString().match(/\s*function (.*)\(/); if(aMatch!=null) { descendant.prototype[aMatch[1]]=parent; } delete aMatch; Object.extend(descendant.prototype, (parent.prototype ? parent.prototype : parent)); } };