// JavaScript Document
var SectionsList = Array('perfil','trabalhos','diretores','blog','contato');
var DiretoresList = Array('dir_wiland','dir_renato','dir_ricardo');

	function changePage(section) {
		// MUDA VÍDEO DE FUNDO
		//changeBgVideo( section + '.flv' );
		// TROCA DIVS DE CONTEÚDO
		swapContent( section );

	}
	
	function swapContent(obj) {
		closeContent();
		//
		if(obj != 'home') {
			var selNav = document.getElementById(obj+'_container');
			//
			selNav.style.display = "block";
		}
		//if (obj == 'trabalhos') { setHeight(obj); }
	}

	function closeContent() {
		for (var i=0; i < SectionsList.length ;i++) {
			if (SectionsList[i] != 'home') {
				var maincontent=document.getElementById( SectionsList[i] + '_container' );
				//
				maincontent.style.display = "none";
			}
		}
	}
	
	var m_clicked;
	function changeMenu(acao,elemento) {
		if (acao == 'click') {
			changePage(elemento);
			for (var i=0; i < SectionsList.length ;i++) {
				document.getElementById('a_b_'+SectionsList[i]).style.color = '#939598'; //normaliza fonte
			}
			document.getElementById('a_b_'+elemento).style.color = '#FFFFFF';
			document.getElementById('a_b_'+elemento).blur();
			m_clicked = "a_b_"+elemento;
			
		}
		if (acao == 'over') {
			ver_elemento = 'a_b_'+elemento;
			if (ver_elemento != m_clicked) { document.getElementById(ver_elemento).innerHTML = '// ' + document.getElementById(ver_elemento).innerHTML; };
		}
		
		if (acao == 'out') {
			for (var i=0; i < SectionsList.length ;i++) {
				botao = 'a_b_'+SectionsList[i];
				if (botao != m_clicked) {
					document.getElementById(botao).style.color = '#939598'; //normaliza fonte
					document.getElementById(botao).innerHTML = document.getElementById(botao).innerHTML.replace("// ",""); //retira barras
				}
			}
		}
	}

	function clearMenu() {
		for (var i=0; i < SectionsList.length ;i++) {
			document.getElementById('a_b_'+SectionsList[i]).style.color = '#939598'; //normaliza fonte
			document.getElementById('a_b_'+SectionsList[i]).innerHTML = document.getElementById('a_b_'+SectionsList[i]).innerHTML.replace("// ",""); //retira barras
		}
	}
	
	var clicked = 'a_dir_wiland';
	function changeDir(acao,elemento) {
		if (acao == 'click') {
			for (var i=0; i < DiretoresList.length ;i++) {
				document.getElementById(DiretoresList[i]+'_content').style.display = 'none'; //oculta exibicao
				document.getElementById('a_'+DiretoresList[i]).style.color = '#939598'; //normaliza fonte
			}
			document.getElementById(elemento + '_content').style.display = 'block';
			document.getElementById('a_'+elemento).style.color = '#FFFFFF';
			document.getElementById('a_'+elemento).blur();
			clicked = "a_"+elemento;
			
		}
		if (acao == 'over') {
			ver_elemento = 'a_'+ elemento;
			if (ver_elemento != clicked) { document.getElementById(ver_elemento).innerHTML = '// ' + document.getElementById(ver_elemento).innerHTML; };
		}
		
		if (acao == 'out') {
			for (var i=0; i < DiretoresList.length ;i++) {
				botao = "a_"+DiretoresList[i];
				if (botao != clicked) {
					document.getElementById(botao).style.color = '#939598'; //normaliza fonte
					document.getElementById(botao).innerHTML = document.getElementById(botao).innerHTML.replace("// ",""); //retira barras
				}
			}
		}
	}



/////////////////////////////////////////////////////
////////// VIDEO AND FLASH MANILPULATION
/////////////////////////////////////////////////////
	function changeBgVideo(newVid) {
		if(navigator.appName.indexOf("Microsoft") != -1) {
			var flash = window.flashObject;
		}else {
			var flash = window.document.flashObject
		}
		if (flash) flash.changeVid(newVid);
	}
	
	function pauseVid(type) {
		if(navigator.appName.indexOf("Microsoft") != -1) {
			var flash = window.flashObject;
		}else {
			var flash = window.document.flashObject
		}
		
		if (flash) flash.changeVidStatus(type);
	}

/*

/////////////////////////////////////////////////////
////////// SCREEN SIZING AND RESIZING
/////////////////////////////////////////////////////
	function getWinHeight() {
		if (parseInt(navigator.appVersion)>3) {
			if (navigator.appName=="Netscape") {
				winW = window.innerWidth;
				winH = window.innerHeight;
			}
			if (navigator.appName.indexOf("Microsoft")!=-1) {
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
		}
		
		return winH;
	}
	/////////////////////////////////////////////////
	function setHeight(obj) {
		var topOffset = 200;
		var thisObj = document.getElementById(obj + "_container");
		var currentHeight = getWinHeight();
		
	 	thisObj.style.height = currentHeight - topOffset - 20;
	}
	function resizeAll() {
		for (var i=0;i<SectionsList.length;i++) {
			if (SectionsList[i] != 'home') setHeight(SectionsList[i]);
		}
	}
	/////////////////////////////////////////////////
	function swapStyle() {
		for (var i=0;i<frameList.length;i++) {
			var thisObj = document.getElementById(frameList[i] + '_frame');
			thisObj.style.overflow = 'no';
			thisObj.style.overflow = 'yes';
			thisObj.style.overflow = 'auto';
		}
	}
	////////////////////////////////////////////////
*/