function F_MenuOver(sIDLink, sClassComplement) {
	if (sMenuSelected != sIDLink) {
		oLink = document.getElementById(sIDLink);
		oLink.className = sIDLink +''+ sClassComplement;
	}
}

function F_SubMenuOver(sIDLink, sClassComplement) {
	if (sSubMenuSelected != sIDLink) {
		oLink = document.getElementById(sIDLink);
		if (oLink) {
			oLink.className = sClassComplement;
		}
	}
}

//Verifica o local de armazenamento do arquivo
bIN = 0;
bES = 0;
sLocation = document.location.toString();
sLocation = sLocation.replace('http://', '');
sLocation = sLocation.replace('https://', '');

//Verifica se esta no ingles
if (sLocation.indexOf('/IN/') > 0) {
	sLocation = sLocation.replace('/IN', '');
	bIN = 1;
}

//Verifica se esta no espanhol
if (sLocation.indexOf('/ES/') > 0) {
	sLocation = sLocation.replace('/ES', '');
	bES = 1;
}

//Verifica onde termina o endereço do Portal Abril
sFirstLevel = sLocation.indexOf('/');

//Separa o caminho do dominio
sLocation = sLocation.substring((sFirstLevel + 1), sLocation.length);
//Separa variável para pegar o segundo nivel de diretorio
sSecondLevel = sLocation
//Separa o primeiro nivel de diretorio
sLocation = sLocation.substring(0, sLocation.indexOf('/')).toLowerCase();
//Separa o segundo nivel do diretorio
sSecondLevel = sSecondLevel.replace(sLocation +'/', '').substring(0, (sSecondLevel.indexOf('/') + 1) + sSecondLevel.length).toLowerCase();

sMenuSelected = '';
function F_ActiveMenu() {
	//Cria um aray com todas as opções
	sDiretorios = new Array('institucional', 'estrutura', 'desenvolvimento', 'marcas', 'eventos','noticias');
	sMenu = new Array('mn1', 'mn2', 'mn3', 'mn4', 'mn5','mn6');
	
	//Realiza a consulta nos arrays criados para separar o menu correto
	for (iCounter = 0; iCounter < sDiretorios.length; iCounter++) {
		if (sLocation == sDiretorios[iCounter]) {
			F_MenuOver(sMenu[iCounter], '-on');
			sMenuSelected = sMenu[iCounter];
		}
	}
}
F_ActiveMenu();

sSubMenuSelected = '';
function F_ActiveSubMenu() {
	//Cria um aray com todas as opções
	sDiretorios = new Array('sobre-abril.shtml', 'editora-abril.shtml', 'abril-digital.shtml', 'grafica-abril.shtml', 'distribuidora-logistica.shtml', 'grupo-tv.shtml', 'abril-educacao.shtml', '');
	sMenu = new Array('submn1', 'submn2', 'submn3', 'submn4', 'submn5', 'submn6', 'submn7', 'submn8');

	//Realiza a consulta nos arrays criados para separar o menu correto
	for (iCounter = 0; iCounter < sDiretorios.length; iCounter++) {
		if (sSecondLevel == sDiretorios[iCounter]) {
			F_SubMenuOver(sMenu[iCounter], 'txtOn');
			sSubMenuSelected = sMenu[iCounter];
		}
	}
}
F_ActiveSubMenu();