(DropMenu = {
	menu:  null,
	hide_timeout: null,
	show: function (evt, menu_id) {
	    var caller = (window.event) ? window.event.srcElement : evt.target;
		this.cancelHide();
		this.hide();
		if (!byId(menu_id)) return;
		this.menu = byId(menu_id);
		if (this.menu.filters) {
			this.menu.style.visibility = 'hidden';
			this.menu.filters[0].apply();
			this.menu.style.visibility = 'visible';
			this.menu.filters[0].play();
		}
		this.menu.style.visibility = 'visible';
		if (caller) this.menu.style.left = this.pos(caller, true)+'px';
		if (caller) this.menu.style.top = this.pos(caller, false)+'px';
	},
	hide: function () {
		if (!this.menu) return;
		if (this.menu.filters) {
			this.menu.style.visibility = 'visible';
			this.menu.filters[0].apply();
			this.menu.style.visibility = 'hidden';
			this.menu.filters[0].play();
		}
		this.menu.style.visibility = 'hidden';
		this.menu = null;
	},
	cancelHide: function () {
		if (this.hide_timeout) {
			clearTimeout(this.hide_timeout);
		}
	},
	out: function () {
		this.hide_timeout = setTimeout('DropMenu.hide()', 600);
	},
	pos: function (obj, is_left) {
		if (!obj.offsetParent) return 0;
		var offset = (is_left) ? obj.offsetLeft : obj.offsetTop + obj.height;
		while (obj = obj.offsetParent) {
			offset += (is_left) ? obj.offsetLeft : obj.offsetTop;
		}
		return offset;
	}
});




function showLoginForm() {
	var login_form = byId('login_form');
	if (login_form) {
		login_form.style.display = 'block';
	}
}
function closeLoginForm() {
	var login_form = byId('login_form');
	if (login_form) {
		login_form.style.display = 'none';
	}
}