
/*************************************************************************************************************
	
	CLASS

*************************************************************************************************************/

CLASS = function() { // classDef, baseClass, funcName, funcBody, funcName, funcBody, ...
	if( arguments.length < 4 || arguments.length % 2 != 0 ) {
		return;
	}

	var classDef = arguments[0];
	var baseClass = arguments[1];

	if( baseClass ) {
		classDef.prototype = baseClass;
	}

	for( var i=2; i+1<arguments.length; i+=2 ) {
		var name = arguments[i];
		var func = arguments[i+1];
		classDef.prototype[name] = func;
	}
};

Class = function() { // sub_class, sup_class, func_name, func_body, func_name, func_body, ...
	if( arguments.length < 4 || arguments.length % 2 != 0 ) {
		return;
	}

	var sub_class = arguments[0];
	var sup_class = arguments[1];

	if( sup_class ) {
		YAHOO.extend(sub_class, sup_class);
	}

	for( var i=2; i+1<arguments.length; i+=2 ) {
		var func_name = arguments[i];
		var func_body = arguments[i+1];
		sub_class.prototype[func_name] = func_body;
	}
};

OBJECT = function(id, parent_id) {
	if( id ) {
		this.init(id, parent_id);
	}
}

OBJECT.prototype = {
	init: function(id, parent_id) {
		this.id = id;
		this.parent_id = parent_id;
	},
	
	get_uid: function(id) {
		return this.id + "." + id;
	},

	get_id: function() {
		return this.id;
	},

	clear: function() {
		delete this.id;
		delete this.parent_id;
	},

	destroy: function() {
		this.clear();
	}
};
