neteck = {};
neteck.chat = {};
neteck.chat.Refresh = {};
neteck.debug = {};
neteck.debug.Console = {};


/**
 * Chat
 */
neteck.chat.exists = function () {
	if (window.opener && window.opener.openchatv2 && !window.opener.openDialogue) // pas dans nav
		return window.opener.main;
	else {
		if (parent.frames['nav'])
			return parent.frames['nav'].main;
		if (window.opener)
			return window.opener.main;
	}
	return null;
};

neteck.chat.getMain = function () {
	return neteck.chat.exists ();
};

neteck.chat.Refresh = {
	favoris: function () {
		if (neteck.chat.exists ())
			neteck.chat.getMain ().swf.refreshFavoris ();
	},
	
	ignored: function () {
		if (neteck.chat.exists ())
			neteck.chat.getMain ().swf.refreshIgnored ();
	},
	
	filters: function () {
		if (neteck.chat.exists ())
			neteck.chat.getMain ().swf.refreshFilters ();
	}
};

/**
 * Debug
 */
neteck.debug.debug_ = !false;

neteck.debug.enable = function () {
	this.debug_ = true;
};

neteck.debug.disable = function () {
	this.debug_ = false;
};

neteck.debug.print_log = function () {
	return this.debug_;
};

neteck.debug.has_console = function () {
	return window.console;
};

neteck.debug.Console = {
	print_:function () {
		return (neteck.debug.has_console () && neteck.debug.print_log ());
	},
	log: function (s) {	if (this.print_) console.log (s);	},
	info: function (s) {	if (this.print_) console.info (s);	},
	error: function (s) {	if (this.print_) console.error (s);	},
	warning: function (s) {	if (this.print_) console.warning (s);	}
};
