// initializing navi object
var navi = {
	main:{
		activeArea: null,
		hide: function() {
			this.mainNaviBg = document.getElementById('mainNaviBg');
			if(this.activeArea) {
				this.activeArea.style.visibility 		= 'hidden';
				this.activeArea.style.display	 		= 'none';
				this.mainNaviBg.style.visibility 		= 'hidden';
				this.mainNaviBg.style.display 			= 'block';
			}
		},
		show: function(parentPoint) {
			myId = parentPoint.getAttribute('myId');
			this.activeArea = document.getElementById('mainNaviArea_' + myId);
			this.mainNaviBg = document.getElementById('mainNaviBg');
			if(this.activeArea) {
				this.mainNaviBg.style.visibility 		= 'visible';
				this.mainNaviBg.style.display 			= '';		
				this.activeArea.style.visibility 		= 'visible';
				this.activeArea.style.display 			= 'block';
			}
			naviSettings.timeout.clear();
		}
	},
	sub: {
		activeSubArea: null,
		hide: function() {
			if(this.activeSubArea) {
				this.activeSubArea.style.visibility 		= 'hidden';
				this.activeSubArea.style.display	 		= 'none';
			}
		},
		show: function(parentPoint) {
			myId = parentPoint.getAttribute('myId');
			this.activeSubArea = document.getElementById('subNaviArea_' + myId);
			if(this.activeSubArea) {
				this.activeSubArea.style.visibility 		= 'visible';
				this.activeSubArea.style.display 			= 'block';					
			}
			naviSettings.timeout.clear();
		}
	}
}


// timeout adaptor
function startNaviTimeout() {
	naviSettings.timeout.start();
}


// hiding all active navi elements
function deactivatingNavi() {
	navi.main.hide();
	navi.sub.hide();
}

// shows the main navigation
function showMainNavi(topNaviPoint) {
	deactivatingNavi();
	navi.main.show(topNaviPoint);
}

// shows the sub navigation
function showSubNavi(mainNaviPoint) {
	deactivatingNavi();
	navi.sub.show(mainNaviPoint);
}

// Switch off Opacity for Mac, because of the Flash in Background
function switchOffOpacity() {
	var allDivs = document.getElementsByTagName('div');
	for (var i=0; i<allDivs.length; i++) {
		allDivs[i].style.MozOpacity = 1;
	}
}
