var QuickMenu = {
	onDDShow: function (bView, button, popup, mate, ddholder) {
		ddholder.className = ((bView) ? 'bbBtnHolder_active' : 'bbBtnHolder');
	},
	init: function QuickMenu(clientId, authRedirectParamsCookieName) {
		this.id = clientId;

		if (authRedirectParamsCookieName) {
			var s = document.cookie.split('; ');
			for (var i = 0; i < s.length; i++) {
				if (s[i].indexOf(authRedirectParamsCookieName) == 0) {
					Flux.createWidget('Authentication', { containerId: null }, function (widget) { widget.checkAuthRedirectParams(); });
					break;
				}
			}
		}

		if ($(clientId + '_ddmate') == null || $(clientId + '_dd') == null) return;

		$(clientId + '_ddmate').style.position = 'absolute';
		$(clientId + '_dd').style.position = 'absolute';

		with (this.dd = new WidgetDropDown(this.id)) {
			onShow = this.onDDShow.bind(this);
			runtimeAdjusting = false;
			init();
		}
	},
	preinit: function () {
		document.write([
'<style type="text/style"> ',
'.Flux .quickMenu .bbBtnHolder .itemsList, ',
'.Flux .quickMenu .bbBtnHolder IFRAME { ',
	'visibility: visible;',
	'position: absolute;',
'} ',
'</style>'].join('')
		);
	}
};
QuickMenu.preinit();