//-------------------------
//A root javascript object, providing basic inheritance methods
//-------------------------

function OnyxObject() {
  //Public Methods
  this.bequeath = OnyxObject_bequeath;
  this.override = OnyxObject_override;
}

//---------------------------
//Pass all properties and methods down to child
function OnyxObject_bequeath(child) {
  for (elementName in this) child[elementName] = this[elementName];
}

//---------------------------
//Override element (property or method) with childObject - retain access to element though 
//this['inherited_' + element].  
//
function OnyxObject_override(elementName, childObject) {
  this['inherited_' + elementName] = this[elementName];
  this[elementName] = childObject;
}

