var system_object = Class.create();
system_object.prototype = {
	initialize : function(json,instancia)
	{
		this.instancia	= instancia;
		if(typeof(json) == 'object')
		{
			this.json_inicial = json;
		}
		else
		{
			eval("this.json_inicial = " + json);
		}
	}
	,
	crear_objeto:function(objeto)
	{
		if(typeof(objeto) == 'object')
		{
			var OUTPUT = '';
			var valor		= '';
			for(var i in objeto)
			{
				switch(i.toLowerCase())
				{
					case "img":
						var terminal	= ' />';
					break;
					case "input":
						var terminal	= ' />';
					break;
					case "br":
						var terminal	= ' />';
					break;
					default :
						var terminal	= '</' + i + '>';
						if(objeto[i].value)
						{
							valor		= objeto[i].value;
						}
					break;
				}
				OUTPUT = "<" + i + " " + (terminal!=' />' ? ' >' : '') + this.tags(objeto[i]) + valor + terminal;
			}
			return OUTPUT;
		}
		return false;
	}
	,
	crear_html:function()
	{
		return this.crear_objeto(this.json_inicial);
	}
	,
	tags:function(objeto)
	{
		var tags_salida	= '';
        for(var tags_x in objeto)
		{
			tags_salida += tags_x + '="' + objeto[tags_x] + '"';
		}
		return tags_salida;
	}
	,
	nombre_objeto:function()
	{
	}
	,
	visor_objetos:function(ELEMENT)
	{
		if(ELEMENT != null)
		{
			if(typeof(ELEMENT) == 'string')
			{
			    var OUTPUT = ELEMENT 
			}
			else if(typeof(ELEMENT) == 'boolean')
			{
			    var OUTPUT=(ELEMENT ? 'true' : 'false');
			}
			else if(typeof(ELEMENT) == 'object')
			{
			    var OUTPUT = ((ELEMENT.reverse) ? 'Array' : 'Object');
			    OUTPUT += "(";
			    for(var i in ELEMENT)
				{
			        OUTPUT += "[" + i + "] => " + system_object_recursivo(ELEMENT[i], this.instancia)
			    }
			    OUTPUT += PARENT_TAB + ")"
			}
		}
		return OUTPUT
	}
};
function system_object_recursivo(objeto,instancia)
{
	eval(instancia + ".visor_objetos(objeto);");
}