(function () {
	$$Helper();
	var d   = document;
	d.mk_cities = function () {
		var m = $E('m_cities');
		var mb, mc;
		for (var i=0;i<m.childNodes.length;i++) {
			var e = m.childNodes[i];
			if (e.nodeType!=1){ continue; }
			if (e.className.match(/menu_btn/)){
				mb = e;
			} else if (e.className.match(/menu_off/)){
				mc = e;
			}
		}
		if (defined(mc)) {

			mb.style.zIndex = 999;
			mc.style.zIndex = 998;

			mb.onmouseover = function(e) {
				this.className=this.className.replace(/\b\s*mbtn_off\b/,' mbtn_on');
				var s = mc.className;
				s = s.replace(/\bmenu_off\b/,'menu_on');
				mc.className=s;
			};
			mb.onmouseout = function(e) {
				this.className=this.className.replace(/\b\s*mbtn_on\b/,' mbtn_off');

				if (!e) { e = window.event; }
				var t = defined(e.toElement)?e.toElement:e.relatedTarget;
				if (!defined(t)) { return; }

				var is = false;
				var c = t;
				while (c&&c.parentNode) {
					if (c==mc) { is=true; break; }
					c = c.parentNode;
				}
				if (!is&&t!=mc&&t!=this.parentNode.parentNode) { //hack:parent.parentNode
					var s = mc.className;
					s = s.replace(/\bmenu_on\b/,'menu_off');
					mc.className=s;
				}
			};
			mc.onmouseout = function(e) {
				if (!e) { e = window.event; }
				var t = defined(e.toElement)?e.toElement:e.relatedTarget;
				if (!defined(t)) { return; }

				var is = false;
				var c = t;
				while (c&&c.parentNode) {
					if (c.parentNode==this) { is=true; break; }
					c = c.parentNode;
				}
				if (!is&&t.parentNode!=this&&t!=this&&t!=this.parentNode.parentNode) { //hack:parent.parentNode
					var s = this.className;
					s = s.replace(/\bmenu_on\b/,'menu_off');
					this.className=s;
				}
			};


		}

		traverse(m,unselectable,1);
	};
	d.ready(d.mk_cities);
})();

