var Xeon = {};

Xeon.Core = {
	namespace : function(name) {
		var parts = name.split('.');
		var current = window;
		for (var i in parts) {
			if (!current[parts[i]]) {
				current[parts[i]] = {};
			}
			current = current[parts[i]];
		}
	},

	// Temporary constructor
	extend : function(Child, Parent) {
		var F = function(){};
		F.prototype = Parent.prototype;
		Child.prototype = new F();
		Child.prototype.constructor = Child;
		Child.uber = Parent.prototype;
	},
	
	// Copying the prototype properties
	extend2 : function (Child, Parent) {
		var p = Parent.prototype;
		var c = Child.prototype;
		for (var i in p) {
			c[i] = p[i];
		}
		c.uber = p;
	},
	
	// Copy all properties (shallow copy)
	extendCopy : function(p) {
		var c = {};
		for (var i in p) {
			c[i] = p[i];
		}
		c.uber = p;
		return c;
	},
	
	// Multiple inheritance
	multi : function() {
		var n = {}, stuff, j = 0,
		len = arguments.length;
		for (j = 0; j < len; j++) {
			stuff = arguments[j];
			for (var i in stuff) {
				n[i] = stuff[i];
			}
		}
		return n;
	},
	
	// Prototypal inheritance
	object : function(o){
		function F() {}
		F.prototype = o;
		return new F();
	},
	
	// Extend and augment
	objectPlus : function(o, stuff) {
		var n;
		function F() {}
		F.prototype = o;
		n = new F();
		n.uber = o;
		for (var i in stuff) {
			n[i] = stuff[i];
		}
		return n;
	}
}