/*
* Base class for all inheritance framework
* Inherits from -nothing-
* Requre -no- file
* d.rybakov
*/

function Class() { };

Class.prototype.construct = function() { };

Class.extend = function(def)
{
	var classDef = function()
	{
		if(arguments[0] !== Class)
			this.construct.apply(this, arguments);
	};
	
	var proto = new this(Class);
	var offspring = this.prototype;
	
	for(var n in def)
	{
		var item = def[n];
		if(item instanceof Function)
			item.$ = offspring;
		else
			classDef[n] = item;
		proto[n] = item;
	}
	
	classDef.prototype = proto;
	classDef.extend = this.extend;
	
	return classDef;
};
