/* navigation-bar.js */
window.addEvent('domready', function() {
	var backIframe = new Element('iframe', {
		'styles': {
			'position': 'absolute',
			'z-index': '1000009', 
			'border': '0',
			'background': 'transparent',
			'overflow': 'hidden'
		}, 
		'frameborder': '0',
		'src': ''
	});
	backIframe.hide();
	
	var myMenu = new MenuMatic({
		id: "navmenu",
		opacity: 100,
		hideDelay: 600,
		duration: 0, 
		onHideSubMenu_complete: function(classRef) {
			backIframe.hide();
		}, onInit_complete: function(classRef) {
			backIframe.inject('subMenusContainer');
		}, onPositionSubMenu_begin:function(classRef) {
			var childMenu = classRef.btn.retrieve('childMenu');
			childMenu.setStyle('z-index', 1000010);
		}, 
		onShowSubMenu_complete:function(classRef) {
			var childMenu = classRef.btn.retrieve('childMenu');
			childMenu.setStyle('z-index', 1000010);
			if (Browser.ie) {
				var props = childMenu.getCoordinates();
				backIframe.setStyles({
					'top': props.top,
					'left': props.left + 11,
					'width': props.width - 20,
					'height': props.height - 10
				})
			} else {
				backIframe.setStyles(childMenu.getCoordinates());
			}
			backIframe.show('block');
		}
	});
});

