// NAVIGATION.JS ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// RESET DEFAULT ENTRY IN FORM FIELDS START ////////////////////////////////////////////////////////////////////////////////////////////
function clearDefaultandCSS(el) {
if (el.defaultValue==el.value) el.value = "";
if (el.style) el.style.cssText = "";
}
// RESET DEFAULT ENTRY IN FORM FIELDS END //////////////////////////////////////////////////////////////////////////////////////////////


function toggleOut(imgPath, label, isActive){
	var statusLabel = 'inactive';
	if (isActive) {
		statusLabel = 'active';
	}
	if (!isActive) {
    	doBackground(imgPath, label, statusLabel);
	}
	doMenu(label, false);
}

function toggleOver(imgPath, label, isActive){
//	parentImgPath = imgPath;
//	parentLabel = label;
//	parentActiveLabel = activeLabel;
	
	if (!isActive) {
    	doBackground(imgPath, label, 'activated');
	}
	doMenu(label, true);		
}

function doBackground(imgPath, label, activeLabel){
	//  Change the background of the menu tab
	var left = document.getElementById('menu-item-'+label+'-left');
	var middle = document.getElementById('menu-item-'+label+'-centre');
	var right = document.getElementById('menu-item-'+label+'-right');
	var submenu = document.getElementById('menu-item-'+label+'-submenu');
	
	if((typeof left != 'undefined') && (left != null)){
		left.className = left.className.substring(0, left.className.lastIndexOf('-') + 1) + activeLabel;
		middle.className = middle.className.substring(0, middle.className.lastIndexOf('-') + 1) + activeLabel;
		right.className = right.className.substring(0, right.className.lastIndexOf('-') + 1) + activeLabel;
		if ((typeof submenu != 'undefined') && (submenu != null)){
			submenu.className = submenu.className.substring(0, submenu.className.lastIndexOf('-') + 1) + activeLabel;
		}
	}
}

function doMenu(label, show){
	var menu = document.getElementById('menu-item-'+label+'-rollout');
	
	if((typeof menu != 'undefined') && (menu != null)){
		if (show) {
			menu.style.display = 'block';
			menu.style.visibility = 'visible';
		} else {
    		menu.style.display = 'none';
	    	menu.style.visibility = 'hidden';
		}
	}
	
}
