//emulate legacy getter/setter API using ES5 APIs
try {   if (!Object.prototype.__defineGetter__ &&        Object.defineProperty({},"x",{get: function(){return true}}).x) {      Object.defineProperty(Object.prototype, "__defineGetter__",         {enumerable: false, configurable: true,          value: function(name,func)             {Object.defineProperty(this,name,                 {get:func,enumerable: true,configurable: true});      }});      Object.defineProperty(Object.prototype, "__defineSetter__",         {enumerable: false, configurable: true,          value: function(name,func)             {Object.defineProperty(this,name,                 {set:func,enumerable: true,configurable: true});      }});   }} catch(defPropException) {/*Do nothing if an exception occurs*/};

Function.prototype.inheritsFrom=function(parentClassOrObject)
{ 
	if(parentClassOrObject.constructor==Function) 
	{ 
		//Normal Inheritance 
		this.prototype=new parentClassOrObject;
		this.prototype.constructor=this;
		this.prototype.parent=parentClassOrObject.prototype;
	} 
	else 
	{ 
		//Pure Virtual Inheritance 
		this.prototype=parentClassOrObject;
		this.prototype.constructor=this;
		this.prototype.parent=parentClassOrObject;
	} 
	
	return this;
} 
