var hideNavOk = 0;

function mouseOverNav (nav_item) {
	
	hideNavOk = 0;

	if (nav_item == 'low') { displayBlock('low'); } else { displayNone('low'); }
	
	if (nav_item == 'medium') { displayBlock('medium'); } else { displayNone('medium'); }

	if (nav_item == 'high') { displayBlock('high'); } else { displayNone('high'); }

	if (nav_item == 'extreme') { displayBlock('extreme'); } else { displayNone('extreme'); }

	if (nav_item == 'function') { displayBlock('function'); } else { displayNone('function'); }
	
	if (nav_item == 'fitness') { displayBlock('fitness'); } else { displayNone('fitness'); }

	if (nav_item == 'function-plus') { displayBlock('function-plus'); } else { displayNone('function-plus'); }
			
	if (nav_item == 'function-warm') { displayBlock('function-warm'); } else { displayNone('function-warm'); }
	
	if (nav_item == 'default') { displayBlock('default'); } else { displayNone('default'); }
}

function hideNav (actNavItem) {
	
	if (hideNavOk == 1) {
		var activ_id = '';
		var navitems = $$('.sub-nav-activ');
		navitems.each(function(s) {
			activ_id = s.identify();
		})
		
		if (actNavItem == 'low') { displayBlock('low'); } else { displayNone('low'); }
		
		if (actNavItem == 'medium') { displayBlock('medium'); }	else { displayNone('medium'); }

		if (actNavItem == 'high') { displayBlock('high'); }	else { displayNone('high'); }

		if (actNavItem == 'extreme') { displayBlock('extreme'); } else { displayNone('extreme'); }

		if (actNavItem == 'function') { displayBlock('function'); }	else { displayNone('function'); }
		
		if (actNavItem == 'fitness') { displayBlock('fitness'); }	else { displayNone('fitness'); }

		if (actNavItem == 'function-plus') { displayBlock('function-plus'); } else { displayNone('function-plus'); }
				
		if (actNavItem == 'function-warm') { displayBlock('function-warm'); } else { displayNone('function-warm'); }
		
		if (actNavItem == 'default') { displayBlock('default'); } else { displayNone('default'); }	
		if (activ_id == '') {
			displayBlock('default');
		} else {
			if (document.getElementById(activ_id)) {		
				document.getElementById(activ_id).style.display = "block";
			}
		}
		
	}

}

function stopTimer () {
	hideNavOk = 0;
}

function startTimer () {
	hideNavOk = 1;
	mouseoutTimeout = window.setTimeout("hideNav()", 500);		
}			

function mouseOutNav (nav_item) {

	hideNavOk = 1;
	mouseoutTimeout = window.setTimeout("hideNav()", 500);

}

function displayBlock (nodeId) {
	if (document.getElementById('sub-nav-' + nodeId)) {		
		document.getElementById('sub-nav-' + nodeId).style.display = "block";
	}
/*	
	if (document.getElementById('nav-' + nodeId)) {		
		document.getElementById('nav-' + nodeId).src = "fileadmin/sys/gfx/" + nodeId + "-large.gif";
	}
*/
}	

function displayNone (nodeId) {
	if (document.getElementById('sub-nav-' + nodeId)) {
		document.getElementById('sub-nav-' + nodeId).style.display = "none";
	}
/*
	if (document.getElementById('nav-' + nodeId) && nodeId != actNavItem) {		
		document.getElementById('nav-' + nodeId).src = "fileadmin/sys/gfx/" + nodeId + "-small.gif";
	}
*/
}

var currentMaterialInfo = false;
function displayMaterialInfo (nodeId) {
	if (document.getElementById(nodeId)) {
		currentMaterialInfo = document.getElementById(nodeId);
		currentMaterialInfo.style.display = 'block';
	}
}

function hideMaterialInfo () {
	if (currentMaterialInfo) {
		currentMaterialInfo.style.display = 'none';
	}
}
