startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

window.onload=startList;



/********************************************************************/

// abre URL em POP UP
function abreConteudo(url,janela){
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=550';
	window.open(url,janela,parametros);
}

function printOrc(hash){
	parametros 	= 'toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=550';
	url			= 'orcamento.print.php?c='+hash;
	janela		= 'print';
	window.open(url,janela,parametros);
}


function popup(url){
	parametros 	= 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=830,height=550';
	janela		= 'popup';
	window.open(url,janela,parametros);
}

// Insere Flash no html via JS para não travar na segurança do IE6
function swf(file,x,y,wmode, variaveis){ // passar variaveis iniciando com ?
	var file, x, y, wmode, variaveis;
	if(variaveis == undefined || variaveis.length < 1) variaveis = '';
	document.write(' <object id="revFlash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+x+'" height="'+y+'">');
	document.write('  <param name="movie" value="'+file+'.swf'+variaveis+'" />');
	document.write('  <param name="quality" value="best" />');
	document.write('  <param name="wmode" value="'+wmode+'" />');
	document.write('  <param name="salign" value="c" />');
	document.write('  <embed src="'+file+'.swf'+variaveis+'" wmode="'+wmode+'" quality="best" salign="c" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+x+'" height="'+y+'"></embed>');
	document.write(' </object>');
}


// filtro de opções do combo 
function jumpMenu(url,obj,variavel){
	eval("document.location='"+url+"?"+variavel+"="+obj.options[obj.selectedIndex].value+"'");
}

// Redimensiona e centraliza a popup
function red(x,y,center,fullscreen){

	// para simular tela cheia numa determinada resolução ( X = x+8 ; Y = y-20 )
	var telaX = screen.width;
	var telaY = screen.height;

	if(fullscreen == true){
		var janelaX = telaX;
		var janelaY = telaY;
	} else {
		var janelaX = x;
		var janelaY = y;
	}
	window.resizeTo(janelaX,janelaY-28);
	if(center == true){
		window.moveTo(telaX/2-janelaX/2,(telaY/2-janelaY/2));//28pixel o menu inferior
	}
}

/****************************************************************************************/
// FAQ
function showFaq(id,fecha){
	IdTabela = 'faq-'+id;
	inicio = IdTabela.split('-');
	if (document.getElementById(IdTabela).style.display == "none" || document.getElementById(IdTabela).style.display == ''){
		acao = 1;
	} else {
		acao = 0;
	}

	if(fecha){
		for(x in document.all){
			if(x.indexOf(inicio[0])>-1){
				document.getElementById(x).style.display = "none";
			 }
		}
	}

	if (acao){
		document.getElementById(IdTabela).style.display = "block";
	} else {
		document.getElementById(IdTabela).style.display = "none";
	}

}


/****************************************************************************************/
// Ajustes das colunas da pagina inicial
function callAdjustBox(){
	setTimeout(adjustBoxHeight, 1000);
	setTimeout(adjustBoxHeight, 5000);
	setTimeout(adjustBoxHeight,15000);
}
		
// Função para ajustar a altura do box da direita conforme conteudo
function adjustBoxHeight(){

	// se nao houver uma das 4 colunas, nao executa a função
	if(!document.getElementById("coluna01")) return false;
	if(!document.getElementById("coluna02")) return false;
	if(!document.getElementById("coluna03")) return false;
	if(!document.getElementById("coluna04")) return false;
	
	// objetos
	col1 = document.getElementById("coluna01");
	col2 = document.getElementById("coluna02");
	col3 = document.getElementById("coluna03");
	col4 = document.getElementById("coluna04");

	// altura das colunas
	hCol1 = col1.offsetHeight;
	hCol2 = col2.offsetHeight;
	hCol3 = col3.offsetHeight;
	hCol4 = col4.offsetHeight;
	
	// escolhe o valor maior
	maior = 0;
	maior = Math.max(maior,hCol1);
	maior = Math.max(maior,hCol2);
	maior = Math.max(maior,hCol3);
	maior = Math.max(maior,hCol4);
	
	if(hCol1 == hCol2 && hCol2 == hCol3 && hCol3 == hCol4){
		return false;
	} else {
		// atribuindo valor maior às 4 colunas (pelo menos uma será o mesmo valor)
		document.getElementById("coluna01").style.height = maior+'px';
		document.getElementById("coluna02").style.height = maior+'px';
		document.getElementById("coluna03").style.height = maior+'px';
		document.getElementById("coluna04").style.height = maior+'px';
	}
}

// Ajustes das colunas da pagina inicial
function callAdjustBoxPrd(){
	setTimeout(adjustBoxHeightPrd, 1000);
	setTimeout(adjustBoxHeightPrd, 5000);
	setTimeout(adjustBoxHeightPrd,15000);
}
		
// Função para ajustar a altura do box da direita conforme conteudo
function adjustBoxHeightPrd(){

	// se nao houver uma das 4 colunas, nao executa a função
	if(!document.getElementById("coluna01")) return false;
	if(!document.getElementById("coluna02")) return false;
	if(!document.getElementById("coluna03")) return false;
	
	// objetos
	col1 = document.getElementById("coluna01");
	col2 = document.getElementById("coluna02");
	col3 = document.getElementById("coluna03");

	// altura das colunas
	hCol1 = col1.offsetHeight;
	hCol2 = col2.offsetHeight;
	hCol3 = col3.offsetHeight;
	
	// escolhe o valor maior
	maior = 0;
	maior = Math.max(maior,hCol1);
	maior = Math.max(maior,hCol2);
	maior = Math.max(maior,hCol3);
	
	if(hCol1 == hCol2 && hCol2 == hCol3){
		return false;
	} else {
		// atribuindo valor maior às 4 colunas (pelo menos uma será o mesmo valor)
		document.getElementById("coluna01").style.height = maior+'px';
		document.getElementById("coluna02").style.height = maior+'px';
		document.getElementById("coluna03").style.height = maior+'px';
	}
}



/* FUNCOES DO ORÇAMENTO ***********************/
function selectAll(qtde,div,boxName){
	box = document.getElementById(boxName);
	if (box.checked == true) {
		for(x=1;x<=qtde;x++){
				document.getElementById(div+x).checked = true;
		}
	} else {
		for(x=1;x<=qtde;x++){
				document.getElementById(div+x).checked = false;
		}
	}
}












browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

function doPic(imgName,imgLegenda) {
	if (ns3up || ie4up) {
		imgOn = ("" + imgName);
		imgOn2 = ("" + imgLegenda);
		document.slideshow.src = imgOn;
		document.getElementById('slideshow').src = imgOn;
		document.getElementById('legenda').innerHTML = imgOn2;
	}
}


function chgImg(direction) {
	if (document.images) {
		ImgNum = ImgNum + direction;
		if (ImgNum > ImgLength) {
			ImgNum = 0;
		}
		if (ImgNum < 0) {
			ImgNum = ImgLength;
		}	
		document.slideshow.src = NewImg[ImgNum];
   }
}
function auto() {
	if (lock == true) {
		lock = false;
		window.clearInterval(run);
	} else if (lock == false) {
		lock = true;
		run = setInterval("chgImg(1)", delay);
	}
}
//  End -->

