
Class.$Superclass = Class.create({
	initialize : function (opts) {
		var t = this;
		$H(opts).each(function (opt) {
			t[opt.key] = opt.value;
		});
	},

	destroy : function () {
		for (var k in this) {
			try {
				delete this[k];
			} catch (e) {
			}
		}
	}
});


var Tauri = {};
Tauri.Request = {};
Tauri.UI = {};
Tauri.Ctrl = {};
Tauri.Lang = Class.create({
	lang : null,
	initialize : function () {
		this.lang = $H();
	},
	set : function (name, value) {
		this.lang.set(name, value);
	},
	get : function (name, def) {
		var value = this.lang.get(name);
		if (!value) {
        	if (Object.isString(def)) {
            	return def;
            }
			return name;
		}
		return value;
	},
    setAll : function (obj) {
        this.lang.update(obj);
    }
});

Tauri.Debug = (function () {
	if (window.console && window.console.info) {
		return window.console;
	} else {
		return {
			info  : Prototype.emptyFunction,
			error : Prototype.emptyFunction
		};
	}
}());

Tauri.Lang = new Tauri.Lang();

window.Alert = window.alert
window.alert = function (msg) {
	if (window.console && window.console.error) {
		window.console.error('Deprecated function window.alert()!!!!!!\nUse Tauri.Debug.info or Tauri.Debug.error!!!!\nMessage: ' + msg);
	} else {
		var message = new Element('div', {className: 'error'});
		message.insert(new Element('p').insert('Deprecated function window.alert()!!!!!!'));
		message.insert(new Element('p').insert('Use Tauri.Debug.info or Tauri.Debug.error!!!!'));
		message.insert(new Element('p').insert('&nbsp;'));
		message.insert(new Element('p').insert('Message:'));
		message.insert(new Element('p').insert(msg).setStyle({fontWeight: 'bold'}));
		(new Tauri.UI.Msgs(message, {buttons: Tauri.UI.Msgs.BTN_OK}));
	}
};