/* Firebug Fix */
;(function(){
	if(!window.console || !console.firebug)
	{
		var a, b = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", 
		"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
		window.console = {};
		for (a in b)
			window.console[b[a]] = function(){};
	}
})();

var ObjClass = {
	name: "Class",
	init: function()
	{
		return this;
	},
	extend: function(obj)
	{
		var varSuper = cloneInstance(this);
		console.log("loading " + obj.name, obj);
		return $.extend(cloneInstance(this), obj, {varSuper:varSuper});
	}
}
console.log("loading " + ObjClass.name, ObjClass);

//newInstance Function 
var cloneInstance = function(object) {
		function F() {}
    F.prototype = object;
    return new F;
}


var newInstance = function(object)
{	
		console.log("instanciando " + object.name, object);
    var instance = cloneInstance(object);
	var params = [];
	
	for(var i = 1; i < arguments.length; i++)
	{
		params.push(arguments[i]);
	}
	
	instance.init.apply(instance,params);
	return instance;

}
